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

Add condition nodes for time and distance replanning #1705

Merged

Conversation

naiveHobo
Copy link
Collaborator

@naiveHobo naiveHobo commented May 8, 2020

Signed-off-by: Sarthak Mittal sarthakmittal2608@gmail.com


Basic Info

Info Please fill out this column
Ticket(s) this addresses None
Primary OS tested on Ubuntu 18.04
Robotic platform tested on TurtleBot3 gazebo simulation

Description of contribution in a few bullet points

  • Added three new condition nodes:
  1. TimeExpired: returns SUCCESS after every predefined time period
  2. DistanceTraveled: returns SUCCESS after every N meters distance traveled by the robot

Description of documentation updates required from your changes

@shrijitsingh99
Copy link
Contributor

shrijitsingh99 commented May 8, 2020

  • TimeExpired: returns SUCCESS after every predefined time period

Wouldn't seconds be a more intuitive parameter than Hz considering the name of the node?

@SteveMacenski
Copy link
Member

SteveMacenski commented May 8, 2020

Alright, let me get this straight because we're entering Confusionland from multiple ideas / PRs / tickets / people working on strongly related items at the same time. This is partially my fault, I shouldn't have brought up the other issues in Davide's ticket that Aitor is working on.

image

To be clear, what is this proposing? To my understanding, you're essentially saying

  • Remove the rate controller (decorator)
  • Invalidate your other PR with a distance controller (decorator)
  • Replace with condition nodes for time / distance

Is that correct? If that is correct, do you think we should remove the existing decorators or just leave them but not use them in any BT?

The isNewGoal is something that @gimait is working on and we've been at that for the better part of a month down a number of rabbit holes (#1644) both self inflicted and wandering in the forest of all knowledge. I would like him to see that work through since he's spent alot of time and energy on this.

I think that covers the intent portion of this PR


The implementation portion of this PR also evokes some questions:

  • How does the time / distance nodes interact? We're discussing that currently in the ticket about how to ensure that we're not replanning super often if the time is set to say once every 10 seconds and the distance is 1 meter, what happens when those both happen in a short period of time. Or alternatively, do we want to require one or both of these conditions to be true? This is an open question that should be discussed in the ticket before we submit a PR (oh well, too late)
  • There's some talk of a speed decorator / condition as well. I would like to see that implemented, even if not used immediately. I see that as a really good idea and something we should have in our war chest.
  • We will likely want to update or remove existing BT XMLs as a result of this change. We should review existing ones and figure out which we keep but update and which may be now no longer required.

@SteveMacenski
Copy link
Member

Also the usual "update readmes, website docs, etc"

@naiveHobo
Copy link
Collaborator Author

The isNewGoal is something that @gimait is working on and we've been at that for the better part of a month down a number of rabbit holes (#1644) both self inflicted and wandering in the forest of all knowledge. I would like him to see that work through since he's spent alot of time and energy on this.

Ah, I'm sorry I missed the isNewGoal part of this PR. I assumed @gimait's work was addressing the preemption issues in the action nodes and recovery node. Should have gone deeper before jumping into it.

To be clear, what is this proposing? To my understanding, you're essentially saying

  • Remove the rate controller (decorator)
  • Invalidate your other PR with a distance controller (decorator)
  • Replace with condition nodes for time / distance

I'd say the decorator nodes should not be removed. They propose a completely different functionality in that they can be used to control the rate of an entire branch in a BT. While throttling is possible with these condition nodes, it would involve the use of other nodes to offer that functionality. A decorator + condition nodes for these scenarios offers the most flexibility I feel.

How does the time / distance nodes interact? We're discussing that currently in the ticket about how to ensure that we're not replanning super often if the time is set to say once every 10 seconds and the distance is 1 meter, what happens when those both happen in a short period of time.

I believe we can work on the time / distance node interaction only if they are implemented as condition nodes. As decorators, I'm not sure if the two nodes can interact.

@SteveMacenski
Copy link
Member

SteveMacenski commented May 8, 2020

OK, lets wait on his new PR for is new goal.

I believe we can work on the time / distance node interaction only if they are implemented as condition nodes.

Lets follow up in the ticket about how to make these work together.

I agree, we should keep all the BT nodes around even if we don't use them. It would be nice to have a large library of primitives. There's probably a bunch of other simple nodes we could add that would be useful.

@naiveHobo
Copy link
Collaborator Author

To conclude, I'm going to remove the isNewGoal condition node and wait for @gimait's new PR. I believe we should still go ahead with the time / distance condition nodes and the BT derived using these nodes since this is inherently superior than using decorators if we want to combine the time / distance behavior.

Once @gimait's PR is in, we can just add the isNewGoal condition node to the existing BT similar to what's been done here.

@SteveMacenski SteveMacenski changed the title Add condition nodes and behavior tree to enable replan on new goal [WIP] Add condition nodes for time and distance replanning May 9, 2020
@SteveMacenski
Copy link
Member

We should still discuss in the other ticket about how to best combine them or if we even should. I agree that either way we should add these BT condition nodes.

@gimait
Copy link
Contributor

gimait commented May 9, 2020

Alright, I just pushed my goal updated node, I think we can make it work with the condition nodes added in this pr for distance and time conditions in this new subtree to control the replanning.

I think we should implement both decorators and control nodes with these key functionalities. The reasons for this are:

  • Decorators can only do one action on the node child, meaning that they are less flexible. This makes them impossible to use for both cancelling the recoveries and triggering the planning.
  • The condition nodes cannot check on the status of the nodes we are interested in checking. For the recoveries, this does not matter, however we might be interested in waiting if the planner has not finished yet when a TimeExpired node returns success (like the rate controller does).

How does the time / distance nodes interact? We're discussing that currently in the ticket about how to ensure that we're not replanning super often if the time is set to say once every 10 seconds and the distance is 1 meter, what happens when those both happen in a short period of time.

