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

Extends the LifecycleNode to manage cognitive processing components in a ROS 2 lifecycle, including afferent, efferent, core, meta, and coupling components. More...

#include <CognitiveModule.hpp>

Inheritance diagram for CognitiveModule:
Collaboration diagram for CognitiveModule:

Public Types

using CallbackReturnT = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn
 

Public Member Functions

 CognitiveModule (const std::string &name, const rclcpp::NodeOptions &options=rclcpp::NodeOptions())
 Constructs a CognitiveModule with the specified node options.
 
CallbackReturnT on_activate (const rclcpp_lifecycle::State &state)
 Lifecycle transition callback for activation.
 
CallbackReturnT on_cleanup (const rclcpp_lifecycle::State &state)
 Lifecycle transition callback for cleanup.
 
CallbackReturnT on_configure (const rclcpp_lifecycle::State &state)
 Lifecycle transition callback for configuration.
 
CallbackReturnT on_deactivate (const rclcpp_lifecycle::State &state)
 Lifecycle transition callback for deactivation.
 
CallbackReturnT on_error (const rclcpp_lifecycle::State &state)
 Lifecycle transition callback for error handling.
 
CallbackReturnT on_shutdown (const rclcpp_lifecycle::State &state)
 Lifecycle transition callback for shutdown.
 

Protected Member Functions

template<class T>
std::tuple< typename T::SharedPtr, std::string > load_component (const std::string &name, rclcpp_lifecycle::LifecycleNode::SharedPtr parent)
 Loads a specified component by name and returns a shared pointer to it.
 

Protected Attributes

Afferent::SharedPtr afferent_
 Pointer to the Afferent component.
 
std::string afferent_name_
 Name of the Afferent component.
 
Core::SharedPtr core_
 Pointer to the Core component.
 
std::string core_name_
 Name of the Core component.
 
Coupling::SharedPtr coupling_
 Pointer to the Coupling component.
 
std::string coupling_name_
 Name of the Coupling component.
 
Efferent::SharedPtr efferent_
 Pointer to the Efferent component.
 
std::string efferent_name_
 Name of the Efferent component.
 
Meta::SharedPtr meta_
 Pointer to the Meta component.
 
std::string meta_name_
 Name of the Meta component.
 

Detailed Description

Extends the LifecycleNode to manage cognitive processing components in a ROS 2 lifecycle, including afferent, efferent, core, meta, and coupling components.

Member Typedef Documentation

◆ CallbackReturnT

using CallbackReturnT = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn

Constructor & Destructor Documentation

◆ CognitiveModule()

CognitiveModule ( const std::string & name,
const rclcpp::NodeOptions & options = rclcpp::NodeOptions() )
explicit

Constructs a CognitiveModule with the specified node options.

Constructs a CognitiveModule and declares parameters.

Parameters
optionsNode options for configuring the lifecycle node.
optionsNode options to initialize the CognitiveModule instance.

Member Function Documentation

◆ load_component()

template<class T>
std::tuple< typename T::SharedPtr, std::string > load_component ( const std::string & name,
rclcpp_lifecycle::LifecycleNode::SharedPtr parent )
protected

Loads a specified component by name and returns a shared pointer to it.

Loads a component dynamically by name.

Template Parameters
TType of the component to load.
Parameters
nameName of the component to load.
parentShared pointer to the parent lifecycle node.
Returns
A tuple containing the loaded component pointer and its name.

Attempts to load the specified component by name from a shared library.

Template Parameters
TType of the component to load.
Parameters
nameName of the component.
parentShared pointer to the parent lifecycle node.
Returns
A tuple containing the shared pointer to the component and an error string (if any).

◆ on_activate()

CallbackReturnT on_activate ( const rclcpp_lifecycle::State & state)

Lifecycle transition callback for activation.

Activates the core component.

Parameters
stateThe current lifecycle state.
Returns
Result of the activation, typically success or failure.
Parameters
stateCurrent lifecycle state.
Returns
CallbackReturnT::SUCCESS if activation is successful, FAILURE otherwise.

◆ on_cleanup()

CallbackReturnT on_cleanup ( const rclcpp_lifecycle::State & state)

Lifecycle transition callback for cleanup.

Cleans up the CognitiveModule instance.

Parameters
stateThe current lifecycle state.
Returns
Result of the cleanup, typically success or failure.
Parameters
stateCurrent lifecycle state.
Returns
CallbackReturnT::SUCCESS indicating cleanup is complete.

◆ on_configure()

CallbackReturnT on_configure ( const rclcpp_lifecycle::State & state)

Lifecycle transition callback for configuration.

Configures the CognitiveModule by loading and setting up components.

Parameters
stateThe current lifecycle state.
Returns
Result of the configuration, typically success or failure.
Parameters
stateCurrent lifecycle state.
Returns
CallbackReturnT::SUCCESS if configuration is successful, FAILURE otherwise.

◆ on_deactivate()

CallbackReturnT on_deactivate ( const rclcpp_lifecycle::State & state)

Lifecycle transition callback for deactivation.

Deactivates the core component.

Parameters
stateThe current lifecycle state.
Returns
Result of the deactivation, typically success or failure.
Parameters
stateCurrent lifecycle state.
Returns
CallbackReturnT::SUCCESS if deactivation is successful, FAILURE otherwise.

◆ on_error()

CallbackReturnT on_error ( const rclcpp_lifecycle::State & state)

Lifecycle transition callback for error handling.

Handles errors in the CognitiveModule instance.

Parameters
stateThe current lifecycle state.
Returns
Result of the error handling, typically success or failure.
Parameters
stateCurrent lifecycle state.
Returns
CallbackReturnT::SUCCESS indicating error handling is complete.

◆ on_shutdown()

CallbackReturnT on_shutdown ( const rclcpp_lifecycle::State & state)

Lifecycle transition callback for shutdown.

Shuts down the CognitiveModule instance.

Parameters
stateThe current lifecycle state.
Returns
Result of the shutdown, typically success or failure.
Parameters
stateCurrent lifecycle state.
Returns
CallbackReturnT::SUCCESS indicating shutdown is complete.

Member Data Documentation

◆ afferent_

Afferent::SharedPtr afferent_
protected

Pointer to the Afferent component.

◆ afferent_name_

std::string afferent_name_
protected

Name of the Afferent component.

◆ core_

Core::SharedPtr core_
protected

Pointer to the Core component.

◆ core_name_

std::string core_name_
protected

Name of the Core component.

◆ coupling_

Coupling::SharedPtr coupling_
protected

Pointer to the Coupling component.

◆ coupling_name_

std::string coupling_name_
protected

Name of the Coupling component.

◆ efferent_

Efferent::SharedPtr efferent_
protected

Pointer to the Efferent component.

◆ efferent_name_

std::string efferent_name_
protected

Name of the Efferent component.

◆ meta_

Meta::SharedPtr meta_
protected

Pointer to the Meta component.

◆ meta_name_

std::string meta_name_
protected

Name of the Meta component.


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