CTRE Phoenix Pro C++ 23.0.12
units::turn_t

Performs latency compensation on signal using the signalSlope and signal's latency to determine the magnitude of compensation.

Performs latency compensation on signal using the signalSlope and signal's latency to determine the magnitude of compensation. The caller must refresh these StatusSignalValues beforehand, this function only does the math required for latency compensation.

compensatedTurns = GetLatencyCompensatedValue(fx.GetPosition(), fx.GetVelocity());

Template Parameters
UType of signal's underlying type. This is the type that the function will return.
U_PER_SECType of signalSlope's underlying type. This must be the derivative of U.
Parameters
signalSignal to be latency compensated. Caller must make sure this signal is up to date either by calling Refresh() or WaitForUpdate().
signalSlopeDerivative of signal that informs compensation magnitude. Caller must make sure this signal is up to date either by calling Refresh() or WaitForUpdate().
Returns
Latency compensated value from the signal StatusSignalValue.