Fix bug where global planner lethal cost is always 1 unit smaller than expected #1240
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Global planner treats
lethal_cost_
as if it was thecostmap_2d::LETHAL_OBSTACLE
cost, and so assumes thatlethal_cost_ - 1
is also in collision (i.e.costmap_2d::INSCRIBED_INFLATED_OBSTACLE
).The whole point of this param being dynamically reconfigured is that we don't have to be tied to the value of
costmap_2d::LETHAL_OBSTACLE
and so we also shouldn't assume thatlethal_cost_ - 1
is lethal too.That's also why the default value for
lethal_cost_
is 253, not 254.navigation/global_planner/cfg/GlobalPlanner.cfg
Line 8 in 9ad6441
Because when planning a path, a cell of cost 253 (i.e. inscribed) is indeed a lethal cell the robot can not traverse.
However, as it stands, the global planner will also treat cells of cost 252 as lethal, which is obviously wrong.