ros-planning / navigation

ROS Navigation stack. Code for finding where the robot is and how it can get somewhere else.
2.32k stars 1.79k forks source link

navigation/costmap_2d/plugins /static_layer.cpp StaticLayer::onInitialize can't return #1249

Open qq779527421 opened 1 year ago

qq779527421 commented 1 year ago

There was an issue with a robot getting stuck while switching maps. Log analysis show that calling /start_costmap cannot end. So Using the gdb --pid XXX connecting move_base node, is stucking in StaticLayer: : onInitialize() at static_layer.cpp:94. while (!map_received_ && g_nh.ok()) { ros::spinOnce(); r.sleep(); } I thik the reason is that the execution order of the two tasks for setting the member variable mapreceived is uncertain.

https://github.com/ros-planning/navigation/blob/noetic-devel/costmap_2d/plugins/static_layer.cpp set mapreceived = false on line 91 and mapreceived = true on line 216