Robotics StackExchange | Archived questions

Global frame for global_costmap and local_costmap are different?

Hi everyone,

I followed the tutorial about the navigation stack (https://wiki.ros.org/navigation/Tutorials/RobotSetup#:~:text=The%20%22global_frame%22%2C%20%22robot_base_frame%22%2C%20%22update_frequency%22%2C%20and%20%22static_map%22%20parameters%20are%20the%20same%20as%20described%20in%20the%20Global%20Configuration%20section%20above.)

But I have a question, to which I didn't find an answer on the internet. On section 2.3.3, about the localcostmapparams.yaml, it says

-localcostmap: globalframe: odom

and

-The "globalframe", "robotbaseframe", "updatefrequency", and "static_map" parameters are the same as described in the Global Configuration section above.

but then when I read section 2.3.2 about globalcostmapparams.yaml, I see

globalcostmap: globalframe: /map

I don't understand what should be the globalframe in localcostmapparams.yaml. I would tend to think that it's the same as in globalcostmap_params.yaml but the example in the tutorial says the contrary. And given that odom is drifting from map, the tutorial seems to be giving contradicting information.

So my questions are:

-Is the globalframe meant to be different or identical in localcostmap and in global_costmap? -Why?

Thank you,

Asked by robotguy on 2021-12-15 08:18:52 UTC

Comments

Answers

We set both parameters to the same value: map. I think the parameter gets used if you specify a static_layer or an obstacle_layer for the costmap.

Asked by Mike Scheutzow on 2021-12-15 22:06:52 UTC

Comments

Ok, thank you! Does that mean that the tutorial needs a fix?

Asked by robotguy on 2021-12-16 03:54:15 UTC

I don't know, I haven't looked at that tutorial lately. At startup, the map->odom transform is usually Identity, so maybe the tutorial is relying on that fact. Or perhaps the global_frame parameter is no longer used because the information is obtained from somewhere else.

Asked by Mike Scheutzow on 2021-12-16 11:52:56 UTC

You got me curious. The global_frame parameter is definitely needed by costmap_2d for a bunch of different reasons. Take a look at costmap_2d_ros.cpp in the navigation package if you are curious.

Asked by Mike Scheutzow on 2021-12-16 13:41:21 UTC

I had a look into it, it indeed seems that the parameter is used for waiting for transform, recompute and publish transforms. Given that map and odom differ quite a lot on in my case (because of my purposedly noisy odom), I don't understand why I still have the same results whether I write map or odom. But anyway, your answer led me to understand what should theoretically happen. Thank you!

Asked by robotguy on 2021-12-21 10:09:53 UTC