Class FirstOrderFit.Samples

java.lang.Object
org.horizon36596.simloop.fit.FirstOrderFit.Samples
Enclosing class:
FirstOrderFit

public static final class FirstOrderFit.Samples extends Object
A logged record for one axis: time, the power applied, the velocity measured, and the battery.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Samples(double[] timeSeconds, double[] power, double[] velocity, double[] volts, double nominalVolts)
    A record whose friction acts against its own velocity: one wheel, one flywheel.
    Samples(double[] timeSeconds, double[] power, double[] velocity, double[] volts, double nominalVolts, double[] frictionDirection)
    A record whose friction direction the caller works out: a mix of several wheels, where each wheel's friction follows that wheel's own direction.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether a real battery voltage was logged, rather than assumed.

    Methods inherited from class java.lang.Object

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

    • Samples

      public Samples(double[] timeSeconds, double[] power, double[] velocity, double[] volts, double nominalVolts)
      A record whose friction acts against its own velocity: one wheel, one flywheel.
      Parameters:
      timeSeconds - frame times, seconds, increasing
      power - applied power per frame, the fraction written to the actuator, in [-1, 1]
      velocity - measured velocity per frame, any unit; the fitted free speed comes out in it
      volts - battery voltage per frame, volts; null when the log has none, in which case every frame is taken to be at nominalVolts
      nominalVolts - the battery voltage free speed is quoted at, volts
    • Samples

      public Samples(double[] timeSeconds, double[] power, double[] velocity, double[] volts, double nominalVolts, double[] frictionDirection)
      A record whose friction direction the caller works out: a mix of several wheels, where each wheel's friction follows that wheel's own direction.
      Parameters:
      timeSeconds - as above
      power - as above
      velocity - as above
      volts - as above
      nominalVolts - as above
      frictionDirection - per frame, the direction friction acts along this axis, unitless in [-1, 1]: for a mecanum axis, the axis's wheel mix of each wheel's sign of speed (0 for a wheel at rest). null to use the sign of velocity with the rest-band deadband, as the other constructor does.
  • Method Details

    • hasVoltage

      public boolean hasVoltage()
      Returns whether a real battery voltage was logged, rather than assumed.
      Returns:
      whether a real battery voltage was logged, rather than assumed