# Costmap_2d update_frequency parameter

Hi all,

My question is rather theoretical, as I'd like to have more insight on how the costmap_2d actually works. In particular, I have a doubt regarding the update frequency of the map.

In the wiki it is the specified that:

The costmap performs map update cycles at the rate specified by the update_frequency parameter. Each cycle, sensor data comes in, marking and clearing operations are perfomed in the underlying occupancy structure of the costmap, and this structure is projected into the costmap where the appropriate cost values are assigned as described above.


Now, assuming that I set an obstacle layer to incorporate information from a 2D laser scanner, what happens when the update_frequency of the costmap doesn't match the sensor rate?

E.g., if a laser scan is published at 10Hz and the update_frequency is 20Hz, I guess that the costmap can only take the last acquired scan (which is somehow "old"). But, if a laser scan is published at 10Hz and the update_frequency is 5Hz does the same happen again or scans are aggregated and processed in sequence?

I hope my question is clear. Thanks in advance for every hint that can help me clarify this aspect.

edit retag close merge delete

why you just dont test it?

( 2019-08-20 03:48:07 -0500 )edit

Sort by » oldest newest most voted

If the update frequency is greater than the sensor frequency, there will just be many cycles where there are no changes to the costmap.

If the sensor frequency is greater than the update frequency (which is generally true), the sensor messages are buffered and applied during the update.

more