Fix emergency stop logic for sending stop primitives - #3812
Merged
williamckha merged 10 commits intoJun 30, 2026
Conversation
nycrat
requested review from
Andrewyx,
sauravbanna and
williamckha
as code owners
June 26, 2026 04:14
sauravbanna
previously approved these changes
Jun 26, 2026
sauravbanna
left a comment
Contributor
There was a problem hiding this comment.
good catch, thank you!
nycrat
commented
Jun 26, 2026
Comment on lines
-44
to
-47
| self.estop_mode = estop_mode | ||
|
|
||
| self.estop_path = estop_path | ||
| self.estop_buadrate = estop_baudrate |
Member
Author
There was a problem hiding this comment.
fixing old unrelated code: these lines were duplicated later on, literally did nothing
nycrat
commented
Jun 26, 2026
Comment on lines
-61
to
-63
| # static map of robot id to stop primitive | ||
| self.robot_stop_primitives_map: dict[int, StopPrimitive] = {} | ||
|
|
Member
Author
There was a problem hiding this comment.
fixing old unrelated code: this map is assigned to but never used, literally did nothing
nycrat
commented
Jun 26, 2026
Comment on lines
-79
to
-81
| # dynamic map of robot id to the individual control mode | ||
| self.robot_control_mode_map: dict[int, IndividualRobotMode] = {} | ||
|
|
Member
Author
There was a problem hiding this comment.
fixing old unrelated code: these lines were duplicated later on, literally did nothing
nycrat
commented
Jun 26, 2026
| # load control mode map with default values | ||
| for robot_id in range(MAX_ROBOT_IDS_PER_SIDE): | ||
| self.robot_control_mode_map[robot_id] = IndividualRobotMode.NONE | ||
| self.robot_stop_primitives_map[robot_id] = Primitive(stop=StopPrimitive()) |
Member
Author
There was a problem hiding this comment.
fixing old unrelated code: this map is assigned to but never used, literally did nothing
williamckha
previously approved these changes
Jun 28, 2026
williamckha
approved these changes
Jun 30, 2026
suchirss
self-requested a review
June 30, 2026 01:45
suchirss
approved these changes
Jun 30, 2026
StarrryNight
approved these changes
Jun 30, 2026
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 PR fixes the estop logic so that stop primitives are actually sent to all robots when the estop is set to stop. Previously, there was a method that guarded against primitives being sent when estop is stopped, however, this logic also prevented stop primitives from being sent. I have observed the robot speeding up for half a second after the estop was pressed, and that was because stop primitives weren't being sent and the robot only stops as a result of the time-out on thunderloop. This PR fixes this.
Testing Done
Screen.Recording.2026-06-26.at.00.36.48.mov
Resolved Issues
Length Justification and Key Files to Review
N/A
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