(#108) Add tilt and freefall detection for ignoring bump odometry#109
(#108) Add tilt and freefall detection for ignoring bump odometry#109
Conversation
There was a problem hiding this comment.
Pull request overview
Adds gyro-derived tilt and vertical acceleration inputs to detect “bump/freefall” conditions and temporarily shift pose-estimation trust toward vision measurements to avoid odometry spikes.
Changes:
- Expose pitch/roll and Z acceleration from the Pigeon2 gyro IO into
GyroIOInputs. - Detect “bump” conditions in
Drive.periodic()using configurable tilt/accel thresholds with a falling-edge debouncer window. - When a bump is detected, adjust vision measurement standard deviations before feeding them into the pose estimator.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/main/java/frc/robot/subsystems/drive/GyroIOPigeon2.java |
Adds pitch/roll/Z-accel status signals and publishes them into GyroIOInputs. |
src/main/java/frc/robot/subsystems/drive/GyroIO.java |
Extends GyroIOInputs with pitch/roll (radians) and Z acceleration. |
src/main/java/frc/robot/subsystems/drive/Drive.java |
Implements bump detection and modifies vision weighting during bumps. |
src/main/java/frc/robot/constants/drive/DriveConstants.java |
Adds tunable constants for bump-detection thresholds and debounce duration. |
src/main/deploy/constants/test_drivebase/DriveConstants.json |
Wires new bump-related constants into the test constants set. |
src/main/deploy/constants/comp/DriveConstants.json |
Wires new bump-related constants into the comp constants set. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
…iations of vision estimate
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
I suggest that we set all of these thresholds to be massive numbers that we will never reach to begin testing. Then, we drive around the field a lot (push the robot pretty hard) and take the maximum numbers that we see for any of our metrics. Next, drive over the bump to see the kind of numbers that we see there. Perhaps we could drive as gently as possible to see what are the lowest deviances in these values that we will ever see while still going over the bump. Hopefully, there will be a clear difference between the most gentle bump driving and the most aggressive flat ground driving. We can split that difference somewhere (probably bias toward the low end so that if we get tipped up by heavy defense, these protections kick in as well) and then test whether our pose estimate is more resilient to driving over the bump very aggressively. |
godmar
left a comment
There was a problem hiding this comment.
Please clarify these two items
godmar
left a comment
There was a problem hiding this comment.
What were the update frequencies for pitch etc. prior to this change?
|
The signals weren't used so they were run at 4 hz I guess. |
|
This seemed to make vision worse. |
No description provided.