mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
Loading...
Searching...
No Matches
node.h
1#pragma once
2
3#include <memory>
4#include <string>
5
6#include <rclcpp/rclcpp.hpp>
7
8namespace mrs_lib
9{
10
11class Node {
12
13protected:
14 Node(const std::string& node_name, const rclcpp::NodeOptions& options = rclcpp::NodeOptions()) : node_(std::make_shared<rclcpp::Node>(node_name, options)) {
15 }
16
17 Node(const std::string& node_name, const std::string& namespace_, const rclcpp::NodeOptions& options = rclcpp::NodeOptions())
18 : node_(std::make_shared<rclcpp::Node>(node_name, namespace_, options)) {
19 }
20
21 ~Node() = default;
22 Node(const Node&) = default;
23 Node& operator=(const Node&) = default;
24 Node(Node&&) = default;
25 Node& operator=(Node&&) = default;
26
27 rclcpp::Node& this_node() {
28 return *node_;
29 }
30 rclcpp::Node::SharedPtr this_node_ptr() const {
31 return node_;
32 }
33
34public:
35 rclcpp::node_interfaces::NodeBaseInterface::SharedPtr get_node_base_interface() const {
36 return node_->get_node_base_interface();
37 }
38
39private:
40 rclcpp::Node::SharedPtr node_;
41};
42
43} // namespace mrs_lib
Definition node.h:11
All mrs_lib functions, classes, variables and definitions are contained in this namespace.
Definition attitude_converter.h:24