AutoAPMS
Resilient Robot Mission Management
|
Base class for behavior tree build handlers that are used to configure missions including fallback mechanisms. More...
#include <auto_apms_mission/mission_builder_base.hpp>
Private Member Functions | |
bool | setBuildRequest (const std::string &build_request, const NodeManifest &node_manifest, const std::string &root_tree_name) override final |
Specify the behavior tree build request encoded in a string. | |
TreeDocument::TreeElement | buildTree (TreeDocument &doc, TreeBlackboard &bb) override final |
Build the behavior tree specified before. | |
Additional Inherited Members | |
Public Member Functions inherited from TreeBuildHandler | |
TreeBuildHandler (const std::string &name, rclcpp::Node::SharedPtr ros_node_ptr, NodeLoader::SharedPtr tree_node_loader_ptr) | |
Constructor allowing to give the build handler a specific name. | |
TreeBuildHandler (rclcpp::Node::SharedPtr ros_node_ptr, NodeLoader::SharedPtr tree_node_loader_ptr) | |
Constructor. | |
rclcpp::Node::SharedPtr | getRosNodePtr () const |
Get a shared pointer to the parent rclcpp::Node of this build handler. | |
NodeLoader::SharedPtr | getNodeLoaderPtr () const |
Get a shared pointer to the class loader instance used for loading the required behavior tree nodes. | |
Protected Attributes inherited from TreeBuildHandler | |
const rclcpp::Logger | logger_ |
ROS 2 logger initialized with the name of the build handler. | |
Base class for behavior tree build handlers that are used to configure missions including fallback mechanisms.
Definition at line 39 of file mission_builder_base.hpp.
|
finaloverrideprivatevirtual |
Specify the behavior tree build request encoded in a string.
Additionally, you may provide an associated node manifest and a specific tree name for setting the root tree. When using TreeExecutorNode, all arguments are populated using the respective parameters of the incoming StartTreeExecutor
action goal. It's up to the specific implementation, if and how they are interpreted.
The intention with the boolean return value is to indicate whether the respective behavior tree is allowed to be built or not. Only if this returns true
, TreeBuildHandler::buildTree is to be called afterwards. The user must stick to this design pattern and implement this function accordingly.
By default, this callback always returns true
.
build_request | Request that specifies how to build the behavior tree encoded in a string. |
node_manifest | Behavior tree node manifest that specifies which nodes to use and how to load them. |
root_tree_name | Name of the requested root tree. |
true
if the build handler accepts the request, false
if it is rejected. Reimplemented from TreeBuildHandler.
Definition at line 35 of file mission_builder_base.cpp.
|
finaloverrideprivatevirtual |
Build the behavior tree specified before.
Typically, the build handler stores the information received when TreeBuildHandler::setBuildRequest was called. As soon as this function is invoked, this information should be looked up and used to configure the corresponding behavior tree with doc
. Optionally, initial values for the global blackboard may be set using bb
.
doc | Reference to the behavior tree document that is used to instantiate the tree that is built by this function. |
bb | Reference to the global blackboard that is used as a parent blackboard when instantiating the tree that is built by this function. |
doc
. It is used to determine the root tree. Implements TreeBuildHandler.
Definition at line 82 of file mission_builder_base.cpp.