Use footprint cost in CostCritic for scoring when available #5672
+30
−37
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.
Basic Info
Description of contribution in a few bullet points
Status Quo: in the CostCritic, the footprint cost is only used to for collision checking. For scoring trajectories we use the point cost only.
I'm not sure why this decision was made historically but I see no drawbacks of using the footprint cost instead when it's available. I'm saying "when it's available" because for optimization reasons, the footprint cost is not only calculated - it's only calculated when the point cost is >= possible_collision_cost. When the footprint cost is not available, this indirectly means that we are not close to an obstacle, the point cost will be used which is not as accurate but that's not so important given no collision-risk (and it's the current behavior anyway)
In my test, I found that as expected, using the footprint cost (when available) for scoring trajectories gives a more consistent distance to obstacles, since it's orientation-agnostic
Additionally, I added
&& !near_goaltoif (cost_for_scoring >= near_collision_cost_ && !near_goal)to be able to reach goals when their footprint cost is>= near_collision_cost_P.S: I removed the
inCollisionjust for code cleanliness, otherwise we would need to pass out of it whether we are using the point cost or the footprint cost. I'm open to refactoring propositionsDescription of documentation updates required from your changes
Description of how this change was tested
Future work that may be required in bullet points
For Maintainers:
backport-*.