CORESENSE4home_Architecture
Loading...
Searching...
No Matches
SimpleImageInput Class Reference

Manages image input by creating subscribers for specified topics and handling image messages from these sources. More...

Inheritance diagram for SimpleImageInput:
Collaboration diagram for SimpleImageInput:

Public Member Functions

bool configure () override
 Configures the SimpleImageInput by creating subscribers for each specified topic.
 
 SimpleImageInput (rclcpp_lifecycle::LifecycleNode::SharedPtr parent)
 Constructs a SimpleImageInput object and declares necessary parameters.
 
- Public Member Functions inherited from Afferent
 Afferent (rclcpp_lifecycle::LifecycleNode::SharedPtr parent)
 Constructor for the Afferent class.
 
size_t get_max_queue_size ()
 Gets the maximum queue size.
 
EfferentProcessMode get_mode ()
 Gets the current processing mode.
 
template<class MessageT>
std::unique_ptr< MessageT > get_msg ()
 Retrieves the next message from the queue, if available.
 
template<class MessageT>
std::unique_ptr< MessageT > get_msg (std::unique_ptr< rclcpp::SerializedMessage > msg)
 Converts a serialized message to a typed message.
 
void set_max_queue_size (size_t size)
 Sets the maximum queue size for storing messages.
 
void set_mode (EfferentProcessMode mode, std::function< void(std::unique_ptr< rclcpp::SerializedMessage >)> cb=nullptr)
 Sets the processing mode and an optional callback function.
 

Additional Inherited Members

- Public Types inherited from Afferent
enum  EfferentProcessMode { CALLBACK , ONDEMAND }
 Defines processing modes for serialized message handling. More...
 
- Protected Member Functions inherited from Afferent
bool create_subscriber (const std::string &topic, const std::string &type)
 Creates a subscriber for a specific topic and message type.
 
- Protected Attributes inherited from Afferent
std::function< void(std::unique_ptr< rclcpp::SerializedMessage >)> callback_
 Callback for serialized messages.
 
const size_t MAX_DEFAULT_QUEUE_SIZE = 100
 Default maximum queue size.
 
size_t max_queue_size_ {MAX_DEFAULT_QUEUE_SIZE}
 Maximum queue size.
 
EfferentProcessMode mode_ {ONDEMAND}
 Current processing mode.
 
std::queue< std::unique_ptr< rclcpp::SerializedMessage > > msg_queue_
 Queue for serialized messages.
 
rclcpp_lifecycle::LifecycleNode::SharedPtr parent_
 Shared pointer to the parent node.
 
std::vector< std::shared_ptr< rclcpp::GenericSubscription > > subs_
 List of subscriptions.
 

Detailed Description

Manages image input by creating subscribers for specified topics and handling image messages from these sources.

Constructor & Destructor Documentation

◆ SimpleImageInput()

SimpleImageInput ( rclcpp_lifecycle::LifecycleNode::SharedPtr parent)
explicit

Constructs a SimpleImageInput object and declares necessary parameters.

Parameters
parentShared pointer to the lifecycle node managing this SimpleImageInput instance.

Member Function Documentation

◆ configure()

bool configure ( )
overridevirtual

Configures the SimpleImageInput by creating subscribers for each specified topic.

This method retrieves the topic names from the parameter server and attempts to create a subscription for each topic to receive sensor_msgs::msg::Image messages.

Returns
True if all subscriptions are created successfully.

Implements Afferent.


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