Interface Kinematics<S,P>

Type Parameters:
S - The type of the wheel speeds.
P - The type of the wheel positions.
All Superinterfaces:
Interpolator<P>
All Known Implementing Classes:
DifferentialDriveKinematics, MecanumDriveKinematics, SwerveDriveKinematics

public interface Kinematics<S,P> extends Interpolator<P>
Helper class that converts a chassis velocity (dx and dtheta components) into wheel speeds. Robot code should not use this directly- Instead, use the particular type for your drivetrain (e.g., DifferentialDriveKinematics).
  • Method Summary

    Modifier and Type
    Method
    Description
    copy(P positions)
    Returns a copy of the wheel positions object.
    toChassisSpeeds(S wheelSpeeds)
    Performs forward kinematics to return the resulting chassis speed from the wheel speeds.
    toTwist2d(P start, P end)
    Performs forward kinematics to return the resulting Twist2d from the given change in wheel positions.
    Performs inverse kinematics to return the wheel speeds from a desired chassis velocity.

    Methods inherited from interface edu.wpi.first.math.interpolation.Interpolator

    interpolate
  • Method Details

    • toChassisSpeeds

      Performs forward kinematics to return the resulting chassis speed from the wheel speeds. This method is often used for odometry -- determining the robot's position on the field using data from the real-world speed of each wheel on the robot.
      Parameters:
      wheelSpeeds - The speeds of the wheels.
      Returns:
      The chassis speed.
    • toWheelSpeeds

      S toWheelSpeeds(ChassisSpeeds chassisSpeeds)
      Performs inverse kinematics to return the wheel speeds from a desired chassis velocity. This method is often used to convert joystick values into wheel speeds.
      Parameters:
      chassisSpeeds - The desired chassis speed.
      Returns:
      The wheel speeds.
    • toTwist2d

      Twist2d toTwist2d(P start, P end)
      Performs forward kinematics to return the resulting Twist2d from the given change in wheel positions. This method is often used for odometry -- determining the robot's position on the field using changes in the distance driven by each wheel on the robot.
      Parameters:
      start - The starting distances driven by the wheels.
      end - The ending distances driven by the wheels.
      Returns:
      The resulting Twist2d in the robot's movement.
    • copy

      P copy(P positions)
      Returns a copy of the wheel positions object.
      Parameters:
      positions - The wheel positions object to copy.
      Returns:
      A copy.