Class FrameData<T>

java.lang.Object
com.reduxrobotics.frames.FrameData<T>

public class FrameData<T> extends Object
Immutable container class for timestamped values.
  • Constructor Details

    • FrameData

      public FrameData(T value, double timestamp)
      Constructs a new FrameData object.
      Parameters:
      value - The value to hold.
      timestamp - The timestamp at which the value was received in seconds.
  • Method Details

    • getValue

      public T getValue()
      Returns the value of the data frame.
      Returns:
      the value the data frame holds.
    • getTimestamp

      public double getTimestamp()
      Gets the timestamp in seconds of when this value was updated.
      Returns:
      the timestamp in seconds.
    • maxTimestamp

      public static double maxTimestamp(FrameData<?>[] dataArray)
      Fetches the maximum CAN timestamp out of an array of FrameData objects
      Parameters:
      dataArray - array value likely begotten from Frame.waitForFrames(double, com.reduxrobotics.frames.Frame<?>...)
      Returns:
      the max timestamp value