Class PhoenixUtil

java.lang.Object
com.marswars.util.PhoenixUtil

public class PhoenixUtil extends Object
  • Constructor Details

    • PhoenixUtil

      public PhoenixUtil()
  • Method Details

    • tryUntilOk

      public static void tryUntilOk(int maxAttempts, Supplier<StatusCode> command)
      Attempts to run the command until no error is produced.
    • toInvertedValue

      public static InvertedValue toInvertedValue(boolean isInverted)
      Converts a boolean invert flag to a Phoenix InvertedValue enum.
      Parameters:
      isInverted - true if the motor should be inverted, false otherwise
      Returns:
      the corresponding InvertedValue enum
    • getSimulationOdometryTimeStamps

      public static double[] getSimulationOdometryTimeStamps()
      Gets an array of timestamps for simulation odometry updates.
      Returns:
      an array of timestamps covering one simulation period