Easy Navigation
Loading...
Searching...
No Matches
PerceptionHandler Class Referenceabstract

Abstract base interface for group-specific perception handlers. More...

#include <Perceptions.hpp>

Inheritance diagram for PerceptionHandler:

Public Member Functions

virtual std::shared_ptr< PerceptionBasecreate (const std::string &sensor_id)=0
 Creates a new instance of a perception object managed by this handler.
 
virtual rclcpp::SubscriptionBase::SharedPtr create_subscription (rclcpp_lifecycle::LifecycleNode &node, const std::string &topic, const std::string &type, std::shared_ptr< PerceptionBase > target, rclcpp::CallbackGroup::SharedPtr cb_group)=0
 Creates a subscription that processes messages into PerceptionBase instances.
 
virtual std::string group () const =0
 Returns the group identifier associated with this handler.
 
virtual ~PerceptionHandler ()=default
 

Detailed Description

Abstract base interface for group-specific perception handlers.

Each handler is responsible for a sensor group (e.g., "points", "image", "dummy"). It creates appropriate PerceptionBase instances and handles the conversion from ROS messages.

Constructor & Destructor Documentation

◆ ~PerceptionHandler()

virtual ~PerceptionHandler ( )
virtualdefault

Member Function Documentation

◆ create()

virtual std::shared_ptr< PerceptionBase > create ( const std::string & sensor_id)
pure virtual

Creates a new instance of a perception object managed by this handler.

Parameters
sensor_idName or ID of the sensor (optional use by handler).
Returns
Shared pointer to a new instance of a class derived from PerceptionBase.

Implemented in DummyHandler, ImagePerceptionHandler, and PointPerceptionHandler.

◆ create_subscription()

virtual rclcpp::SubscriptionBase::SharedPtr create_subscription ( rclcpp_lifecycle::LifecycleNode & node,
const std::string & topic,
const std::string & type,
std::shared_ptr< PerceptionBase > target,
rclcpp::CallbackGroup::SharedPtr cb_group )
pure virtual

Creates a subscription that processes messages into PerceptionBase instances.

The handler is expected to parse the message received on topic of type type and store the result in the target.

Parameters
nodeReference to the lifecycle node used for creating the subscription.
topicTopic name to subscribe to.
typeType name of the ROS message (e.g., "sensor_msgs/msg/LaserScan").
targetAtomic shared pointer where perception results are stored.
cb_groupCallback group where the subscription callback will be executed.
Returns
The created subscription.

Implemented in DummyHandler, ImagePerceptionHandler, and PointPerceptionHandler.

◆ group()

virtual std::string group ( ) const
pure virtual

Returns the group identifier associated with this handler.

This identifier is used to match sensors to the appropriate handler. Example: "points", "image", "dummy".

Returns
String representing the group name.

Implemented in DummyHandler, ImagePerceptionHandler, and PointPerceptionHandler.


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