You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When we enable in auto, the pose will inexplicably jump to a random position. It can be off field or on.
I haven't seen it do this any other time than when we start an auto. We have a detection routine in our code where it will stop the auto if it is off field. I don't know if we've seen this behavior at comp, just at home.
Additional context
I have implemented a workaround in the code to handle this situation. When I detect that the pose is off by more than 0.1m (arbitrarily) from the last known pose, I re-run the pose-estimator update after resetting the pose to last known. I've seen this behavior when connected over AP, tethered, and in debug mode.
Our pose estimator is in YAGSL code and we are using a copy of the library instead of the vendordep.
The log output I'm getting doesn't seem to have anything off. Encoders haven't moved on the swerve modules. Yaw is basically 0.
https://github.com/FRC5010/Reefscape2025/blob/main/TigerShark2025/src/main/java/swervelib/SwerveDrive.java:1160
Rotation2d yaw = getYaw();
// The normal update
swerveDrivePoseEstimator.update(yaw, getModulePositions());
// Check that the pose hasn't jumped
Pose2d currentPose = swerveDrivePoseEstimator.getEstimatedPosition();
if (lastPoseEstimate != null) {
double distance = Math.abs(lastPoseEstimate.getTranslation().getDistance(currentPose.getTranslation()));
// If we are enabled and a big jump occurs, reset the pose and try again
if(distance > 0.1 && DriverStation.isEnabled()) {
DriverStation.reportError("Pose error: Distance " + distance + " Yaw " + yaw + " Last Pose " + lastPoseEstimate + " to " + currentPose, false);
Arrays.stream(getModulePositions()).forEach(it -> DriverStation.reportError("Pose error: Module " + it , false));
// Reset the pose and try again
swerveDrivePoseEstimator.resetPose(lastPoseEstimate);
currentPose = swerveDrivePoseEstimator.update(yaw, getModulePositions());
distance = Math.abs(lastPoseEstimate.getTranslation().getDistance(currentPose.getTranslation()));
if(distance > 0.1) {
DriverStation.reportError("Pose error: Nope that didn't help", false);
} else {
DriverStation.reportError("Pose error: Reset pose to last known", false);
}
}
}
// Store the last known good pose
lastPoseEstimate = currentPose;
The text was updated successfully, but these errors were encountered:
Additional context, we were working on odometry calibration and using only odometry to run autos, so no vision inputs are being given. We tried breakpoints at various places where the pose gets reset and not seeing anything reset the pose unexpectedly. We are using PathPlanner's path-generation on-the-fly to create the path, so we are not seeing it set pose to the start of an auto-path.
Figured this out. We have code from way back that zeros our drive train encoders. This caused the pose estimator to register a change in pose that would be relative to how our robot moved prior to starting auto.
Describe the bug
When we enable in auto, the pose will inexplicably jump to a random position. It can be off field or on.
I haven't seen it do this any other time than when we start an auto. We have a detection routine in our code where it will stop the auto if it is off field. I don't know if we've seen this behavior at comp, just at home.
To Reproduce
Steps to reproduce the behavior:
https://github.com/FRC5010/Reefscape2025/tree/main/TigerShark2025
Expected behavior
The pose will not jump to a random place in auto, but remain where it is set.
Screenshots
Desktop (please complete the following information):
Project Version: 2025.3.1
VS Code Version: 1.96.2
WPILib Extension Version: 2025.3.1
C++ Extension Version: 1.23.2
Java Extension Version: 1.38.0
Java Debug Extension Version: 0.58.1
Java Dependencies Extension Version 0.24.1
Java Version: 17
Java Location: C:\Users\Public\wpilib\2025\jdk
Vendor Libraries:
ChoreoLib (2025.0.3)
maplesim (0.3.9)
PathplannerLib (2025.2.3)
CTRE-Phoenix (v5) (5.35.1)
CTRE-Phoenix (v6) (25.2.2)
photonlib (v2025.1.1)
ReduxLib (2025.0.1)
REVLib (2025.0.2)
Studica (2025.0.1)
ThriftyLib (2025.0.2)
WPILib-New-Commands (1.0.0)
Additional context
I have implemented a workaround in the code to handle this situation. When I detect that the pose is off by more than 0.1m (arbitrarily) from the last known pose, I re-run the pose-estimator update after resetting the pose to last known. I've seen this behavior when connected over AP, tethered, and in debug mode.
Our pose estimator is in YAGSL code and we are using a copy of the library instead of the vendordep.
The log output I'm getting doesn't seem to have anything off. Encoders haven't moved on the swerve modules. Yaw is basically 0.
The text was updated successfully, but these errors were encountered: