Package edu.wpi.first.math.geometry
Class Twist2d
java.lang.Object
edu.wpi.first.math.geometry.Twist2d
- All Implemented Interfaces:
ProtobufSerializable,StructSerializable,WPISerializable
A change in distance along a 2D arc since the last pose update. We can use ideas from
differential calculus to create new Pose2d objects from a Twist2d and vice versa.
A Twist can be used to represent a difference between two poses.
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleAngular "dtheta" component (radians).doubleLinear "dx" component.doubleLinear "dy" component.static final Twist2dProtoTwist2d protobuf for serialization.static final Twist2dStructTwist2d struct for serialization. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
dx
Linear "dx" component. -
dy
Linear "dy" component. -
dtheta
Angular "dtheta" component (radians). -
proto
Twist2d protobuf for serialization. -
struct
Twist2d struct for serialization.
-
-
Constructor Details
-
Twist2d
public Twist2d()Default constructor. -
Twist2d
Constructs a Twist2d with the given values.- Parameters:
dx- Change in x direction relative to robot.dy- Change in y direction relative to robot.dtheta- Change in angle relative to robot.
-
-
Method Details
-
exp
Obtain a new Transform2d from a (constant curvature) velocity.See Controls Engineering in the FIRST Robotics Competition section 10.2 "Pose exponential" for a derivation.
The twist is a change in pose in the robot's coordinate frame since the previous pose update. When the user runs exp() on the twist, the user will receive the pose delta.
"Exp" represents the pose exponential, which is solving a differential equation moving the pose forward in time.
- Returns:
- The pose delta of the robot.
-
toString
-
equals
Checks equality between this Twist2d and another object. -
hashCode
-