core / com.acmerobotics.roadrunner.kinematics / Kinematics

Kinematics

object Kinematics (source)

A collection of methods for various kinematics-related tasks.

Functions

calculateFieldPoseError

Returns the error between targetFieldPose and currentFieldPose in the field frame.

fun calculateFieldPoseError(targetFieldPose: Pose2d, currentFieldPose: Pose2d): Pose2d

calculateMotorFeedforward

Computes the motor feedforward (i.e., open loop powers) for the given set of coefficients.

fun calculateMotorFeedforward(vels: List<Double>, accels: List<Double>, kV: Double, kA: Double, kStatic: Double): List<Double>

Computes the motor feedforward (i.e., open loop power) for the given set of coefficients.

fun calculateMotorFeedforward(vel: Double, accel: Double, kV: Double, kA: Double, kStatic: Double): Double

calculateRobotPoseError

Returns the error between targetFieldPose and currentFieldPose in the robot frame.

fun calculateRobotPoseError(targetFieldPose: Pose2d, currentFieldPose: Pose2d): Pose2d

fieldToRobotAcceleration

Returns the robot pose acceleration corresponding to fieldPose, fieldVel, and fieldAccel.

fun fieldToRobotAcceleration(fieldPose: Pose2d, fieldVel: Pose2d, fieldAccel: Pose2d): Pose2d

fieldToRobotVelocity

Returns the robot pose velocity corresponding to fieldPose and fieldVel.

fun fieldToRobotVelocity(fieldPose: Pose2d, fieldVel: Pose2d): Pose2d

relativeOdometryUpdate

Performs a relative odometry update. Note: this assumes that the robot moves with constant velocity over the measurement interval.

fun relativeOdometryUpdate(fieldPose: Pose2d, robotPoseDelta: Pose2d): Pose2d