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.
Modifier and Type | Field and Description |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.lang.Double> |
robotToWheelAccelerations(Pose2d robotPoseAcceleration,
double trackWidth)
Computes the wheel accelerations corresponding to robotPoseAcceleration given trackWidth.
|
static java.util.List<java.lang.Double> |
robotToWheelVelocities(Pose2d robotPoseVelocity,
double trackWidth)
Computes the wheel velocities corresponding to robotPoseVelocity given trackWidth.
|
static Pose2d |
wheelToRobotVelocities(java.util.List<java.lang.Double> wheelVelocities,
double trackWidth)
Computes the robot velocity corresponding to wheelVelocities and the given drive parameters.
|
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.
public static java.util.List<java.lang.Double> robotToWheelVelocities(Pose2d robotPoseVelocity, double trackWidth)
Computes the wheel velocities corresponding to robotPoseVelocity given trackWidth.
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> robotToWheelAccelerations(Pose2d robotPoseAcceleration, double trackWidth)
Computes the wheel accelerations corresponding to robotPoseAcceleration given trackWidth.
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, 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 robot