ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

ROS2 nav2 global costmap disappearing

asked 2022-06-01 02:42:57 -0500

Bastian2909 gravatar image

updated 2022-06-01 03:01:41 -0500

Hello, I am using ros2 foxy on Ubuntu 20.04 with rviz2 and gazebo 11. I'm running a robot in a simulation and will soon test my program on a real robot.

Everything launch and work as intended : - I can drive the robot with teleop - I can use nav2 to tell it to go from point A to point B

Now I want to save a map of where the robot has been when driving. I set up it's footprint so when I move it around, the global_costmap gets "populated" with white cells (if I understand correctly, it means they go from unknown to free).

However, after 3/4 minutes of driving the global costmap disappear with this message :

[bt_navigator-11] [INFO] [1654067456.988313971] [bt_navigator]: Begin navigating from current location to (3.10, 1.08)
[controller_server-8] [INFO] [1654067457.016923884] [local_costmap.local_costmap]: Received request to clear entirely the local_costmap
[bt_navigator-11] [WARN] [1654067457.017791003] [bt_navigator_rclcpp_node]: Node timed out while executing service call to local_costmap/clear_entirely_local_costmap.
[controller_server-8] [INFO] [1654067457.018207010] [local_costmap.local_costmap]: Received request to clear entirely the local_costmap
[planner_server-9] [INFO] [1654067457.019795388] [global_costmap.global_costmap]: Received request to clear entirely the global_costmap
[recoveries_server-10] [INFO] [1654067457.023361510] [recoveries_server]: Attempting spin

I think it is a normal behavior but is there a way to stop that from happening so I can move around my entire area and then save it as a map for future uses ? Thank you for taking the time to read my question, feel free to correct anything you think is wrong/inaccurate.

Edit (1) : After more testing, it appear that this happens when the robot get's "stuck" or have difficulties to follow the path it was given.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-06-01 07:47:17 -0500

ljaniec gravatar image

updated 2022-06-01 07:52:53 -0500

I think you should check your Behavior Tree for this Behaviors plugin Clear Costmap call:

A service to clear the given costmap in case of incorrect perception or robot is stuck

If you want to not use it, modifying a BT is the way to go. I recommend Groot for this, it's easier.

For the ROS2 Galactic installation:

   cd ~/dev_ws/src
   git clone
   cd ..
   rosdep install --from-paths src --ignore-src
   colcon build --symlink-install --packages-select groot

I have sudo apt install ros-galactic-behaviortree-cpp-v3 before too.

You have to source install/setup.bash and ./build/groot/Groot.

You can load BT XMLs from the Nav2 repository/your package and modify it.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2022-06-01 02:42:57 -0500

Seen: 444 times

Last updated: Jun 01 '22