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>
|
using | CallbackReturnT = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn |
|
|
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.
|
|
Extends the LifecycleNode to manage cognitive processing components in a ROS 2 lifecycle, including afferent, efferent, core, meta, and coupling components.
◆ CallbackReturnT
using CallbackReturnT = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn |
◆ 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
-
options | Node options for configuring the lifecycle node. |
options | Node options to initialize the CognitiveModule instance. |
◆ 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
-
T | Type of the component to load. |
- Parameters
-
name | Name of the component to load. |
parent | Shared 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
-
T | Type of the component to load. |
- Parameters
-
name | Name of the component. |
parent | Shared pointer to the parent lifecycle node. |
- Returns
- A tuple containing the shared pointer to the component and an error string (if any).
◆ on_activate()
Lifecycle transition callback for activation.
Activates the core component.
- Parameters
-
state | The current lifecycle state. |
- Returns
- Result of the activation, typically success or failure.
- Parameters
-
state | Current lifecycle state. |
- Returns
- CallbackReturnT::SUCCESS if activation is successful, FAILURE otherwise.
◆ on_cleanup()
Lifecycle transition callback for cleanup.
Cleans up the CognitiveModule instance.
- Parameters
-
state | The current lifecycle state. |
- Returns
- Result of the cleanup, typically success or failure.
- Parameters
-
state | Current lifecycle state. |
- Returns
- CallbackReturnT::SUCCESS indicating cleanup is complete.
◆ on_configure()
Lifecycle transition callback for configuration.
Configures the CognitiveModule by loading and setting up components.
- Parameters
-
state | The current lifecycle state. |
- Returns
- Result of the configuration, typically success or failure.
- Parameters
-
state | Current lifecycle state. |
- Returns
- CallbackReturnT::SUCCESS if configuration is successful, FAILURE otherwise.
◆ on_deactivate()
Lifecycle transition callback for deactivation.
Deactivates the core component.
- Parameters
-
state | The current lifecycle state. |
- Returns
- Result of the deactivation, typically success or failure.
- Parameters
-
state | Current lifecycle state. |
- Returns
- CallbackReturnT::SUCCESS if deactivation is successful, FAILURE otherwise.
◆ on_error()
Lifecycle transition callback for error handling.
Handles errors in the CognitiveModule instance.
- Parameters
-
state | The current lifecycle state. |
- Returns
- Result of the error handling, typically success or failure.
- Parameters
-
state | Current lifecycle state. |
- Returns
- CallbackReturnT::SUCCESS indicating error handling is complete.
◆ on_shutdown()
Lifecycle transition callback for shutdown.
Shuts down the CognitiveModule instance.
- Parameters
-
state | The current lifecycle state. |
- Returns
- Result of the shutdown, typically success or failure.
- Parameters
-
state | Current lifecycle state. |
- Returns
- CallbackReturnT::SUCCESS indicating shutdown is complete.
◆ afferent_
Afferent::SharedPtr afferent_ |
|
protected |
◆ afferent_name_
std::string afferent_name_ |
|
protected |
◆ core_
Pointer to the Core component.
◆ core_name_
Name of the Core component.
◆ coupling_
Coupling::SharedPtr coupling_ |
|
protected |
◆ coupling_name_
std::string coupling_name_ |
|
protected |
◆ efferent_
Efferent::SharedPtr efferent_ |
|
protected |
◆ efferent_name_
std::string efferent_name_ |
|
protected |
◆ meta_
Pointer to the Meta component.
◆ meta_name_
Name of the Meta component.
The documentation for this class was generated from the following files: