|
| | Capability (const std::string &capability_name, const rclcpp::NodeOptions &options=rclcpp::NodeOptions()) |
| | Constructs the capability node.
|
| ActionServerBaseT::SharedPtr | get_action_server () const noexcept |
| | The action server backing this capability.
|
| const std::string & | get_capability_name () const noexcept override |
| | The capability identity field published on /capabilities and /capabilities_status.
|
| const std::string & | get_robot_name () const noexcept override |
| | This node's namespace, without the leading '/' (empty if none), e.g.
|
| const std::string & | get_resolved_action_name () const noexcept |
| | Fully-qualified name of the action this capability exposes, e.g.
|
| CallbackReturn | configure_node () override |
| | Drive the underlying lifecycle node from UNCONFIGURED to INACTIVE.
|
| CallbackReturn | activate_node () override |
| | Drive the underlying lifecycle node from INACTIVE to ACTIVE.
|
| CallbackReturn | deactivate_node () override |
| | Drive the underlying lifecycle node from ACTIVE to INACTIVE.
|
| CallbackReturn | cleanup_node () override |
| | Drive the underlying lifecycle node from INACTIVE to UNCONFIGURED.
|
| CallbackReturn | shutdown_node () override |
| | Drive the underlying lifecycle node to FINALIZED, from whatever state it is currently in.
|
| uint8_t | get_current_state_id () const override |
| | The underlying lifecycle node's current state id.
|
| rclcpp::node_interfaces::NodeBaseInterface::SharedPtr | get_node_base_interface () override |
| | So a Deployment can add the underlying node to its shared executor without knowing its concrete type.
|
template<typename ActionServerT>
class easyfleet_core::Capability< ActionServerT >
Lifecycle node that advertises a single action as a "capability".
Capability<ActionServerT> is a rclcpp_lifecycle::LifecycleNode that:
- owns an instance of ActionServerT (a concrete subclass of ActionServerBase<ActionType>, constructed as ActionServerT(rclcpp_lifecycle::LifecycleNode &, const std::string &)), exposed through its ActionServerBase<ActionType>::SharedPtr base type;
- on on_activate, reads the file named by the capabilities_file string parameter and publishes it, together with its own runtime identity (namespace and fully-qualified action name), as an easyfleet_interfaces/CapabilityDescription on the reliable, transient-local /capabilities topic, so late subscribers still get it;
- while active, publishes an easyfleet_interfaces/CapabilityStatus heartbeat once a second on /capabilities_status.
ActionServerT must publicly inherit ActionServerBase<SomeActionType> and be constructible as ActionServerT(LifecycleNode &, const std::string &).
The robot/capability/action_name identity published on both topics is resolved from this node's actual namespace at construction time, so a capability launched under namespace robot1 announces itself as such without any code changes – this is what lets a control center tell apart, say, robot1's and robot2's navigation capabilities.
Also implements CapabilityNodeBase, so a Robot/Deployment that doesn't know (and doesn't need to know) ActionServerT can still drive this instance's lifecycle and add its node to an executor – see capability_node_base.hpp and capability_factory.hpp.
template<typename ActionServerT>
| const std::string & get_robot_name |
( |
| ) |
const |
|
overridevirtualnoexcept |
This node's namespace, without the leading '/' (empty if none), e.g.
"robot1". This is the robot identity field published on /capabilities and /capabilities_status.
- Returns
- This node's resolved robot name.
Implements CapabilityNodeBase.