Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where global planner lethal cost is always 1 unit smaller than expected #1240

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

siferati
Copy link

@siferati siferati commented May 24, 2023

Description

Global planner treats lethal_cost_ as if it was the costmap_2d::LETHAL_OBSTACLE cost, and so assumes that lethal_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 that lethal_cost_ - 1 is lethal too.
That's also why the default value for lethal_cost_ is 253, not 254.

gen.add("lethal_cost", int_t, 0, "Lethal Cost", 253, 1, 255)

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.

@siferati siferati changed the title Fix #1093 Fix bug where global planner lethal cost is always 1 unit smaller than expected May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [Global Planner] Lethal cost is always 1 unit smaller than user setting
3 participants