public class Kinematics
A collection of methods for various kinematics-related tasks.
public static Kinematics INSTANCE
A collection of methods for various kinematics-related tasks.
@JvmStatic @NotNull public static Pose2d fieldToRobotVelocity(@NotNull Pose2d fieldPose, @NotNull Pose2d fieldVel)
@JvmStatic @NotNull public static Pose2d fieldToRobotAcceleration(@NotNull Pose2d fieldPose, @NotNull Pose2d fieldVel, @NotNull Pose2d fieldAccel)
Returns the robot pose acceleration corresponding to fieldPose
, fieldVel
, and fieldAccel
.
fieldPose
,
fieldVel
,
fieldAccel
@JvmStatic @NotNull public static Pose2d calculateFieldPoseError(@NotNull Pose2d targetFieldPose, @NotNull Pose2d currentFieldPose)
Returns the error between targetFieldPose
and currentFieldPose
in the field frame.
targetFieldPose
,
currentFieldPose
@JvmStatic @NotNull public static Pose2d calculateRobotPoseError(@NotNull Pose2d targetFieldPose, @NotNull Pose2d currentFieldPose)
Returns the error between targetFieldPose
and currentFieldPose
in the robot frame.
targetFieldPose
,
currentFieldPose
@JvmStatic @NotNull public static java.util.List<java.lang.Double> calculateMotorFeedforward(@NotNull java.util.List<java.lang.Double> vels, @NotNull java.util.List<java.lang.Double> accels, double kV, double kA, double kStatic)
Computes the motor feedforward (i.e., open loop powers) for the given set of coefficients.
@JvmStatic public static double calculateMotorFeedforward(double vel, double accel, double kV, double kA, double kStatic)
Computes the motor feedforward (i.e., open loop power) for the given set of coefficients.