Fix zig-zaggin in smac planner due to discrete angular bin quantizations#3752
Fix zig-zaggin in smac planner due to discrete angular bin quantizations#3752SteveMacenski merged 16 commits intomainfrom
Conversation
|
Benchmarking: For previous changes to current changes in both the dubins and reeds-shepp models on the random benchmark map kindly provided by @jwallace42. No substantive changes needing optimization wrt either model Turning radius tests next to see how it scales with primitive numbers |
For different turning radius'. First set are normal, second set are with the addtl primitives set on. More or less all the same or not notably different worth additional optimization. Repeated for RS |
|
Thanks for the quick analysis! I think its due to me not updating this function yet (https://github.com/ros-planning/navigation2/blob/main/nav2_smac_planner/src/node_hybrid.cpp#L303) that was brought up in the ticket. I think because its not 0,1,2, we're penalizing it the most and also giving it the reversing penalty. I think that's why you see it happening sometimes (e.g. the graph shows occasional uses of the other bins) but not as regularly as it should be. I hope, at least :-) I'll work on that tomorrow, hopefully that will resolve the issue! I'll need to re-run the testing metrics above, but that's relatively straight forward. I appreciate your experimentation with the charts, it was illuminating! |
…es for enabling multi-primitive planning & accurate traversal cost functions
|
Traversal cost function updates made, but it involved some surgical changes so I'm going to be extremely careful in testing to make sure this still works as expected since it involved modifications that could be subtly error prone. I looked carefully over them and added a couple more unit tests to sanity check the actual traversal cost function, but since there were updates to the projections computation and how the data is propagated during search, its worth careful consideration. @stevedanomodolor please test again :-) |
|
With updates: I'm messing with costmap settings, so the actual values aren't really important. The comparison with the original method is the important part. (for 0.05, 0.4, 2.0 turning radii). I am seeing this use alot more search iterations (2x+) for some reason that I'm not totally sure about (even when the setting is off, I believe?) I need to do some looking into this. I'm testing right now by recompiling the current base branch and re-running some of my experiments to sanity check myself. I might just be gaslighting myself. Edit - the "off" mode is the same as the base branch, good to know. See #3172 (comment) and below for more performance discussion |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #3752 +/- ##
==========================================
+ Coverage 89.57% 90.39% +0.81%
==========================================
Files 411 411
Lines 17894 18003 +109
==========================================
+ Hits 16029 16274 +245
+ Misses 1865 1729 -136
☔ View full report in Codecov by Sentry. |
|
I performed some more tests based on the new changes, the behavior does not appear and the planner is able to use more of the bin space, although one thing to watch out for is the increment of planning time which make sense because we have increased the number of primitives used during the planning. With respect to planning time, when using the default minimum turning radius, 72 seems to be the optimal number of quantization bins. The results of the graphs are for 64, 72, 124, and 256 while the table includes more tests in between. ComparisionFigures64 bins no interpolation64 bins interpolation72 bins no interpolation72 bins interpolation124 bins no interpolation124 bins interpolation256 bins no interpolation256 bins interpolation |
|
Great thanks for the detail! |
…atic cost penalty functions
|
@stevedanomodolor see new changes adding the additional features which can be enabled using the parameters |
…ons (ros-navigation#3752) * adding intial prototype for smac hybrid-A* multiple primitives quantization interpolation * fixing unsigned int issue * cleaning up expansions log * fix primitives to be of equal dist * adding test for expansions getting * fixing tests from changes * adding a theoretical guardrail * updating Hybrid-A* to include directional information in the primitives for enabling multi-primitive planning & accurate traversal cost functions * moving Hybrid-A* specifics to template specialization * expand support for debug visualizations to State Lattice and 2D A*'s * fix some test oddities * dynamic parameters * remove unused variable * minor changes * adding options for downsampling obstacle heurisic and for using quadratic cost penalty functions * fixing unit tests
…ons (ros-navigation#3752) * adding intial prototype for smac hybrid-A* multiple primitives quantization interpolation * fixing unsigned int issue * cleaning up expansions log * fix primitives to be of equal dist * adding test for expansions getting * fixing tests from changes * adding a theoretical guardrail * updating Hybrid-A* to include directional information in the primitives for enabling multi-primitive planning & accurate traversal cost functions * moving Hybrid-A* specifics to template specialization * expand support for debug visualizations to State Lattice and 2D A*'s * fix some test oddities * dynamic parameters * remove unused variable * minor changes * adding options for downsampling obstacle heurisic and for using quadratic cost penalty functions * fixing unit tests Signed-off-by: enricosutera <enricosutera@outlook.com>
…ons (ros-navigation#3752) * adding intial prototype for smac hybrid-A* multiple primitives quantization interpolation * fixing unsigned int issue * cleaning up expansions log * fix primitives to be of equal dist * adding test for expansions getting * fixing tests from changes * adding a theoretical guardrail * updating Hybrid-A* to include directional information in the primitives for enabling multi-primitive planning & accurate traversal cost functions * moving Hybrid-A* specifics to template specialization * expand support for debug visualizations to State Lattice and 2D A*'s * fix some test oddities * dynamic parameters * remove unused variable * minor changes * adding options for downsampling obstacle heurisic and for using quadratic cost penalty functions * fixing unit tests
…ons (ros-navigation#3752) * adding intial prototype for smac hybrid-A* multiple primitives quantization interpolation * fixing unsigned int issue * cleaning up expansions log * fix primitives to be of equal dist * adding test for expansions getting * fixing tests from changes * adding a theoretical guardrail * updating Hybrid-A* to include directional information in the primitives for enabling multi-primitive planning & accurate traversal cost functions * moving Hybrid-A* specifics to template specialization * expand support for debug visualizations to State Lattice and 2D A*'s * fix some test oddities * dynamic parameters * remove unused variable * minor changes * adding options for downsampling obstacle heurisic and for using quadratic cost penalty functions * fixing unit tests
…ons (ros-navigation#3752) * adding intial prototype for smac hybrid-A* multiple primitives quantization interpolation * fixing unsigned int issue * cleaning up expansions log * fix primitives to be of equal dist * adding test for expansions getting * fixing tests from changes * adding a theoretical guardrail * updating Hybrid-A* to include directional information in the primitives for enabling multi-primitive planning & accurate traversal cost functions * moving Hybrid-A* specifics to template specialization * expand support for debug visualizations to State Lattice and 2D A*'s * fix some test oddities * dynamic parameters * remove unused variable * minor changes * adding options for downsampling obstacle heurisic and for using quadratic cost penalty functions * fixing unit tests (cherry picked from commit cf2ab03)





















Per #3172, we sometimes see zig-zagging behavior due to the discrete increments of angular quanitizations not fully utilizing the requested angular resolution. This issue is written out in detail in this comment: #3172 (comment)
This solves that by creating additional motion primitives to fill in the angular space for each expansion to hit every angular bin possible. As a result, keeping angular bin densities of 64/72 as previously utilized will create many more new primitives for certain configurations than previously. It may be wise to reduce your resolution to not create additional primitives that your application does not require.
TODO