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
Properties
Functions
Divides the chassis acceleration by a scalar.
Uses kinematic integration to compute a new velocity given a time step and initial velocity.
Linear interpolation (lerp) toward another chassis acceleration.
Subtracts two chassis accelerations component-wise.
Adds two chassis accelerations component-wise.
Multiplies the chassis acceleration by a scalar.
Converts this chassis acceleration (local frame) to a pose acceleration (global frame).
Negates the chassis acceleration.