Bug report
Required Info:
- Operating System:
- ROS2 Version:
- Version or commit hash:
- DDS implementation:
Steps to reproduce issue
This happened when I launched nav2 bringup while many CPU-expensive nodes were running (Gazebo, data processing, object detection, ...).
Most easily reproducible by adding
std::this_thread::sleep_for(500ms);
at the end of lifecycle manager constructor and launching
ros2 launch nav2_bringup bringup_launch.py
Expected behavior
LifecycleManager starts.
Actual behavior
LifecycleManager crashes in createLifecycleServiceClients() method on shared_from_this() as the shared pointer has not been created yet when init_timer_ fires.
Additional information
Can be fixed by removing callback_group_ from init_timer_ construction, so that the callback is fired from rclcpp::spin(node) after the shared ptr has been created for sure. Cannot say whether this change affects negatively different ways of bringing up the manager (other than ros2 launch nav2_bringup bringup_launch.py )
Bug report
Required Info:
Steps to reproduce issue
This happened when I launched nav2 bringup while many CPU-expensive nodes were running (Gazebo, data processing, object detection, ...).
Most easily reproducible by adding
at the end of lifecycle manager constructor and launching
Expected behavior
LifecycleManager starts.
Actual behavior
LifecycleManager crashes in
createLifecycleServiceClients()method onshared_from_this()as the shared pointer has not been created yet wheninit_timer_fires.Additional information
Can be fixed by removing
callback_group_frominit_timer_construction, so that the callback is fired fromrclcpp::spin(node)after the shared ptr has been created for sure. Cannot say whether this change affects negatively different ways of bringing up the manager (other thanros2 launch nav2_bringup bringup_launch.py)