-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add Pause and SequenceWithBlackboardMemory BT nodes #5247
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 Pause and SequenceWithBlackboardMemory BT nodes #5247
Conversation
Codecov Report❌ Patch coverage is
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
So this is missing tests coverage - but you know that :-) Also make sure to fix DCO
nav2_behavior_tree/include/nav2_behavior_tree/plugins/control/pause.hpp
Outdated
Show resolved
Hide resolved
nav2_behavior_tree/include/nav2_behavior_tree/plugins/control/pause.hpp
Outdated
Show resolved
Hide resolved
nav2_behavior_tree/include/nav2_behavior_tree/plugins/control/pause.hpp
Outdated
Show resolved
Hide resolved
nav2_behavior_tree/plugins/control/sequence_with_blackboard_memory.cpp
Outdated
Show resolved
Hide resolved
@redvinaa, your PR has failed to build. Please check CI outputs and resolve issues. |
Woah, this suddenly became more serious than I expected :D |
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.
Woah, this suddenly became more serious than I expected :D
I think this is really great work! Definitely happy to have it contributed! 🥇
I still have to write the tests and make this work with my jazzy stack, so it might take some time.
OK! Only really nitpicks, tests, and doc updates left in my book
nav2_behavior_tree/include/nav2_behavior_tree/plugins/control/pause_resume_controller.hpp
Outdated
Show resolved
Hide resolved
nav2_behavior_tree/include/nav2_behavior_tree/plugins/control/pause_resume_controller.hpp
Outdated
Show resolved
Hide resolved
@redvinaa, your PR has failed to build. Please check CI outputs and resolve issues. |
1 similar comment
@redvinaa, your PR has failed to build. Please check CI outputs and resolve issues. |
@SteveMacenski I started writing the tests and I have a few questions. The dummy BT node used for tests now returns Also, could you give me some pointers on how to write tests for the |
I found the bug which didn't let me set |
Sorry for the delay - I've been underwater the last couple of weeks and now committing today to get through my email review backlog. I apologize for the delay and thank you for your help! For tests, you can do something more in the theme of the action nodes: https://github.com/ros-navigation/navigation2/blob/main/nav2_behavior_tree/test/plugins/action/test_append_goal_pose_to_goals_action.cpp. Here, we make an example BT XML that is loaded and used instead. This is actually a better way to write the tests IMO and the dummy node manual tree population done in the control test you linked to is an outdated way. We know those can have some problems since the tree isn't being constructed in the same way it would be in an application. You could still potentially use a dummy node within the tree, but the tree itself is constructed fully, including the ports and blackboard. That way, the blackboard of the BT is maintained between ticks since it acts like a proper behavior tree (because it is one). I think that answers your question! |
@redvinaa, your PR has failed to build. Please check CI outputs and resolve issues. |
I've implemented the tests using xml strings as in the action nodes, and DummyNodes. I've had to be creative, because none of the existing tests needed this level of complexity. Tell me what you think of this solution @SteveMacenski. I've added a new header file to access nodes from the tree and cast them to the correct type. I also had to modify the DummyNode implementation a bit, so it returns IDLE after resetting, but on tick it again returns the state that it was set to. I don't think it breaks existing tests. |
@redvinaa, your PR has failed to build. Please check CI outputs and resolve issues. |
@redvinaa, your PR has failed to build. Please check CI outputs and resolve issues. |
1 similar comment
@redvinaa, your PR has failed to build. Please check CI outputs and resolve issues. |
@redvinaa, your PR has failed to build. Please check CI outputs and resolve issues. |
55be1a2
to
dd67e94
Compare
@redvinaa, your PR has failed to build. Please check CI outputs and resolve issues. |
This pull request is in conflict. Could you fix it @redvinaa? |
@SteveMacenski can you take a look at this? |
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.
Last bit are docs:
- Add to the Nav2 Specific BT Nodes page for how to use
- Migration guide
- Configuration guide for param descriptions on the nodes + examples
- Add to the Navigation Plugins page
nav2_behavior_tree/include/nav2_behavior_tree/plugins/control/pause_resume_controller.hpp
Outdated
Show resolved
Hide resolved
...behavior_tree/include/nav2_behavior_tree/plugins/control/sequence_with_blackboard_memory.hpp
Outdated
Show resolved
Hide resolved
...behavior_tree/include/nav2_behavior_tree/plugins/control/sequence_with_blackboard_memory.hpp
Outdated
Show resolved
Hide resolved
@redvinaa, your PR has failed to build. Please check CI outputs and resolve issues. |
WARNING: don't accept this yet, still waiting for submodule changes I've finally implemented the requested changes, but it turns out to inherit from the Also, how to "upgrade" the BT.CPP version used in this repo? I added a commit hash from the BT.CPP repo HEAD in the P.S. I also wrote the docs |
@redvinaa, your PR has failed to build. Please check CI outputs and resolve issues. |
Pull in / rebase once #5409 is merged - we're having an issue with circleci time limits and I'm load balancing the builds. For a temp basis, the BT custom build is OK but not ideal. I'd just make sure we poke Davide to release a new rolling version once those are merged so that we can have that be as temporary as possible. Or, we have the main version you have now and we can have a follow up PR once new binaries are available so Nav2 Let me know! |
Signed-off-by: redvinaa <redvinaa@gmail.com>
Signed-off-by: redvinaa <redvinaa@gmail.com>
Signed-off-by: redvinaa <redvinaa@gmail.com>
Signed-off-by: redvinaa <redvinaa@gmail.com>
Signed-off-by: redvinaa <redvinaa@gmail.com>
Signed-off-by: redvinaa <redvinaa@gmail.com>
Signed-off-by: redvinaa <redvinaa@gmail.com>
Signed-off-by: redvinaa <redvinaa@gmail.com>
Signed-off-by: redvinaa <redvinaa@gmail.com>
Signed-off-by: redvinaa <redvinaa@gmail.com>
Signed-off-by: redvinaa <redvinaa@gmail.com>
Signed-off-by: redvinaa <redvinaa@gmail.com>
184381f
to
0db8b63
Compare
Okay! Then let's wait for the BT.CPP release, and then I'm gonna open a follow up. Until then, this PR should be ready to merge :D I removed the parts that need the new BT version. |
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.
Just the small docs update and I can merge the pair!
@redvinaa thanks so much! By the way... if you had a nice video / gif of this, this would make a really nice linkedin post to promote the changes and contribution 😉 |
const BT::NodeConfiguration & conf) | ||
: BT::ControlNode(xml_tag_name, conf) | ||
{ | ||
auto node = this->config().blackboard->get<rclcpp::Node::SharedPtr>("node"); |
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.
auto node = this->config().blackboard->get<rclcpp::Node::SharedPtr>("node"); | |
auto node = config().blackboard->get<nav2::LifecycleNode::SharedPtr>("node"); |
As per #5288
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.
Nice catch, opened a PR to fix it
) * Add pause and seq with bb memory BT nodes Signed-off-by: redvinaa <redvinaa@gmail.com> * Requested changes Signed-off-by: redvinaa <redvinaa@gmail.com> * Lint Signed-off-by: redvinaa <redvinaa@gmail.com> * Restructure pause, rename unpaused state to resumed Signed-off-by: redvinaa <redvinaa@gmail.com> * Add PauseResumeController test Signed-off-by: redvinaa <redvinaa@gmail.com> * Implement tests using xml_txt trees and dummy nodes Signed-off-by: redvinaa <redvinaa@gmail.com> * Update include Signed-off-by: redvinaa <redvinaa@gmail.com> * One more fix because of sync Signed-off-by: redvinaa <redvinaa@gmail.com> * Fix build Signed-off-by: redvinaa <redvinaa@gmail.com> * Add tests Signed-off-by: redvinaa <redvinaa@gmail.com> * Remove unreachable code Signed-off-by: redvinaa <redvinaa@gmail.com> * Fix tests Signed-off-by: redvinaa <redvinaa@gmail.com> * Update copyrights Signed-off-by: redvinaa <redvinaa@gmail.com> * Fix size calc Signed-off-by: redvinaa <redvinaa@gmail.com> * Rename to PersistentSequence Signed-off-by: redvinaa <redvinaa@gmail.com> * Fix docstring Signed-off-by: redvinaa <redvinaa@gmail.com> --------- Signed-off-by: redvinaa <redvinaa@gmail.com>
Basic Info
Description of contribution in a few bullet points
Description of documentation updates required from your changes
Description of how this change was tested
Future work that may be required in bullet points
For Maintainers: