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 #78

Merged
merged 1 commit into from
May 24, 2023

Conversation

siferati
Copy link

Description

This is a fix to an issue I reported on upstream over 2 years ago:

I found this issue again while working on the route deviation layer.
We set lethal_cost_ of the global planner to be 253 (i.e. costmap_2d::INSCRIBED_INFLATED_OBSTACLE).
This is correct -- if the robot center is at a cell of cost 253, the robot is in collision.

The problem is that the global planner treats this 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.

So if you happen to have an aggressive inflation factor that causes most cells to have the highest possible free cost (i.e. 252), then the potential field will look like in the image, where every cell outside the route is not expanded because we set lethal_cost_ to costmap_2d::INSCRIBED_INFLATED_OBSTACLE and so costmap_2d::INSCRIBED_INFLATED_OBSTACLE - 1 is also treated as lethal.

This will result in the global planner failing to find any valid paths as soon as the robot center touches the gray area.

image

@siferati siferati added the bug Something isn't working label May 19, 2023
@siferati siferati merged commit 8091aac into devel May 24, 2023
@siferati siferati deleted the tiago/fix_global_planner branch May 24, 2023 23:37
siferati added a commit that referenced this pull request May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants