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

Add ispathvalid maxcost #4873

Merged
merged 5 commits into from
Jan 29, 2025
Merged

Add ispathvalid maxcost #4873

merged 5 commits into from
Jan 29, 2025

Conversation

mini-1235
Copy link
Contributor


Basic Info

Info Please fill out this column
Ticket(s) this addresses #4756
Primary OS tested on Ubuntu 24.04
Robotic platform tested on Custom simulation environment
Does this PR contain AI generated software? No

Description of contribution in a few bullet points

  • Add max cost as described in the issue
  • Add corresponding test

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:

  • Check that any new parameters added are updated in docs.nav2.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists

Signed-off-by: mini-1235 <[email protected]>
Copy link
Member

@SteveMacenski SteveMacenski left a 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_msgs/srv/IsPathValid.srv Outdated Show resolved Hide resolved
nav2_behavior_tree/nav2_tree_nodes.xml Show resolved Hide resolved
nav2_planner/src/planner_server.cpp Outdated Show resolved Hide resolved
Signed-off-by: mini-1235 <[email protected]>
@mini-1235
Copy link
Contributor Author

mini-1235 commented Jan 28, 2025

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 😄

Copy link
Member

@SteveMacenski SteveMacenski left a 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_planner/src/planner_server.cpp Outdated Show resolved Hide resolved
cost == nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE))
{
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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} else if (cost == nav2_costmap_2d::LETHAL_OBSTACLE || cost > request->max_cost) {
} else if (cost == nav2_costmap_2d::LETHAL_OBSTACLE || cost >= request->max_cost) {

Copy link
Contributor Author

@mini-1235 mini-1235 Jan 29, 2025

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?

Copy link
Member

@SteveMacenski SteveMacenski Jan 29, 2025

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!

nav2_planner/src/planner_server.cpp Outdated Show resolved Hide resolved
@SteveMacenski
Copy link
Member

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

@SteveMacenski SteveMacenski merged commit dcc5db5 into ros-navigation:main Jan 29, 2025
9 of 10 checks passed
masf7g pushed a commit to quasi-robotics/navigation2 that referenced this pull request Jan 30, 2025
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants