|
Easy Navigation
|
ROS 2 lifecycle node that manages sensor fusion in Easy Navigation. More...
#include <SensorsNode.hpp>


Public Types | |
| using | CallbackReturnT = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn |
Public Member Functions | |
| void | cycle (std::shared_ptr< NavState > nav_state) |
| Run one non-real-time processing cycle. | |
| bool | cycle_rt (std::shared_ptr< NavState > nav_state, bool trigger=false) |
| Run one real-time sensor processing cycle. | |
| rclcpp::CallbackGroup::SharedPtr | get_real_time_cbg () |
| Get the callback group for real-time tasks. | |
| CallbackReturnT | on_activate (const rclcpp_lifecycle::State &state) |
| Activate the node. | |
| CallbackReturnT | on_cleanup (const rclcpp_lifecycle::State &state) |
| Cleanup the node. | |
| CallbackReturnT | on_configure (const rclcpp_lifecycle::State &state) |
| Configure the node. | |
| CallbackReturnT | on_deactivate (const rclcpp_lifecycle::State &state) |
| Deactivate the node. | |
| CallbackReturnT | on_error (const rclcpp_lifecycle::State &state) |
| Handle lifecycle transition errors. | |
| CallbackReturnT | on_shutdown (const rclcpp_lifecycle::State &state) |
| Shutdown the node. | |
| SensorsNode (const rclcpp::NodeOptions &options=rclcpp::NodeOptions()) | |
| Constructor. | |
| ~SensorsNode () | |
| Destructor. | |
Protected Attributes | |
| std::map< std::string, std::vector< std::string > > | groups_ |
| Sensor groups (set as group of keys in the NavState). | |
| std::vector< std::shared_ptr< PerceptionHandler > > | handler_list_ |
| vector of PerceptionHandler instances | |
| std::mutex | handler_list_mutex_ |
| Guards handler_list_ between the RT thread (cycle_rt) and the non-RT thread (on_cleanup), which run concurrently. | |
| std::unique_ptr< pluginlib::ClassLoader< PerceptionHandler > > | handler_loader_ |
| Pluginlib class loader for PerceptionHandler plugins. | |
ROS 2 lifecycle node that manages sensor fusion in Easy Navigation.
Collects, transforms, and publishes fused perception data from multiple sources. Sensor handlers are loaded at runtime as pluginlib plugins, allowing users to add new sensor types without modifying this node.
Every RT cycle, a perception older than "forget_time" seconds (ROS time) is invalidated, so nothing uses it until new data arrives. Sensors without data, or with old data, are reported as "diagnostics.sensors" (WARN), on changes only.
| using CallbackReturnT = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn |
|
explicit |
Constructor.
| options | Node configuration options. |
| ~SensorsNode | ( | ) |
Destructor.
| void cycle | ( | std::shared_ptr< NavState > | nav_state | ) |
Run one non-real-time processing cycle.
| bool cycle_rt | ( | std::shared_ptr< NavState > | nav_state, |
| bool | trigger = false ) |
Run one real-time sensor processing cycle.
| trigger | Force execution regardless of frequency. |
| rclcpp::CallbackGroup::SharedPtr get_real_time_cbg | ( | ) |
Get the callback group for real-time tasks.
| CallbackReturnT on_activate | ( | const rclcpp_lifecycle::State & | state | ) |
Activate the node.
| state | Lifecycle state. |
| CallbackReturnT on_cleanup | ( | const rclcpp_lifecycle::State & | state | ) |
Cleanup the node.
| state | Lifecycle state. |
| CallbackReturnT on_configure | ( | const rclcpp_lifecycle::State & | state | ) |
Configure the node.
| state | Lifecycle state. |
| CallbackReturnT on_deactivate | ( | const rclcpp_lifecycle::State & | state | ) |
Deactivate the node.
| state | Lifecycle state. |
| CallbackReturnT on_error | ( | const rclcpp_lifecycle::State & | state | ) |
Handle lifecycle transition errors.
| state | Lifecycle state. |
| CallbackReturnT on_shutdown | ( | const rclcpp_lifecycle::State & | state | ) |
Shutdown the node.
| state | Lifecycle state. |
|
protected |
Sensor groups (set as group of keys in the NavState).
|
protected |
vector of PerceptionHandler instances
|
protected |
Guards handler_list_ between the RT thread (cycle_rt) and the non-RT thread (on_cleanup), which run concurrently.
|
protected |
Pluginlib class loader for PerceptionHandler plugins.
Declared before handler_list_ so it is destroyed after it: members are destroyed in reverse declaration order, and each handler instance's vtable/code lives inside the shared library this loader dlopen()s. Destroying the loader (and therefore dlclose()-ing the library) before the instances would make their destructors call into unloaded code.