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

Costmap2d inflation radius

asked 2012-02-03 04:03:22 -0500

DimitriProsser gravatar image

updated 2014-01-28 17:11:15 -0500

ngrennan gravatar image

I've been trying to increase the inflation radius of obstacles in the local_costmap for move_base. The problem that I've noticed is that the inflation radius as viewed by Costmap2dPublisher never changes. Using rosparam get, I verified that the inflation_radius parameter was correctly set, but even setting this value as high as 10m has no effect. It seems that the inflation radius of the obstacles is directly linked to the circumscribed radius of the robot footprint.

If I set the robot footprint to a 0.5m x 0.5m box, the inflation radius is 0.25m. If I set the robot footprint to a 0.8m x 0.8m box, the inflation radius is 0.4m. From the documentation on costmap_2d, it seemed that I could set my own inflation radius, but I've been unable to do so.

I would like to be able to set two different values for the footprint and the inflation_radius. How can I go about doing so?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-02-03 04:34:02 -0500

Eric Perko gravatar image

updated 2012-02-03 04:34:53 -0500

I had similar confusion when I first went to configure the costmap to inflate differently.

The inflation_radius is actually the radius to which the cost scaling function is applied, not a parameter of the cost scaling function. Inside the inflation radius, the cost scaling function is applied, but outside the inflation radius, the cost of a cell is not inflated using the cost function.

Take a look at the documentation for the cost_scaling_factor. What you have to do is basically solve the equation there ( exp(-1.0 * cost_scaling_factor * (distance_from_obstacle - inscribed_radius)) * (costmap_2d::INSCRIBED_INFLATED_OBSTACLE - 1)) for the correct cost_scaling_factor, using your distance from obstacle and the cost value you want that cell to have.

You'll have to make sure to set the inflation radius large enough that it includes the distance you need the cost function to be applied out to, as anything outside the inflation_radius will not have the cost function applied.

edit flag offensive delete link more


That makes sense. Where can I obtain the value of "inscribed_radius"? Also, is there a way to get Rviz to account for this change? While I can see the cost values changing (by accessing the costmap directly), Rviz still limits inflation to the size of the robot footprint.
DimitriProsser gravatar image DimitriProsser  ( 2012-02-03 04:46:35 -0500 )edit
I'm not sure where you can get the inscribed_radius directly, since it's calculated from the robot footprint. It might get printed as a debug statement somewhere. I think I just calculated it by hand. Might be useful to open a ticket to print out debugs with this if costmap_2d doesn't already.
Eric Perko gravatar image Eric Perko  ( 2012-02-06 02:49:21 -0500 )edit

Question Tools



Asked: 2012-02-03 04:03:22 -0500

Seen: 11,983 times

Last updated: Feb 03 '12