public class TankKinematics
Tank drive kinematic equations based upon the unicycle model. All wheel positions and velocities are given in (left, right) tuples. 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.
This page gives a motivated derivation.
public static TankKinematics INSTANCE
Tank drive kinematic equations based upon the unicycle model. All wheel positions and velocities are given in (left, right) tuples. 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.
This page gives a motivated derivation.
@JvmStatic @NotNull public static java.util.List<java.lang.Double> robotToWheelVelocities(@NotNull Pose2d robotVel, double trackWidth)
Computes the wheel velocities corresponding to robotVel
given trackWidth
.
robotVel
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotrobotVel
,
trackWidth
@JvmStatic @NotNull public static java.util.List<java.lang.Double> robotToWheelAccelerations(@NotNull Pose2d robotAccel, double trackWidth)
Computes the wheel accelerations corresponding to robotAccel
given trackWidth
.
robotAccel
- velocity of the robot in its reference frametrackWidth
- lateral distance between pairs of wheels on different sides of the robotrobotAccel
,
trackWidth
@JvmStatic @NotNull public static Pose2d wheelToRobotVelocities(@NotNull java.util.List<java.lang.Double> wheelVelocities, double trackWidth)
Computes the robot velocity corresponding to wheelVelocities
and the given drive parameters.
wheelVelocities
- wheel velocities (or wheel position deltas)trackWidth
- lateral distance between pairs of wheels on different sides of the robotwheelVelocities