From c9362fbb703a2dde48bc6ead96620b99395e84b9 Mon Sep 17 00:00:00 2001 From: Samuel Tabor Date: Mon, 17 Aug 2020 15:07:19 +0100 Subject: [PATCH] SITL: Calculate current in SIM_Plane. --- libraries/SITL/SIM_Plane.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/SITL/SIM_Plane.cpp b/libraries/SITL/SIM_Plane.cpp index 92fc5d8213..d25bea6760 100644 --- a/libraries/SITL/SIM_Plane.cpp +++ b/libraries/SITL/SIM_Plane.cpp @@ -308,6 +308,9 @@ void Plane::calculate_forces(const struct sitl_input &input, Vector3f &rot_accel float thrust = throttle; + battery_voltage = sitl->batt_voltage - 0.7*throttle; + battery_current = 50.0f*throttle; + if (ice_engine) { thrust = icengine.update(input); }