Package com.marswars.util
Class PhoenixUtil
java.lang.Object
com.marswars.util.PhoenixUtil
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]Gets an array of timestamps for simulation odometry updates.static InvertedValuetoInvertedValue(boolean isInverted) Converts a boolean invert flag to a Phoenix InvertedValue enum.static voidtryUntilOk(int maxAttempts, Supplier<StatusCode> command) Attempts to run the command until no error is produced.
-
Constructor Details
-
PhoenixUtil
public PhoenixUtil()
-
-
Method Details
-
tryUntilOk
Attempts to run the command until no error is produced. -
toInvertedValue
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
-