Package org.horizon36596.simloop.fit
Class FirstOrderFit.Samples
java.lang.Object
org.horizon36596.simloop.fit.FirstOrderFit.Samples
- Enclosing class:
- FirstOrderFit
A logged record for one axis: time, the power applied, the velocity measured, and the battery.
-
Constructor Summary
ConstructorsConstructorDescriptionSamples(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 TypeMethodDescriptionbooleanReturns whether a real battery voltage was logged, rather than assumed.
-
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, increasingpower- 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 itvolts- battery voltage per frame, volts;nullwhen the log has none, in which case every frame is taken to be atnominalVoltsnominalVolts- 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 abovepower- as abovevelocity- as abovevolts- as abovenominalVolts- as abovefrictionDirection- 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).nullto use the sign ofvelocitywith 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
-