-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Remove redundant collision checks in the Smac Planners to optimize performance #4857
Conversation
Signed-off-by: Steve Macenski <[email protected]>
Signed-off-by: Steve Macenski <[email protected]>
Signed-off-by: Steve Macenski <[email protected]>
Signed-off-by: Steve Macenski <[email protected]>
Signed-off-by: Steve Macenski <[email protected]>
Signed-off-by: Steve Macenski <[email protected]>
Signed-off-by: Steve Macenski <[email protected]>
Signed-off-by: Steve Macenski <[email protected]>
Metrics - using the Nav2 Configuration Guide params and square footprint. Only changes are to enable reeds-shepp and reversing lattice models and primitive interpoliation for worse case, best quality paths.
OG - Circular Footprint
OG - Square Footprint
New - Circular footprint
New - Square Footprint
Appears to be faster for Circular cases (likely due to stopping re-checks), but slower for non-circular footprints - which was the intent of this work. Further investigation is required, there may be a bug or unexpected performance change. Perhaps worth trying to see if the (a) coarse-to-fine is the problem or the (b) caching of collision states for returning -- and if one or the other is sensible to merge while I work on the other. I'm thinking there's a bug somewhere that fine checks are happening more than they should, its related to cache misses for bringing the costmap back into the equation, static/inlining of functions. |
Updated new - Circular:
Updated new - Square:
Reduced to only remove redundant checking without coarse-to-fine update. Improvement: 2D - 7.5-15%. Hybrid: 13-15%. Lattice: 12-13%. That's a pretty nice imrpovement! |
Signed-off-by: Steve Macenski <[email protected]>
Codecov ReportAttention: Patch coverage is
|
…rformance (#4857) * initial prototype to resolve smac planner issue Signed-off-by: Steve Macenski <[email protected]> * fix test Signed-off-by: Steve Macenski <[email protected]> * initial prototype for coarse to fine checking for smac: incomplete Signed-off-by: Steve Macenski <[email protected]> * completed initial prototype; for testing and benchmarking now Signed-off-by: Steve Macenski <[email protected]> * fix typo Signed-off-by: Steve Macenski <[email protected]> * adding bounds checking for coarse Signed-off-by: Steve Macenski <[email protected]> * fix test Signed-off-by: Steve Macenski <[email protected]> * remove coarse to fine checks Signed-off-by: Steve Macenski <[email protected]> --------- Signed-off-by: Steve Macenski <[email protected]> (cherry picked from commit 5ff8cc7)
…rformance (#4857) (#4858) * initial prototype to resolve smac planner issue Signed-off-by: Steve Macenski <[email protected]> * fix test Signed-off-by: Steve Macenski <[email protected]> * initial prototype for coarse to fine checking for smac: incomplete Signed-off-by: Steve Macenski <[email protected]> * completed initial prototype; for testing and benchmarking now Signed-off-by: Steve Macenski <[email protected]> * fix typo Signed-off-by: Steve Macenski <[email protected]> * adding bounds checking for coarse Signed-off-by: Steve Macenski <[email protected]> * fix test Signed-off-by: Steve Macenski <[email protected]> * remove coarse to fine checks Signed-off-by: Steve Macenski <[email protected]> --------- Signed-off-by: Steve Macenski <[email protected]> (cherry picked from commit 5ff8cc7) Co-authored-by: Steve Macenski <[email protected]>
…rformance (ros-navigation#4857) * initial prototype to resolve smac planner issue Signed-off-by: Steve Macenski <[email protected]> * fix test Signed-off-by: Steve Macenski <[email protected]> * initial prototype for coarse to fine checking for smac: incomplete Signed-off-by: Steve Macenski <[email protected]> * completed initial prototype; for testing and benchmarking now Signed-off-by: Steve Macenski <[email protected]> * fix typo Signed-off-by: Steve Macenski <[email protected]> * adding bounds checking for coarse Signed-off-by: Steve Macenski <[email protected]> * fix test Signed-off-by: Steve Macenski <[email protected]> * remove coarse to fine checks Signed-off-by: Steve Macenski <[email protected]> --------- Signed-off-by: Steve Macenski <[email protected]> Signed-off-by: RBT22 <[email protected]>
This PR introduces a coarse-to-fine collision checking method in Smac Planners.It checks coarsely for node collision when expanded to know if the node is clearly in collision with obstacles by checking its center point for SE2 footprints only (same behavior for circular / radius defined robots). If we're valid, then we queue the node for expansion. Once expanded, then we check the node for collision finely by checking the full SE2 footprint.This reduces substantial numbers of full SE2 footprint checks for non-circular robots while also leaving the behavior for circular robots the same.Edit: removed. These did not speed up performance due to cache misses by moving costmap checks into the main loop in the middle of other operations rather than batch processing them.
Additionally, I store the collision checker's state so that additional queuing of nodes will prevent unnecessary re-checking of collision states. For fine checks, it shouldn't be redone since we only visit nodes once, but it can reduce point-checks in coarse collision checking in dense expansion trees.
TODO: