From db2975901d1a5d5cb8b4aef9dcb04242e75a2aaa Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Wed, 2 Oct 2013 17:44:49 +0900 Subject: [PATCH] AP_HAL_AVR_SITL: use SIM_BATT_VOLTAGE parameter --- libraries/AP_HAL_AVR_SITL/SITL_State.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_HAL_AVR_SITL/SITL_State.cpp b/libraries/AP_HAL_AVR_SITL/SITL_State.cpp index 82d32dc77c..d12811bd47 100644 --- a/libraries/AP_HAL_AVR_SITL/SITL_State.cpp +++ b/libraries/AP_HAL_AVR_SITL/SITL_State.cpp @@ -482,7 +482,7 @@ void SITL_State::_simulator_output(void) float throttle = _motors_on?(control.pwm[2]-1000) / 1000.0f:0; // lose 0.7V at full throttle - float voltage = 12.6 - 0.7f*throttle; + float voltage = _sitl->batt_voltage - 0.7f*throttle; // assume 50A at full throttle float current = 50.0 * throttle; // assume 3DR power brick