[xrp] Fix motor support (#8916)

The protocol layer got out of sync with the rename to throttle.
This commit is contained in:
Peter Johnson
2026-05-23 17:37:38 -07:00
committed by GitHub
parent 94fda36e04
commit 40f9a87e70

View File

@@ -144,9 +144,9 @@ void XRP::HandleMotorSimValueChanged(const wpi::util::json& data) {
deviceId = 3;
}
auto dutyCycle = motorData->lookup("<duty_cycle");
if (deviceId != -1 && dutyCycle && dutyCycle->is_number()) {
m_motor_outputs[deviceId] = dutyCycle->get_number();
auto throttle = motorData->lookup("<throttle");
if (deviceId != -1 && throttle && throttle->is_number()) {
m_motor_outputs[deviceId] = throttle->get_number();
}
}