-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 BT based implementation of waypoint_follower #1928
Add BT based implementation of waypoint_follower #1928
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1928 +/- ##
==========================================
- Coverage 78.18% 76.08% -2.11%
==========================================
Files 219 228 +9
Lines 10588 11029 +441
==========================================
+ Hits 8278 8391 +113
- Misses 2310 2638 +328
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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 wasn't able to fully analyze this, but please make sure that you change so that you're adding a new package doing some behavior tree autonomy and not replacing the existing one.
Also in your PR, a little section about the goals of this contribution and the scope of it (autonomy applications only, are you seeing this as some replacement for bt navigator? etc). There seems to be some feature creep between them we should flush out and make clear the separation of concerns that this has w.r.t. BT navigator and the navigation task
nav2_bt_waypoint_follower/include/nav2_bt_waypoint_follower/bt_waypoint_follower.hpp
Show resolved
Hide resolved
Why? |
I've added it. |
Signed-off-by: ymd-stella <world.applepie@gmail.com>
75af835
to
a3e95fc
Compare
It looks like you deleted the waypoint follower package and replaced it with the bt waypoint follower (or just modified the waypoint follower and overrided it as a new package) |
Signed-off-by: ymd-stella <world.applepie@gmail.com>
What am I missing in this PR? |
@mkhansenbot what's your take on this? Its another waypoint follower using a behavior tree as the high level application (using the NavigateToPose BT to call the BT navigator). In concept I don't have an issue with it, but there's a bunch of redundant code between them that makes me think we should have some more wrappers in the nav2_behavior_tree package to deal with the boilerplate. Additionally, it's really not a 'waypoint follower' as much as the default behavior trees given are for following tasks. It really can be thought more of the "autonomy application framework" where you can use any behavior tree nodes to create your autonomy application as you like. That to me makes me think a different name / scope is appropriate and we should provide a couple of BT options to make the point clear. E.g.
If for some reason we couldn't generalize this for an autonomy application, then maybe this is better suited for the navigation2_tutorials repo and write a tutorial about making a BT autonomy application per #1651 with some example application behind just waypoint following. @ymd-stella pull in main, your fork is too old to run CI |
…to add-follow-waypoints-bt-navigator
I like the idea of adding a BT which adds a more real use case than just navigate to a series of waypoints. The "take a picture" could be used for a patrolling use case, the "pick up object" could be a future case for robots with arms. The whole purpose of moving to a BT based approach was to make these extensions possible by adding additional BT actions. These were on our list of desired examples since we started working on Nav2. As for whether those belong in this repo or not, that's a matter of opinion. My opinion is that these types of example apps should be moved into another repo, including the existing C++ waypoint follower example. |
I'd tend to agree, but I've gotten feedback along the lines of "thank god we have the waypoint follower in the navigation stack now" as if just having it somewhere else would somehow make it insufficient. Within reason, I think another "bt application" package could be added as long as it was generalizable with a few BTs to make the point. If we can't generalize it, then I think it shoiuld go in the nav2 tutorials repo or we make a new repo for nav2 applications. @ymd-stella is there another action message we can define to make this BT application more general and just now the |
Here's a thought, based on managing dependencies:
The big reason to do this is managing dependencies. If you keep the framework inside nav2, then things like MoveIt, etc would have to depend on nav2 directly if they wanted to keep their "BT application" nodes inside their repo. Having a lightweight framework repo will almost certainly aid in adoption of the new framework. |
I can think of the following action like NavigateToPose to pass the BT filename. I'll call it the PerformTask action temporarily.
If I want the robot to do <root main_tree_to_execute="MainTree">
<BehaviorTree ID="MainTree">
<Sequence name="PerformTask">
<NavigateToPose goal="0;map;5.0;0.0;0.0;0.0;0.0;0.0;1.0"/> <!-- go to point A -->
<GetBox/>
<NavigateToPose goal="0;map;0.0;0.0;0.0;0.0;0.0;0.0;1.0"/> <!-- go to point B -->
<PutBox/>
</Sequence> <!-- Move a box from A to B -->
</BehaviorTree>
</root> The disadvantage of this configuration is that we lose the mechanism to give an array of goals. I think it's a good idea to move it to a different repository. |
I'm wondering about templating the this server instead so that they can implement it with whatever interface they like, under some light weight requirements (like certain fields must be in the result like a return code). That way you can make your own action interface for whatever your aim is but still use this server as the basis. I'm thinking of the behavior tree action nodes in Another option is having the request be a little more generic. For example, in your provided BT, we if were able to change it to something like
So the action request would have a behavior tree field, but then also some array of info corresponding to these input port / blackboard variables for specific ports like Then the goal request field would be something like:
And It wouldn't be hard to have a BT node look at the blackboard list of waypoints and dish them out on the Thoughts? |
I'll try to implement it. |
I think you should describe what you're going to do / aims before going off and doing it, just to make sure we're aligned so that you don't accidentally spend a bunch of time on something that might not quite fit |
Waiting on some progress in #2010 since that would likely be the backbone of this work |
@ymd-stella I'm going to close this PR since the new refactored version probably makes sense for this PR to have a clean history once (if) you get a chance to do it with the new abstracted logic. It should be much simpler now with alot less code redundancy! |
Basic Info
Description of contribution in a few bullet points
Description of documentation updates required from your changes
Future work that may be required in bullet points
the goals of this contribution and the scope of it