![]() |
AutoAPMS
Streamlining behaviors in ROS 2
|
Class containing behavior resource data. More...
#include <auto_apms_behavior_tree_core/behavior.hpp>

Public Member Functions | |
| BehaviorResourceTemplate (const Identity &search_identity) | |
| Assemble a behavior resource using a BehaviorResourceIdentity. | |
| BehaviorResourceTemplate (const std::string &search_identity) | |
| Assemble a behavior resource identified by a string. | |
| BehaviorResourceTemplate (const char *search_identity) | |
| Assemble a behavior tree resource identified by a string. | |
Public Member Functions inherited from BehaviorResourceTemplate< BehaviorResourceIdentity > | |
| BehaviorResourceTemplate (const Identity &search_identity) | |
| Assemble a behavior resource using a BehaviorResourceIdentity. | |
| BehaviorResourceTemplate (const std::string &search_identity) | |
| Assemble a behavior resource identified by a string. | |
| BehaviorResourceTemplate (const char *search_identity) | |
| Assemble a behavior tree resource identified by a string. | |
| const Identity & | getIdentity () const |
| Get the unique identity for this resource. | |
| const std::string & | getBuildRequest () const |
| Get the behavior build request associated with this resource. | |
| const std::string & | getDefaultBuildHandlerName () const |
| Get the fully qualified class name of the default build handler associated with this behavior resource. | |
| const std::string & | getEntrypoint () const |
| Get the entrypoint of this behavior resource. | |
| const NodeManifest & | getNodeManifest () const |
| Get the node manifest associated with this resource. | |
Additional Inherited Members | |
Static Public Member Functions inherited from BehaviorResourceTemplate< BehaviorResourceIdentity > | |
| static BehaviorResourceTemplate | find (const std::string &behavior_alias, const std::string &package_name="", const std::string &category_name="") |
| Find an installed behavior resource using a specific behavior tree name. | |
Class containing behavior resource data.
Behavior resources are registered by calling the CMake macro auto_apms_behavior_tree_register_behavior in the CMakeLists.txt of a package. They can be discovered once the corresponding package has been installed to the ROS 2 workspace.
The user may refer to a specific resource using an identity string that may contain the tokens <category_name>, <package_name>, and <behavior_alias>. Depending on the number of registered resources, it might be convenient to use shorter, less precise signatures. The formatting is described below:
<category_name>/<package_name>::<behavior_alias>
Fully qualified identity string of a specific behavior tree.
<package_name>::<behavior_alias> or /<package_name>::<behavior_alias>
The category name is always optional. If omitted, the resource is searched in all categories.
::<behavior_alias> or <behavior_alias>
Just like the category name, the package name is optional as well. If omitted, the resource is searched in all packages.
auto_apms_behavior_tree_register_behavior. However, it is also possible to provide raw strings as arguments (e.g. for referring to another resource). In this case, <behavior_alias> is determined to be the given string.Given the user has specified a behavior using a YAML file, the CMake macro auto_apms_behavior_tree_register_behavior must be called in the CMakeLists.txt of the parent package (for example my_package) like this:
The macro automatically installs the given file and makes it discoverable using the above mentioned identities. In the C++ source code, one may use this resource like this after the parent package my_package has been installed:
Definition at line 276 of file behavior.hpp.
|
inline |
Assemble a behavior resource using a BehaviorResourceIdentity.
| search_identity | Behavior resource identity object used for searching the corresponding resource. |
| auto_apms_util::exceptions::ResourceError | if the resource cannot be found using the given identity. |
Definition at line 130 of file behavior.hpp.
|
inline |
Assemble a behavior resource identified by a string.
search_identity must be formatted like <category_name>/<package_name>::<behavior_alias>.
| search_identity | Behavior resource identity string used for searching the corresponding resource. |
| auto_apms_util::exceptions::ResourceIdentityFormatError | if the identity string has wrong format. |
| auto_apms_util::exceptions::ResourceError | if the resource cannot be found using the given identity string. |
Definition at line 142 of file behavior.hpp.
|
inline |
Assemble a behavior tree resource identified by a string.
search_identity must be formatted like <category_name>/<package_name>::<behavior_alias>.
| search_identity | C-style behavior resource identity string used for searching the corresponding resource. |
| auto_apms_util::exceptions::ResourceIdentityFormatError | if the identity string has wrong format. |
| auto_apms_util::exceptions::ResourceError | if the resource cannot be found using the given identity string. |
Definition at line 154 of file behavior.hpp.