-
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
Goalchecker path argument and plugin #4789
base: main
Are you sure you want to change the base?
Goalchecker path argument and plugin #4789
Conversation
Signed-off-by: Jonas Otto <[email protected]>
Signed-off-by: Joseph Duchesne <[email protected]>
…checking 3 goal checkers at once in a single method proved too unweildy. - Added tests for the new PathCompleteGoalChecker Signed-off-by: Joseph Duchesne <[email protected]>
@josephduchesne, your PR has failed to build. Please check CI outputs and resolve issues. |
Signed-off-by: Joseph Duchesne <[email protected]>
715a395
to
d90135e
Compare
@josephduchesne, your PR has failed to build. Please check CI outputs and resolve issues. |
Signed-off-by: Joseph Duchesne <[email protected]>
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.
A couple of followups:
- We should add in a new configuration guide page for this on docs.nav2.org. Also, a migration guide entry for the new feature!
- Is there a sensible reason why we shouldn't make this the default? I think we can update the nav2_params.yaml to always use this now & update the controller server's built-in default as well. This, I believe, is a globally better solution :-)
Generally though, this looks good to me
nav2_controller/include/nav2_controller/plugins/path_complete_goal_checker.hpp
Outdated
Show resolved
Hide resolved
nav2_controller/include/nav2_controller/plugins/path_complete_goal_checker.hpp
Outdated
Show resolved
Hide resolved
Will do.
I think this is a reasonable default. The only advantage that the existing built-in goal checkers have is that they require potentially far less math to check (which could be important on budget educational bots). I only made a new goal checker because that was what the original draft author had in his todo list :) I'll update the default in the PR. |
Signed-off-by: Joseph Duchesne <[email protected]>
I keep thinking that there is probably a way to use |
Signed-off-by: Joseph Duchesne <[email protected]>
… threshold rather than pose count. Extended tests. Signed-off-by: Joseph Duchesne <[email protected]>
Signed-off-by: Joseph Duchesne <[email protected]>
Signed-off-by: Joseph Duchesne <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
|
* @class PathCompleteGoalChecker | ||
* @brief Goal Checker plugin that checks position delta, once path is shorter than a threshold. | ||
* | ||
* |
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.
Remove the extra 2 lines :-)
node->get_parameter(plugin_name + ".path_length_tolerance", path_length_tolerance_); | ||
|
||
// Replace SimpleGoalChecker's callback for dynamic parameters | ||
node->remove_on_set_parameters_callback(dyn_params_handler_.get()); |
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.
Why remove? I think we can add another so that we can manipulate both the path length here and the dynamic parameters there as well
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.
Good point, that's simpler. Will do.
{ | ||
using nav2_util::geometry_utils::is_path_longer_than_length; | ||
|
||
if (is_path_longer_than_length(path, path_length_tolerance_)) { |
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 think the problem here is that if the path is not updated regularly (i.e. we plan once on start and only replan if there's a problem rather than at a fixed frequency), this would not work. We actually have logic in the Controller's path handlers to account for this by finding the robot's closest point on a path within a local window size of the path and storing that as our robot's "new starting point" to prune all points prior to. Then as we iterate, that is dynamically updated. As long as the search window is larger than the greatest distance a robot can move within the control frequency plus some margin, then it works on an iterative basis.
I agree this would work fine enough though for the case that we update the path on a regular frequency as long as the tolerance is sufficiently generous.
I think it would make sense to implement the same kind of logic here, no? If so, I think we should create a nav2_util
function that does this path handling that we use here. Then, we can replace the copy-pasted version of that in all the controllers with a common util so they all behave the same! That would be a great architectural contribution
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'll see what I can do :)
This is a continuation of work started by @ottojo in draft PR #4593
I'll quote their introduction and, expand a bit afterwards, and update any fields that have changed.
I've cherry-picked @ottojo 's commit on top of the latest main branch, then added a new basic goal checker PathCompleteGoalChecker, which is a subclass of SimpleGoalChecker, but has an additional parameter (path_length_tolerance, default=1), and checks that the current path has <= path_length_tolerance waypoints before allowing the normal SimpleGoalChecker completion logic to take its course.
The result is a trivial extension of SimpleGoalChecker that should be immune to the current_pose = goal_pose short-circuit problem/bug. Rather than try to create an elaborate unit test that navigates a course, I stuck to first principles to ensure that the new plugin behaves the same as SimpleGoalChecker with <= path_length_tolerance waypoints, and that it does not complete with > path_length_tolerance waypoints.
Basic Info
Description of contribution in a few bullet points
GoalChecker::isGoalReached
interface with argument for current pathDescription of documentation updates required from your changes
Future work that may be required in bullet points
For Maintainers: