-
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
[SmacPlanner2D] Unintuitive plan when away from obstacles #2913
Comments
Even without the costs, that is odd. Though, as part of the README I make pretty clear everything in Smac requires a potential field to be applied, it is important. If there is no cost, then the cost multiplier is irrelevant so all moves have a simple cost of 1 (or sqrt2). But that doesn't explain / excuse that laughable behavior. If you can provide me with a minimum example (map, costmap settings, etc) and starting / goal poses you see this happen in, I can take a look. Looking over the code, I have a couple of places I'm suspicious about that I meant to update long ago and simply slipped my mind since the 2D planner was mostly just a toy example to show that things were working while building up the Hybrid-A* / State Lattice capabilities. If you wanted to yourself if that's faster, they're all small but based on updates made to the other complimentary planners:
|
Thanks for your detailed answer, I am slowly looking into all that. |
Via https://github.com/ros-planning/navigation2/blob/main/nav2_system_tests/src/planning/test_planner_random_node.cpp which has its map set in https://github.com/ros-planning/navigation2/blob/bcc9aff6bd0e60f6f887cde91b8d2f23f6a1dfa9/nav2_system_tests/src/planning/CMakeLists.txt#L46 which is set to https://github.com/ros-planning/navigation2/blob/bcc9aff6bd0e60f6f887cde91b8d2f23f6a1dfa9/nav2_system_tests/maps/map.pgm which is the map generated. I'm not entirely sure where the code that was used to overlay the points on the map was done, that was probably done offline just for the purposes of visual demonstration of what was happening under the hood. |
I'm fairly certain that the top 3 comments on my bulleted list will take care of the issue you mention for Smac2D. The heuristic would explain alot. For the thing you show with NavFn, It uses the Navigation Function 2 for expanding the potential field which is smooth, but the backtracing is done seperately which can sometimes do odd things, usually towards the end of paths. Given this is only a binary field, not a costmap, there are a couple of odd "squiggles" but they're only as they're going up to / against hard walls at the start/end of goal so that is probably OK overall. Navfn has been around essentially since the start of ROS Navigation and the codebase is relatively complex, I don't think it would be wise to make changes to it based on a benchmarking test if in practice we don't have issue with it when there is a potential field due to inflation. You didn't seem to have an issue with it before now ;-) so I wouldn't argue with it. |
Any update? |
Slow progress because of other parallel tasks, but I am currently rewriting a test process directly interacting with the planner_server through its action (and with standard costmap with inflation) |
I'm not sure what I should be pulling exactly from those images, but always nice to see things visualized! I would still say that my bulleted changes to 2D are probably what you want to fix the behavior you mentioned |
Just for showing the difference between the planners and some weird paths with Smac2D. I ll investigate more and report here when I ll have a a bit of time. |
Is there a couple paths in particular in Smac 2D that you think are odd? At first glance, I'm not sure which you mean. |
@doisyg I went ahead and made the changes I outlined in the comment. See https://github.com/ros-planning/navigation2/tree/smac_fix2 Let me know if this fixes your issues / comments. I can open a PR and merge it. I didn't make costmap downsampling to 2d default but that does give a nice 75% speed up if speed is a concern. |
Thx, I ll try ASAP and report |
Any thoughts / updates? |
Review and test on a real platform planned for the end of the month |
@doisyg we did some testing (see images in the PR) and I strongly believe this fixes your reported issue, but happy to reopen if it does not fully resolve what you're seeing |
Great! Sorry about opening the discussion without having the time nor the resources to further investigate it soon enough. I will try to report my conclusions on these changes at some point though. |
Bug report
Required Info:
Steps to reproduce issue
Plan with the following parameters
Expected behavior
Shorter path when there is no cost constraint
Actual behavior
Non straight path when there is no cost constraint
For instance:
Additional information
The text was updated successfully, but these errors were encountered: