java.lang.Object
org.firstinspires.ftc.teamcode.fy23.units.DTS

public class DTS extends Object
An immutable vector represented as Drive, Turn, and Strafe axes.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
     
    final double
     
    final double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DTS()
     
    DTS(double argDrive, double argTurn, double argStrafe)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    add(DTS dts)
     
     
    Refactor the DTS to be within a normal range, keeping the sum of the axes between -1 and 1 in this case, while maintaining the proportions between the axes.
    rotate(double radians)
    Rotate the drive and strafe axes by a value in Radians.
    scale(double factor)
    also known as multiplication
    withDrive(double newDrive)
     
    withStrafe(double newStrafe)
     
    withTurn(double newTurn)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • drive

      public final double drive
    • turn

      public final double turn
    • strafe

      public final double strafe
  • Constructor Details

    • DTS

      public DTS(double argDrive, double argTurn, double argStrafe)
    • DTS

      public DTS()
  • Method Details

    • negate

      public DTS negate()
    • add

      public DTS add(DTS dts)
    • scale

      public DTS scale(double factor)
      also known as multiplication
    • normalize

      public DTS normalize()
      Refactor the DTS to be within a normal range, keeping the sum of the axes between -1 and 1 in this case, while maintaining the proportions between the axes. In other words, scales everything down so that the sum of the axes is between -1 and 1.
    • withDrive

      public DTS withDrive(double newDrive)
    • withTurn

      public DTS withTurn(double newTurn)
    • withStrafe

      public DTS withStrafe(double newStrafe)
    • rotate

      public DTS rotate(double radians)
      Rotate the drive and strafe axes by a value in Radians. Leaves the turn axis unmodified. Perhaps most useful for field-oriented driving, or perhaps driving with independent axes on an "XDrive" base.