Package org.team1126.lib.util.vendors
Class ReduxUtil
java.lang.Object
org.team1126.lib.util.vendors.ReduxUtil
Utilities for ReduxLib.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanapplySettings(com.reduxrobotics.sensors.canandgyro.Canandgyro canandgyro, com.reduxrobotics.sensors.canandgyro.CanandgyroSettings settings) Applies settings to a Canandgyro and checks for errors.static booleanapplySettings(com.reduxrobotics.sensors.canandgyro.Canandgyro canandgyro, com.reduxrobotics.sensors.canandgyro.CanandgyroSettings settings, int maxTries) Applies settings to a Canandgyro and checks for errors.static booleanapplySettings(com.reduxrobotics.sensors.canandmag.Canandmag canandmag, com.reduxrobotics.sensors.canandmag.CanandmagSettings settings) Applies settings to a Canandmag and checks for errors.static booleanapplySettings(com.reduxrobotics.sensors.canandmag.Canandmag canandmag, com.reduxrobotics.sensors.canandmag.CanandmagSettings settings, int maxTries) Applies settings to a Canandmag and checks for errors.static doublelatencyCompensate(double value, double timestamp, double slope) Performs latency compensation on the provided frame using theslopeto determine the magnitude of the compensation.static doublelatencyCompensate(com.reduxrobotics.frames.DoubleFrame<Double> frame, double slope) Performs latency compensation on the provided frame using theslopeto determine the magnitude of the compensation.static doublelatencyCompensate(com.reduxrobotics.frames.Frame<Double> frame, double slope) Performs latency compensation on the provided frame using theslopeto determine the magnitude of the compensation.static doublelatencyCompensateQuaternionPitch(com.reduxrobotics.sensors.canandgyro.QuaternionFrame frame, double slope) Performs latency compensation on the pitch of the provided quaternion frame using theslopeto determine the magnitude of the compensation.static doublelatencyCompensateQuaternionRoll(com.reduxrobotics.sensors.canandgyro.QuaternionFrame frame, double slope) Performs latency compensation on the roll of the provided quaternion frame using theslopeto determine the magnitude of the compensation.static doublelatencyCompensateQuaternionYaw(com.reduxrobotics.sensors.canandgyro.QuaternionFrame frame, double slope) Performs latency compensation on the yaw of the provided quaternion frame using theslopeto determine the magnitude of the compensation.static doublelatencyCompensateVec3X(com.reduxrobotics.sensors.canandgyro.Vec3Frame frame, double slope) Performs latency compensation on the X component of the provided 3D vector frame using theslopeto determine the magnitude of the compensation.static doublelatencyCompensateVec3Y(com.reduxrobotics.sensors.canandgyro.Vec3Frame frame, double slope) Performs latency compensation on the Y component of the provided 3D vector frame using theslopeto determine the magnitude of the compensation.static doublelatencyCompensateVec3Z(com.reduxrobotics.sensors.canandgyro.Vec3Frame frame, double slope) Performs latency compensation on the Z component of the provided 3D vector frame using theslopeto determine the magnitude of the compensation.
-
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:
trueif success,falseotherwise.
-
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.1only tries once.- Returns:
trueif success,falseotherwise.
-
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:
trueif success,falseotherwise.
-
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.1only tries once.- Returns:
trueif success,falseotherwise.
-
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 theslopeto 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 theslopeto 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 theslopeto 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 theslopeto 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 theslopeto 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 theslopeto 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 theslopeto determine the magnitude of the compensation.- Parameters:
frame- The frame to compensate.slope- The rate of change of the frame's data.
-
latencyCompensate
Performs latency compensation on the provided frame using theslopeto 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 theslopeto 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.
-