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

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

Inheritance diagram for ImageFilterCB:
Collaboration diagram for ImageFilterCB:

Public Member Functions

bool activate () override
 Activates the ImageFilterCB component.
 
bool configure () override
 Configures the ImageFilterCB component.
 
bool deactivate () override
 Deactivates the ImageFilterCB component.
 
 ImageFilterCB (rclcpp_lifecycle::LifecycleNode::SharedPtr parent)
 Constructs an ImageFilterCB object and initializes the parent lifecycle node.
 
void process_in_image (std::unique_ptr< rclcpp::SerializedMessage > msg)
 Processes incoming serialized image messages, applies a simple transformation, and republishes them.
 
- 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.

Uses ROS 2 lifecycle and callback functions for message processing.

Constructor & Destructor Documentation

◆ ImageFilterCB()

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

Constructs an ImageFilterCB object and initializes the parent lifecycle node.

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

Member Function Documentation

◆ activate()

bool activate ( )
overridevirtual

Activates the ImageFilterCB component.

Returns
True if activation is successful.

Implements Core.

◆ configure()

bool configure ( )
overridevirtual

Configures the ImageFilterCB component.

Sets the afferent component mode to CALLBACK, binding the process_in_image method to handle incoming messages.

Returns
True if configuration is successful.

Implements Core.

◆ deactivate()

bool deactivate ( )
overridevirtual

Deactivates the ImageFilterCB component.

Disables the internal timer by resetting the timer shared pointer to null.

Returns
True if deactivation is successful.

Implements Core.

◆ process_in_image()

void process_in_image ( std::unique_ptr< rclcpp::SerializedMessage > msg)

Processes incoming serialized image messages, applies a simple transformation, and republishes them.

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 serialized incoming image message.

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