ChassisAccelerations

Represents the acceleration of a robot chassis in its local (body) frame.

ChassisAccelerations vs PoseAcceleration2d

ChassisAccelerations represents accelerations in the robot's local frame (body frame):

  • The x-axis points forward from the robot

  • The y-axis points left from the robot

  • Linear accelerations are relative to the robot's orientation

  • Useful for motor control and dynamic modeling

PoseAcceleration2d represents accelerations in the global (field) frame:

  • The x and y axes are fixed to the field

  • Linear accelerations are relative to the field coordinate system

  • Useful for trajectory generation and feedforward control

Frame Considerations

When a robot rotates, the relationship between chassis and field accelerations is more complex than for velocities due to centripetal effects. The transformation includes:

  • Rotation of the acceleration vector

  • Centripetal acceleration terms from the rotating frame

Kinematic Integration

Given an initial velocity \(\mathbf{v}_0\) and a time step \(\Delta t\), the new velocity is: \(\mathbf{v}(t + \Delta t) = \mathbf{v}_0 + \mathbf{a} \cdot \Delta t\)

Example Usage

// Robot accelerating forward at 5 in/s², with angular acceleration 0.1 rad/s²
val chassisAcc = ChassisAccelerations(
linearAcc = Vector2d(5.0.inchesPerSecondSquared, 0.0.inchesPerSecondSquared),
angAcc = 0.1.radiansPerSecondSquared
)

// Integrate to get velocity after 0.1 seconds
val newVel = chassisAcc.integrateToVel(0.1.seconds, currentVel)

See also

for accelerations in the global frame

Constructors

Link copied to clipboard

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

angular acceleration (frame-invariant)

Link copied to clipboard

linear acceleration in the robot's local frame (forward/left)

Functions

Link copied to clipboard
operator fun div(scalar: Double): ChassisAccelerations

Divides the chassis acceleration by a scalar.

Link copied to clipboard
fun integrateToVel(dt: Time, initial: ChassisVelocities = ChassisVelocities.zero): ChassisVelocities

Uses kinematic integration to compute a new velocity given a time step and initial velocity.

Link copied to clipboard

Linear interpolation (lerp) toward another chassis acceleration.

Link copied to clipboard

Subtracts two chassis accelerations component-wise.

Link copied to clipboard

Adds two chassis accelerations component-wise.

Link copied to clipboard
operator fun times(scalar: Double): ChassisAccelerations

Multiplies the chassis acceleration by a scalar.

Link copied to clipboard

Converts this chassis acceleration (local frame) to a pose acceleration (global frame).

Link copied to clipboard

Negates the chassis acceleration.