From a5e5ee73ebb2d5d916eae9fd0f146d97246679a9 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Sun, 25 Nov 2018 21:23:30 +0100 Subject: [PATCH] AP_HAL_SITL: correct battery setup for rover --- libraries/AP_HAL_SITL/SITL_State.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_SITL/SITL_State.cpp b/libraries/AP_HAL_SITL/SITL_State.cpp index 58ae41d4c3..8737bb648d 100644 --- a/libraries/AP_HAL_SITL/SITL_State.cpp +++ b/libraries/AP_HAL_SITL/SITL_State.cpp @@ -481,7 +481,12 @@ void SITL_State::_simulator_servos(struct sitl_input &input) } } else { // simulate simple battery setup - float throttle = motors_on?(input.servos[2]-1000) / 1000.0f:0; + float throttle; + if (_vehicle == APMrover2) { + throttle = motors_on ? (input.servos[2] - 1500) / 500.0f : 0; + } else { + throttle = motors_on ? (input.servos[2] - 1000) / 1000.0f : 0; + } // lose 0.7V at full throttle voltage = _sitl->batt_voltage - 0.7f*fabsf(throttle);