FRC2706 / 2023-2706-Fall-Poseidon

Reprogramming Poseidon from scratch in the offseason.
Other
2 stars 0 forks source link

Improve SwerveTeleopCommand #4

Open ErikCald opened 11 months ago

ErikCald commented 11 months ago

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:

ErikCald commented 11 months ago

List of tasks ordered by how important they are:

ErikCald commented 9 months ago

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();