assorted bug fixes
This commit is contained in:
14
main.lua
14
main.lua
@@ -76,7 +76,7 @@ function serializeTable(val, name, skipnewlines, depth)
|
|||||||
|
|
||||||
local tmp = string.rep(" ", depth)
|
local tmp = string.rep(" ", depth)
|
||||||
if name then
|
if name then
|
||||||
if not string.match(name, '^[a-zA-z_][a-zA-Z0-9_]*$') then
|
if not string.match(name, '^[a-zA-Z_][a-zA-Z0-9_]*$') then
|
||||||
name = string.gsub(name, "'", "\\'")
|
name = string.gsub(name, "'", "\\'")
|
||||||
name = "['".. name .. "']"
|
name = "['".. name .. "']"
|
||||||
end
|
end
|
||||||
@@ -487,7 +487,7 @@ function PollVelocity()
|
|||||||
-- Velocity Sensors
|
-- Velocity Sensors
|
||||||
VelocityVectors = {}
|
VelocityVectors = {}
|
||||||
|
|
||||||
if velSensors[0] == nil then -- verify array is not empty
|
if velSensors[1] == nil then -- verify array is not empty
|
||||||
|
|
||||||
SensorData.Velocity = {}
|
SensorData.Velocity = {}
|
||||||
|
|
||||||
@@ -594,9 +594,9 @@ function PollGimbal()
|
|||||||
zAngle = 0 -- roll angle
|
zAngle = 0 -- roll angle
|
||||||
}
|
}
|
||||||
for i, v in ipairs(gimbalSensor.getAngles()) do
|
for i, v in ipairs(gimbalSensor.getAngles()) do
|
||||||
if i == 0 then
|
if i == 1 then
|
||||||
Angles.xAngle = v
|
Angles.xAngle = v
|
||||||
elseif i == 1 then
|
elseif i == 2 then
|
||||||
Angles.zAngle = v
|
Angles.zAngle = v
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -635,7 +635,7 @@ function PollGimbal()
|
|||||||
SensorData.Gimbal.LinearAcceleration = LinearAcceleration
|
SensorData.Gimbal.LinearAcceleration = LinearAcceleration
|
||||||
|
|
||||||
if Config.Debug then
|
if Config.Debug then
|
||||||
print("DEBUG: PollGimbaal fetched sensor data: "..tableToString(SensorData.Gimbal))
|
print("DEBUG: PollGimbal fetched sensor data: "..tableToString(SensorData.Gimbal))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -871,9 +871,9 @@ function displayInstrumentPanel(monitor, sensorData)
|
|||||||
if next(sensorData) ~= nil then
|
if next(sensorData) ~= nil then
|
||||||
if sensorData then
|
if sensorData then
|
||||||
m.setCursorPos(1, 3)
|
m.setCursorPos(1, 3)
|
||||||
m.write("Pitch: " .. string.format("%.2f", SensorData.Gimbal.Angles[0] or 0))
|
m.write("Pitch: " .. string.format("%.2f", SensorData.Gimbal.Angles[1] or 0))
|
||||||
m.setCursorPos(1, 4)
|
m.setCursorPos(1, 4)
|
||||||
m.write("Roll: " .. string.format("%.2f", SensorData.Gimbal.Angles[1] or 0))
|
m.write("Roll: " .. string.format("%.2f", SensorData.Gimbal.Angles[2] or 0))
|
||||||
m.setCursorPos(1, 5)
|
m.setCursorPos(1, 5)
|
||||||
m.write("Yaw: " .. string.format("%.2f", SensorData.NavTable.Heading or 0))
|
m.write("Yaw: " .. string.format("%.2f", SensorData.NavTable.Heading or 0))
|
||||||
m.setCursorPos(1, 6)
|
m.setCursorPos(1, 6)
|
||||||
|
|||||||
Reference in New Issue
Block a user