PoseAcceleration2d
Represents the acceleration of a 2D pose in the global (field) frame.
A pose acceleration describes how a pose velocity changes over time and consists of:
Linear acceleration: \(\mathbf{a}\) - the acceleration of the position in field coordinates
Angular acceleration: \(\alpha\) - the rate of change of angular velocity (frame-invariant)
PoseAcceleration2d vs ChassisAccelerations
PoseAcceleration2d represents accelerations in the global (field) frame:
The x-axis and y-axis are fixed to the field
Linear accelerations are expressed in field coordinates
Natural for trajectory generation and feedforward control
Includes effects from changing the robot's orientation
ChassisAccelerations represents accelerations in the robot's local frame (body frame):
The x-axis points forward, y-axis points left (from robot's perspective)
Linear accelerations are relative to the robot's orientation
Natural for motor control and dynamic modeling
Does not directly include centripetal acceleration effects
Important Note on Rotating Frames
When a robot is rotating, the relationship between chassis and field accelerations is more complex than for velocities. The field acceleration includes:
The rotated chassis acceleration
Centripetal acceleration: \(\mathbf{a}_{centripetal} = \omega \times \mathbf{v}\)
Where \(\omega\) is angular velocity and \(\mathbf{v}\) is the velocity vector.
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\)
Similarly for angular components: \(\omega(t + \Delta t) = \omega_0 + \alpha \cdot \Delta t\)
Example Usage
// Robot accelerating at 5 in/s² in the field's x-direction
val poseAcc = PoseAcceleration2d(
linearAcc = Vector2d(5.0.inchesPerSecondSquared, 0.0.inchesPerSecondSquared),
angAcc = 0.1.radiansPerSecondSquared
)
// Integrate to get velocity after 0.1 seconds
val dt = 0.1.seconds
val initialVel = PoseVelocity2d.zero
val newVel = poseAcc.integrateToVel(dt, initialVel)
// For trajectory control, often converted to chassis frame:
val chassisAcc = ChassisAccelerations(
linearAcc = pose.heading.inverse() * poseAcc.linearAcc,
angAcc = poseAcc.angAcc
)See also
for accelerations in the robot's local frame
Constructors
Properties
Functions
Divides the pose acceleration by a scalar.
Uses kinematic integration to compute a new velocity given a time step and initial velocity.
Linear interpolation (lerp) toward another pose acceleration.
Subtracts two pose accelerations component-wise.
Adds two pose accelerations component-wise.
Multiplies the pose acceleration by a scalar.
Converts this pose acceleration (global frame) to a chassis acceleration (local frame).
Negates the pose acceleration.