Skip to content

Instantly share code, notes, and snippets.

@kpykc
Last active August 29, 2015 14:21
Show Gist options
  • Save kpykc/195e6feeef56e4566d96 to your computer and use it in GitHub Desktop.
Save kpykc/195e6feeef56e4566d96 to your computer and use it in GitHub Desktop.
log structure
0/apmlog_tools> cd src
0/src> ipython
Python 2.7.9 (default, May 1 2015, 19:04:44)
Type "copyright", "credits" or "license" for more information.
IPython 3.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
import time
import DataflashLog
import rospy
import rosbag
from sensor_msgs.msg import Imu
logdata = DataflashLog.DataflashLog()
logdata.read("../sample/2.bin", format="bin", ignoreBadlines=False)
In [10]: logdata.channels
Out[10]:
{'AHR2': {'Alt': <DataflashLog.Channel at 0x10f9d8210>,
'Lat': <DataflashLog.Channel at 0x10f9d8250>,
'Lng': <DataflashLog.Channel at 0x10f9d8290>,
'Pitch': <DataflashLog.Channel at 0x10f9d8190>,
'Roll': <DataflashLog.Channel at 0x10f9d8150>,
'TimeMS': <DataflashLog.Channel at 0x10f9d8110>,
'Yaw': <DataflashLog.Channel at 0x10f9d81d0>},
'ATT': {'DesPitch': <DataflashLog.Channel at 0x10f9c9350>,
'DesRoll': <DataflashLog.Channel at 0x10f9c92d0>,
'DesYaw': <DataflashLog.Channel at 0x10f9c93d0>,
'ErrRP': <DataflashLog.Channel at 0x10f9c9450>,
'ErrYaw': <DataflashLog.Channel at 0x10f9c9490>,
'Pitch': <DataflashLog.Channel at 0x10f9c9390>,
'Roll': <DataflashLog.Channel at 0x10f9c9310>,
'TimeMS': <DataflashLog.Channel at 0x10f9c9290>,
'Yaw': <DataflashLog.Channel at 0x10f9c9410>},
'BARO': {'Alt': <DataflashLog.Channel at 0x10f9d8c90>,
'CRt': <DataflashLog.Channel at 0x10f9d8d50>,
'Press': <DataflashLog.Channel at 0x10f9d8cd0>,
'Temp': <DataflashLog.Channel at 0x10f9d8d10>,
'TimeMS': <DataflashLog.Channel at 0x10f9d8c50>},
'CTUN': {'Alt': <DataflashLog.Channel at 0x10f9d8ed0>,
'AngBst': <DataflashLog.Channel at 0x10f9d8e10>,
'BarAlt': <DataflashLog.Channel at 0x10f9d8f10>,
'CRt': <DataflashLog.Channel at 0x10f9e5050>,
'DAlt': <DataflashLog.Channel at 0x10f9d8e90>,
'DCRt': <DataflashLog.Channel at 0x10f9d8fd0>,
'DSAlt': <DataflashLog.Channel at 0x10f9d8f50>,
'SAlt': <DataflashLog.Channel at 0x10f9d8f90>,
'ThrIn': <DataflashLog.Channel at 0x10f9d8dd0>,
'ThrOut': <DataflashLog.Channel at 0x10f9d8e50>,
'TimeMS': <DataflashLog.Channel at 0x10f9d8d90>},
'CURR': {'Curr': <DataflashLog.Channel at 0x10f9e5d10>,
'CurrTot': <DataflashLog.Channel at 0x10f9e5d90>,
'ThrInt': <DataflashLog.Channel at 0x10f9e5c90>,
'ThrOut': <DataflashLog.Channel at 0x10f9e5c50>,
'TimeMS': <DataflashLog.Channel at 0x10f9e5c10>,
'Vcc': <DataflashLog.Channel at 0x10f9e5d50>,
'Volt': <DataflashLog.Channel at 0x10f9e5cd0>},
'DU32': {'Id': <DataflashLog.Channel at 0x10f9e5b90>,
'Value': <DataflashLog.Channel at 0x10f9e5bd0>},
'EKF1': {'GX': <DataflashLog.Channel at 0x10f9c9750>,
'GY': <DataflashLog.Channel at 0x10f9c9790>,
'GZ': <DataflashLog.Channel at 0x10f9c97d0>,
'PD': <DataflashLog.Channel at 0x10f9c9710>,
'PE': <DataflashLog.Channel at 0x10f9c96d0>,
'PN': <DataflashLog.Channel at 0x10f9c9690>,
'Pitch': <DataflashLog.Channel at 0x10f9c9550>,
'Roll': <DataflashLog.Channel at 0x10f9c9510>,
'TimeMS': <DataflashLog.Channel at 0x10f9c94d0>,
'VD': <DataflashLog.Channel at 0x10f9c9650>,
'VE': <DataflashLog.Channel at 0x10f9c9610>,
'VN': <DataflashLog.Channel at 0x10f9c95d0>,
'Yaw': <DataflashLog.Channel at 0x10f9c9590>},
'EKF2': {'AX': <DataflashLog.Channel at 0x10f9c9850>,
'AY': <DataflashLog.Channel at 0x10f9c9890>,
'AZ': <DataflashLog.Channel at 0x10f9c98d0>,
'MD': <DataflashLog.Channel at 0x10f9c9a10>,
'ME': <DataflashLog.Channel at 0x10f9c99d0>,
'MN': <DataflashLog.Channel at 0x10f9c9990>,
'MX': <DataflashLog.Channel at 0x10f9c9a50>,
'MY': <DataflashLog.Channel at 0x10f9c9a90>,
'MZ': <DataflashLog.Channel at 0x10f9c9ad0>,
'TimeMS': <DataflashLog.Channel at 0x10f9c9810>,
'VWE': <DataflashLog.Channel at 0x10f9c9950>,
'VWN': <DataflashLog.Channel at 0x10f9c9910>},
'EKF3': {'IMX': <DataflashLog.Channel at 0x10f9c9cd0>,
'IMY': <DataflashLog.Channel at 0x10f9c9d10>,
'IMZ': <DataflashLog.Channel at 0x10f9c9d50>,
'IPD': <DataflashLog.Channel at 0x10f9c9c90>,
'IPE': <DataflashLog.Channel at 0x10f9c9c50>,
'IPN': <DataflashLog.Channel at 0x10f9c9c10>,
'IVD': <DataflashLog.Channel at 0x10f9c9bd0>,
'IVE': <DataflashLog.Channel at 0x10f9c9b90>,
'IVN': <DataflashLog.Channel at 0x10f9c9b50>,
'IVT': <DataflashLog.Channel at 0x10f9c9d90>,
'TimeMS': <DataflashLog.Channel at 0x10f9c9b10>},
'EKF4': {'DS': <DataflashLog.Channel at 0x10f9d80d0>,
'EFE': <DataflashLog.Channel at 0x10f9d8050>,
'FS': <DataflashLog.Channel at 0x10f9d8090>,
'OFN': <DataflashLog.Channel at 0x10f9c9fd0>,
'SH': <DataflashLog.Channel at 0x10f9c9e90>,
'SMX': <DataflashLog.Channel at 0x10f9c9ed0>,
'SMY': <DataflashLog.Channel at 0x10f9c9f10>,
'SMZ': <DataflashLog.Channel at 0x10f9c9f50>,
'SP': <DataflashLog.Channel at 0x10f9c9e50>,
'SV': <DataflashLog.Channel at 0x10f9c9e10>,
'SVT': <DataflashLog.Channel at 0x10f9c9f90>,
'TimeMS': <DataflashLog.Channel at 0x10f9c9dd0>},
'EV': {'Id': <DataflashLog.Channel at 0x10f9c9250>},
'GPS': {'Alt': <DataflashLog.Channel at 0x10f9d8b10>,
'GCrs': <DataflashLog.Channel at 0x10f9d8b90>,
'HDop': <DataflashLog.Channel at 0x10f9d8a10>,
'Lat': <DataflashLog.Channel at 0x10f9d8a50>,
'Lng': <DataflashLog.Channel at 0x10f9d8a90>,
'NSats': <DataflashLog.Channel at 0x10f9d89d0>,
'RelAlt': <DataflashLog.Channel at 0x10f9d8ad0>,
'Spd': <DataflashLog.Channel at 0x10f9d8b50>,
'Status': <DataflashLog.Channel at 0x10f9d8910>,
'T': <DataflashLog.Channel at 0x10f9d8c10>,
'TimeMS': <DataflashLog.Channel at 0x10f9d8950>,
'VZ': <DataflashLog.Channel at 0x10f9d8bd0>,
'Week': <DataflashLog.Channel at 0x10f9d8990>},
'IMU': {'AccX': <DataflashLog.Channel at 0x10f9d83d0>,
'AccY': <DataflashLog.Channel at 0x10f9d8410>,
'AccZ': <DataflashLog.Channel at 0x10f9d8450>,
'GyrX': <DataflashLog.Channel at 0x10f9d8310>,
'GyrY': <DataflashLog.Channel at 0x10f9d8350>,
'GyrZ': <DataflashLog.Channel at 0x10f9d8390>,
'TimeMS': <DataflashLog.Channel at 0x10f9d82d0>},
'IMU2': {'AccX': <DataflashLog.Channel at 0x10f9d8590>,
'AccY': <DataflashLog.Channel at 0x10f9d85d0>,
'AccZ': <DataflashLog.Channel at 0x10f9d8610>,
'GyrX': <DataflashLog.Channel at 0x10f9d84d0>,
'GyrY': <DataflashLog.Channel at 0x10f9d8510>,
'GyrZ': <DataflashLog.Channel at 0x10f9d8550>,
'TimeMS': <DataflashLog.Channel at 0x10f9d8490>},
'MAG': {'MOfsX': <DataflashLog.Channel at 0x10f9e5850>,
'MOfsY': <DataflashLog.Channel at 0x10f9e5890>,
'MOfsZ': <DataflashLog.Channel at 0x10f9e58d0>,
'MagX': <DataflashLog.Channel at 0x10f9e56d0>,
'MagY': <DataflashLog.Channel at 0x10f9e5710>,
'MagZ': <DataflashLog.Channel at 0x10f9e5750>,
'OfsX': <DataflashLog.Channel at 0x10f9e5790>,
'OfsY': <DataflashLog.Channel at 0x10f9e57d0>,
'OfsZ': <DataflashLog.Channel at 0x10f9e5810>,
'TimeMS': <DataflashLog.Channel at 0x10f9e5690>},
'MAG2': {'MOfsX': <DataflashLog.Channel at 0x10f9e5ad0>,
'MOfsY': <DataflashLog.Channel at 0x10f9e5b10>,
'MOfsZ': <DataflashLog.Channel at 0x10f9e5b50>,
'MagX': <DataflashLog.Channel at 0x10f9e5950>,
'MagY': <DataflashLog.Channel at 0x10f9e5990>,
'MagZ': <DataflashLog.Channel at 0x10f9e59d0>,
'OfsX': <DataflashLog.Channel at 0x10f9e5a10>,
'OfsY': <DataflashLog.Channel at 0x10f9e5a50>,
'OfsZ': <DataflashLog.Channel at 0x10f9e5a90>,
'TimeMS': <DataflashLog.Channel at 0x10f9e5910>},
'NTUN': {'DAccX': <DataflashLog.Channel at 0x10fa43510>,
'DAccY': <DataflashLog.Channel at 0x10fa43550>,
'DPosX': <DataflashLog.Channel at 0x10fa43310>,
'DPosY': <DataflashLog.Channel at 0x10fa43350>,
'DVelX': <DataflashLog.Channel at 0x10fa43410>,
'DVelY': <DataflashLog.Channel at 0x10fa43450>,
'PosX': <DataflashLog.Channel at 0x10fa43390>,
'PosY': <DataflashLog.Channel at 0x10fa433d0>,
'TimeMS': <DataflashLog.Channel at 0x10fa432d0>,
'VelX': <DataflashLog.Channel at 0x10fa43490>,
'VelY': <DataflashLog.Channel at 0x10fa434d0>},
'PM': {'I2CErr': <DataflashLog.Channel at 0x10fa43210>,
'INAVErr': <DataflashLog.Channel at 0x10fa43290>,
'INSErr': <DataflashLog.Channel at 0x10fa43250>,
'MaxT': <DataflashLog.Channel at 0x10fa43190>,
'NLon': <DataflashLog.Channel at 0x10fa43110>,
'NLoop': <DataflashLog.Channel at 0x10fa43150>,
'PMT': <DataflashLog.Channel at 0x10fa431d0>},
'POWR': {'Flags': <DataflashLog.Channel at 0x10f9e5e90>,
'TimeMS': <DataflashLog.Channel at 0x10f9e5dd0>,
'VServo': <DataflashLog.Channel at 0x10f9e5e50>,
'Vcc': <DataflashLog.Channel at 0x10f9e5e10>},
'RAD': {'Fixed': <DataflashLog.Channel at 0x10fa430d0>,
'Noise': <DataflashLog.Channel at 0x10f9e5fd0>,
'RSSI': <DataflashLog.Channel at 0x10f9e5f10>,
'RemNoise': <DataflashLog.Channel at 0x10fa43050>,
'RemRSSI': <DataflashLog.Channel at 0x10f9e5f50>,
'RxErrors': <DataflashLog.Channel at 0x10fa43090>,
'TimeMS': <DataflashLog.Channel at 0x10f9e5ed0>,
'TxBuf': <DataflashLog.Channel at 0x10f9e5f90>},
'RCIN': {'C1': <DataflashLog.Channel at 0x10f9e50d0>,
'C10': <DataflashLog.Channel at 0x10f9e5310>,
'C11': <DataflashLog.Channel at 0x10f9e5350>,
'C12': <DataflashLog.Channel at 0x10f9e5390>,
'C13': <DataflashLog.Channel at 0x10f9e53d0>,
'C14': <DataflashLog.Channel at 0x10f9e5410>,
'C2': <DataflashLog.Channel at 0x10f9e5110>,
'C3': <DataflashLog.Channel at 0x10f9e5150>,
'C4': <DataflashLog.Channel at 0x10f9e5190>,
'C5': <DataflashLog.Channel at 0x10f9e51d0>,
'C6': <DataflashLog.Channel at 0x10f9e5210>,
'C7': <DataflashLog.Channel at 0x10f9e5250>,
'C8': <DataflashLog.Channel at 0x10f9e5290>,
'C9': <DataflashLog.Channel at 0x10f9e52d0>,
'TimeMS': <DataflashLog.Channel at 0x10f9e5090>},
'RCOU': {'Chan1': <DataflashLog.Channel at 0x10f9e5490>,
'Chan2': <DataflashLog.Channel at 0x10f9e54d0>,
'Chan3': <DataflashLog.Channel at 0x10f9e5510>,
'Chan4': <DataflashLog.Channel at 0x10f9e5550>,
'Chan5': <DataflashLog.Channel at 0x10f9e5590>,
'Chan6': <DataflashLog.Channel at 0x10f9e55d0>,
'Chan7': <DataflashLog.Channel at 0x10f9e5610>,
'Chan8': <DataflashLog.Channel at 0x10f9e5650>,
'TimeMS': <DataflashLog.Channel at 0x10f9e5450>},
'UBX1': {'Instance': <DataflashLog.Channel at 0x10f9d8690>,
'TimeMS': <DataflashLog.Channel at 0x10f9d8650>,
'aPower': <DataflashLog.Channel at 0x10f9d8750>,
'jamInd': <DataflashLog.Channel at 0x10f9d8710>,
'noisePerMS': <DataflashLog.Channel at 0x10f9d86d0>},
'UBX2': {'Instance': <DataflashLog.Channel at 0x10f9d87d0>,
'TimeMS': <DataflashLog.Channel at 0x10f9d8790>,
'magI': <DataflashLog.Channel at 0x10f9d8850>,
'magQ': <DataflashLog.Channel at 0x10f9d88d0>,
'ofsI': <DataflashLog.Channel at 0x10f9d8810>,
'ofsQ': <DataflashLog.Channel at 0x10f9d8890>}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment