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

"map update loop missed" happen frequently when robot path plan and run

asked 2021-02-23 10:22:01 -0500

ayato gravatar image

updated 2021-02-23 18:55:57 -0500

Hello,

My robot is planning path and controlling velocity with move_base.
In many cases, it seems to be working properly.
However, there were times when it suddenly started rotating in place or recovery behaviors was run even though there were no obstacles.
I checked rosout log at this time, and I found that "map update loop missed" log remained.

Further investigation revealed the following.

  • I set update_frequency of global costmap to 10 Hz, but there was a delay in seconds, and in the worst case, it was delayed by about 20 seconds.
  • I analyzed bag file using rqt_bag, footprint of local costmap was constantly updated, but only footprint of global costmap was rarely updated.
  • These phenomena occurred only during path planning and running, and did not occur when no goal was set for move_base. In those idle time, also footprint of global costmap was published in correct frequency. (I set shutdown_costmaps of move_base to true.)
  • I compiled move_base package with catkin_make using -DCMAKE_BUILD_TYPE=Release.
  • I also watched the CPU and memory resources, but it seemed that there was still about 40% left.
  • The size of map (.pgm) that global costmap subscribe is over 30 MB...

I don't know what to look for, so please give me some wisdom.
How to fix it is also welcome.

Thanks in advance.

costmap_params_common.yaml

robot_radius: 0.35
footprint_padding: 0.05
obstacle_layer:
  observation_sources: scan1 scan2 scan3
  obstacle_range: 4.5
  raytrace_range: 4.9
  track_unknown_space: true
  footprint_clearing_enabled: false

  scan1: {sensor_frame: scan1_frame, data_type: LaserScan, topic: scan1, marking: true, clearing: true}
  scan2: {sensor_frame: scan2_frame, data_type: LaserScan, topic: scan2, marking: true, clearing: true}
  scan3: {sensor_frame: scan3_frame, data_type: LaserScan, topic: scan3, marking: true, clearing: true}

global_costmap_params.yaml

global_costmap:
  global_frame: map
  robot_base_frame: base_link
  update_frequency: 10.0
  publish_frequency: 0.5

  width: 10.0
  height: 10.0

  plugins:
   - {name: static_layer, type: 'costmap_2d::StaticLayer'}
   - {name: obstacle_layer, type: 'costmap_2d::ObstacleLayer'}
   - {name: inflation_layer, type: 'costmap_2d::InflationLayer'}

  inflation_layer:
    cost_scaling_factor: 5.0
    enabled: true
    inflate_unknown: false
    inflation_radius: 1.2

  resolution: 0.025
  static_map: true
  rolling_window: false
  transform_tolerance: 0.5
  meter_scoring: true

local_costmap_params.yaml

local_costmap:
  global_frame: odom
  robot_base_frame: base_link
  update_frequency: 10.0
  publish_frequency: 0.2

  width: 7.0
  height: 7.0

  plugins:
   - {name: obstacle_layer, type: 'costmap_2d::ObstacleLayer'}
   - {name: inflation_layer, type: 'costmap_2d::InflationLayer'}

  inflation_layer:
    cost_scaling_factor: 5.0
    enabled: true
    inflate_unknown: false
    inflation_radius: 1.0

  resolution: 0.025
  static_map: false
  rolling_window: true
  transform_tolerance: 0.5
  meter_scoring: true
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-02-23 12:52:31 -0500

I think 10 Hz is quiet fast maybe lower it to something like 5 Hz (depends on your application of course).

How many inputs/layers do your costmaps have?

How large is the inflation radius?(This could be computationally havy)

Do you use a custom costmap layer?(Until now i was quiet happy with the performance of the standard ones)

In general please upload you costmap configs along with your question. This will help others to understand your setup.

edit flag offensive delete link more

Comments

@Tristan9497 Thanks for your answer.I added costmap config, please check it.
You're right, 5Hz may be too fast, but I'm very concerned that it only occurs when the planner is active.

ayato gravatar image ayato  ( 2021-02-23 19:01:39 -0500 )edit

I think you misunderstand the frequencies. e.g. 5Hz means every 200ms, 10Hz means every 100ms

The inflation Layer needs to calculate cost for each individual cell in the proximity of an occupied cell, which obviously is computational expensive even though they use optimized rasterization like bresenham.

Since you have your inflation radius set to 1 m and having a resolution of 0.025 this might be too much. This might be the reason you get this only while driving because then the incoming data is way larger then when stationary.

If you need the 1m radius please try to lower your map resolution. In my experience 0.05 is already very fine you can probably do 0.1.

Another thing that stands out is your publish frequency are you sure you want to publish a map only every 2 seconds? If so you can turn down your update frequency ...(more)

Tristan9497 gravatar image Tristan9497  ( 2021-02-24 09:58:50 -0500 )edit

Any news on this? Did the parameters work for you? If so, please close the question

Tristan9497 gravatar image Tristan9497  ( 2021-03-01 09:14:20 -0500 )edit

@Tristan9497 I'm really sorry for the delay in replying.
However, it is difficult to change the inflation radius and resolution parameters... They are already adjusted for the environment. This robot is going to go through narrow passages. Also, the reason why the publish frequency is very low is because I thought it would reduce the computational load.
I am not able to change the parameters as you suggested, but I experimented with a more powerful CPU instead. As a result, I was able to reduce the number of warnings.
I was wondering if there was some kind of deadlock in the configuration, but your advice was very helpful. Thank you very much.
It is difficult to change the parameters, so I will look into other methods such as splitting the map.

ayato gravatar image ayato  ( 2021-03-17 21:44:58 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-02-23 10:22:01 -0500

Seen: 381 times

Last updated: Feb 23 '21