broke out UpdateGlobalThrust into UpdateGlobalLateralThrust and UpdateGlobalAngularThrust to check if the sensor issue is isolated
This commit is contained in:
14
main.lua
14
main.lua
@@ -709,11 +709,19 @@ function UpdateGlobalThrust()
|
|||||||
-- each thruster has a power value from 0 to 1, which is the amount of thrust the thruster is currently applying
|
-- each thruster has a power value from 0 to 1, which is the amount of thrust the thruster is currently applying
|
||||||
-- depending on the desired thrust vectors, some counteractive desired thrust vectors will be ignored
|
-- depending on the desired thrust vectors, some counteractive desired thrust vectors will be ignored
|
||||||
|
|
||||||
|
-- lateral thrust
|
||||||
|
UpdateGlobalLateralThrust()
|
||||||
|
|
||||||
|
-- angular thrust
|
||||||
|
UpdateGlobalAngularThrust()
|
||||||
|
end
|
||||||
|
|
||||||
|
function UpdateGlobalLateralThrust()
|
||||||
-- lateral thrust
|
-- lateral thrust
|
||||||
-- verify that SensorData.Velocity.Raw is not nil
|
-- verify that SensorData.Velocity.Raw is not nil
|
||||||
if SensorData.Velocity == nil or SensorData.Velocity.Raw == nil then
|
if SensorData.Velocity == nil or SensorData.Velocity.Raw == nil then
|
||||||
if Config.Debug then
|
if Config.Debug then
|
||||||
print("DEBUG: SensorData.Velocity.Raw is nil, skipping UpdateGlobalThrust")
|
print("DEBUG: SensorData.Velocity.Raw is nil, skipping UpdateGlobalLateralThrust")
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -745,12 +753,14 @@ function UpdateGlobalThrust()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function UpdateGlobalAngularThrust()
|
||||||
-- angular thrust
|
-- angular thrust
|
||||||
-- verify that SensorData.Gimbal.AngularRates is not nil
|
-- verify that SensorData.Gimbal.AngularRates is not nil
|
||||||
if SensorData.Gimbal == nil or SensorData.Gimbal.AngularRates == nil then
|
if SensorData.Gimbal == nil or SensorData.Gimbal.AngularRates == nil then
|
||||||
if Config.Debug then
|
if Config.Debug then
|
||||||
print("DEBUG: SensorData.Gimbal.AngularRates is nil, skipping UpdateGlobalThrust")
|
print("DEBUG: SensorData.Gimbal.AngularRates is nil, skipping UpdateGlobalAngularThrust")
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user