Compare commits

...

2 Commits

View File

@@ -847,10 +847,16 @@ function UpdateGlobalThrust()
end end
local throttleOutput = PIDs.AltitudePID:update(Config.Autopilot.AutopilotDesiredAltitude or 0, SensorData.Altitude.Altitude or 0, dt) local throttleOutput = PIDs.AltitudePID:update(Config.Autopilot.AutopilotDesiredAltitude or 0, SensorData.Altitude.Altitude or 0, dt)
local pitchOutput = PIDs.PitchAttitudePID:update(0, SensorData.Gimbal.Angles.xAngle, dt)
local rollOutput = PIDs.RollAttitudePID:update(0, SensorData.Gimbal.Angles.zAngle, dt)
local yawOutput = PIDs.YawAttitudePID:update(Config.Autopilot.AutopilotDesiredHeading or 0, SensorData.NavTable.Heading, dt)
local pitchOutput = PIDs.PitchRatePID:update(Config.Autopilot.AutopilotDesiredPitchRate or 0, SensorData.Gimbal.AngularRates.wx or 0, dt) local pitchRateOutput = PIDs.PitchRatePID:update(Config.Autopilot.AutopilotDesiredPitchRate or 0, SensorData.Gimbal.AngularRates.wx or 0, dt)
local rollOutput = PIDs.RollRatePID:update(Config.Autopilot.AutopilotDesiredRollRate or 0, SensorData.Gimbal.AngularRates.wz or 0, dt) local rollRateOutput = PIDs.RollRatePID:update(Config.Autopilot.AutopilotDesiredRollRate or 0, SensorData.Gimbal.AngularRates.wz or 0, dt)
local yawOutput = PIDs.YawRatePID:update(Config.Autopilot.AutopilotDesiredYawRate or 0, SensorData.Gimbal.AngularRates.wy or 0, dt) local yawRateOutput = PIDs.YawRatePID:update(Config.Autopilot.AutopilotDesiredYawRate or 0, SensorData.Gimbal.AngularRates.wy or 0, dt)
for _, thruster in pairs(Thrusters) do for _, thruster in pairs(Thrusters) do
@@ -864,7 +870,7 @@ function UpdateGlobalThrust()
desiredThrust = desiredThrust + rollOutput desiredThrust = desiredThrust + rollOutput
end end
if thruster.affectVectors.angular.yaw ~= nil and thruster.primary_yaw_thruster then if thruster.affectVectors.angular.yaw ~= nil and thruster.primary_yaw_thruster then
desiredThrust = desiredThrust + yawOutput desiredThrust = desiredThrust + yawRateOutput
end end
if thruster.affectVectors.lateral.y == "up" then if thruster.affectVectors.lateral.y == "up" then