-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Draft: Added GoalUpdatedController BT plugin node #3044
Draft: Added GoalUpdatedController BT plugin node #3044
Conversation
Signed-off-by: relffok <[email protected]>
@relffok, please properly fill in PR template in the future. @SteveMacenski, use this instead.
|
@SteveMacenski, is this how you had the |
@naiveHobo mind reviewing this? |
Couple of things off the bat - there's no reason you should know these things so no worries
Ignoring the new server code, this PR is a good example of where all these things reside / examples: #2904 |
nav2_bt_navigator/behavior_trees/navigate_w_replanning_only_if_goal_is_updated.xml
Show resolved
Hide resolved
|
||
setStatus(BT::NodeStatus::RUNNING); | ||
|
||
if (first_time_) { |
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 don't think first_time_
is required, if you place the 2 initial get
s inside of the if IDLE
condition above. I'm not sure (?) that first_time_
is required in the main if in L65.
Thinking through the logic, if this is called a 2nd time, the goal_was_updated_
will be true. If the child action is still continuing, it'll tick again. So its really just the first time we need to specifically say to go for it.
We could just in if (status() == BT::NodeStatus::IDLE) {
say goal_was_updated_ = true
since its updated from the idle state reference. That would be the same logic without the first_time_
variable.
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 agree with this, first_time_
isn't required.
Although, does it make sense for this node to tick its child when it's updated from IDLE state to RUNNING state on the first tick? The node is only meant to tick its child when goal is updated on the blackboard. But with this logic, we assume that the decorator should tick its child on the first tick and any further ticks where the goal is updated. This logic made sense for RateController
and DistanceController
where we start the logic at 0 seconds or 0 meters traveled but I'm not sure if GoalUpdated
condition requires a mandatory execution of its child on its first tick, that should happen automatically on the first tick when if (goal_ != current_goal || goals_ != current_goals)
condition is true.
We could just remove first_time_
and place to 2 initial get
s inside the if (status() == BT::NodeStatus::IDLE)
condition while setting goal_was_updated_ = false
within the condition and leave everything else as it is. That would mean that this node would tick its child only when the goal is updated on the blackboard.
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.
-
Fully agree with the
first_time
parameter, I wanted to keep it to make it obvious but since the code is so easy, it's quickly figured out. -
I think from the naming it makes sense not to tick the child on the first visit, I am just wondering if application-wise it makes sense to tick it anyway for the first time. Either way, it's a quick change.
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.
We should always tick on the first visit for this kind of thing - or else when you submitted a navigation request, it would never plan at all (you'd have to issue another new goal afterwards)
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.
Logically, everything seems alright to me. Just looking for a BT node test to make sure the node actually works as intended.
Updated PR with all the comments, I am not quite sure about the test though. It needs to be decided if the child should be ticket when visiting the first time or not. If not, I need to adapt (more of a note to myself):
|
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.
LGTM! Thanks for the contribution! That came through surprisingly fast, good job! I'd welcome your help with any bug/feature in the future!
* first draft for goal updated controller Signed-off-by: relffok <[email protected]> * added goal_updated_controller to all yamls * added GoalUpdatedController API * added GoaUpdatedController to default plugins * removed first_time param * added test for GoalUpdatedController * linter fix
…3044) * first draft for goal updated controller Signed-off-by: relffok <[email protected]> * added goal_updated_controller to all yamls * added GoalUpdatedController API * added GoaUpdatedController to default plugins * removed first_time param * added test for GoalUpdatedController * linter fix
@SteveMacenski Will this be backported to galactic since it doesn't break anything? Do you do backports in complete sweeps or can I open a PR for that? |
…igation#3044)" This reverts commit ba3deb1.
…3044) * first draft for goal updated controller Signed-off-by: relffok <[email protected]> * added goal_updated_controller to all yamls * added GoalUpdatedController API * added GoaUpdatedController to default plugins * removed first_time param * added test for GoalUpdatedController * linter fix
Yes! It'll be backported next time I do a sync to galactic, I do them in batches. But if you're building Galactic from source and want it sooner, we can backport it more immediately |
* first draft for goal updated controller Signed-off-by: relffok <[email protected]> * added goal_updated_controller to all yamls * added GoalUpdatedController API * added GoaUpdatedController to default plugins * removed first_time param * added test for GoalUpdatedController * linter fix (cherry picked from commit 28d16ab)
* first draft for goal updated controller Signed-off-by: relffok <[email protected]> * added goal_updated_controller to all yamls * added GoalUpdatedController API * added GoaUpdatedController to default plugins * removed first_time param * added test for GoalUpdatedController * linter fix (cherry picked from commit 28d16ab) # Conflicts: # nav2_behavior_tree/nav2_tree_nodes.xml # nav2_behavior_tree/test/plugins/decorator/CMakeLists.txt
* first draft for goal updated controller Signed-off-by: relffok <[email protected]> * added goal_updated_controller to all yamls * added GoalUpdatedController API * added GoaUpdatedController to default plugins * removed first_time param * added test for GoalUpdatedController * linter fix (cherry picked from commit 28d16ab) Co-authored-by: relffok <[email protected]>
* first draft for goal updated controller Signed-off-by: relffok <[email protected]> * added goal_updated_controller to all yamls * added GoalUpdatedController API * added GoaUpdatedController to default plugins * removed first_time param * added test for GoalUpdatedController * linter fix
* first draft for goal updated controller Signed-off-by: relffok <[email protected]> * added goal_updated_controller to all yamls * added GoalUpdatedController API * added GoaUpdatedController to default plugins * removed first_time param * added test for GoalUpdatedController * linter fix Co-authored-by: relffok <[email protected]>
No need but thanks for doing it right away anyway! :) |
… (ros-navigation#3058) * first draft for goal updated controller Signed-off-by: relffok <[email protected]> * added goal_updated_controller to all yamls * added GoalUpdatedController API * added GoaUpdatedController to default plugins * removed first_time param * added test for GoalUpdatedController * linter fix Co-authored-by: relffok <[email protected]>
* first draft for goal updated controller Signed-off-by: relffok <[email protected]> * added goal_updated_controller to all yamls * added GoalUpdatedController API * added GoaUpdatedController to default plugins * removed first_time param * added test for GoalUpdatedController * linter fix
… (ros-navigation#3058) * first draft for goal updated controller Signed-off-by: relffok <[email protected]> * added goal_updated_controller to all yamls * added GoalUpdatedController API * added GoaUpdatedController to default plugins * removed first_time param * added test for GoalUpdatedController * linter fix Co-authored-by: relffok <[email protected]>
… (ros-navigation#3058) * first draft for goal updated controller Signed-off-by: relffok <[email protected]> * added goal_updated_controller to all yamls * added GoalUpdatedController API * added GoaUpdatedController to default plugins * removed first_time param * added test for GoalUpdatedController * linter fix Co-authored-by: relffok <[email protected]>
* first draft for goal updated controller Signed-off-by: relffok <[email protected]> * added goal_updated_controller to all yamls * added GoalUpdatedController API * added GoaUpdatedController to default plugins * removed first_time param * added test for GoalUpdatedController * linter fix
Signed-off-by: relffok [email protected]
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
For Maintainers: