ros-planning / navigation

ROS Navigation stack. Code for finding where the robot is and how it can get somewhere else.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

qq779527421 opened this issue · comments

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 map_received_ is uncertain.

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