|
AutoAPMS
Streamlining behaviors in ROS 2
|
Struct that encapsulates the identity string for a registered behavior. More...
#include <auto_apms_behavior_tree_core/behavior.hpp>

Public Member Functions | |
| BehaviorResourceIdentity (const std::string &identity) | |
| Constructor of a behavior resource identity object. | |
| BehaviorResourceIdentity (const std::string &identity, const std::string &default_category) | |
| Constructor of a behavior resource identity object. | |
| BehaviorResourceIdentity (const char *identity) | |
| Constructor of a behavior resource identity object. | |
| BehaviorResourceIdentity ()=default | |
| Constructor of an empty behavior resource identity object. | |
| std::string | str () const |
| Create the corresponding identity string. | |
| bool | empty () const |
| Determine whether this behavior resource identity object is considered empty. | |
Public Attributes | |
| std::string | category_name |
| Name of the category this behavior resource belongs to. | |
| std::string | package_name |
| Name of the package that registers the behavior resource. | |
| std::string | behavior_alias |
| Alias for a single registered behavior. | |
Struct that encapsulates the identity string for a registered behavior.
A behavior resource identity string consists of three optional tokens:
<category_name> — The category of the behavior resource (e.g. "tree", "default").<package_name> — The ROS 2 package that registered the behavior resource.<behavior_alias> — The alias that uniquely identifies the behavior within its package.Several short forms are supported to allow omitting tokens that are not needed for disambiguation. The :: separator is always used between <package_name> and <behavior_alias>, and / is used between <category_name> and the rest of the identity.
| Format | Description |
|---|---|
<category_name>/<package_name>::<behavior_alias> | Fully qualified: category, package, and alias. |
<package_name>::<behavior_alias> | Omit category — searches across all categories. Equivalent to /<package_name>::<behavior_alias>. |
::<behavior_alias> | Omit both category and package — searches across all packages and categories. |
<behavior_alias> | Same as ::<behavior_alias>, but only when the alias itself does not contain ::. |
<category_name>/::<behavior_alias> | With category, but without package — narrows search to a specific category across all packages. |
<behavior_alias> itself contains :: (as is the case with TreeResourceIdentity where the alias is <tree_file_stem>::<tree_name>), the bare alias form is ambiguous with the <package_name>::<behavior_alias> form. In that case, you must provide the first :: which separates the package name (which can be empty though) to avoid misinterpretation./, the substring before the first / is the <category_name> and everything after is processed as <package_name>::<behavior_alias>.::, the substring before the first :: is the <package_name> and everything after is the <behavior_alias>.:: is found, the entire remaining string is treated as the <behavior_alias> (package is empty).default_category may be provided to fill <category_name> when it is omitted or set to "default". Definition at line 77 of file behavior.hpp.
| BehaviorResourceIdentity | ( | const std::string & | identity | ) |
Constructor of a behavior resource identity object.
identity must be formatted like <category_name>/<package_name>::<behavior_alias>.
| identity | Identity string for a specific behavior resource. |
| auto_apms_util::exceptions::ResourceIdentityFormatError | if the identity string has wrong format. |
Definition at line 28 of file behavior.cpp.
| BehaviorResourceIdentity | ( | const std::string & | identity, |
| const std::string & | default_category ) |
Constructor of a behavior resource identity object.
identity must be formatted like <category_name>/<package_name>::<behavior_alias>.
| identity | Identity string for a specific behavior resource. |
| default_category | Name of the default category assigned if none is provided with the identity string. |
| auto_apms_util::exceptions::ResourceIdentityFormatError | if the identity string has wrong format. |
Definition at line 65 of file behavior.cpp.
| BehaviorResourceIdentity | ( | const char * | identity | ) |
Constructor of a behavior resource identity object.
identity must be formatted like <category_name>/<package_name>::<behavior_alias>.
| identity | C-style identity string for a specific behavior resource. |
| auto_apms_util::exceptions::ResourceIdentityFormatError | if the identity string has wrong format. |
Definition at line 74 of file behavior.cpp.
|
default |
Constructor of an empty behavior resource identity object.
The user must manually populate the member fields.
| std::string str | ( | ) | const |
Create the corresponding identity string.
Definition at line 83 of file behavior.cpp.
| bool empty | ( | ) | const |
Determine whether this behavior resource identity object is considered empty.
true if none of the member fields are set, false otherwise. Definition at line 93 of file behavior.cpp.
| std::string category_name |
Name of the category this behavior resource belongs to.
Definition at line 134 of file behavior.hpp.
| std::string package_name |
Name of the package that registers the behavior resource.
Definition at line 136 of file behavior.hpp.
| std::string behavior_alias |
Alias for a single registered behavior.
Definition at line 138 of file behavior.hpp.