Skip to content

Conversation

@BOOPESH-foxy
Copy link

Changes

Adds ROS 2 managed lifecycle support for EKF/UKF state estimation nodes.

  • Nodes inherit from rclcpp_lifecycle::LifecycleNode
  • New lifecycle_managed_node parameter (default: false)
    • false: nodes auto-configure/activate (backward compatible)
    • true: nodes require external lifecycle management via ros2 lifecycle commands
  • Implements lifecycle callbacks: on_configure, on_activate, on_deactivate, on_cleanup, on_shutdown
  • Added rclcpp_lifecycle dependency to CMakeLists.txt and package.xml
  • Updated launch files (ekf.launch.py, ukf.launch.py) to expose parameter
  • Added comprehensive documentation (doc/lifecycle_support.rst)
  • Updated CHANGELOG.rst

Testing

  • Builds cleanly without errors
  • All lifecycle callbacks implemented and integrated
  • Ready for community review and testing

Closes #958

- Add ROS 2 managed lifecycle support (LifecycleNode pattern)
- Introduce lifecycle_managed_node parameter (default: false for backward compatibility)
- Implement lifecycle callbacks: on_configure, on_activate, on_deactivate, on_cleanup, on_shutdown
- Update CMakeLists.txt and package.xml with rclcpp_lifecycle dependency
- Update launch files (ekf.launch.py, ukf.launch.py) to expose lifecycle_managed_node parameter
- Add comprehensive documentation in doc/lifecycle_support.rst
- Update CHANGELOG.rst with feature summary

Closes cra-ros-pkg#958
Copy link
Collaborator

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good first stab - in general lets not change unrelated things like declaring parameters lambdas

Comment on lines 537 to 542
//! @brief Whether the node requires external lifecycle management
//!
//! When false (default), the node auto-transitions through configure and activate
//! on startup, maintaining backward compatibility. When true, external lifecycle
//! management via ros2 lifecycle commands is required.
bool lifecycle_managed_node_;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should always be a managed node and have no auto-transition like this. There are ways to do this via the launch file instead.


return LaunchDescription([
lifecycle_managed_param,
launch_ros.actions.Node(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use the LifecycleNode then there's an autostart param in rolling + newer that'll auto transition if desired

default_value='false',
description='Enable lifecycle management for the UKF node')

return LaunchDescription([
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto, and then remove this launch configuration for the lifecycle_managed_node

src/ekf_node.cpp Outdated
Comment on lines 48 to 52
void sigintHandler(int signum)
{
static_cast<void>(signum);
g_sigint_requested.store(true);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also be removed from all nodes

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general many of the changes here are not necessary if not lifecycle_managed_node

template<typename T>
void RosFilter<T>::loadParams()
{
auto declare_parameter_if_not_declared =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this lambda

@@ -2077,6 +2299,11 @@ void RosFilter<T>::poseCallback(
template<typename T>
void RosFilter<T>::initialize()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're doing lifecyckle, this method should be removed and its implementation should be happening on configure / activate as appropriate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Lifecycle Node Support for EKF and UKF nodes

2 participants