Closed wilcobonestroo closed 2 years ago
This is nav through poses, not waypoint follower. The waypoint follower won't have all those paths set up to have awareness of that loop on the global scale.
See https://github.com/ros-planning/navigation2/issues/2622 where this was discussed at length and we added fixes for how the controllers use that information. It looks like that work was applied to DWB, but check the linked PRs and let me know if we missed something there. Have you tested with RPP? That one was the main testing ground for that work so that should work properly as a baseline.
This is largely dependent on how the controllers handle the path inputs, rather than being an artifact of the rest of the stack / nav through poses.
It is indeed the same issue as #2622. I will have a try with RPP.
Well it should work with DWB too, so if you find it works with RPP and not DWB, that's worth opening the ticket again for and seeing what we missed when we ported the work from RPP to DWB.
I'm not sure is it good to leave comment here.
I'm currently facing the same issue of intersecting path, and I'm using released branch of 1.1.12 , RPP controller and Smac Hybrid-A* Planner.
most of the time, robot will suddenly track the end part of path at intersection of path as video below:
https://github.com/ros-navigation/navigation2/assets/48769492/e6b6f508-37a4-44bd-a17e-83f836a9f6b7
due to the RPP controller is using function: nav2_util::geometry_utils::min_by
to find the closest pose on the path, i tried to modify some code from /geometry_utils.hpp
the result is good to me, and here is the result video:
https://github.com/ros-navigation/navigation2/assets/48769492/a90b6448-fe86-4612-a564-355c8f943aa0
https://github.com/ros-navigation/navigation2/assets/48769492/bd3ae864-0d51-4568-9a18-e61e174df8ab
the code i changed is shown below: added new min_by function for RPP:
the idea is came from #2622 from @SteveMacenski , and the few assumption i made is:
however, in case of given a static path and robot position off the path, where robot is closer to reset part of path, it will change the tracking path to the reset part of path as video below:
https://github.com/ros-navigation/navigation2/assets/48769492/00917bcc-a3ce-422d-8d76-f61b6014d727
i believe this result is acceptable and if robot off the path, it should replan the path.
My concern there is the hyper parameter of map resolution - is this quantity really handled by the map resolution? I think as you showed, the point it selected wasn't within the same cell. Because the robot didn't exactly follow the path, it was slightly closer to the other cell. That distance of path tracking error could be small/large depending on the algorithm or the choice of parameters. I don't think its proportionate to the map resolution - though I can see how that's an improvement for the particular situation you point to in this constrained environment.
We introduce the max_robot_pose_search_dist
for this reason to limit the maximum distance in the future to search for the closest point. What value do you have for that? Perhaps that should be reduced so that you don't search unnecessarily far into the future. By default we have it set to the costmap's window size / 2 (https://github.com/ros-navigation/navigation2/blob/main/nav2_regulated_pure_pursuit_controller/src/parameter_handler.cpp#L94), but that can/should be reduced for any given application. By default, we wanted to set it to the highest theoretical needed for robot motion for higher speed applications. You're no where near those speeds where the robot might hit the edge of the local costmap during a control cycle, so you can reduce that significantly which would negate these issues. Try something like 1m and you should be good to go. You just need to make sure its larger than the max speed * control rate + some margin.
Thank you for your reply, it inspired me to solve my problem in a different way.
As you mention:
That distance of path tracking error could be small/large depending on the algorithm or the choice of parameters.
I really agree with that, because my assumption is based on perfect controller with no error, and it will be hard to find a reasonable value when it comes error..
But after you point to max_robot_pose_search_dist
, i start wondering if there was any good method to find a boundary of path that interested me. Then i tried to find a path without fallback for closest_pose_upper_bound
Here is the thing i tried:
I created a parameter robot_pose_search_fallback_tolerance
for checking upper bound of path that won't have fallback part, and robot_pose_search_fallback_tolerance
should greater than or equal to xy_tolerance.
and I added a new function of first_after_integrated_distance_without_fallback
:
The results shown below are even better than the results I showed earlier.
https://github.com/ros-navigation/navigation2/assets/48769492/a04b6234-2934-40ee-aceb-63c4587d345f
https://github.com/ros-navigation/navigation2/assets/48769492/d506fd85-e46b-4354-82ce-922552f08627
If you have any other concern or suggestion please let me know.
I don't fully understand the fallback bit, why is that necessary if you set the max search distance appropriately for your application? What does that add in addition that makes it more robust? I certainly don't mind modifications / improvements, but I don't immediately see
yes, you're right!!!
If I set the maximum search distance appropriately, the behavior is what I expect and I don't need to modify anything.
max_robot_pose_search_dist
solved my problem.
thanks for your help.
Bug report
Steps to reproduce issue
I started the default setup using the following commands:
I gave the initial pose estimation. Then I clicked
Waypoint / Nav through Poses
button. I entered some waypoints that include a loop or crossing. When the robot gets at the intersection, it starts rotating.Expected behavior
The robot should follow the path, going through waypoint 1, 2, etc.
Actual behavior
The robot gets stuck at the intersection. The console shows the following errors:
Sometimes I also get these.
It keeps doing this for a while and then gives up.
Additional information