Class ReduxUtil

java.lang.Object
org.team1126.lib.util.vendors.ReduxUtil

public final class ReduxUtil extends Object
Utilities for ReduxLib.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    applySettings(com.reduxrobotics.sensors.canandgyro.Canandgyro canandgyro, com.reduxrobotics.sensors.canandgyro.CanandgyroSettings settings)
    Applies settings to a Canandgyro and checks for errors.
    static boolean
    applySettings(com.reduxrobotics.sensors.canandgyro.Canandgyro canandgyro, com.reduxrobotics.sensors.canandgyro.CanandgyroSettings settings, int maxTries)
    Applies settings to a Canandgyro and checks for errors.
    static boolean
    applySettings(com.reduxrobotics.sensors.canandmag.Canandmag canandmag, com.reduxrobotics.sensors.canandmag.CanandmagSettings settings)
    Applies settings to a Canandmag and checks for errors.
    static boolean
    applySettings(com.reduxrobotics.sensors.canandmag.Canandmag canandmag, com.reduxrobotics.sensors.canandmag.CanandmagSettings settings, int maxTries)
    Applies settings to a Canandmag and checks for errors.
    static double
    latencyCompensate(double value, double timestamp, double slope)
    Performs latency compensation on the provided frame using the slope to determine the magnitude of the compensation.
    static double
    latencyCompensate(com.reduxrobotics.frames.DoubleFrame<Double> frame, double slope)
    Performs latency compensation on the provided frame using the slope to determine the magnitude of the compensation.
    static double
    latencyCompensate(com.reduxrobotics.frames.Frame<Double> frame, double slope)
    Performs latency compensation on the provided frame using the slope to determine the magnitude of the compensation.
    static double
    latencyCompensateQuaternionPitch(com.reduxrobotics.sensors.canandgyro.QuaternionFrame frame, double slope)
    Performs latency compensation on the pitch of the provided quaternion frame using the slope to determine the magnitude of the compensation.
    static double
    latencyCompensateQuaternionRoll(com.reduxrobotics.sensors.canandgyro.QuaternionFrame frame, double slope)
    Performs latency compensation on the roll of the provided quaternion frame using the slope to determine the magnitude of the compensation.
    static double
    latencyCompensateQuaternionYaw(com.reduxrobotics.sensors.canandgyro.QuaternionFrame frame, double slope)
    Performs latency compensation on the yaw of the provided quaternion frame using the slope to determine the magnitude of the compensation.
    static double
    latencyCompensateVec3X(com.reduxrobotics.sensors.canandgyro.Vec3Frame frame, double slope)
    Performs latency compensation on the X component of the provided 3D vector frame using the slope to determine the magnitude of the compensation.
    static double
    latencyCompensateVec3Y(com.reduxrobotics.sensors.canandgyro.Vec3Frame frame, double slope)
    Performs latency compensation on the Y component of the provided 3D vector frame using the slope to determine the magnitude of the compensation.
    static double
    latencyCompensateVec3Z(com.reduxrobotics.sensors.canandgyro.Vec3Frame frame, double slope)
    Performs latency compensation on the Z component of the provided 3D vector frame using the slope to determine the magnitude of the compensation.

    Methods inherited from class java.lang.Object

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

    • applySettings

      public static boolean applySettings(com.reduxrobotics.sensors.canandmag.Canandmag canandmag, com.reduxrobotics.sensors.canandmag.CanandmagSettings settings)
      Applies settings to a Canandmag and checks for errors. Will try up to 3 times if settings fail to apply.
      Parameters:
      canandmag - The Canandmag.
      settings - The settings to apply.
      Returns:
      true if success, false otherwise.
    • applySettings

      public static boolean applySettings(com.reduxrobotics.sensors.canandmag.Canandmag canandmag, com.reduxrobotics.sensors.canandmag.CanandmagSettings settings, int maxTries)
      Applies settings to a Canandmag and checks for errors.
      Parameters:
      canandmag - The Canandmag.
      settings - The settings to apply.
      maxTries - The number of times to try to apply settings before failing. 1 only tries once.
      Returns:
      true if success, false otherwise.
    • applySettings

      public static boolean applySettings(com.reduxrobotics.sensors.canandgyro.Canandgyro canandgyro, com.reduxrobotics.sensors.canandgyro.CanandgyroSettings settings)
      Applies settings to a Canandgyro and checks for errors. Will try up to 3 times if settings fail to apply.
      Parameters:
      canandgyro - The Canandgyro.
      settings - The settings to apply.
      Returns:
      true if success, false otherwise.
    • applySettings

      public static boolean applySettings(com.reduxrobotics.sensors.canandgyro.Canandgyro canandgyro, com.reduxrobotics.sensors.canandgyro.CanandgyroSettings settings, int maxTries)
      Applies settings to a Canandgyro and checks for errors.
      Parameters:
      canandgyro - The Canandgyro.
      settings - The settings to apply.
      maxTries - The number of times to try to apply settings before failing. 1 only tries once.
      Returns:
      true if success, false otherwise.
    • latencyCompensateVec3X

      public static double latencyCompensateVec3X(com.reduxrobotics.sensors.canandgyro.Vec3Frame frame, double slope)
      Performs latency compensation on the X component of the provided 3D vector frame using the slope to determine the magnitude of the compensation.
      Parameters:
      frame - The frame to compensate.
      slope - The rate of change of the frame's data.
    • latencyCompensateVec3Y

      public static double latencyCompensateVec3Y(com.reduxrobotics.sensors.canandgyro.Vec3Frame frame, double slope)
      Performs latency compensation on the Y component of the provided 3D vector frame using the slope to determine the magnitude of the compensation.
      Parameters:
      frame - The frame to compensate.
      slope - The rate of change of the frame's data.
    • latencyCompensateVec3Z

      public static double latencyCompensateVec3Z(com.reduxrobotics.sensors.canandgyro.Vec3Frame frame, double slope)
      Performs latency compensation on the Z component of the provided 3D vector frame using the slope to determine the magnitude of the compensation.
      Parameters:
      frame - The frame to compensate.
      slope - The rate of change of the frame's data.
    • latencyCompensateQuaternionYaw

      public static double latencyCompensateQuaternionYaw(com.reduxrobotics.sensors.canandgyro.QuaternionFrame frame, double slope)
      Performs latency compensation on the yaw of the provided quaternion frame using the slope to determine the magnitude of the compensation.
      Parameters:
      frame - The frame to compensate.
      slope - The rate of change of the frame's data.
    • latencyCompensateQuaternionPitch

      public static double latencyCompensateQuaternionPitch(com.reduxrobotics.sensors.canandgyro.QuaternionFrame frame, double slope)
      Performs latency compensation on the pitch of the provided quaternion frame using the slope to determine the magnitude of the compensation.
      Parameters:
      frame - The frame to compensate.
      slope - The rate of change of the frame's data.
    • latencyCompensateQuaternionRoll

      public static double latencyCompensateQuaternionRoll(com.reduxrobotics.sensors.canandgyro.QuaternionFrame frame, double slope)
      Performs latency compensation on the roll of the provided quaternion frame using the slope to determine the magnitude of the compensation.
      Parameters:
      frame - The frame to compensate.
      slope - The rate of change of the frame's data.
    • latencyCompensate

      public static double latencyCompensate(com.reduxrobotics.frames.DoubleFrame<Double> frame, double slope)
      Performs latency compensation on the provided frame using the slope to determine the magnitude of the compensation.
      Parameters:
      frame - The frame to compensate.
      slope - The rate of change of the frame's data.
    • latencyCompensate

      public static double latencyCompensate(com.reduxrobotics.frames.Frame<Double> frame, double slope)
      Performs latency compensation on the provided frame using the slope to determine the magnitude of the compensation.
      Parameters:
      frame - The frame to compensate.
      slope - The rate of change of the frame's data.
    • latencyCompensate

      public static double latencyCompensate(double value, double timestamp, double slope)
      Performs latency compensation on the provided frame using the slope to determine the magnitude of the compensation.
      Parameters:
      value - The value of the frame.
      timestamp - The timestamp of the frame.
      slope - The rate of change of the frame's data.