public class SwerveKinematics
Swerve drive kinematic equations. All wheel positions and velocities are given starting with front left and proceeding counter-clockwise (i.e., front left, rear left, rear right, front right). Robot poses are specified in a coordinate system with positive x pointing forward, positive y pointing left, and positive heading measured counter-clockwise from the x-axis.
Modifier and Type | Field and Description |
---|---|
static SwerveKinematics |
INSTANCE
Swerve drive kinematic equations. All wheel positions and velocities are given starting with front left and
proceeding counter-clockwise (i.e., front left, rear left, rear right, front right). Robot poses are specified in a
coordinate system with positive x pointing forward, positive y pointing left, and positive heading measured
counter-clockwise from the x-axis.
|
Modifier and Type | Method and Description |
---|---|
static java.util.List<com.acmerobotics.roadrunner.Vector2d> |
robotToModuleAccelerationVectors(Pose2d robotPoseAcceleration,
double trackWidth,
double wheelBase)
Computes the acceleration vectors corresponding to robotPoseAcceleration given the provided trackWidth and
wheelBase.
|
static java.util.List<com.acmerobotics.roadrunner.Vector2d> |
robotToModuleAccelerationVectors(Pose2d robotPoseAcceleration,
double trackWidth)
Computes the acceleration vectors corresponding to robotPoseAcceleration given the provided trackWidth and
wheelBase.
|
static java.util.List<java.lang.Double> |
robotToModuleAngularVelocities(Pose2d robotPoseVelocity,
Pose2d robotPoseAcceleration,
double trackWidth,
double wheelBase)
Computes the module angular velocities corresponding to robotPoseAcceleration given the provided trackWidth
and wheelBase.
|
static java.util.List<java.lang.Double> |
robotToModuleAngularVelocities(Pose2d robotPoseVelocity,
Pose2d robotPoseAcceleration,
double trackWidth)
Computes the module angular velocities corresponding to robotPoseAcceleration given the provided trackWidth
and wheelBase.
|
static java.util.List<java.lang.Double> |
robotToModuleOrientations(Pose2d robotPoseVelocity,
double trackWidth,
double wheelBase)
Computes the module orientations (in radians) corresponding to robotPoseVelocity given the provided
trackWidth and wheelBase.
|
static java.util.List<java.lang.Double> |
robotToModuleOrientations(Pose2d robotPoseVelocity,
double trackWidth)
Computes the module orientations (in radians) corresponding to robotPoseVelocity given the provided
trackWidth and wheelBase.
|
static java.util.List<com.acmerobotics.roadrunner.Vector2d> |
robotToModuleVelocityVectors(Pose2d robotPoseVelocity,
double trackWidth,
double wheelBase)
Computes the wheel velocity vectors corresponding to robotPoseVelocity given the provided trackWidth and
wheelBase.
|
static java.util.List<com.acmerobotics.roadrunner.Vector2d> |
robotToModuleVelocityVectors(Pose2d robotPoseVelocity,
double trackWidth)
Computes the wheel velocity vectors corresponding to robotPoseVelocity given the provided trackWidth and
wheelBase.
|
static java.util.List<java.lang.Double> |
robotToWheelAccelerations(Pose2d robotPoseVelocity,
Pose2d robotPoseAcceleration,
double trackWidth,
double wheelBase)
Computes the wheel accelerations corresponding to robotPoseAcceleration given the provided trackWidth and
wheelBase.
|
static java.util.List<java.lang.Double> |
robotToWheelAccelerations(Pose2d robotPoseVelocity,
Pose2d robotPoseAcceleration,
double trackWidth)
Computes the wheel accelerations corresponding to robotPoseAcceleration given the provided trackWidth and
wheelBase.
|
static java.util.List<java.lang.Double> |
robotToWheelVelocities(Pose2d robotPoseVelocity,
double trackWidth,
double wheelBase)
Computes the wheel velocities corresponding to robotPoseVelocity given the provided trackWidth and
wheelBase.
|
static java.util.List<java.lang.Double> |
robotToWheelVelocities(Pose2d robotPoseVelocity,
double trackWidth)
Computes the wheel velocities corresponding to robotPoseVelocity given the provided trackWidth and
wheelBase.
|
static Pose2d |
wheelToRobotVelocities(java.util.List<java.lang.Double> wheelVelocities,
java.util.List<java.lang.Double> moduleOrientations,
double trackWidth,
double wheelBase)
Computes the robot velocities corresponding to wheelVelocities, moduleOrientations, and the drive parameters.
|
static Pose2d |
wheelToRobotVelocities(java.util.List<java.lang.Double> wheelVelocities,
java.util.List<java.lang.Double> moduleOrientations,
double trackWidth)
Computes the robot velocities corresponding to wheelVelocities, moduleOrientations, and the drive parameters.
|
public static SwerveKinematics INSTANCE
Swerve drive kinematic equations. All wheel positions and velocities are given starting with front left and proceeding counter-clockwise (i.e., front left, rear left, rear right, front right). Robot poses are specified in a coordinate system with positive x pointing forward, positive y pointing left, and positive heading measured counter-clockwise from the x-axis.
public static java.util.List<com.acmerobotics.roadrunner.Vector2d> robotToModuleVelocityVectors(Pose2d robotPoseVelocity, double trackWidth, double wheelBase)
Computes the wheel velocity vectors corresponding to robotPoseVelocity given the provided trackWidth and wheelBase.
robotPoseVelocity
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotwheelBase
- distance between pairs of wheels on the same side of the robotpublic static java.util.List<com.acmerobotics.roadrunner.Vector2d> robotToModuleVelocityVectors(Pose2d robotPoseVelocity, double trackWidth)
Computes the wheel velocity vectors corresponding to robotPoseVelocity given the provided trackWidth and wheelBase.
robotPoseVelocity
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotpublic static java.util.List<java.lang.Double> robotToWheelVelocities(Pose2d robotPoseVelocity, double trackWidth, double wheelBase)
Computes the wheel velocities corresponding to robotPoseVelocity given the provided trackWidth and wheelBase.
robotPoseVelocity
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotwheelBase
- distance between pairs of wheels on the same side of the robotpublic static java.util.List<java.lang.Double> robotToWheelVelocities(Pose2d robotPoseVelocity, double trackWidth)
Computes the wheel velocities corresponding to robotPoseVelocity given the provided trackWidth and wheelBase.
robotPoseVelocity
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotpublic static java.util.List<java.lang.Double> robotToModuleOrientations(Pose2d robotPoseVelocity, double trackWidth, double wheelBase)
Computes the module orientations (in radians) corresponding to robotPoseVelocity given the provided trackWidth and wheelBase.
robotPoseVelocity
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotwheelBase
- distance between pairs of wheels on the same side of the robotpublic static java.util.List<java.lang.Double> robotToModuleOrientations(Pose2d robotPoseVelocity, double trackWidth)
Computes the module orientations (in radians) corresponding to robotPoseVelocity given the provided trackWidth and wheelBase.
robotPoseVelocity
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotpublic static java.util.List<com.acmerobotics.roadrunner.Vector2d> robotToModuleAccelerationVectors(Pose2d robotPoseAcceleration, double trackWidth, double wheelBase)
Computes the acceleration vectors corresponding to robotPoseAcceleration given the provided trackWidth and wheelBase.
robotPoseAcceleration
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotwheelBase
- distance between pairs of wheels on the same side of the robotpublic static java.util.List<com.acmerobotics.roadrunner.Vector2d> robotToModuleAccelerationVectors(Pose2d robotPoseAcceleration, double trackWidth)
Computes the acceleration vectors corresponding to robotPoseAcceleration given the provided trackWidth and wheelBase.
robotPoseAcceleration
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotpublic static java.util.List<java.lang.Double> robotToWheelAccelerations(Pose2d robotPoseVelocity, Pose2d robotPoseAcceleration, double trackWidth, double wheelBase)
Computes the wheel accelerations corresponding to robotPoseAcceleration given the provided trackWidth and wheelBase.
robotPoseAcceleration
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotwheelBase
- distance between pairs of wheels on the same side of the robotpublic static java.util.List<java.lang.Double> robotToWheelAccelerations(Pose2d robotPoseVelocity, Pose2d robotPoseAcceleration, double trackWidth)
Computes the wheel accelerations corresponding to robotPoseAcceleration given the provided trackWidth and wheelBase.
robotPoseAcceleration
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotpublic static java.util.List<java.lang.Double> robotToModuleAngularVelocities(Pose2d robotPoseVelocity, Pose2d robotPoseAcceleration, double trackWidth, double wheelBase)
Computes the module angular velocities corresponding to robotPoseAcceleration given the provided trackWidth and wheelBase.
robotPoseAcceleration
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotwheelBase
- distance between pairs of wheels on the same side of the robotpublic static java.util.List<java.lang.Double> robotToModuleAngularVelocities(Pose2d robotPoseVelocity, Pose2d robotPoseAcceleration, double trackWidth)
Computes the module angular velocities corresponding to robotPoseAcceleration given the provided trackWidth and wheelBase.
robotPoseAcceleration
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotpublic static Pose2d wheelToRobotVelocities(java.util.List<java.lang.Double> wheelVelocities, java.util.List<java.lang.Double> moduleOrientations, double trackWidth, double wheelBase)
Computes the robot velocities corresponding to wheelVelocities, moduleOrientations, and the drive parameters.
wheelVelocities
- wheel velocities (or wheel position deltas)moduleOrientations
- wheel orientations (in radians)trackWidth
- lateral distance between pairs of wheels on different sides of the robotwheelBase
- distance between pairs of wheels on the same side of the robotpublic static Pose2d wheelToRobotVelocities(java.util.List<java.lang.Double> wheelVelocities, java.util.List<java.lang.Double> moduleOrientations, double trackWidth)
Computes the robot velocities corresponding to wheelVelocities, moduleOrientations, and the drive parameters.
wheelVelocities
- wheel velocities (or wheel position deltas)moduleOrientations
- wheel orientations (in radians)trackWidth
- lateral distance between pairs of wheels on different sides of the robot