Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pose estimator doesn't work after vision is lost #50

Open
varshil3009 opened this issue Jan 9, 2025 · 1 comment
Open

Pose estimator doesn't work after vision is lost #50

varshil3009 opened this issue Jan 9, 2025 · 1 comment

Comments

@varshil3009
Copy link

when you are taking the value from the April tag the getState().pose gets updated but once the april tag is not in the view , the robot shifts to the odometry (0,0,0). it doesn't keep account of the last pose at the same time, even after moving the robot the odometry of the robot is (0,0,0) while it works perfectly when the vision or the april tag is detected

@bhall-ctre
Copy link
Collaborator

bhall-ctre commented Jan 10, 2025

Make sure you're not calling addVisionMeasurement() when the vision pose data is invalid, otherwise the pose estimator will constantly try to correct for that invalid vision pose. We just use the WPILib SwerveDrivePoseEstimator implementation, so everything in their Pose Estimators documentation applies.

Note that the very basic vision code in our SwerveWithPathPlanner and SwerveWithChoreo examples may not be sufficient for use on a real robot; they are simply demonstrations of basic API usage. With that said, we have just updated the examples to include some simple validation checking on the vision pose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants