Fix/path smoothing robot radius#1231
Merged
AtsushiSakai merged 2 commits intoAtsushiSakai:masterfrom Jun 20, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR ensures the path smoothing routine respects the robot’s radius by updating collision checks and adding a safety-focused unit test.
- Expanded line_collision_check to sample finite-length segments and inflate obstacles by robot_radius.
- Updated path_smoothing to pass robot_radius into collision checks.
- Added a new test verifying no smoothed path point encroaches on obstacles.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/test_rrt_with_pathsmoothing_radius.py | New test ensuring smoothed path maintains clearance. |
| PathPlanning/RRT/rrt_with_pathsmoothing.py | Modified collision logic and updated function calls. |
Comments suppressed due to low confidence (2)
tests/test_rrt_with_pathsmoothing_radius.py:43
- [nitpick] Using a strict '>' may fail when a point lies exactly at the clearance boundary. Consider using '>=' if touching the safety radius is acceptable or adjust the test to account for floating-point tolerances.
assert d > min_safe_dist, \
PathPlanning/RRT/rrt_with_pathsmoothing.py:76
- [nitpick] The variable 'size' represents an obstacle radius. Rename it to 'obs_radius' or 'radius' for clearer semantics.
for (ox, oy, size) in obstacle_list:
AtsushiSakai
requested changes
Jun 15, 2025
Owner
AtsushiSakai
left a comment
There was a problem hiding this comment.
Thank you for great PR!!. I have some small comments. PTAL.
df9cdad to
f57fb4f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reference issue
Fixes path smoothing safety issue discussed in Bug: path_smoothing() Ignores robot_radius, Causing Smoothed Paths to Violate Obstacle Clearance #1230
What does this implement/fix?
This PR fixes an issue in the
path_smoothing()function, where the collision checking vialine_collision_check()did not takerobot_radiusinto account correctly. This caused the smoothed path to pass dangerously close to obstacles.line_collision_check()to check collision along finite-length line segments and incorporaterobot_radius.path_smoothing()logic to use this corrected check.Additional information
CheckList