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

cannot have a true replay when using CTRE Swerve Drivetrain class #73

Open
gcschmit opened this issue Jan 2, 2024 · 0 comments
Open
Labels
help wanted Extra attention is needed invalid This doesn't seem right

Comments

@gcschmit
Copy link
Contributor

gcschmit commented Jan 2, 2024

CTRE's SwerveDrivetrain class updates the pose estimation inside of its 250 Hz odometry thread based on wheel positions. Since this occurs outside of the AdvantageKit IO architecture, when logs are replayed, the pose estimate will not be exactly the same. While this isn't ideal, I'm not sure of the practical impact.

The AdvantageKit swerve example, takes one approach to addressing this issue. This approach stills gathers wheel positions at 250 Hz but queues these values and updates the pose estimator in a manner consistent with the AdvantageKit IO architecture. This enables true replays. However, this is different than the CTRE solution in that the swerve commands are not applied as part of the 250 Hz thread. Again, I'm not sure of the practice impact.

We could do something icky like subclass the SwerveDrivePoseEstimator class and change the value of the m_odometry instance variable in our subclass of SwerveDrivetrain. We could implement a similar queueing solution. I'm not sure if this is worth the effort.

For now, I'm just capturing this issue.

@gcschmit gcschmit added help wanted Extra attention is needed invalid This doesn't seem right labels Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant