AutoAPMS
Resilient Robot Mission Management
Loading...
Searching...
No Matches
RosNodeContext Class Reference

Additional parameters specific to ROS 2 determined at runtime by TreeBuilder. More...

#include <auto_apms_behavior_tree_core/node/ros_node_context.hpp>

Public Member Functions

 RosNodeContext (rclcpp::Node::SharedPtr ros_node, rclcpp::CallbackGroup::SharedPtr tree_node_waitables_callback_group, rclcpp::executors::SingleThreadedExecutor::SharedPtr tree_node_waitables_executor, const NodeRegistrationOptions &options)
 Constructor.
 
std::string getROSNodeName () const
 Get the name of the ROS 2 node passed to the constructor.
 
std::string getFullyQualifiedRosNodeName () const
 Get the fully qualified name of the ROS 2 node passed to the constructor.
 
rclcpp::Logger getBaseLogger () const
 Get the logger of the associated ROS 2 node.
 
rclcpp::Logger getChildLogger (const std::string &name)
 Get a child logger created using the associated ROS 2 node.
 
rclcpp::Time getCurrentTime () const
 Get the current time using the associated ROS 2 node.
 
std::string getFullyQualifiedTreeNodeName (const BT::TreeNode *node, bool with_class_name=true) const
 Create a string representing the detailed name of a behavior tree node.
 

Detailed Description

Additional parameters specific to ROS 2 determined at runtime by TreeBuilder.

Definition at line 30 of file ros_node_context.hpp.

Constructor & Destructor Documentation

◆ RosNodeContext()

RosNodeContext ( rclcpp::Node::SharedPtr ros_node,
rclcpp::CallbackGroup::SharedPtr tree_node_waitables_callback_group,
rclcpp::executors::SingleThreadedExecutor::SharedPtr tree_node_waitables_executor,
const NodeRegistrationOptions & options )

Constructor.

Parameters
[in]ros_nodeROS 2 node instance used for adding waitables with.
[in]tree_node_waitables_callback_groupCallback group to be used within tree nodes when adding waitables.
[in]tree_node_waitables_executorExecutor used for executing work provided by the node's waitables.
[in]optionsConfiguration options for the behavior tree node.

Definition at line 25 of file ros_node_context.cpp.

Member Function Documentation

◆ getROSNodeName()

std::string getROSNodeName ( ) const

Get the name of the ROS 2 node passed to the constructor.

Returns
Name of the associated ROS 2 node.

Definition at line 39 of file ros_node_context.cpp.

◆ getFullyQualifiedRosNodeName()

std::string getFullyQualifiedRosNodeName ( ) const

Get the fully qualified name of the ROS 2 node passed to the constructor.

Returns
Fully qualified name of the associated ROS 2 node.

Definition at line 41 of file ros_node_context.cpp.

◆ getBaseLogger()

rclcpp::Logger getBaseLogger ( ) const

Get the logger of the associated ROS 2 node.

Returns
Logger instance.

Definition at line 43 of file ros_node_context.cpp.

◆ getChildLogger()

rclcpp::Logger getChildLogger ( const std::string & name)

Get a child logger created using the associated ROS 2 node.

Parameters
nameName of the new logger.
Returns
Logger instance.

Definition at line 45 of file ros_node_context.cpp.

◆ getCurrentTime()

rclcpp::Time getCurrentTime ( ) const

Get the current time using the associated ROS 2 node.

Returns
Current time.

Definition at line 58 of file ros_node_context.cpp.

◆ getFullyQualifiedTreeNodeName()

std::string getFullyQualifiedTreeNodeName ( const BT::TreeNode * node,
bool with_class_name = true ) const

Create a string representing the detailed name of a behavior tree node.

Parameters
nodePointer to the behavior tree node instance.
with_class_nameWhether to include the name of the behavior tree node class.
Returns
Fully qualified name of node.

Definition at line 66 of file ros_node_context.cpp.


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