Remove redundant collision checks in the Smac Planners to optimize performance (backport #4857) #4858
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
This is an automatic backport of pull request Remove redundant collision checks in the Smac Planners to optimize performance #4857 done by Mergify.