With the Fallback control node, all the new condition nodes would be halted if any returns Success.
Thanks to this, it won't happen that time and distance are triggered (almost) at the same time. If one of them is triggered, all the others are reset.

Is this right @naiveHobo? (Awesome job btw)

@naiveHobo
Copy link
Collaborator Author

With the Fallback control node, all the new condition nodes would be halted if any returns Success.
Thanks to this, it won't happen that time and distance are triggered (almost) at the same time. If one of them is triggered, all the others are reset.

Yes, that's the idea. Plus such a structure also naturally integrates your goal update node.

@Sarath18
Copy link
Contributor

Sarath18 commented May 9, 2020

Hello everyone, I would like to point out a potential issue in the current implementation. During the first cycle, if the TimeExpired node returns SUCCESS, ComputPathToPose is ticked to generate a path. In the next cycle, TimeExpired node returns FAILURE and DistanceTravelled is ticked, which might return SUCCESS leading to ComputPathToPose being ticked again. This can lead to continuous replanning of the path due to these nodes. To avoid this we need to add a reset functionality.

With the Fallback control node, all the new condition nodes would be halted if any returns Success.
Thanks to this, it won't happen that time and distance are triggered (almost) at the same time. If one of them is triggered, all the others are reset.

As far as I know, the fallback node halts all the children and sets their status to IDLE whenever any child return SUCCESS or the last child return FAILURE. Reset might not be the correct terminology used here. The Condition node in the behavior tree does not allow the halt() function to be overridden as you can see here. Correct me if I am wrong.

To solve this issue, I see a few potential implementations (taking into consideration the order of TimeExpired and DistanceTravelled can be changed):

  1. The easiest way to do this would be to add a condition flag in the blackboard and check the value from the blackboard to reset it.
  2. The better way to solve this might be to create a custom condition node in which we can override the halt() function. SyncActionNode cannot override halt() method. Using AsyncActionNode is a bad idea as they spawn a new thread. CoroActionNode might be the way to do it.

I would also like to suggest a small change in the current tree structure. Instead of having a fallback node and an inverter under the PipelineSequence, we can convert these nodes to a ReactiveSequence which still follows the same logical path. A visual representation is provided below.

bt

@naiveHobo
Copy link
Collaborator Author

As far as I know, the fallback node halts all the children and sets their status to IDLE whenever any child return SUCCESS or the last child return FAILURE.

If this is true, a simple way to mend this would be to reset the state when the status of the condition node is IDLE. The same thing also happens in the decorators.

I would also like to suggest a small change in the current tree structure. Instead of having a fallback node and an inverter under the PipelineSequence, we can convert these nodes to a ReactiveSequence which still follows the same logical path. A visual representation is provided below.

Ah, good catch! Will make this change in the BT.

@gimait
Copy link
Contributor

gimait commented May 10, 2020

The Condition node in the behavior tree does not allow the halt() function to be overridden as you can see here. Correct me if I am wrong.

You are completely right, but shouldn't the node be initialized only when it's ticked and idle? :D
A simple if statement can make this work pretty well without overriding the halt:

  • When ticked, if the node status is idle, initialize it and return failure (this also means that the node state is set to failure).
  • If it's not idle, then do whatever distance/time check you need, and return success if the condition happens.

Also, if you need to override halt sometime, you can just subclass from action nodes instead.

DistanceTraveledCondition() = delete;

