mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
Loading...
Searching...
No Matches
mrs_lib::Node Class Reference

Wrapper class around rclcpp::Node providing interface required for components. More...

#include <node.h>

Public Member Functions

rclcpp::node_interfaces::NodeBaseInterface::SharedPtr get_node_base_interface ()
 

Protected Member Functions

 Node (const std::string &node_name, const rclcpp::NodeOptions &options=rclcpp::NodeOptions())
 Constructs the underlying node with the given parameters.
 
 Node (const std::string &node_name, const std::string &namespace_, const rclcpp::NodeOptions &options=rclcpp::NodeOptions())
 Constructs the underlying node with the given parameters.
 
 Node (const Node &)=delete
 
Nodeoperator= (const Node &)=delete
 
 Node (Node &&)=delete
 
Nodeoperator= (Node &&)=delete
 
rclcpp::Node & this_node () noexcept
 Get reference to the underlying rclcpp::Node.
 
const rclcpp::Node & this_node () const noexcept
 Get reference to the underlying rclcpp::Node.
 
rclcpp::Node::SharedPtr this_node_ptr () const noexcept
 Get shared pointer to the underlying rclcpp::Node.
 

Detailed Description

Wrapper class around rclcpp::Node providing interface required for components.

When deriving directly from rclcpp::Node, the derived class is unable to obtain shared pointer to the rclcpp::Node, because the construction did not yet finish. Since the constructor might need this pointer to initialize subobjects, it cannot derive from rclcpp::Node directly.

This class wraps the rclcpp::Node in a way that allows obtaining the shared pointer directly in the constructor. It also provides the interface necessary for the derived class to be used as rclcpp component.

Constructor & Destructor Documentation

◆ Node() [1/2]

mrs_lib::Node::Node ( const std::string &  node_name,
const rclcpp::NodeOptions &  options = rclcpp::NodeOptions() 
)
inlineexplicitprotected

Constructs the underlying node with the given parameters.

See rclcpp::Node for the meaning of individual parameter.

◆ Node() [2/2]

mrs_lib::Node::Node ( const std::string &  node_name,
const std::string &  namespace_,
const rclcpp::NodeOptions &  options = rclcpp::NodeOptions() 
)
inlineexplicitprotected

Constructs the underlying node with the given parameters.

See rclcpp::Node for the meaning of individual parameter.

Member Function Documentation

◆ get_node_base_interface()

rclcpp::node_interfaces::NodeBaseInterface::SharedPtr mrs_lib::Node::get_node_base_interface ( )
inline

This method is required for the class to be treated as rclcpp component.

See rclcpp::Node::get_node_base_interface().


The documentation for this class was generated from the following file: