add vision pose ambiguity scalar#130
Conversation
- change robot RotationSupplier to SwerveDriveState for access to heading + speed - add isFront boolean, sets true for front cameras - multiply stdDev matrices by dynamic matrixScalar dependent on robot speed :)
🤖 Augment PR SummarySummary: This PR adjusts vision measurement confidence based on robot speed to reduce trust in front-camera pose estimates while driving quickly. Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
| m_robotSwerveStateSupplier = robotSwerveStateSupplier; | ||
|
|
||
| // boolean that stores camera location | ||
| if (m_cameraName.indexOf("front") == -1) { |
There was a problem hiding this comment.
LocalizationCamera.java:64 — Determining m_isFront by substring-matching the camera name ("front") is brittle and can silently disable this behavior for robots whose front camera names don’t follow that convention (e.g., CAMERA*_NAME values like "camera3"). Consider making the “front vs back” classification explicit via constants/config rather than inferred from the name.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
shouldnt be a problem bc we have a naming convention!
| } | ||
|
|
||
| // if camera is in front and robot is above max velocity, update matrixScalar | ||
| double linearRobotSpeed = Math.hypot(m_robotSwerveStateSupplier.get().Speeds.vxMetersPerSecond, |
There was a problem hiding this comment.
LocalizationCamera.java:304 — This assumes m_robotSwerveStateSupplier.get() always returns a fully-populated SwerveDriveState with non-null Pose/Speeds; if either is null (or changes between calls) this can throw or compute speed/heading inconsistently. It’d be safer to grab one snapshot of the state per update and ensure the fields you read are valid before using them.
Severity: medium
Other Locations
src/main/java/frc/robot/subsystems/vision/LocalizationCamera.java:244
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
amzoeee
left a comment
There was a problem hiding this comment.
see comments in slack re: accel and vel checks
add vision pose ambiguity scalar for front cameras when we're moving fast