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

Remove in collision goals BT node #4595

Merged

Conversation

tonynajjar
Copy link
Contributor


Basic Info

Info Please fill out this column
Ticket(s) this addresses #4587
Primary OS tested on Ubuntu
Robotic platform tested on (Steve's Robot, gazebo simulation of Tally, hardware turtlebot)
Does this PR contain AI generated software? No

Description of contribution in a few bullet points

  • Added BT node that removes goals if the footprint cost is below a configurable cost threshold
  • Fixed getCostCallback not handling out-of-bounds if use_footprint is true

Description of documentation updates required from your changes


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: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 90.38462% with 5 lines in your changes missing coverage. Please review.

Files Patch % Lines
...lugins/action/remove_in_collision_goals_action.cpp 88.88% 3 Missing ⚠️
nav2_costmap_2d/src/costmap_2d_ros.cpp 88.23% 2 Missing ⚠️
Files Coverage Δ
...lugins/action/remove_in_collision_goals_action.hpp 100.00% <100.00%> (ø)
...tree/plugins/action/remove_passed_goals_action.cpp 100.00% <100.00%> (ø)
...tmap_2d/include/nav2_costmap_2d/costmap_2d_ros.hpp 100.00% <ø> (ø)
nav2_costmap_2d/src/costmap_2d_ros.cpp 88.52% <88.23%> (+0.09%) ⬆️
...lugins/action/remove_in_collision_goals_action.cpp 88.88% <88.88%> (ø)

... and 5 files with indirect coverage changes

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.

Usual bits on tests and docs, but overall looks like a good initial prototype!

Thought: Adjust the GetCost service to a GetCosts service so that you don't call it repeatedly - populate 1 request with N goals and get their costs back in bulk. That's probably useful for a number of reasons

Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Copy link
Contributor

mergify bot commented Aug 7, 2024

@tonynajjar, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

Signed-off-by: Tony Najjar <[email protected]>
Copy link
Contributor

mergify bot commented Aug 7, 2024

@tonynajjar, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Copy link
Contributor

mergify bot commented Aug 7, 2024

@tonynajjar, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
@tonynajjar tonynajjar marked this pull request as ready for review August 7, 2024 12:26
@tonynajjar
Copy link
Contributor Author

I graduated the PR from draft status. Docs and some manual testing are are missing, you can do a second round of review though

Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
should_send_request_ = false;
return;
}
request_ = std::make_shared<nav2_msgs::srv::GetCosts::Request>();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The request_ is never recreated/reset in bt_service_node. It would make sense to add that there don't you think?

Copy link
Member

Choose a reason for hiding this comment

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

I think for this case since the goal vector length can change this is good!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I wasn't clear enough, I meant to recreate the request in the BTServiceNode parent instead of for every child. Seems like a generic enough thing to do to me.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I think some rely on it being the same by populating it once in initialization -- but if that's not the case, happy to have that change too. Some API change could come and make that break.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's only used here in Nav2 but some people might rely on it in their private plugins. I'm happy either way, the benefit of keeping it as is, is at least to have the option to initialize once.

Copy link
Member

Choose a reason for hiding this comment

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

I'm ambivalent unless someone had a compelling argument either way.

Copy link
Contributor

mergify bot commented Aug 7, 2024

This pull request is in conflict. Could you fix it @tonynajjar?

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.

Otherwise LGTM, just doc updates:

  • Update migration guide that its GetCosts now
  • Add the new BT node to the plugins page, migration guide, configuration guide

should_send_request_ = false;
return;
}
request_ = std::make_shared<nav2_msgs::srv::GetCosts::Request>();
Copy link
Member

Choose a reason for hiding this comment

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

I think for this case since the goal vector length can change this is good!

Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
should_send_request_ = false;
return;
}
request_ = std::make_shared<nav2_msgs::srv::GetCosts::Request>();
Copy link
Member

Choose a reason for hiding this comment

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

I'm ambivalent unless someone had a compelling argument either way.

@SteveMacenski SteveMacenski merged commit 47a1235 into ros-navigation:main Aug 8, 2024
11 checks passed
@tonynajjar tonynajjar changed the title Remove in collision goals Remove in collision goals BT node Aug 8, 2024
josephduchesne pushed a commit to josephduchesne/navigation2 that referenced this pull request Dec 10, 2024
* Remove goals in collision

Signed-off-by: Tony Najjar <[email protected]>

* fix for main

Signed-off-by: Tony Najjar <[email protected]>

* Fix linting

Signed-off-by: Tony Najjar <[email protected]>

* linting fixes

Signed-off-by: Tony Najjar <[email protected]>

* PR fixes

Signed-off-by: Tony Najjar <[email protected]>

* remove second costmap

Signed-off-by: Tony Najjar <[email protected]>

* Minor fixes

Signed-off-by: Tony Najjar <[email protected]>

* getcosts instead of cost

Signed-off-by: Tony Najjar <[email protected]>

* get future once

Signed-off-by: Tony Najjar <[email protected]>

* replace with BTServiceNode

Signed-off-by: Tony Najjar <[email protected]>

* Add test

Signed-off-by: Tony Najjar <[email protected]>

* fix costmap tool

Signed-off-by: Tony Najjar <[email protected]>

* fix ament_uncrustify

Signed-off-by: Tony Najjar <[email protected]>

* remove duplicate

Signed-off-by: Tony Najjar <[email protected]>

* add return

Signed-off-by: Tony Najjar <[email protected]>

* fix typo

Signed-off-by: Tony Najjar <[email protected]>

* reset request before sending

Signed-off-by: Tony Najjar <[email protected]>

* pr comments fixes

Signed-off-by: Tony Najjar <[email protected]>

* fix ament cmake

Signed-off-by: Tony Najjar <[email protected]>

* fix test

Signed-off-by: Tony Najjar <[email protected]>

* fix

Signed-off-by: Tony Najjar <[email protected]>

---------

Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Joseph Duchesne <[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