File-By-File
Kinematics

Kinematics

This interface defines a contract for kinematic calculations, specifically for converting between a robot's desired Translation (movement) and a specific state representation (E) that the robot's drive train can understand and execute. It also supports the inverse operation: converting a state back into a Translation.

Type Parameter

  • <E>: Represents the specific state type that the kinematics system works with. This could be motor powers, wheel velocities, or any other relevant drive train state.

Methods

calculate(Translation translation)

Converts a desired Translation into a specific state representation (E) that the robot's drive train can use. This is often referred to as inverse kinematics.

  • translation: The desired movement of the robot, typically containing linear and angular velocity components.

Returns a calculated value of type E that represents the necessary drive train state to achieve the given translation.

toTranslation(E state)

Converts a given state representation (E) back into a Translation. This is often referred to as forward kinematics.

  • state: The current state of the robot's drive train, of type E.

Returns a Translation that represents the robot's movement based on the provided state.