Class Twist2d

java.lang.Object
edu.wpi.first.math.geometry.Twist2d
All Implemented Interfaces:
ProtobufSerializable, StructSerializable, WPISerializable

public class Twist2d extends Object implements ProtobufSerializable, StructSerializable
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

    Fields
    Modifier and Type
    Field
    Description
    double
    Angular "dtheta" component (radians).
    double
    Linear "dx" component.
    double
    Linear "dy" component.
    static final Twist2dProto
    Twist2d protobuf for serialization.
    static final Twist2dStruct
    Twist2d struct for serialization.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    Twist2d(double dx, double dy, double dtheta)
    Constructs a Twist2d with the given values.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks equality between this Twist2d and another object.
    int
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • dx

      public double dx
      Linear "dx" component.
    • dy

      public double dy
      Linear "dy" component.
    • dtheta

      public double dtheta
      Angular "dtheta" component (radians).
    • proto

      public static final Twist2dProto proto
      Twist2d protobuf for serialization.
    • struct

      public static final Twist2dStruct struct
      Twist2d struct for serialization.
  • Constructor Details

    • Twist2d

      public Twist2d()
      Default constructor.
    • Twist2d

      public Twist2d(double dx, double dy, double dtheta)
      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

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Checks equality between this Twist2d and another object.
      Overrides:
      equals in class Object
      Parameters:
      obj - The other object.
      Returns:
      Whether the two objects are equal or not.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object