What does a padded footprint mean in navigation package?
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!