-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add ispathvalid maxcost #4873
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
Add ispathvalid maxcost #4873
Conversation
Signed-off-by: mini-1235 <[email protected]>
SteveMacenski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks very good to me, just small ~5 minute worth of nitpicks and we can merge this!
nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_path_valid_condition.hpp
Outdated
Show resolved
Hide resolved
Signed-off-by: mini-1235 <[email protected]>
|
Hi, thanks for reviewing @SteveMacenski, I have fixed the problem you have mentioned above and raised a PR on the documentation side, can you please take another look on it? Also the mppi test failed for some reason, but it passed on my machine, can you help on it 😄 |
SteveMacenski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small changes for setting the limit to be inscribed inflated by default, but otherwise LGTM!
nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_path_valid_condition.hpp
Outdated
Show resolved
Hide resolved
nav2_behavior_tree/plugins/condition/is_path_valid_condition.cpp
Outdated
Show resolved
Hide resolved
nav2_planner/src/planner_server.cpp
Outdated
| response->is_valid = false; | ||
| break; | ||
| } else if (cost == nav2_costmap_2d::LETHAL_OBSTACLE) { | ||
| } else if (cost == nav2_costmap_2d::LETHAL_OBSTACLE || cost > request->max_cost) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } else if (cost == nav2_costmap_2d::LETHAL_OBSTACLE || cost > request->max_cost) { | |
| } else if (cost == nav2_costmap_2d::LETHAL_OBSTACLE || cost >= request->max_cost) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we treat NO_INFORMATION(255) as FREE_SPACE here, so I should convert 255 to 0 / do a simple && cost!=FREE_SAPCE here, am I correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good point - I think if we add in max_cost, we should also add in a bool service argument for unknown_valid and we check if the cost is larger than the max cost and if unknown should be considered valid or invalid (collision). It would need to be exposed from the BT node and so forth as well - but easy enough!
Signed-off-by: mini-1235 <[email protected]>
Signed-off-by: mini-1235 <[email protected]>
Signed-off-by: Steve Macenski <[email protected]>
|
One sec - lets let CI turn over again, a bunch of weird unusual tests failed and I want to make sure it wasn't just a fluke. Retriggering |
* Add ispathvalid maxcost Signed-off-by: mini-1235 <[email protected]> * Fix problems as requested Signed-off-by: mini-1235 <[email protected]> * Set default as 253, Add considered unknown as obstacle Signed-off-by: mini-1235 <[email protected]> * Edit comment Signed-off-by: mini-1235 <[email protected]> * Update nav2_planner/src/planner_server.cpp Signed-off-by: Steve Macenski <[email protected]> --------- Signed-off-by: mini-1235 <[email protected]> Signed-off-by: Steve Macenski <[email protected]> Co-authored-by: Steve Macenski <[email protected]>
* Add ispathvalid maxcost Signed-off-by: mini-1235 <[email protected]> * Fix problems as requested Signed-off-by: mini-1235 <[email protected]> * Set default as 253, Add considered unknown as obstacle Signed-off-by: mini-1235 <[email protected]> * Edit comment Signed-off-by: mini-1235 <[email protected]> * Update nav2_planner/src/planner_server.cpp Signed-off-by: Steve Macenski <[email protected]> --------- Signed-off-by: mini-1235 <[email protected]> Signed-off-by: Steve Macenski <[email protected]> Co-authored-by: Steve Macenski <[email protected]> Signed-off-by: stevedanomodolor <[email protected]>
| response->is_valid = false; | ||
| break; | ||
| } else if (cost == nav2_costmap_2d::LETHAL_OBSTACLE) { | ||
| } else if (cost == nav2_costmap_2d::LETHAL_OBSTACLE || cost >= request->max_cost) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this introduced a bug or at the very least an unexpected behavior compared to how it was.
In this clause, use_radius is false so cost is a footprintCost. The default max_cost that was set to 253. A footprintCost of 253 is acceptable (a vertex is intersecting a INSCRIBED_INFLATED_OBSTACLE cell) but according to this logic, this renders the path invalid.
@mini-1235 can you double-check my logic? Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true, but that's why this is a configuration of the request. If you set use_radius = false then you should set your max_cost limit.
Do you recommend changing the default to 254? That seems sensible enough to me so it doesn't trigger anything unless the user meaningfully overrides it with another value of their selection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you recommend changing the default to 254?
Yes and that would not change anything for the case of where use_radius is true because we already check cost == nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE)
This is true, but that's why this is a configuration of the request
I just didn't expect a change in behavior in my IsPathValid BT node, at least not without notes.
Basic Info
Description of contribution in a few bullet points
Description of documentation updates required from your changes
Add new parameter description https://docs.nav2.org/configuration/packages/bt-plugins/conditions/IsPathValid.html
Description of how this change was tested
Wrote a new test to test this and also tested on custom simulation env
Future work that may be required in bullet points
For Maintainers: