Open ErikCald opened 11 months ago
List of tasks ordered by how important they are:
Here's the proper bit for converting linearMagnitude and linearDirection back into X, Y speeds. I put the code from the GeomUtil into this line. I'm not sure why this piece has to be so complicated.
// Calcaulate new linear components
Translation2d linearVelocity =
new Pose2d(new Translation2d(), linearDirection)
.transformBy(new Transform2d(new Translation2d(linearMagnitude, 0.0), new Rotation2d()))
.getTranslation();
This is the command that well read the joystick inputs from the driver and then tell the SwerveSubsystem to go a certain X speed, Y speed and rotating speed. It can be greatly improved through acceleration limiters, slow modes, etc.
Here are some good examples from here teams: