diff --git a/main.lua b/main.lua index a21801c..9822d7b 100644 --- a/main.lua +++ b/main.lua @@ -771,6 +771,10 @@ function UpdateGlobalThrust() local dt = GetDeltaTime() + if SensorData.Gimbal == nil or SensorData.Altitude == nil or SensorData.Velocity == nil then + print("ERROR: One or more of SensorData is nil. Cannot update thrust.") + return + end local throttleOutput = PIDs.AltitudePID:update(Config.Autopilot.AutopilotDesiredAltitude or 0, SensorData.Altitude.Altitude or 0, dt)