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

What does a padded footprint mean in navigation package?

asked 2018-01-18 21:35:26 -0500

scopus gravatar image

updated 2018-01-19 02:27:56 -0500

Hi, all. I am learning and modifying the navigation package to make it suit our need. I found many method functions in costmap_2d are about padded footprint. For example, padFootprint(),Costmap2DROS::setUnpaddedRobotFootprint()

I wonder what "pad/padded/padding" mean in navigation, and what the hell the comment of padFootprint() "Adds the specified amount of padding to the footprint (in place)" means.

The body of padFootprint is displayed as follows:

 void padFootprint(std::vector<geometry_msgs::Point>& footprint, double padding)
    {
      // pad footprint in place
      for (unsigned int i = 0; i < footprint.size(); i++)
      {
        geometry_msgs::Point& pt = footprint[ i ];
        pt.x += sign0(pt.x) * padding;
        pt.y += sign0(pt.y) * padding;
      }
    }


    /** @brief Same as sign(x) but returns 0 if x is 0. */
inline double sign0(double x)
{
  return x < 0.0 ? -1.0 : (x > 0.0 ? 1.0 : 0.0);
}

Hopefully anyone give me any guidance. Thank you!

EDIT:

Thank you very much for your explanation! @ahendrix

However, I compare the output of Costmap2DROS::getRobotFootprint() which returns padded_footprint_ with the output of LayeredCostmap::getFootprint() which returns footprint_. They have same values. Why?

Why and when does it need to provide some extra distance between the robot and obstacles duriing navigation?

Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2018-01-18 23:34:56 -0500

ahendrix gravatar image

"Padding" is extra clearance around the footprint, which is usually used to provide some extra distance between the robot and obstacles as it is navigating.

The padFootprint() function here is taking the existing footprint and moving all of the points away from the centroid of the footprint by the specified amount in both x and y.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-01-18 21:35:26 -0500

Seen: 2,271 times

Last updated: Jan 19 '18