BaseStatusSignalGetLatencyCompensatedValue Method
Performs latency compensation on signal using the signalSlope and signal's latency to determine
the magnitude of compensation.The caller must refresh these StatusSignals beforehand;
this function only does the math required for latency compensation.
Important: The signalSlope must be the rate of change of the signal. If it is not, the latency
compensation may not perform as expected.
For example:
double compensatedTurns = BaseStatusSignal.GetLatencyCompensatedValue(fx.GetPosition(), fx.GetVelocity());
Namespace: CTRE.Phoenix6Assembly: Phoenix6 (in Phoenix6.dll) Version: 1.0.0
public static double GetLatencyCompensatedValue(
StatusSignal<double> signal,
StatusSignal<double> signalSlope
)
static member GetLatencyCompensatedValue :
signal : StatusSignal<float> *
signalSlope : StatusSignal<float> -> float
- signal StatusSignalDouble
- Signal to be latency compensated. Caller must make sure this signal is up to date
either by calling Refresh(Boolean) or
WaitForUpdate(Double, Boolean)
- signalSlope StatusSignalDouble
- Derivative of the signal that informs compensation magnitude. Caller must make sure this
signal is up to date either by calling Refresh(Boolean) or
WaitForUpdate(Double, Boolean)
DoubleLatency compensated value from the signal StatusSignal