Skip to content

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!

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!

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!

@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]>
stevedanomodolor pushed a commit to stevedanomodolor/navigation2 that referenced this pull request Apr 29, 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]>
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) {
Copy link
Contributor

@tonynajjar tonynajjar Jun 11, 2025

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

Copy link
Member

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.

Copy link
Contributor

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.

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.

3 participants