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

Core component that filters incoming image messages by modifying their headers and republishing them on a timer. More...

Inheritance diagram for ImageFilter:
Collaboration diagram for ImageFilter:

Public Member Functions

bool activate () override
 Activates the ImageFilter component by initializing a timer.
 
bool configure () override
 Configures the ImageFilter component.
 
bool deactivate () override
 Deactivates the ImageFilter component by disabling the timer.
 
 ImageFilter (rclcpp_lifecycle::LifecycleNode::SharedPtr parent)
 Constructs an ImageFilter object and initializes the parent lifecycle node.
 
void process_in_image (sensor_msgs::msg::Image::UniquePtr msg)
 Processes an incoming image message by modifying its header.
 
void timer_callback ()
 Timer callback function that retrieves an image message and processes it.
 
- Public Member Functions inherited from Core
 Core (rclcpp_lifecycle::LifecycleNode::SharedPtr parent)
 Constructs a Core object associated with a parent lifecycle node.
 
void set_afferent (cs4home_core::Afferent::SharedPtr afferent)
 Sets the Afferent component associated with this Core.
 
void set_efferent (cs4home_core::Efferent::SharedPtr efferent)
 Sets the Efferent component associated with this Core.
 

Additional Inherited Members

- Protected Attributes inherited from Core
cs4home_core::Afferent::SharedPtr afferent_
 Shared pointer to the Afferent component.
 
cs4home_core::Efferent::SharedPtr efferent_
 Shared pointer to the Efferent component.
 
rclcpp_lifecycle::LifecycleNode::SharedPtr parent_
 Shared pointer to the parent lifecycle node.
 

Detailed Description

Core component that filters incoming image messages by modifying their headers and republishing them on a timer.

Constructor & Destructor Documentation

◆ ImageFilter()

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

Constructs an ImageFilter object and initializes the parent lifecycle node.

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

Member Function Documentation

◆ activate()

bool activate ( )
overridevirtual

Activates the ImageFilter component by initializing a timer.

The timer is set to call timer_callback every 50 milliseconds.

Returns
True if activation is successful.

Implements Core.

◆ configure()

bool configure ( )
overridevirtual

Configures the ImageFilter component.

Returns
True if configuration is successful.

Implements Core.

◆ deactivate()

bool deactivate ( )
overridevirtual

Deactivates the ImageFilter component by disabling the timer.

The timer is reset to null, stopping periodic message processing.

Returns
True if deactivation is successful.

Implements Core.

◆ process_in_image()

void process_in_image ( sensor_msgs::msg::Image::UniquePtr msg)

Processes an incoming image message by modifying its header.

The frame_id in the image header is converted to an integer, doubled, and set as the new frame_id. The modified message is then sent to the efferent component.

Parameters
msgUnique pointer to the incoming image message of type sensor_msgs::msg::Image.

◆ timer_callback()

void timer_callback ( )

Timer callback function that retrieves an image message and processes it.

This function is called periodically and attempts to retrieve an image message from the afferent component. If a message is received, it is passed to process_in_image.


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