Browse Source

AP_HAL_SITL: correct battery setup for rover

mission-4.1.18
Pierre Kancir 6 years ago committed by Randy Mackay
parent
commit
a5e5ee73eb
  1. 7
      libraries/AP_HAL_SITL/SITL_State.cpp

7
libraries/AP_HAL_SITL/SITL_State.cpp

@ -481,7 +481,12 @@ void SITL_State::_simulator_servos(struct sitl_input &input) @@ -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);

Loading…
Cancel
Save