20#include "auto_apms_behavior_tree_core/node/node_registration_options.hpp"
21#include "behaviortree_cpp/tree_node.h"
22#include "rclcpp/rclcpp.hpp"
32 friend class RosNodeBase;
33 template <
class,
typename,
bool>
34 friend class NodeRegistrationTemplate;
46 rclcpp::Node::SharedPtr ros_node, rclcpp::CallbackGroup::SharedPtr tree_node_waitables_callback_group,
47 rclcpp::executors::SingleThreadedExecutor::SharedPtr tree_node_waitables_executor,
128 BT::Expected<std::string>
getTopicName(
const BT::TreeNode * node)
const;
147 void copyAliasedPortValuesToOriginalPorts(
const BT::TreeNode * node)
const;
149 void modifyProvidedPortsListForRegistration(BT::PortsList & ports_list)
const;
151 const std::string ros_node_name_;
152 const std::string fully_qualified_ros_node_name_;
153 rclcpp::Logger base_logger_;
156 rclcpp::Node::WeakPtr nh_;
158 rclcpp::CallbackGroup::WeakPtr cb_group_;
160 rclcpp::executors::SingleThreadedExecutor::WeakPtr executor_;
std::string getROSNodeName() const
Get the name of the ROS 2 node passed to the constructor.
rclcpp::Logger getChildLogger(const std::string &name)
Get a child logger created using the associated ROS 2 node.
rclcpp::CallbackGroup::SharedPtr getWaitablesCallbackGroup() const
Get the callback group to use when adding ROS 2 waitables (subscriptions, clients,...
rclcpp::Time getCurrentTime() const
Get the current time using the associated ROS 2 node.
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.
rclcpp::Node::SharedPtr getRosNode() const
Get the associated ROS 2 node handle.
const NodeRegistrationOptions & getRegistrationOptions() const
Get the node registration options.
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.
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),...
std::string getFullyQualifiedRosNodeName() const
Get the fully qualified name of the ROS 2 node passed to the constructor.
YAML::Node getExtraOptions() const
Get the extra YAML options provided during node registration.
rclcpp::Logger getBaseLogger() const
Get the logger of the associated ROS 2 node.
rclcpp::executors::SingleThreadedExecutor::SharedPtr getWaitablesExecutor() const
Get the executor used for spinning the tree node's waitables.
Core API for AutoAPMS's behavior tree implementation.
Parameters for loading and registering a behavior tree node class from a shared library using e....