You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CostmapFilter::worldToMask() does not process correctly some points from world that belonging to mask.
For example, consider an OccupancyGrid mask of size 3x3 with origin in (3.0, 3.0) world point.
Taking resolution = 1.0 m and this mask should cover 9 square meters in the world, starting from (3.0, 3.0) world point up to (6.0, 6.0) world point as shown in the illustration below. The world point (5.9, 5.9) in this case should belong to the mask. However, in current implementation, CostmapFilter::worldToMask(mask, 5.9, 5.9) will return false value indicating that the underlying world point does not belong to the filter mask, which is incorrect.
This appears because of CostmapFilter::worldToMask() incorrectly uses std::round instead of type casting with decimal fraction drop. This leads to CostmapFilter::worldToMask() converts to mask only (3.0, 3.0) ... (5.49999, 5.49999) world coordinates, depicted in blue at the illustration below:
CostmapFilter::worldToMask()
does not process correctly some points from world that belonging to mask.For example, consider an OccupancyGrid mask of size
3x3
with origin in(3.0, 3.0)
world point.Taking
resolution = 1.0 m
and this mask should cover9
square meters in the world, starting from(3.0, 3.0)
world point up to(6.0, 6.0)
world point as shown in the illustration below. The world point(5.9, 5.9)
in this case should belong to the mask. However, in current implementation,CostmapFilter::worldToMask(mask, 5.9, 5.9)
will returnfalse
value indicating that the underlying world point does not belong to the filter mask, which is incorrect.This appears because of
CostmapFilter::worldToMask()
incorrectly usesstd::round
instead of type casting with decimal fraction drop. This leads toCostmapFilter::worldToMask()
converts to mask only(3.0, 3.0) ... (5.49999, 5.49999)
world coordinates, depicted in blue at the illustration below:Bug report
Required Info:
Steps to reproduce issue
3x3
size,(3.0, 3.0)
origin andresolution = 1.0
CostmapFilter::worldToMask(filter_mask, 5.9, 5.9, mx, my)
with(5.9, 5.9)
world coordinateExpected behavior
CostmapFilter::worldToMask()
should returntrue
and(mx, my) = (2, 2)
Actual behavior
CostmapFilter::worldToMask()
returnsfalse
Additional information
The problem is being fixed by the following change:
Which is also consistent with current Costmap2D::worldToMap and NavfnPlanner::worldToMap and implementations.
The text was updated successfully, but these errors were encountered: