EasyFleet
A simple-by-default framework for multi-robot, multi-capability fleets built on ROS 2
Loading...
Searching...
No Matches
CapabilityNodeBase Class Referenceabstract

Non-template handle to an already-constructed Capability<ActionServerT> instance, exposing exactly the surface Robot/Deployment need to drive it – lifecycle transitions, its node (to add to an executor), and its identity – without needing to know ActionServerT. More...

#include <capability_node_base.hpp>

Inheritance diagram for CapabilityNodeBase:
Capability< ManipulationFakeActionServer > Capability< PerceptionFakeActionServer > Capability< EasynavNavigationActionServer > Capability< NavigationFakeActionServer > Capability< ActionServerT > ManipulationFakeCapability ManipulationFakeCapability ManipulationFakeCapability ManipulationFakeCapability PerceptionFakeCapability PerceptionFakeCapability PerceptionFakeCapability PerceptionFakeCapability EasynavNavigationCapability NavigationFakeCapability NavigationFakeCapability

Public Types

using SharedPtr = std::shared_ptr<CapabilityNodeBase>
 Shared pointer to a CapabilityNodeBase.
using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn
 Lifecycle transition result type shared with rclcpp_lifecycle.

Public Member Functions

virtual CallbackReturn configure_node ()=0
 Drive the underlying lifecycle node from UNCONFIGURED to INACTIVE.
virtual CallbackReturn activate_node ()=0
 Drive the underlying lifecycle node from INACTIVE to ACTIVE.
virtual CallbackReturn deactivate_node ()=0
 Drive the underlying lifecycle node from ACTIVE to INACTIVE.
virtual CallbackReturn cleanup_node ()=0
 Drive the underlying lifecycle node from INACTIVE to UNCONFIGURED.
virtual CallbackReturn shutdown_node ()=0
 Drive the underlying lifecycle node to FINALIZED, from whatever state it is currently in.
virtual uint8_t get_current_state_id () const =0
 The underlying lifecycle node's current state id.
virtual rclcpp::node_interfaces::NodeBaseInterface::SharedPtr get_node_base_interface ()=0
 So a Deployment can add the underlying node to its shared executor without knowing its concrete type.
virtual const std::string & get_capability_name () const =0
 The capability identity field published on /capabilities and /capabilities_status.
virtual const std::string & get_robot_name () const =0
 The robot identity field published on /capabilities and /capabilities_status.

Detailed Description

Non-template handle to an already-constructed Capability<ActionServerT> instance, exposing exactly the surface Robot/Deployment need to drive it – lifecycle transitions, its node (to add to an executor), and its identity – without needing to know ActionServerT.

This exists purely so Robot::add_capability() can hold a runtime-selected, pluginlib-loaded capability (see CapabilityFactory) in a single homogeneous container: Capability<ActionServerT> itself stays exactly as it is today (still template, still constructed eagerly with (capability_name, options), still usable standalone the way every existing deployment already uses it) – it just additionally implements this small interface.

Member Function Documentation

◆ activate_node()

virtual CallbackReturn activate_node ( )
pure virtual

Drive the underlying lifecycle node from INACTIVE to ACTIVE.

Returns
The resulting lifecycle transition outcome.

Implemented in Capability< ActionServerT >, Capability< EasynavNavigationActionServer >, Capability< ManipulationFakeActionServer >, Capability< NavigationFakeActionServer >, and Capability< PerceptionFakeActionServer >.

◆ cleanup_node()

virtual CallbackReturn cleanup_node ( )
pure virtual

Drive the underlying lifecycle node from INACTIVE to UNCONFIGURED.

Returns
The resulting lifecycle transition outcome.

Implemented in Capability< ActionServerT >, Capability< EasynavNavigationActionServer >, Capability< ManipulationFakeActionServer >, Capability< NavigationFakeActionServer >, and Capability< PerceptionFakeActionServer >.

◆ configure_node()

virtual CallbackReturn configure_node ( )
pure virtual

Drive the underlying lifecycle node from UNCONFIGURED to INACTIVE.

Returns
The resulting lifecycle transition outcome.

Implemented in Capability< ActionServerT >, Capability< EasynavNavigationActionServer >, Capability< ManipulationFakeActionServer >, Capability< NavigationFakeActionServer >, and Capability< PerceptionFakeActionServer >.

◆ deactivate_node()

virtual CallbackReturn deactivate_node ( )
pure virtual

Drive the underlying lifecycle node from ACTIVE to INACTIVE.

Returns
The resulting lifecycle transition outcome.

Implemented in Capability< ActionServerT >, Capability< EasynavNavigationActionServer >, Capability< ManipulationFakeActionServer >, Capability< NavigationFakeActionServer >, and Capability< PerceptionFakeActionServer >.

◆ get_capability_name()

virtual const std::string & get_capability_name ( ) const
pure virtual

The capability identity field published on /capabilities and /capabilities_status.

Returns
The capability identity field published on /capabilities and /capabilities_status.

Implemented in Capability< ActionServerT >, Capability< EasynavNavigationActionServer >, Capability< ManipulationFakeActionServer >, Capability< NavigationFakeActionServer >, and Capability< PerceptionFakeActionServer >.

◆ get_current_state_id()

virtual uint8_t get_current_state_id ( ) const
pure virtual

The underlying lifecycle node's current state id.

Returns
The underlying lifecycle node's current state id (one of the lifecycle_msgs::msg::State::PRIMARY_STATE_* constants).

Implemented in Capability< ActionServerT >, Capability< EasynavNavigationActionServer >, Capability< ManipulationFakeActionServer >, Capability< NavigationFakeActionServer >, and Capability< PerceptionFakeActionServer >.

◆ get_node_base_interface()

virtual rclcpp::node_interfaces::NodeBaseInterface::SharedPtr get_node_base_interface ( )
pure virtual

So a Deployment can add the underlying node to its shared executor without knowing its concrete type.

Returns
The underlying node's base interface.

Implemented in Capability< ActionServerT >, Capability< EasynavNavigationActionServer >, Capability< ManipulationFakeActionServer >, Capability< NavigationFakeActionServer >, and Capability< PerceptionFakeActionServer >.

◆ get_robot_name()

virtual const std::string & get_robot_name ( ) const
pure virtual

The robot identity field published on /capabilities and /capabilities_status.

Returns
The robot identity field published on /capabilities and /capabilities_status.

Implemented in Capability< ActionServerT >, Capability< EasynavNavigationActionServer >, Capability< ManipulationFakeActionServer >, Capability< NavigationFakeActionServer >, and Capability< PerceptionFakeActionServer >.

◆ shutdown_node()

virtual CallbackReturn shutdown_node ( )
pure virtual

Drive the underlying lifecycle node to FINALIZED, from whatever state it is currently in.

Returns
The resulting lifecycle transition outcome.

Implemented in Capability< ActionServerT >, Capability< EasynavNavigationActionServer >, Capability< ManipulationFakeActionServer >, Capability< NavigationFakeActionServer >, and Capability< PerceptionFakeActionServer >.


The documentation for this class was generated from the following file: