|
MoveIt Pro API
Core Behaviors for MoveIt Pro
|
Thread-safe registry mapping a port C++ type to a parser that turns a YAML string into a typed BehaviorTree.CPP blackboard entry. More...
#include <parameter_override_registry.hpp>
Public Types | |
| using | ParseFn = std::function< tl::expected< BT::Any, std::string >(std::string_view)> |
Callback that parses a YAML string into a typed BT::Any value. | |
Public Member Functions | |
| void | registerParser (std::type_index type_index, ParseFn parser) |
Register a parser for the type identified by type_index. | |
| ParseFn | findParser (std::type_index type_index) const |
Look up the parser for type_index. Returns an empty ParseFn if no parser is registered. | |
Static Public Member Functions | |
| static ParameterOverrideRegistry & | get () |
| Access the process-global registry. | |
Thread-safe registry mapping a port C++ type to a parser that turns a YAML string into a typed BehaviorTree.CPP blackboard entry.
Used by the objective server to apply parameter_overrides from DoObjectiveSequence goals onto the tree's blackboards as typed values, so behaviors do not need a BT::convertFromString<T> specialization visible in every .cpp that calls getInput<T>(). Built-in ROS message types are seeded once at startup via seedBuiltinParameterOverrideParsers(). Customers register custom types by calling registerParameterType<T>() once per type from their behavior loader plugin's registerBehaviors().
| using moveit_pro::behavior::ParameterOverrideRegistry::ParseFn = std::function<tl::expected<BT::Any, std::string>(std::string_view)> |
Callback that parses a YAML string into a typed BT::Any value.
tl::expected wrapping the parsed value on success, or a human-readable error string on YAML parse failure. The parser does not touch any blackboard — that is the caller's responsibility so the apply step can be made transactional. | ParameterOverrideRegistry::ParseFn moveit_pro::behavior::ParameterOverrideRegistry::findParser | ( | std::type_index | type_index | ) | const |
Look up the parser for type_index. Returns an empty ParseFn if no parser is registered.
Returns by value (a copy of the std::function) so concurrent registerParser calls cannot dangle the pointer to a rehashed unordered_map entry between lookup and invocation.
|
static |
Access the process-global registry.
| void moveit_pro::behavior::ParameterOverrideRegistry::registerParser | ( | std::type_index | type_index, |
| ParseFn | parser | ||
| ) |
Register a parser for the type identified by type_index.
Overwrites any prior registration for the same type. Thread-safe.