Creating stop primitive before unavoidable collisions #3590
Open
StarrryNight wants to merge 19 commits intoUBC-Thunderbots:masterfrom
Open
Creating stop primitive before unavoidable collisions #3590StarrryNight wants to merge 19 commits intoUBC-Thunderbots:masterfrom
StarrryNight wants to merge 19 commits intoUBC-Thunderbots:masterfrom
Conversation
This reverts commit ddea16f.
I have no idea why the CI just removes this automatically... I didn't change anything requirement-related
williamckha
previously approved these changes
Feb 7, 2026
Comment on lines
35
to
37
| // The time and obstacle at which the trajectory first collides with an | ||
| // obstacle first_collision_time_s is set to infinity and colliding_obstacle is | ||
| // nullptr if the trajectory does not collide. |
Member
There was a problem hiding this comment.
Nit: nullopt (which is what is being returned) is different from nullptr
Comment on lines
8
to
10
| const double UNAVOIDABLE_COLLISION_TIME_THRESHOLD = 0.2f; | ||
| // Tune | ||
| const double UNAVOIDABLE_COLLISION_VELOCITY_THRESHOLD = 0.5f; |
Member
There was a problem hiding this comment.
Tag a TODO (#xxxx): tune collision threshold constants comment with issue number
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.
Description
This ticket resolve #3587, which is a sub-issue of #2896.
MovePrimitive now return a StopPrimitive if there's an unavoidable collision with a high velocity under a certain time threshold.
Time threshold: time until collision happens. Currently set to 0.2s.
Velocity threshold: Minimum velocity of robot to be considered "high velocity". Currently set to 2.0m/s.
Thresholds can be fine-tuned.
Testing Done
Tested by running thunderscope and logging when unavoidable collisions in a high speed is triggered.
Resolved Issues
Length Justification and Key Files to Review
Review Checklist
It is the reviewers responsibility to also make sure every item here has been covered
.hfile) should have a javadoc style comment at the start of them. For examples, see the functions defined inthunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.TODO(or similar) statements should either be completed or associated with a github issue