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

Pluginlib base class for "a thing that can build a capability node by name". More...

#include <capability_factory.hpp>

Inheritance diagram for CapabilityFactory:
CapabilityFactoryFor< ManipulationFakeActionServer > CapabilityFactoryFor< PerceptionFakeActionServer > CapabilityFactoryFor< ActionServerT >

Public Types

using SharedPtr = std::shared_ptr<CapabilityFactory>
 Shared pointer to a CapabilityFactory.

Public Member Functions

virtual std::shared_ptr< CapabilityNodeBasecreate (const std::string &capability_name, const rclcpp::NodeOptions &options) const =0
 Constructs and returns one capability node instance ready for the caller to configure()/activate().

Detailed Description

Pluginlib base class for "a thing that can build a capability node by name".

Not itself default-constructible-and-ready like a typical pluginlib strategy plugin, because Capability<ActionServerT> is a real rclcpp_lifecycle::LifecycleNode and its base class needs a name at construction time, not after – so instead of loading the capability node itself through pluginlib (which would force it to become default-constructible, breaking every existing use of Capability<T>), pluginlib loads this small, genuinely-default-constructible factory object, and the factory does the eager construction on Robot's behalf.

Member Function Documentation

◆ create()

virtual std::shared_ptr< CapabilityNodeBase > create ( const std::string & capability_name,
const rclcpp::NodeOptions & options ) const
pure virtual

Constructs and returns one capability node instance ready for the caller to configure()/activate().

Parameters
capability_namePassed straight through to Capability<T>'s own constructor – the node name, the action name, and the capability identity field published on /capabilities.
optionsNode options Robot::add_capability() has already stamped with this robot's namespace (see robot.hpp), plus whatever parameter overrides the caller supplied.
Returns
The newly constructed capability node, through its CapabilityNodeBase interface.

Implemented in CapabilityFactoryFor< ActionServerT >, CapabilityFactoryFor< ManipulationFakeActionServer >, and CapabilityFactoryFor< PerceptionFakeActionServer >.


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