Class SubsystemRatios

java.lang.Object
com.flarerobotics.lib.control.SubsystemRatios

public class SubsystemRatios extends Object
Utility class for calculating subsystem ratios. Returns in terms of CTRE conversion factor. For REV use, take 1/f, the reciprocal instead.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    arm_calculateSTMR_degs(double reduction)
    Calculates the Sensor to Mechanism Ratio (STMR) for the arm subsystem.
    static double
    arm_calculateSTMR_rads(double reduction)
    Calculates the Sensor to Mechanism Ratio (STMR) for the arm subsystem.
    static double
    elevator_calculateSTMR(double pulleyRadius, double reduction)
    Calculates the Sensor to Mechanism Ratio (STMR) for the elevator subsystem.
    static double
    elevator_calculateSTMR(double chainPitch, double sprocketTeethAmount, double reduction)
    Calculates the Sensor to Mechanism Ratio (STMR) for the elevator subsystem.

    Methods inherited from class java.lang.Object

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

    • elevator_calculateSTMR

      public static double elevator_calculateSTMR(double pulleyRadius, double reduction)
      Calculates the Sensor to Mechanism Ratio (STMR) for the elevator subsystem. This ratio is used to convert sensor readings to mechanism positions. Uses a rope.

      Units: X/rev

      Parameters:
      pulleyRadius - The radius of the pulley in unit X.
      reduction - The overall reduction.
      Returns:
      The calculated STM ratio.
    • elevator_calculateSTMR

      public static double elevator_calculateSTMR(double chainPitch, double sprocketTeethAmount, double reduction)
      Calculates the Sensor to Mechanism Ratio (STMR) for the elevator subsystem. This ratio is used to convert sensor readings to mechanism positions. Uses a chain.

      Units: X/rev

      Parameters:
      chainPitch - The pitch of the chain in unit X.
      sprocketTeethAmount - The number of teeth on the sprocket.
      reduction - The overall reduction.
      Returns:
      The calculated STM ratio.
    • arm_calculateSTMR_degs

      public static double arm_calculateSTMR_degs(double reduction)
      Calculates the Sensor to Mechanism Ratio (STMR) for the arm subsystem. This ratio is used to convert sensor readings to mechanism positions.

      Units: Degrees/rev

      Parameters:
      reduction - The overall reduction.
      Returns:
      The calculated STM ratio.
    • arm_calculateSTMR_rads

      public static double arm_calculateSTMR_rads(double reduction)
      Calculates the Sensor to Mechanism Ratio (STMR) for the arm subsystem. This ratio is used to convert sensor readings to mechanism positions.

      Units: Rads/rev

      Parameters:
      reduction - The overall reduction.
      Returns:
      The calculated STM ratio.