|
AutoAPMS
Streamlining behaviors in ROS 2
|
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. | |
| YAML::Node | getExtraOptions () const |
| Get the extra YAML options provided during node registration. | |
| rclcpp::Node::SharedPtr | getRosNode () const |
| Get the associated ROS 2 node handle. | |
| rclcpp::CallbackGroup::SharedPtr | getWaitablesCallbackGroup () const |
| Get the callback group to use when adding ROS 2 waitables (subscriptions, clients, ...) from a tree node. | |
| rclcpp::executors::SingleThreadedExecutor::SharedPtr | getWaitablesExecutor () const |
| Get the executor used for spinning the tree node's waitables. | |
| BT::Expected< std::string > | getTopicName (const BT::TreeNode *node) const |
Resolve the ROS 2 topic name from the node's registration options (node manifest 'topic' feature), applying any (input:port) substitutions. | |
| const NodeRegistrationOptions & | getRegistrationOptions () const |
| Get the node registration options. | |
Additional parameters specific to ROS 2 determined at runtime by TreeBuilder.
Definition at line 30 of file ros_node_context.hpp.
| 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.
| [in] | ros_node | ROS 2 node instance used for adding waitables with. |
| [in] | tree_node_waitables_callback_group | Callback group to be used within tree nodes when adding waitables. |
| [in] | tree_node_waitables_executor | Executor used for executing work provided by the node's waitables. |
| [in] | options | Configuration options for registering the behavior tree node. |
Definition at line 25 of file ros_node_context.cpp.
| std::string getROSNodeName | ( | ) | const |
Get the name of the ROS 2 node passed to the constructor.
Definition at line 39 of file ros_node_context.cpp.
| std::string getFullyQualifiedRosNodeName | ( | ) | const |
Get the fully qualified name of the ROS 2 node passed to the constructor.
Definition at line 41 of file ros_node_context.cpp.
| rclcpp::Logger getBaseLogger | ( | ) | const |
Get the logger of the associated ROS 2 node.
Definition at line 43 of file ros_node_context.cpp.
| rclcpp::Logger getChildLogger | ( | const std::string & | name | ) |
Get a child logger created using the associated ROS 2 node.
| name | Name of the new logger. |
Definition at line 45 of file ros_node_context.cpp.
| rclcpp::Time getCurrentTime | ( | ) | const |
Get the current time using the associated ROS 2 node.
Definition at line 60 of file ros_node_context.cpp.
| 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.
| node | Pointer to the behavior tree node instance. |
| with_class_name | Whether to include the name of the behavior tree node class. |
node. Definition at line 68 of file ros_node_context.cpp.
| YAML::Node getExtraOptions | ( | ) | const |
Get the extra YAML options provided during node registration.
Definition at line 83 of file ros_node_context.cpp.
| rclcpp::Node::SharedPtr getRosNode | ( | ) | const |
Get the associated ROS 2 node handle.
Allows custom tree nodes (e.g. a StatefulActionNode that must both publish and subscribe) to create their own ROS 2 entities. Prefer the dedicated node base classes (RosPublisherNode, ...) where they suffice.
| auto_apms_behavior_tree::core::exceptions::RosNodeError | if the node handle has expired. |
Definition at line 85 of file ros_node_context.cpp.
| rclcpp::CallbackGroup::SharedPtr getWaitablesCallbackGroup | ( | ) | const |
Get the callback group to use when adding ROS 2 waitables (subscriptions, clients, ...) from a tree node.
Definition at line 96 of file ros_node_context.cpp.
| rclcpp::executors::SingleThreadedExecutor::SharedPtr getWaitablesExecutor | ( | ) | const |
Get the executor used for spinning the tree node's waitables.
Definition at line 98 of file ros_node_context.cpp.
| BT::Expected< std::string > getTopicName | ( | const BT::TreeNode * | node | ) | const |
Resolve the ROS 2 topic name from the node's registration options (node manifest 'topic' feature), applying any (input:port) substitutions.
Exposed so custom tree nodes that are not derived from the provided node base classes can still honor a manifest-configured topic exactly like RosPublisherNode/RosSubscriberNode do.
| node | Pointer to the behavior tree node instance. |
Definition at line 105 of file ros_node_context.cpp.
| const NodeRegistrationOptions & getRegistrationOptions | ( | ) | const |
Get the node registration options.
Definition at line 103 of file ros_node_context.cpp.