|
| | GenericTreeExecutorNode (const std::string &name, Options options) |
| | Constructor.
|
| |
| | GenericTreeExecutorNode (rclcpp::NodeOptions options) |
| | Constructor with default options.
|
| |
| std::shared_future< ExecutionResult > | startExecution (const std::string &build_request, const std::string &entry_point="", const core::NodeManifest &node_manifest={}) |
| | Start the behavior tree specified by a particular build request.
|
| |
| std::shared_future< ExecutionResult > | startExecution (TreeConstructor make_tree, double tick_rate_sec=0.1, int groot2_port=-1) |
| | Start a behavior tree that is built using a callback.
|
| |
| template<typename TimeRepT = int64_t, typename TimeT = std::milli> |
| std::shared_future< ExecutionResult > | startExecution (TreeConstructor make_tree, const std::chrono::duration< TimeRepT, TimeT > &tick_rate, int groot2_port=-1) |
| | Start a behavior tree that is built using a callback.
|
| |
| | TreeExecutorBase (rclcpp::Node::SharedPtr node_ptr, rclcpp::CallbackGroup::SharedPtr tree_node_callback_group_ptr=nullptr) |
| | Constructor.
|
| |
| std::shared_future< ExecutionResult > | startExecution (TreeConstructor make_tree, double tick_rate_sec=0.1, int groot2_port=-1) |
| | Start a behavior tree that is built using a callback.
|
| |
| template<typename TimeRepT = int64_t, typename TimeT = std::milli> |
| std::shared_future< ExecutionResult > | startExecution (TreeConstructor make_tree, const std::chrono::duration< TimeRepT, TimeT > &tick_rate, int groot2_port=-1) |
| | Start a behavior tree that is built using a callback.
|
| |
| void | setControlCommand (ControlCommand cmd) |
| | Set the command that handles the control flow of the execution routine.
|
| |
| bool | isBusy () |
| | Determine whether this executor is currently executing a behavior tree.
|
| |
| ExecutionState | getExecutionState () |
| | Get a status code indicating the current state of execution.
|
| |
| std::string | getTreeName () |
| | Get the name of the tree that is currently executing.
|
| |
| TreeBlackboardSharedPtr | getGlobalBlackboardPtr () |
| | Get a shared pointer to the global blackboard instance.
|
| |
| TreeStateObserver & | getStateObserver () |
| | Get a reference to the current behavior tree state observer.
|
| |
| rclcpp::Node::SharedPtr | getNodePtr () |
| | Get a shared pointer to the parent ROS 2 node.
|
| |
| rclcpp::node_interfaces::NodeBaseInterface::SharedPtr | get_node_base_interface () |
| | Get the node's base interface. Is required to be able to register derived classes as ROS2 components.
|
| |
| rclcpp::CallbackGroup::SharedPtr | getTreeNodeWaitablesCallbackGroupPtr () |
| | Get the callback group used for all waitables registered by behavior tree nodes.
|
| |
| rclcpp::executors::SingleThreadedExecutor::SharedPtr | getTreeNodeWaitablesExecutorPtr () |
| | Get the ROS 2 executor instance used for spinning waitables registered by behavior tree nodes.
|
| |
|
| ExecutorParameters | getExecutorParameters () const |
| | Get a copy of the current executor parameters.
|
| |
| std::map< std::string, rclcpp::ParameterValue > | getParameterValuesWithPrefix (const std::string &prefix) |
| | Assemble all parameters of this node that have a specific prefix.
|
| |
| bool | updateScriptingEnumsWithParameterValues (const std::map< std::string, rclcpp::ParameterValue > &value_map, bool simulate=false) |
| | Update the internal buffer of scripting enums.
|
| |
| bool | updateGlobalBlackboardWithParameterValues (const std::map< std::string, rclcpp::ParameterValue > &value_map, bool simulate=false) |
| | Update the global blackboard using parameter values.
|
| |
| void | loadBuildHandler (const std::string &name) |
| | Load a particular behavior tree build handler plugin.
|
| |
| TreeConstructor | makeTreeConstructor (const std::string &build_request, const std::string &entry_point="", const core::NodeManifest &node_manifest={}) |
| | Create a callback that builds a behavior tree according to a specific request.
|
| |
| core::TreeBuilder::SharedPtr | createTreeBuilder () |
| | Create a tree builder for building the behavior tree.
|
| |
| virtual bool | clearGlobalBlackboard () override |
| | Reset the global blackboard and clear all entries.
|
| |
|
| enum class | ExecutionState : uint8_t {
IDLE
, STARTING
, RUNNING
, PAUSED
,
HALTED
} |
| | Enum representing possible behavior tree execution states. More...
|
| |
| enum class | ControlCommand : uint8_t { RUN
, PAUSE
, HALT
, TERMINATE
} |
| | Enum representing possible commands for controlling the behavior tree execution routine. More...
|
| |
| enum class | TreeExitBehavior : uint8_t { TERMINATE
, RESTART
} |
| | Enum representing possible options for what to do when a behavior tree is completed. More...
|
| |
| enum class | ExecutionResult : uint8_t { TREE_SUCCEEDED
, TREE_FAILED
, TERMINATED_PREMATURELY
, ERROR
} |
| | Enum representing possible behavior tree execution results. More...
|
| |
| rclcpp::Node::SharedPtr | node_ptr_ |
| | Shared pointer to the parent ROS 2 node.
|
| |
| const rclcpp::Logger | logger_ |
| | Logger associated with the parent ROS 2 node.
|
| |
Flexible and configurable ROS 2 behavior tree executor node.
This executor extends TreeExecutorBase with configurable support for:
- Build handler management (loading and switching build handlers)
- CommandTreeExecutor action interface (pause, resume, halt, terminate)
- Parameter/blackboard synchronization
- Scripting enum parameters
Derived classes can trigger the behavior tree execution by calling GenericTreeExecutorNode::startExecution with a build request or a TreeConstructor directly.
Definition at line 59 of file generic_executor_node.hpp.
Start a behavior tree that is built using a callback.
Executing the behavior tree is achieved by regularly invoking the internal routine that ticks the behavior tree created using make_tree. This requires to register a timer with the associated ROS 2 node. Consequently, the behavior tree is executed asynchronously. The user is provided a shared future object that allows to check whether the execution finished. Once this future completes, the execution result can be evaluated.
- Parameters
-
| make_tree | Callback that creates a BT::Tree object which will be ticked to execute the tree. |
| tick_rate_sec | Behavior tree tick rate in seconds (1 tick every tick_rate_sec seconds) i.e. the interval of the timer that regularly invokes the execution routine. |
| groot2_port | Port number used for introspection and debugging with Groot2. -1 means that no BT::Groot2Publisher will be installed. |
- Returns
- Shared future that completes once executing the tree is finished or an error occurs. In that case, it is assigned an execution result code.
Definition at line 116 of file executor_base.cpp.
template<typename TimeRepT = int64_t, typename TimeT = std::milli>
| std::shared_future< TreeExecutorBase::ExecutionResult > startExecution |
( |
TreeConstructor | make_tree, |
|
|
const std::chrono::duration< TimeRepT, TimeT > & | tick_rate, |
|
|
int | groot2_port = -1 ) |
|
inline |
Start a behavior tree that is built using a callback.
Executing the behavior tree is achieved by regularly invoking the internal routine that ticks the behavior tree created using make_tree. This requires to register a timer with the associated ROS 2 node. Consequently, the behavior tree is executed asynchronously. The user is provided a shared future object that allows to check whether the execution finished. Once this future completes, the execution result can be evaluated.
- Parameters
-
| make_tree | Callback that creates a BT::Tree object which will be ticked to execute the tree. |
| tick_rate | Behavior tree tick rate i.e. the interval of the timer that regularly invokes the execution routine. |
| groot2_port | Port number used for introspection and debugging with Groot2. -1 means that no BT::Groot2Publisher will be installed. |
- Returns
- Shared future that completes once executing the tree is finished or an error occurs. In that case, it is assigned an execution result code.
Definition at line 135 of file executor_base.hpp.