Browse Source

AP_Scripting: add units and multipliers to logging example

c415-sdk
Iampete1 5 years ago committed by Andrew Tridgell
parent
commit
5cbbe656ba
  1. 6
      libraries/AP_Scripting/examples/logging.lua

6
libraries/AP_Scripting/examples/logging.lua

@ -27,9 +27,13 @@ local function write_to_dataflash() @@ -27,9 +27,13 @@ local function write_to_dataflash()
-- care must be taken when selecting a name, must be less than four characters and not clash with an existing log type
-- format characters specify the type of variable to be logged, see AP_Logger/README.md
-- https://github.com/ArduPilot/ardupilot/tree/master/libraries/AP_Logger
-- not all format types are supported by scripting only: i, L, e, f, n, M, B, I, E, and N
-- lua automatically adds a timestamp in micro seconds
logger.write('SCR','roll(deg),pitch(deg),yaw(deg)','fff',interesting_data[roll],interesting_data[pitch],interesting_data[yaw])
logger.write('SCR1','roll(deg),pitch(deg),yaw(deg)','fff',interesting_data[roll],interesting_data[pitch],interesting_data[yaw])
-- it is also possible to give units and multipliers
logger.write('SCR2','roll,pitch,yaw','fff','ddd','---',interesting_data[roll],interesting_data[pitch],interesting_data[yaw])
end

Loading…
Cancel
Save