Twist2d
Represents a differential twist in 2D: a combination of linear and angular displacement.
A twist is an element of the Lie algebra \(\mathfrak{se}(2)\), the tangent space of SE(2). It represents an infinitesimal transformation consisting of:
Linear displacement: \(\mathbf{v}\) - translation component
Angular displacement: \(\theta\) - rotation component (as a Rotation2d)
Relationship to Velocity
A twist can be thought of as a "velocity × time" - it represents the displacement that would result from moving with a constant velocity for a unit time.
Exponential Map
The exponential map converts a twist to a pose: \(\exp: \mathfrak{se}(2) \to SE(2)\)
This allows us to compute the pose resulting from a given displacement.
Example Usage
// Create a twist: move forward 1 inch and rotate 45 degrees
val twist = Twist2d(
Vector2d(1.0.inches, 0.0.inches),
Math.PI / 4
)
// Convert twist to pose
val pose = Pose2d.exp(twist)
// Add twist to existing pose
val newPose = currentPose + twistConstructors
Constructs a Twist2d from x and y distance measurements and a rotation.
Constructs a Twist2d from x and y distance measurements and an angle measurement.
Constructs a Twist2d from x and y coordinates (in inches) and a rotation.
Constructs a Twist2d from x and y coordinates (in inches) and an angle (in radians).