-
Notifications
You must be signed in to change notification settings - Fork 0
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
Test/drive cv alignment #14
base: main
Are you sure you want to change the base?
Conversation
&& Math.abs(rotAmount) < AutoConstants.DEGREES_MARGIN_OF_ERROR) { | ||
drive(0, 0, 0, false, false); | ||
} else { | ||
double xSpeed = xDist / AutoConstants.DRIVE_TO_TAG_TRANSLATIONAL_CONSTANT; |
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.
I think for swerve you want to control for the overall speed, not the speed of the individual axes. In other words, the magnitude of the velocity vector. Otherwise you'd be sqrt(2) faster if the direction to the target happens to be on a diagonal.
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.
It shouldn't matter because our x and y components of this speed vector are proportional to how far we need to move to get to our target coordinates, right? Because the drive() function in our swerve method accepts the xSpeed, ySpeed, and angularSpeed as parameters, we can't simply use the magnitude.
Has a method for driving to a specific (x,y,angle) using encoder-gyro odometry