# Configuring robot footprint in costmap_2d

I have attempted to find the answer previously, however I have only found scraps that did not directly point to the treasure.

I am working on a rectangular-shaped robot of which I'd want to display its rough size in rviz. I found that this needed to be configured in the costmap_common_params.yaml file. In there, I have added the following:

inflation_layer:
footprint: [[-0.31, -0.69], [-0.31, 0.25], [0.31, 0,25], [0.31, -0.69]]


These are the estimated dimensions in centimeters from the center point of the robot's two wheels (diff drive). The backside of the robot is indeed larger, which is why I'd want this displayed to keep track of its turning. (the base is derived off an electric wheelchair, with two caster wheels at the rear end.)

To symbolize the robot's design: (L = LIDAR sensor, 0 = motorized wheels. x = base point of the robot, C = Caster wheels)

 ----L----
0-   x   -0
-       -
-       -
C       C
---------


Additionally, the environment is set up using the standard followed throughout the tutorials (global_planner, base_local_planner, costmap2d) and no custom packages/configurations are being used.

Upon rebooting the robot and its navigation stack, I found that these parameters are not applied and the footprint is still presented as a circle around the base, among with other changes in the configuration files being ignored.

In short, the question would be: "How can I properly configure the robot's footprint to be represented in rviz"?

edit retag close merge delete

This may point to a more general problem with loading parameters (does move_base take your updated footprint into account fi?), so it would help if you tell us a little more about the specific setup that you use: are you using the "standard" navigation config files, a custom pkg? Etc.

( 2019-02-26 05:56:17 -0500 )edit
1

Also:

These are the estimated dimensions in centimeters from the center point of the robot's two wheels (diff drive).

I assume you meant to write "in metres" there: everything in ROS is in (derived) SI units. Your robot would also be about 1cm^2 if these were actual centimetres.

( 2019-02-26 05:57:25 -0500 )edit

As far as I am aware, the default navigation stack is being used without any custom plugins or configuration files. the common costmap yaml is included innavigation.launch. As for the measurements, my intention was to write down "0.3 meter", therefore I might have used the wrong words indeed

( 2019-02-26 06:18:47 -0500 )edit

Sort by » oldest newest most voted
footprint: [[-0.31, -0.69], [-0.31, 0.25], [0.31, 0,25], [0.31, -0.69]]
^


Is this a typo when writing your question here ? That should return an error. But I believe you don't have any errors because you don't define the footprint in the correct scope. You define it inside the infaltion_layer, the footprint isn't a parameter related to the inflation_layer but a global one (global as common for the local and global costmaps).

Try putting the footprint and footprint_padding params with the other common params and it should define the footprint as desired.

more

...Oh dear, I overlooked that one. That was copied straight out of the configuration file.

Having made those amendments, I now have a rectangular footprint in rviz, apologies for the typo!

( 2019-02-26 08:32:10 -0500 )edit

The issue was only due to the typo ? You didn't have to define the footprint outside the inflation layer ?

( 2019-02-26 08:35:44 -0500 )edit

Most of it was due to the typo I'd imagine, I did move the footprint lines outside of the inflation_layer and defined them globally in the file since they're global parameters as you said.

( 2019-02-27 03:03:22 -0500 )edit

Alright, good to know. Can you mark the question as answered (check mark icon next to answer) if your problem is fully solved ? That'll put more visibility for future readers encountering the same issue.

( 2019-02-27 03:17:01 -0500 )edit