BT::NodeStatus tick() override
{
Copy link
Contributor

Choose a reason for hiding this comment

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

If you set to true first_time_ when the node is ticked and idle, then the node will get initialized again after being halted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, going to follow pretty much the thing you did in the GoalUpdated condition

@naiveHobo
Copy link
Collaborator Author

Waiting for #1712 (for GoalUpdated condition) and #1699 (for testing framework) to be merged to take this forward

@SteveMacenski SteveMacenski changed the title [WIP] Add condition nodes for time and distance replanning [WIP] Add condition nodes for time and distance replanning [blocked by 1712] May 11, 2020
@SteveMacenski
Copy link
Member

SteveMacenski commented May 11, 2020

I won't re-review until #1712 is in and that is used for the new is goal new node.

If one of them is triggered, all the others are reset.

How is that? If node 1 is triggered, then node 2 is never called to update its internal state about current time / distance. @Sarath18 's comment is my understanding as well. I'm not sure resetting on idle works because if node 2 is never ticked, the state never moves from idle.

I agree that a reset functionality would indeed fix the AND or OR on the condition issues I brought up. The BT also has an issue in another way; the IsNewGoal MUST be first. If its last and the other ones trigger, then the state of the new goal isn't propagated and results in the next tick cycle a replan from a request that should have been processed in the last update. So IsNewGoal must always be first in the children for preemption. But if any of them cause update, including IsNewGoal, the time and distance need to "reset" their internal state.

That seems to me to mean that the condition node that parents these needs to reset their states. I don't see how any of the suggestions above fixes that issue. I haven't fully thought out the use of halt(), Id have to dig into the BT.CPP code to make sure that halt() on all children are called if any return in this case. If that does work out, that needs to be documented the **** out of because we're doing something really subtle.

@gimait
Copy link
Contributor

gimait commented May 12, 2020

How is that? If node 1 is triggered, then node 2 is never called to update its internal state about current time / distance.

The behaviour of fallback nodes is: tick the first child, did it success? yes: halt all children and return success; no: tick the next child, did it success?.. and so on.
In the tree structure we have here (which is the one that Davide proposed as solution to our problem), on each iteration of the bt the condition nodes are checked, and if any of them is successful, we replan. There is only one problem with this implementation and it is that the planning cannot be halted if it's still running when a condition happens.. We have to check on how to do that, maybe the reactive sequence or reactive callback can be used.

The BT also has an issue in another way; the IsNewGoal MUST be first. If its last and the other ones trigger, then the state of the new goal isn't propagated and results in the next tick cycle a replan from a request that should have been processed in the last update.

That's right, that is a possibility. I agree that IsNewGoal should be first.

But if any of them cause update, including IsNewGoal, the time and distance need to "reset" their internal state.
That seems to me to mean that the condition node that parents these needs to reset their states.

Isn't it okay that the node is initialized when idle?
Fallbacks do reset their children states by calling halt all children.

@naiveHobo
Copy link
Collaborator Author

The BT also has an issue in another way; the IsNewGoal MUST be first. If its last and the other ones trigger, then the state of the new goal isn't propagated and results in the next tick cycle a replan from a request that should have been processed in the last update. So IsNewGoal must always be first in the children for preemption.

I don't think this is true. At least for the replanning branch, all the TimeExpired and DistanceTravelled conditions are doing is telling ComputePathToPose to replan a path given whatever goal is currently on the blackboard. Even if the other condition nodes are ticked before IsNewGoal when there is in fact a new goal, ComputePathToPose plans a path considering the latest goal on the blackboard.
As @gimait said, since one of these condition nodes returned success, the IsNewGoal condition will be reset to update its internal goal to store the latest goal and it won't be ticked in the next cycle if the goal is not updated again.

@SteveMacenski
Copy link
Member

SteveMacenski commented May 12, 2020

@gimait none of that answers my concerns. If you have some parameter param1 in a BT node that's second in the control flow, and the first one is called 5 times. Each time that first one returns to update and the control flow halt() all of the child nodes, no where in that process that I'm aware of is param1 reset.

The practical example is if NewGoal is first and distance is second, if NewGoal comes in 5 times rapidly to replan, each time the internal state parameter distance isn't being reset to 0. Then on iteration 6, it'll trigger a replan because its moved enough, but not relative to the last update.

The halt() method that's called would need to reset those parameters in each of the conditionals.

I don't think this is true. At least for the replanning branch, all the TimeExpired and DistanceTravelled conditions are doing is telling ComputePathToPose to replan a path given whatever goal is currently on the blackboard. Even if the other condition nodes are ticked before IsNewGoal when there is in fact a new goal, ComputePathToPose plans a path considering the latest goal on the blackboard.

Not the point - another instance of internal state being incorrect. The NewGoal parameter goal_ will be wrong causing a replan the next iteration it is called because it wasn't called initially when a new goal was actually available to update its internal state.

These are all cases of state issues that need to be addressed and generalized to document for designers.

@SteveMacenski SteveMacenski changed the title [WIP] Add condition nodes for time and distance replanning [blocked by 1712] [WIP] Add condition nodes for time and distance replanning May 15, 2020
@SteveMacenski
Copy link
Member

SteveMacenski commented May 15, 2020

Ok, I think this is now unblocked. We have the IsNewGoal so we can add these nodes and BT tree updates for both - though have we come to a resolution on the state updates ?

Edit: We may want to separate PRs, one that adds the nodes, the other with the BTs.

@naiveHobo naiveHobo force-pushed the feature/is-new-goal-condition branch from d197fb2 to a112cbe Compare May 16, 2020 20:33
@naiveHobo
Copy link
Collaborator Author

Sorry, had to force push after rebasing to master.

We may want to separate PRs, one that adds the nodes, the other with the BTs.

Makes sense, I'll add the nodes on this PR.


though have we come to a resolution on the state updates ?

Not exactly. I agree with everything @SteveMacenski said but there are still a few issues.

There are two ways we can account for state reset:

  1. The state reset can be done in halt(). For this, we will need a new base condition node which allows halt() to be overridden.

  2. The state reset can be done in tick() by checking that the current state of the node is IDLE. This has to be the first check in tick() before any other processing. If the state is IDLE, reset state and return failure. This saves up from adding another node but a problem here is, one tick is wasted in restting the state.

I think the second option is better. In the example that @SteveMacenski proposed:

The practical example is if NewGoal is first and distance is second, if NewGoal comes in 5 times rapidly to replan, each time the internal state parameter distance isn't being reset to 0. Then on iteration 6, it'll trigger a replan because its moved enough, but not relative to the last update.

If a NewGoal comes in 5 times rapidly to replan, the internal state of DistanceTraveled and TimeExpired will indeed be incorrect. All the nodes are set to IDLE since NewGoal returned success. On the 6th iteration, DistanceTraveled will check if its current state is IDLE and will reset the internal state parameter distance back to 0 and return failure.


Another thing, with the current implementation of Fallback or ReactiveFallback, all the children are halted when:

  1. Any one child returns success
  2. All children return failure

For the IsReplanNeeded branch, I believe we need a control node with some functionalities of Fallback but some additional things as well. The ideal behavior should be:

  1. If a child returns failure, tick the next child (like fallback)
  2. If a child returns success, halt all children and return success (like fallback)
  3. If all children return failure, don't halt any child and return failure (unlike fallback)

Another issue with the GoalUpdated condition; it doesn't return success on the very first goal. Which means it can't be used as it is for replanning. When the first goal is received, GoalUpdated updates its internal goal state and returns false and the other conditions also return false as expected. All the conditions return failure so all the children are halted and set back to IDLE. In the next tick, the GoalUpdated condition checks if it is IDLE and again updates its internal goal state and returns a failure and this keeps continuing.

This should be on a new ticket though.

@gimait
Copy link
Contributor

gimait commented May 18, 2020

There are two ways we can account for state reset:

I agree. I think in general the second option is best for the concept of condition nodes in general, unless you need to measure something since the last halt (let's say, has time passed since halt).
For nodes like isGoalUpdated, TimeExpired or DistanceTravelled, my understanding is that you want to measure those distances from the time when you first tick the node.

If a NewGoal comes in 5 times rapidly to replan, the internal state of DistanceTraveled and TimeExpired will indeed be incorrect. All the nodes are set to IDLE since NewGoal returned success. On the 6th iteration, DistanceTraveled will check if its current state is IDLE and will reset the internal state parameter distance back to 0 and return failure.

But that is what I would expect that should happen, right? If you just replanned, you won't need to replan again until you travelled x meters more (?).

Another thing, with the current implementation of Fallback or ReactiveFallback, all the children are halted

Very good point, I didn't realise that. I like a lot the idea of a new control node for this.

Another issue with the GoalUpdated condition; it doesn't return success on the very first goal.

This is intended. If you make it return success in the first iteration, it won't work for the recovery actions (which was the main reason why it was introduced). I think we have to think of condition nodes as single, super simple conditions. Otherwise, they can't be reused in different situations. The isGoalUpdated node is a good example. In my opinion, if you want something to happen in the first iteration, you could add a IsFirstCall condition node (or something) that returns success the first time and never again.
Following that idea, it doesn't make sense to have any node apart from the IsFirstTick return success on the first tick. Which is good, because if you have three different nodes with this functionality (let's say we return success in the first call to TimeExpired and DistanceTravelled), you would tick the first, return success, and replan, then you go in the fallback again, pass the first condition and get to the second, and replan again, because it's the first time you got in the second child.

We should probably open a slack group to align on the way to go, and then make the extra prs that we need to close this issues with the behavior trees.

What do you think @SteveMacenski? Should we also write a new ticket to finalize this?

@SteveMacenski
Copy link
Member

SteveMacenski commented May 18, 2020

@naiveHobo I think we just need an on_halt() method like we have an on_*() for other parts, in that, reset state. For door #3. That deals with how to deal with state, but not how to properly make sure that they're reset only when another is successful. That could be done with the blackboard or a new control flow node.

@naiveHobo @gimait please stop talking about this in a PR and redirect it to the ticket. This isn't the place for that discussion and it won't be easily searchable in the future. Go to #1701.

The discussion here should be about the condition nodes for time and distance, only.

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.

@cdelsey @crdelsey (which account are you using now?) can you review?

@SteveMacenski SteveMacenski changed the title [WIP] Add condition nodes for time and distance replanning Add condition nodes for time and distance replanning May 19, 2020
@SteveMacenski
Copy link
Member

@naiveHobo you have some merge conflicts from the last update. Can you fix so that Carl can review?

@naiveHobo
Copy link
Collaborator Author

@SteveMacenski Just to confirm, should I rebase to master?

@SteveMacenski
Copy link
Member

Yes, or pull in changes and resolve the conflict.

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>
@SteveMacenski
Copy link
Member

SteveMacenski commented May 20, 2020

@naiveHobo please avoid force pushing on PRs. I'd rather see you spend 20 commits fixing some small issue than have a blob of untracked code I need to fully re-review.

This looks good to me, I'm just waiting on Carl's thoughts. I'm using the tag merge as a reminder for me that this is ready to merge pending confirmation actions

@naiveHobo
Copy link
Collaborator Author

Ah, that's what I wanted to confirm. I rebased to master after your review, hence the force push.

@SteveMacenski
Copy link
Member

@naiveHobo please rebase so that CI passes. @crdelsey I'd still like your review, that's the only thing blocking this.

@codecov
Copy link

codecov bot commented May 27, 2020

Codecov Report

Merging #1705 into master will increase coverage by 0.93%.
The diff coverage is 94.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1705      +/-   ##
==========================================
+ Coverage   64.43%   65.37%   +0.93%     
==========================================
  Files         196      200       +4     
  Lines       10472    10526      +54     
==========================================
+ Hits         6748     6881     +133     
+ Misses       3724     3645      -79     
Flag Coverage Δ
#project 65.37% <94.44%> (+0.93%) ⬆️
Impacted Files Coverage Δ
...nav2_behavior_tree/plugins/distance_controller.hpp 100.00% <ø> (ø)
...ior_tree/plugins/decorator/distance_controller.cpp 76.19% <ø> (ø)
nav2_bt_navigator/src/bt_navigator.cpp 81.69% <ø> (ø)
.../plugins/condition/distance_traveled_condition.cpp 89.28% <89.28%> (ø)
...avior_tree/plugins/distance_traveled_condition.hpp 100.00% <100.00%> (ø)
...2_behavior_tree/plugins/time_expired_condition.hpp 100.00% <100.00%> (ø)
..._tree/plugins/condition/time_expired_condition.cpp 100.00% <100.00%> (ø)
...v2_util/include/nav2_util/simple_action_server.hpp 85.80% <0.00%> (-2.47%) ⬇️
nav2_amcl/src/amcl_node.cpp 83.23% <0.00%> (-0.77%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de0ed9a...de0f797. Read the comment docs.

@SteveMacenski SteveMacenski merged commit ec7f550 into ros-navigation:master May 27, 2020
@SteveMacenski
Copy link
Member

I think this soaked long enough.

@naiveHobo naiveHobo deleted the feature/is-new-goal-condition branch May 27, 2020 19:46
SteveMacenski added a commit to SteveMacenski/navigation2 that referenced this pull request Jun 17, 2020
* Corrected check to detect collision (open-navigation#1404) (open-navigation#1601)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Script (open-navigation#1599)

* Add eloquent option to build script and made it default

* Add eloquent in the error message

* Remove dashing

* setStatus(BT::NodeStatus::IDLE) removed (open-navigation#1602)

the removed code has no effect at all: the status of a node will be its returned value!.

In general, you never set your status to IDLE, unless halted.

* Spin recovery (open-navigation#1605)

* Corrected check to detect collision (open-navigation#1404)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Changed collision check to detect only lethal and unknown cells (open-navigation#1404)(open-navigation#1603)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* making documentation distro agnostic (open-navigation#1610)

* Issue 1608 segmentation fault planner server node master (open-navigation#1612)

* corrected wrong indexing in NavfnPlanner::smoothApproachToGoal function

* resolved uncrustify errors

* corrected the condition inside NavfnPlanner::smoothApproachToGoal to replace last pose of computed path

Co-authored-by: chikmagalore.thilak <chikmagalore.thilak@bshg.com>

* BehaviorTree refactoring (open-navigation#1606)

* Proposed refactoring to avoid issues with CoroAction

* correctly haltAllActions (related to open-navigation#1600)

* not really needed and will be deprecated soon

* Applying changes suggested in the comments of open-navigation#1606

- fix haltAllActions
- changes method signature on_success()
- reverts the changes made here:
https://github.com/ros-planning/navigation2/pull/1515/files

* fix warnings and errors

* make uncrustify happy?

* Update bt_navigator.cpp

* Update bt_navigator.cpp

* uncrustify fix

Co-authored-by: daf@blue-ocean-robotics.com <Davide Faconti>

* Decide the output of BtServiceNode based on the service-response (open-navigation#1615)

- `BtServiceNode::check_future()` was created, to encapsulate the logic
where a the output of the BtServiceNode is computed.
- Inherited classes can overload this function according to the requirement
of the user

* Add server_name parameter to BtActionNode (open-navigation#1616)

A BT port is introduced in case the user wants to change the default action_name
of BtActionNode.

* Added thread synchronization to KinematicParameters (open-navigation#1459) (open-navigation#1621)

* Added thread synchronization to KinematicParameters (open-navigation#1459)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Doxygen fix (open-navigation#1459)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Docs (open-navigation#1629)

* Updated website gifs (open-navigation#1228)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Created new gifs (open-navigation#1228)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Corrected gif name (open-navigation#1228)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Allow reaction to cancellation and preemption on wait recovery plugin (open-navigation#1636)

* Changed onCycleUpdate to allow preemption (open-navigation#1622)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Deleted unnecessary wait and corrected style (open-navigation#1622)

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Nav2 planner plugin tutorial (open-navigation#1633)

* Nav2 planner plugin tutorial draft 1

* Reduced gif size

* Updated the config code block

* Remove RRTConnect plugin and add StraightLine plugin.

* Address reviewer's comments

* Add information about planners mapping in Navigation2

* Minor path fix for gif (open-navigation#1638)

* Minor improvement on best practice for pluginlib export (open-navigation#1637)

* Add caps to headers (open-navigation#1639)

* Fix segfault in test_planner_random_node/test_planner_costmaps_node (open-navigation#1640)

The problem appears while addressing zero-length path vector
after planner failed to create a plan.

* Fix trans_stopped_velocity comparison with x & y velocity (open-navigation#1649)

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* map_server refactor and cleanup (open-navigation#1624)

* [WIP] map_server refactor and cleanup

nav2_map_server/mapio (map input-optput library):
* Move OccupancyGrid messages saving code from MapSaver::mapCallback()
  to saveMapToFile() function
* Rename and move try_write_map_to_file() MapSaver method
  to tryWriteMapToFile() function
* Move map saving parameters into one SaveParameters struct
* Reorganize map saving parameters verification code from MapSaver
  to new checkSaveParameters() function
* Correct logging for incorrect input cases in checkSaveParameters()
* Copy loadMapFromYaml() method from OccupancyGridLoader
* Move loadMapFromFile() method from OccupancyGridLoader
* Rename and move load_map_yaml() OccupancyGrid method
  to loadMapYaml() function
* Move LoadParameters struct from OccupancyGridLoader

nav2_map_server/map_saver:
* Completely re-work MapSaver node:
 - Switch MapSaver from rclcpp::Node to nav2_utils::LifecycleNode
 - Revise MapSaver node parameters model
 - Add saveMapTopicToFile() method for saving map from topic
 - Remove future-promise synchronization model as unnecessary
* Add "save_map" service with new SaveMap service messages
* Rename map_saver_cli.cpp -> map_saver_cli_main.cpp file
  and map_saver -> to map_saver_cli executable
* Add ability to save a map from custom topic ("-t" cli-option)
* Restore support of "--ros-args" remappings
* Update help message in map_saver_cli
* New map_saver_server_main.cpp file and map_saver_server executable:
  continuously running server node
* New launch/map_saver_server.launch.py: map_saver_server launcher

nav2_map_server/map_server:
* Revise MapServer node parameters model
* Rename loadMapFromYaml() -> loadMapResponseFromYaml()
* Add node prefix to "map" and "load_map" service names
* Fix crash: dereferencing nullptr in map_server running as a node
  while handling of incorrect input map name
* Add updateMsgHeader() method for correcting map message header
  when it belongs to instantiated object
* Rename main.cpp -> map_server_main.cpp file
* Minor changes and renames to keep unified code style

nav2_util/map_loader:
* Remove as duplicating of loadMapFromFile() from MapIO library

other:
* Update nav2_map_server/README
* Fix testcases

* Fixes for cpplint, uncrustify, flake8 and test_occ_grid_node failures

* Fixing review comments

* Rename mapio -> map_io
* Move all OccGridLoader functionality into MapServer. Remove OccGridLoader
* Switch all thresholds to be floating-point
* Switch loadMapFromYaml() returning type to LOAD_MAP_STATUS and remove
  duplicating code from loadMapResponseFromYaml()
* Make mapCallback() to be lambda-function
* Make saveMapCallback() to be class method
* Utilize local rclcpp_node_ from LifecycleNode instead of map_listener_.
  Remove map_listener_ and got_map_msg_ variables.
* Rename load_map_callback() -> loadMapCallback() and make it to be class method
* Rename handle_occ_callback() -> getMapCallback() and make it to be class method
* Force saveMapTopicToFile() and saveMapToFile() to work with constant arguments
* map_saver_cli: move arguments parsing code into new parse_arguments() function
* Rename test_occ_grid_node -> test_map_server_node and fix test
* Rename test_occ_grid -> test_occ_grid and fix test
* Fix copyrights
* Fix comments
* Update README

* Increase test coverage

* Fixing review comments

* Separate map_server and map_saver sources
* Fix copyrights
* Suppress false-positive uncrustify failure

* Map Server docs update for Foxy (open-navigation#1650)

* Map Server docs update for Foxy

* Fixes after review

* Add brief description of map_io

* Initialize variabes to avoid errors during build (open-navigation#1654)

Signed-off-by: Pablo Vega <epvega@gmail.com>

* Temporarily remove planner tests (open-navigation#1656)

* Replace deprecated ament_export_interfaces

* Revert edf9b9a

Accidental commit into github ui

* remove docs from navigation2 repo (open-navigation#1657)

* Update hyperlinks in readme for new website docs (open-navigation#1668)

* Update hyperlinks in readme for new website docs

* Adding link to join slack

* Ignore codecov paths in tests (open-navigation#1671)

* Ignore codecov paths in tests

* adding missing string test case for stripping leading slash

* Update test_string_utils.cpp

* Update test_string_utils.cpp

* Update codecov.yml

* Update codecov.yml

* Update codecov.yml

* Update codecov.yml

* Fix bug in the condition to publish local plan (open-navigation#1674)

Signed-off-by: Francisco Martin Rico <fmrico@gmail.com>

* Fix infinite rotation in Spin recovery when angle > PI (open-navigation#1670)

* Fix infinite rotation in Spin recovery when angle > PI

* Add test for spin recovery

* Fix formatting

* Add general optimizations

* Fix copyright

* Add weights to AMCL particle cloud (open-navigation#1677)

* Add Particle and ParticleCloud msgs to publish amcl particle cloud with weights

* Add deprecation warning

* Remove dead code from navfn planner (open-navigation#1682)

* adding wait recovery integration test (open-navigation#1685)

* adding recovery wait test

* adding copy rights

* fixing gaurds

* Add ignoring code cov any files named test_ (open-navigation#1691)

* Add ignoring code cov any files named test_

* Update slack URL

* Update codecov.yml

* Replace current cell reference with copy (open-navigation#1690)

The cell reference becomes invalidated as the reference becomes invalid when a new  cell is added to the vector

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Fix segfault in test_planner_random_node (open-navigation#1694)

deactivate needs to be called before cleanup
to stop the mapUpdateLoop()

Signed-off-by: Siddarth Gore <siddarth.gore@gmail.com>

* Adding more simple action server, nav2_utils, and lifecycle bringup CLI tests (open-navigation#1695)

* adding tests to simple action server and fixed bug

* more test coverage in nav2_utils

* testing lifecycle cli program

* shifting action server test around for stability

* adding test temp commented out

* flake

* w/o resetting

* Change publishers to publish unique ptrs (open-navigation#1673)

* Change publishers to publish unique ptrs

* Revert test case modification

* Update function signature to receive unique_ptrs

* Update publishers in nav2_costmap_2d to publish unique ptrs

* Update publishers in nav2_planner and nav2_map_server

* Change nav2_map_server publisher to publish occupancy grid unique ptr

* Change publisher in nav2_planner to publish path unique ptr

* Remove smart pointer return from functions in nav2_costmap_2d

* Run cpp_lint manually in nav2_costmap_2d

* Minor fixes

* Adhere to conventions of smart pointers passing to function

* Change publisher in dwb_core to publish unique pointer

* update for BT.cpp master (open-navigation#1714)

* Update CI for ROS2 Foxy (open-navigation#1684)

* Update Dockerfile

* Update repo paths

* Copy all of workspaceto include .repo files expected by CI in image

* Patch Docker and CI for missing gazebo 11
Revert once gazebo 11 is ready

* Disable connext for now

* Disable debug jobs in nightly workflow

* Remove unused install_deployment_key refrence

* Update the release Dockerfile

* Use buildkit to speed up loacal builds

* Add example of running tests

* Roll back BTcpp and no-error deprecated warnings

* Revert "Roll back BTcpp and no-error deprecated warnings"

This reverts commit 301eb54.

* Move extra Dockerfiles to tools folder

* Replace deprecated ament_export_interfaces (open-navigation#1669)

with ament_export_targets
See notice here:
https://index.ros.org/doc/ros2/Releases/Release-Foxy-Fitzroy/

* Refactor rclcpp::executor::FutureReturnCode deprecation (open-navigation#1702)

* Refactor deprecated code

* Add ompl repo (for test)

* Fix indent

* Remove OMPL

* Fix cppcheck errors (open-navigation#1718)

* Fix cppcheck errors

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Fix test name generator

* Fix returning after it is deallocated / released error

* Increase sleep to 10 seconds to allow map server node to start up

* Fix infinite wait for service in nav2_map_server tests

* [WIP] Checking line coverage in codecov (open-navigation#1713)

* Add parsers options

* Disable all branch detection option

* Replace lcov with gcov

* Revert changes in codecov.yaml and remove branch coverage from coverage bash script

* [master] Windows bring-up (open-navigation#1704)

* Windows bringup.

* nullity check.

* nullity check.

* Added goal updated condition node (open-navigation#1712)

* Added goal updated condition node

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Updated bt_navigator readme and added missing failure condition

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Updated bt_navigator readme

Signed-off-by: Aitor Miguel Blanco <aitormibl@gmail.com>

* Update nav2_bt_navigator/README.md

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>

* Update nav2_bt_navigator/README.md

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>

* Update nav2_bt_navigator/README.md

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>

* Tf timeout (open-navigation#1724)

* Parameterized tf_timeout in amcl
* Refactored the existing transform_tolerance parameter in amcl to transform_publish_shift.
* Refactored tf_buffer method calls to use transform_tolerance according to [978].

* Added tf_timeout to static_layer and observation_buffer

* declared transform_tolerance parameter

* change transform_tolerance default value

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>

* Removed transform_publish_shift param

* Fixed linting errors

Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>

* Fix system_tests flaky issue (open-navigation#1723)

* Return back planning system tests

* Fix testcase failure related to not updating costmap

This appeared while compiler treated costmap pointer
to be unused and optimized it out

* Fix flake8 E128 failure

* Fix uninitialized variable warnings and change default value (open-navigation#1728)

* Fix uninitialized warning for variable temp_tf_tol.

* Change default GridBased.tolerance to 0.5 meters

* Add DistanceController decorator node (open-navigation#1699)

* Add DistanceController decorator node

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Update documentation and rename behavior tree XMLs

* Add tests for distance controller

* Fix test

* Update readme and add BT image

* Rename test files

* Remove protected setStatus calls

* Add option to inflate unknown space (open-navigation#1675)

* Add option to inflate around unknown space

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Fix bug regarding lower bound of double in worldToMapEnforceBounds

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Convert 2D caches to 1D vectors for automatic memory management and better locality

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Add general optimizations and modern syntax

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Switch from map<double> to vector<> in using precached integer distances

Credits to original author from ros-planning/navigation#839

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Add tests for inflate_unknown and inflate_around_unknown

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Remove commented out assert

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>

* Add BehaviorTree visualization support using Groot (open-navigation#1725)

* Add BehaviorTree visualization support using Groot

* Add nav2 TreeNodesModel containing all BT Nodes used

* Add instructions on using Groot to visualize behavior trees

Signed-off-by: Sarathkrishnan Ramesh <sarathkrishnan99@gmail.com>

* Rearrange files and minor updates

* Move nav2_tree_nodes.xml and groot instruction to nav2_beahvior_tree

* Run cmake install rules for nav2_tree_nodes.xml

Signed-off-by: Sarathkrishnan Ramesh <sarathkrishnan99@gmail.com>

* Add distance controller node in nav2 TreeNodesModel

Signed-off-by: Sarathkrishnan Ramesh <sarathkrishnan99@gmail.com>

* Add collision checking for footprint without using subscibers. (open-navigation#1703)

* Add collision checking for footprint without using subscibers.

* Address reviewer's comments

- Changed the design if the footprint collision checkers
- And propogate the changes to dependencies such as nav2_recoveries and nav2_core

* Remove some extra headers

* Remove debuging code

* Add requested test

* Change weird test names.

* Remove unorientFootprint function dependency

* Imporve tests

* Fix commented Varible

* Expose distance controller frames to ports (open-navigation#1741)

* Add feedback in navigation2 actions (open-navigation#1736)

* adding navigate to pose feedback and remove random crawl from master

* adding controller feedback

* recovery feedback actions

* Update nav2_controller/src/nav2_controller.cpp

Co-Authored-By: Carl Delsey <1828778+cdelsey@users.noreply.github.com>

* Add feedback in wait action and make general improvements

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Fix rebase errors

* Make feedback reset across different goals

Co-authored-by: stevemacenski <stevenmacenski@gmail.com>
Co-authored-by: Carl Delsey <1828778+cdelsey@users.noreply.github.com>

* Switch to nightly tag for release image (open-navigation#1746)

as tests for connext rmw have been disabled.54

* Parameterization of the tf_tol argument for getCurrentPose calls (open-navigation#1735)

* parametrized collision_checker getCurrentPose timeout

* Parameterized tf_tol for spin and backup recoveries

* Parameterized tf_tol for goal_reached_condition

* moved transform_tolerance_ to recovery.hpp

* moved transform_tolerance parameter declaration to bt_navigator

* Fixed typo

* Fixed transform_tolerance_ location and transform_tolerance param declaration location

* Parameterized tf_tol for distance_controller.cpp

* Revert libgazebo11 workaround for CI (open-navigation#1750)

* Revert libgazebo11 workaround

* Revert gazebo_ros_pkgs to main ros2 branch

* Resolves open-navigation#938 (open-navigation#1747)

The forward_point_distance used in the GoalAlign and PathAlign critics projects the current pose forward a default 0.325 meters before scoring the trajectory. This can cause velocities that create sharp turns into obstacles to be chosen (reproducible with the Turtlebot3 simulation).

For TB3, which is small in size, 0.325 meters is too far. Instead, enable GoalAlign and PathAlign critics in the DWB controller and shorten the critics' forward_point_distance (how far the current pose is project given the current orientation before scoring the trajectory) from the default 0.325 meters to 0.1 meters which improves stability when running with TB3.

Signed-off-by: Jack Pien <jack@jackpien.com>

* make basic failing test for tf2 wrapper (start of robot utils tests) (open-navigation#1743)

* make basic failing test for tf2 wrapper

* add file :-)

* Run rosdep update in Dockerfile and CI (open-navigation#1751)

So we don't have to wait for the nightly parent image to update rosdep

* Don't pass rosdistro when using empty index (open-navigation#1752)

Context: osrf/docker_images#399

* Explicitly set junit_family parameter for nav2_gazebo_spawner tests (open-navigation#1753)

* Parameterize frame IDs (open-navigation#1742)

* Use parameterized frames (ros-planning#1726)

Signed-off-by: ymd-stella <world.applepie@gmail.com>

* Expore frame to ports in GoalReached and add params to bringu yaml files

* Fix recovery interface

* Update launch file and add recovery parameters to bringup yaml

* Remove lifecycle node params

* Update bringup param files

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Fix cpplint error

* Fix nav2_recoveries cpplint errors

Co-authored-by: ymd-stella <world.applepie@gmail.com>

* Add the goal to NavFN tolerance region traversing algorithm (open-navigation#1734)

* Consider the goal itself when looking to potential within tolerance region

* Fixed comments

* Re-enable nightly debug builds for codecov (open-navigation#1760)

Looks like codecov analytics from merged PRs alone do not update codecov status for the master branch.
Re-enabling nightly debug builds to keep codecov status on master up-to-date

* Wait for initial pose and increase timeouts (open-navigation#1759)

Initial pose is needed for the test to run
so it makes sense to wait for it till it times out.

* removed unused condition (open-navigation#1769)

* Added use of declare_parameter_if_not_declared. (open-navigation#1765)

* Added use of declare_parameter_if_not_declared.

* Fixed column width.

* Whitespace removal

* Style cleanup.

* a bugfix of clear costmap service action (open-navigation#1764)

The following is an example of the error.
[ERROR] [1590171638.335693813] [bt_navigator]: Action server failed while executing action callback: "failed to send request: ros_request argument is null, at /opt/ros/src/ros2/rcl/rcl/src/rcl/client.c:278"a bugfix of clear costmap service action

Signed-off-by: Daisuke Sato <daisukes@cmu.edu>

* Add condition nodes for time and distance replanning (open-navigation#1705)

* Add condition nodes and behavior tree to enable replan on new goal

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Fix time expired and distance traveled conditions

* Remove new_goal_received from blackboard

* Fix IDLE check condition in new condition nodes

* Fix lint errors

* Fix lint errors

* Address reviewer's comments

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Add tests

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* a patch for open-navigation#1773 BT navigator nodes with use_sim_time (open-navigation#1776)

Signed-off-by: Daisuke Sato <daisukes@cmu.edu>

* Replace deprecated launch params (open-navigation#1778)

* Update deprecated launch params

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* Revert internal python changes

Signed-off-by: Sarthak Mittal <sarthakmittal2608@gmail.com>

* adding backup tests (open-navigation#1774)

* adding backup tests

* add negative case

* correct termination logic

* increase speed

* fixish failure test case

* declared default_critic_namespaces param (open-navigation#1785)

* List of parameters in the stack  (open-navigation#1761)

* Initial commit

* Added AMCL params and some formatting fixes

* Added some missing params

* Added bt nodes ports

* fixed typo

* Added <> to base names + some reformating

* added default_critic_namespaces param to dwb_local_planner

* Fix some parameters not being passed to getCurrentPose (open-navigation#1790)

Signed-off-by: ymd-stella <world.applepie@gmail.com>

* Add SLAM Toolbox and map_saver_server into launch-files (open-navigation#1768)

* Add SLAM launch file

Fix possible collision of laser scan with camera on waffle

* Simplifications and fixes after review

* Increase save_map_timeout to 5 sec to comply with SLAM Toolbox map rate

* BT navigator conversion fix (open-navigation#1793)

* include bt_conversions.hpp to convert input properly

Signed-off-by: Daisuke Sato <daisukes@cmu.edu>

* delete redundant include statement

Signed-off-by: Daisuke Sato <daisukes@cmu.edu>

* Add complete parameter description documentation (open-navigation#1786)

* adding a bunch of parameter descriptions

* ading costmap param descriptions

* add AMCL parameters

* adding DWB params

* resolving review questions

* include planner and controller ID parameters

* fixing jack's requests

* Test for lifecycle manager (open-navigation#1794)

* Add test

* Add more coverage

* Merge test header file with executable

* Address PR reviewer's comment

* Add some more coverage

* Revert accidental changes to localization_launch.py file.

* Update modified default_bt_xml_filename parameter (open-navigation#1797)

Parameter ``bt_xml_filename`` has changed to ``default_bt_xml_filename``

Co-authored-by: Aitor Miguel Blanco <aitormibl@gmail.com>
Co-authored-by: Shivang Patel <shivaang14@gmail.com>
Co-authored-by: Davide Faconti <davide.faconti@gmail.com>
Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
Co-authored-by: crthilakraj <crthilakraj@users.noreply.github.com>
Co-authored-by: chikmagalore.thilak <chikmagalore.thilak@bshg.com>
Co-authored-by: Ashwin Bose <ashwinbose123@gmail.com>
Co-authored-by: Alexey Merzlyakov <60094858+AlexeyMerzlyakov@users.noreply.github.com>
Co-authored-by: Shrijit Singh <shrijitsingh99@gmail.com>
Co-authored-by: p-vega <vega@enib.fr>
Co-authored-by: Ruffin <roxfoxpox@gmail.com>
Co-authored-by: Francisco Martín Rico <fmrico@gmail.com>
Co-authored-by: Sarthak Mittal <sarthakmittal2608@gmail.com>
Co-authored-by: Siddarth Gore <siddarth.gore@gmail.com>
Co-authored-by: Sarathkrishnan Ramesh <sarathkrishnan99@gmail.com>
Co-authored-by: Sean Yen <seanyen@microsoft.com>
Co-authored-by: Marwan Taher <marokhaled99@gmail.com>
Co-authored-by: TingChang <qting0529@hotmail.com>
Co-authored-by: Carl Delsey <1828778+cdelsey@users.noreply.github.com>
Co-authored-by: Jack Pien <jack@jackpien.com>
Co-authored-by: ymd-stella <world.applepie@gmail.com>
Co-authored-by: tgreier <tgreier@moog.com>
Co-authored-by: Daisuke Sato <43101027+daisukes@users.noreply.github.com>
Co-authored-by: ymd-stella <7959916+ymd-stella@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants