Skip to content

(#108) Add tilt and freefall detection for ignoring bump odometry#109

Open
aidnem wants to merge 8 commits intomainfrom
108-fix-bump-odometry
Open

(#108) Add tilt and freefall detection for ignoring bump odometry#109
aidnem wants to merge 8 commits intomainfrom
108-fix-bump-odometry

Conversation

@aidnem
Copy link
Contributor

@aidnem aidnem commented Mar 10, 2026

No description provided.

@aidnem aidnem linked an issue Mar 10, 2026 that may be closed by this pull request
3 tasks
@aidnem aidnem requested a review from Copilot March 10, 2026 12:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@aidnem aidnem requested a review from godmar March 10, 2026 17:05
@aidnem
Copy link
Contributor Author

aidnem commented Mar 10, 2026

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.

Copy link
Contributor

@godmar godmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please clarify these two items

@aidnem aidnem requested a review from godmar March 10, 2026 19:44
Copy link
Contributor

@godmar godmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What were the update frequencies for pitch etc. prior to this change?

@aidnem
Copy link
Contributor Author

aidnem commented Mar 10, 2026

The signals weren't used so they were run at 4 hz I guess.

@aidnem
Copy link
Contributor Author

aidnem commented Mar 11, 2026

This seemed to make vision worse.

@aidnem aidnem added the reference These PRs have reference changes (usually AI-authored) that probably won't merge label Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reference These PRs have reference changes (usually AI-authored) that probably won't merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix odometry over the bump

3 participants