-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update swerve code #66
base: swerve
Are you sure you want to change the base?
Conversation
|
||
import com.team254.lib.geometry.State; | ||
|
||
public interface ICurvature<S> extends State<S> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use 254's ICurvature
@@ -0,0 +1,9 @@ | |||
package com.team1323.lib.geometry; | |||
|
|||
public interface IPose2d<S> extends IRotation2d<S>, ITranslation2d<S> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be IUnwrappable...
|
||
// Swerve Module Wheel Offsets (Rotation encoder values when the wheels are | ||
// facing 0 degrees) | ||
public static final int kFrontRightEncoderStartingPos = Settings.kIsUsingCompBot ? -1403 - 1024 : 1740 - 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are only going to have 1 bot, just make these constants, and leave them as zeroes with a TODO for calibration
@@ -336,6 +341,11 @@ public synchronized void updatePose(Rotation2d robotHeading){ | |||
estimatedRobotPose = robotPose; | |||
previousEncDistance = currentEncDistance; | |||
} | |||
|
|||
public synchronized void resetOffsetFromAbsoluteEncoder() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use: resetRotationToAbsolute
|
||
public synchronized void resetOffsetFromAbsoluteEncoder() { | ||
double absoluteEncoderAngle = (mAbsoluteEncoder.getOutputScaleFactor() / mAbsoluteEncoder.getOutputRaw()) * 360.0; | ||
encoderOffset += absoluteEncoderAngle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don’t modify this, see how the original function resets the original encoder converted + encoderOffset
Complete
In Progress