nav2_waypoint_follower; Add an optional param to specify a sleep time…#1993
nav2_waypoint_follower; Add an optional param to specify a sleep time…#1993jediofgever wants to merge 6 commits intoros-navigation:foxy-develfrom jediofgever:foxy-devel
Conversation
… inbetween waypoints. Signed-off-by: jediofgever <fetulahatas1@gmail.com>
|
I targeted |
|
Hi, @jediofgever Did you passed the tests? I think that some code would not pass the linters... |
|
Hi @fmrico , I haven't really run tests. Could you elaborate more on how we can run tests locally ? |
|
@jediofgever you must target the |
SteveMacenski
left a comment
There was a problem hiding this comment.
Another option I was thinking over this afternoon was adding a plugin for processing.
So rather than just hardcoding the sleep, we could create a really simple pluginlib interface for the user to load a plugin to do some behavior.
For example:
- Plugin has an
initialize()and arun()function. Initialize will let the plugin setup any action / service / get parameters / etc for use. - Then once we reach a waypoint, we give that waypoint pose to the
run()function which can do whatever it likes. For this implementation, that plugin would just sleep forNseconds - For a more specific use-case (like taking a picture or waiting for external input) then it could call a service, action, or wait for an event to occur before continuing on.
This would allow for all of those types of behaviors and abstract out the specifics to a run-time loadable plugin.
|
Applied requested changes and , changed trageted branch in this commit jediofgever@2a6d1b1 I opened a new PR #1996 with modified changes but CI builds are failing, interestingly on the package that I modified. but from the log I see the error has appeared before I submitted #1996 I closed that #1996, I will open once the CI builds are back to normal. |
processing this information ... In my case, at each waypoint arrival, I had like call a action server which will notify user with QT pop-up, then depending on user's reaction, the robot will then proceed for the next waypoint. I was thinking of adding a generic action such as ;
Then again the implementation of the server side for this generic action will be depending on desired behavior. Going back to your comment;
I think that if it is decided that we add this |
|
Please do not open new PRs for the same topic. Add your commit to this branch / PR for review. Submitting a new PR for each new commit makes it impossible to track changes and spams subscribers unnecessarily that could work, but I think the plugin-based option is the most flexible. That way a user can make that "task" happen in the same process if they want, or call a remote server / action. Though having a defined message would make things easier for beginners since they wouldn't need to write any plugins. What do you think? I'm still leaning towards plugins. I think that's the most flexible and makes no assumptions about the users' needs. |
Hi @jediofgever To pass the tests, do a I checked in the CI details and I saw some style errors, like lines with spaces and |
my bad , I opened that PR because I targeted the wrong branch at first place, lets assume that PR never happened,I will add modified code into this PR. Agreed that a run time loadable plugin will address this in a clean way. I can work towards that. Edit related to plugin; |
Signed-off-by: jediofgever <fetulahatas1@gmail.com>
|
Yes, a simple plugin definition in Actually, move the plugin header definition into |
|
Applied the suggestions to the draft. I think the above commit is ready for a review. I hope to iterate through, in this week, I will take long break and might not be back quite soon. in addition to that I guess I would be able to add the parameter entries to https://github.com/ros-planning/navigation.ros.org |
|
Yes, for docs adding parameters to this repo's yaml and then the website's waypoint follower page. Additionally adding this to the website's migration guides & list in navigation plugins page. At some point (not part of this PR but hopefully if you're willing) a tutorial about how to create a custom plugin for their applications. |
There was a problem hiding this comment.
Really, really good first draft. I'm actually really impressed that you picked up on our plugin styling on your first PR in the project!
Just some stuff to clean up but overall I have no substantive issues.
Docs stuff: Yes, for docs adding parameters to this repo's yaml and then the website's waypoint follower page. Additionally adding this to the website's migration guides & adding to the list of navigation plugins. At some point (not part of this PR but hopefully if you're willing) a tutorial about how to create a custom plugin for their applications.
nav2_core/include/nav2_core/task_executor_at_waypoint_arrival.hpp
Outdated
Show resolved
Hide resolved
nav2_core/include/nav2_core/task_executor_at_waypoint_arrival.hpp
Outdated
Show resolved
Hide resolved
|
Thanks for the constructive feedback. I think I touched all the points on the requested changes. Please see above commit to make sure whether there is need for another iteration. jediofgever/navigation.ros.org@35b1e6e is I am willing to add the tutorial to website as we have all needed code/classes. |
SteveMacenski
left a comment
There was a problem hiding this comment.
Just some smaller clean up
nav2_waypoint_follower/include/nav2_waypoint_follower/plugins/wait_at_waypoint.hpp
Outdated
Show resolved
Hide resolved
| get_logger(), "Succeeded processing waypoint %i, processing waypoint task execution", | ||
| goal_index); | ||
| auto node = shared_from_this(); | ||
| waypoint_task_executor_->processAtWaypoint(goal->poses[goal_index], goal_index); |
There was a problem hiding this comment.
Oh here's a good idea, we should change this API so that processAtWaypoint can return a bool and we can check if its false to also treat it as a fail checking on stop_on_failure_ for whether to exit or continue to the next one
There was a problem hiding this comment.
nice idea, I changed the return type of processAtWaypoint to bool, but if the plugin is disabled or waypoint_pause_duration is set to zero, we will always have to return false from processAtWaypoint call, right ? that will make stop_on_failure_ to be depending on the plugin to be enabled and active, not sure if that is behavior we want ?
There was a problem hiding this comment.
If it fails to process & stop_on_failure_ is true, we should exit with failure.
I think maybe just not enabled returns true since its not a "failure", its just not turned on. The other option is that we make the default stopping time non-zero.
There was a problem hiding this comment.
I will address this after we confirm whether there will be a follow up PR
|
Also this PR needs to target On your docs branch:
|
sure but Followed your suggestions on docs branch and made another commit to address points. It will still need changes but priority now should be on how to merge this pull into To me it seems that, I will need to add the latest changes in this pull(which you have already reviewed) to my fork ( |
|
I don't know, but we do not accept new feature development to a targeted distribution, it must be in We also need that docs PR to be submitted as well before this can be merged. I want to make sure that we keep things up to date. |
|
@jediofgever any update? That last thing with stop on failure is the last thing (other than going to main) for merging this! |
|
sorry I was away for a local holiday. Will update here soon. |
|
No worries, enjoy your vacation 🌴 |
|
As much as I like the concept this PR introduces, isn't the whole idea of executing a behavior after reaching a waypoint better suited to be executed as part of the behavior tree? A very simple way of sleeping after reaching a waypoint with the current architecture would be by adding a |
doc/parameters/param_list.md
Outdated
| | stop_on_failure | true | Whether to fail action task if a single waypoint fails. If false, will continue to next waypoint. | | ||
| | loop_rate | 20 | Rate to check for results from current navigation task | | ||
| | waypoint_task_executor_plugin | `waypoint_task_executor` | Name of plugin to be loaded for executing waypoint tasks.| | ||
| | waypoint_task_executor_plugin | `WaitAtWaypoint` | Name of plugin to be loaded for executing waypoint tasks.| |
There was a problem hiding this comment.
@SteveMacenski, I think it is resolved here ? waypoint_task_executor==> WaitAtWaypoint
|
It seems hard to elegantly change target branch to main with current status, Edit; relevant PR for ==========================================================================================
It well could be, but to my understanding implementing the concept of this PR with BT could be an overkill(or misuse of BT). The rationale behind this for me is that; I have hard time to see |
Codecov Report
@@ Coverage Diff @@
## main #1993 +/- ##
===========================================
+ Coverage 69.39% 84.73% +15.33%
===========================================
Files 212 294 +82
Lines 10595 15056 +4461
===========================================
+ Hits 7352 12757 +5405
+ Misses 3243 2299 -944
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
That's one option, but sometimes that's overkill. Sometimes you just need a robot to follow some points and do something at each point, and in that case this could be a more streamline method. Plus if we wanted to add custom behavior to the WP follower this would be required, so I like the idea of making it a framework vs patching for every single possible thing someone might want to do at a waypoint for testing. I look at this and say "better is good". As long as we're wanting to have a basic WP follower node, we should make it the best WP follower node it can be. @jediofgever this PR has become somewhat of a mess, there's a ton of stuff in here that should not be in here from incorrect rebasing or conflicting branches. I'm not sure what you did, but please revert those changes. If you need to cherry pick your commits over to the main branch and reopen a new branch PR, that's fine too. |
Agreed, but no worries I will handle it |
…iours at waypoint arrivals when using nav2_waypoint_follower (#2015) * Add WaypointTaskExecutor plugin to main Signed-off-by: jediofgever <fetulahatas1@gmail.com> * couple result of task execution with stop_on_failure Signed-off-by: jediofgever <fetulahatas1@gmail.com> * add failed ids to it's vector * experimental change in nav2_waypoint_tester Signed-off-by: jediofgever <fetulahatas1@gmail.com> * remove unused code
…o define behaviours at waypoint arrivals when using nav2_waypoint_follower (ros-navigation#2015) * Add WaypointTaskExecutor plugin to main Signed-off-by: jediofgever <fetulahatas1@gmail.com> * couple result of task execution with stop_on_failure Signed-off-by: jediofgever <fetulahatas1@gmail.com> * add failed ids to it's vector * experimental change in nav2_waypoint_tester Signed-off-by: jediofgever <fetulahatas1@gmail.com> * remove unused code
…o define behaviours at waypoint arrivals when using nav2_waypoint_follower (ros-navigation#2015) * Add WaypointTaskExecutor plugin to main Signed-off-by: jediofgever <fetulahatas1@gmail.com> * couple result of task execution with stop_on_failure Signed-off-by: jediofgever <fetulahatas1@gmail.com> * add failed ids to it's vector * experimental change in nav2_waypoint_tester Signed-off-by: jediofgever <fetulahatas1@gmail.com> * remove unused code
ros-navigation#91) * nav2_waypoint_follower; add task executor plugin info. Signed-off-by: jediofgever <fetulahatas1@gmail.com> * waypoint task executor plugin; corrections on documentation and configuration Signed-off-by: jediofgever <fetulahatas1@gmail.com> * docs and info related to PR ros-navigation#1993, ready to review Signed-off-by: jediofgever <fetulahatas1@gmail.com>
Signed-off-by: jediofgever fetulahatas1@gmail.com
Basic Info
Description of contribution in a few bullet points
nav2_waypoint_follower, in order to control behavior of robot in between waypoints. This int parameter species an amount of time in seconds to wait/sleep after reaching each waypoint. The parameter could be set to zero if a continuous execution(or as in original implementation) of waypoints is desired.Description of documentation updates required from your changes
Future work that may be required in bullet points