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

Implement more performant swerve kinematics and odometry #46

Merged
merged 5 commits into from
Nov 5, 2023

Conversation

MathNerd28
Copy link
Member

No description provided.

@mmarchetti
Copy link
Member

Is this based on WPILib swerve kinematics, or is it entirely new?

@MathNerd28
Copy link
Member Author

It's essentially a clone (see theirs), with some performance optimizations and better method names. Additionally, I combined the Odometry and PoseEstimator into one class, since they're typically used together anyway.

}
minCosine *= minCosine * minCosine; // minCosine to the 3rd power
for (int i = 0; i < modules.length; i++) {
states[i].speedMetersPerSecond *= minCosine;
Copy link
Member

Choose a reason for hiding this comment

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

IIRC we originally added a correction like this to limit the speed of wheels that are facing the wrong way, until the motors align them a bit more with the direction of travel (though I don't recall the cubing). We'll need to do some testing as soon as we have a swerve chassis and shake all the issues out of this implementation before the build season.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's my plan for the new swerve chassis we just got

@MathNerd28 MathNerd28 merged commit 91abd33 into master Nov 5, 2023
@MathNerd28 MathNerd28 deleted the swerve branch November 5, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants