Class DifferentialSample

All Implemented Interfaces:
ProtobufSerializable, StructSerializable, WPISerializable

public class DifferentialSample extends HolonomicSample implements StructSerializable
Represents a single sample in a differential drive trajectory.
  • Field Details

    • leftVelocity

      public double leftVelocity
      The left-wheel velocity at this sample in meters per second.
    • rightVelocity

      public double rightVelocity
      The right-wheel velocity at this sample in meters per second.
    • proto

      public static final DifferentialSampleProto proto
      Base proto for serialization.
    • struct

      public static final DifferentialSampleStruct struct
      Base struct for serialization.
  • Constructor Details

    • DifferentialSample

      public DifferentialSample(double time, Pose2d pose, ChassisVelocities velocity, ChassisAccelerations acceleration, double leftVelocity, double rightVelocity)
      Constructs a DifferentialSample.
      Parameters:
      time - The time of the sample relative to the trajectory start, in seconds.
      pose - The robot pose at this sample (in the field reference frame).
      velocity - The robot velocity at this sample (in the field reference frame).
      acceleration - The robot acceleration at this sample (in the field reference frame).
      leftVelocity - The left-wheel velocity at this sample in meters per second.
      rightVelocity - The right-wheel velocity at this sample in meters per second.
    • DifferentialSample

      public DifferentialSample(Time time, Pose2d pose, ChassisVelocities velocity, ChassisAccelerations acceleration, LinearVelocity leftVelocity, LinearVelocity rightVelocity)
      Constructs a DifferentialSample.
      Parameters:
      time - The time of the sample relative to the trajectory start.
      pose - The robot pose at this sample (in the field reference frame).
      velocity - The robot velocity at this sample (in the field reference frame).
      acceleration - The robot acceleration at this sample (in the field reference frame).
      leftVelocity - The left wheel velocity at this sample.
      rightVelocity - The right wheel velocity at this sample.
    • DifferentialSample

      public DifferentialSample(double time, Pose2d pose, ChassisVelocities velocity, ChassisAccelerations acceleration, DifferentialDriveKinematics kinematics)
      Constructs a DifferentialSample.
      Parameters:
      time - The time of the sample relative to the trajectory start, in seconds.
      pose - The robot pose at this sample (in the field reference frame).
      velocity - The robot velocity at this sample (in the field reference frame).
      acceleration - The robot acceleration at this sample (in the field reference frame).
      kinematics - The kinematics of the drivetrain.
    • DifferentialSample

      public DifferentialSample(HolonomicSample sample, double leftVelocity, double rightVelocity)
      Constructs a DifferentialSample from a HolonomicSample.
      Parameters:
      sample - The HolonomicSample to copy.
      leftVelocity - The left wheel velocity at this sample in meters per second.
      rightVelocity - The right wheel velocity at this sample in meters per second.
    • DifferentialSample

      public DifferentialSample(HolonomicSample sample, DifferentialDriveKinematics kinematics)
      Constructs a DifferentialSample from a HolonomicSample.
      Parameters:
      sample - The HolonomicSample to copy.
      kinematics - The kinematics of the drivetrain.
  • Method Details