lvauvillier / dji-log-parser Goto Github PK
View Code? Open in Web Editor NEWA library to parse records from DJI .txt logs
License: MIT License
A library to parse records from DJI .txt logs
License: MIT License
I have a flight log that is producing gibberish data. I have tested with PhantomHelp, and that is able to parse the data correctly ๐ค
Here is some sample output:
{
longitude: 2.5403599960839037e-220,
latitude: 9.746796079499643e+238,
altitude: -1541.7,
speedX: 242.5,
speedY: 2659.7,
speedZ: -1858.4,
pitch: -14.3,
roll: -2462.2,
yaw: -2964,
flightMode: 'ForceLanding',
rcOutcontrol: true,
appCommand: 155,
canIocWork: true,
groundOrSky: 'Ground',
isMotorUp: true,
isSwaveWork: true,
goHomeStatus: 7,
isVisionUsed: false,
voltageWarning: 0,
isImuPreheated: false,
modeChannel: 1,
isGpsValid: true,
isCompassError: false,
waveError: false,
gpsLevel: 0,
batteryType: 3,
isOutOfLimit: true,
isGoHomeHeightModified: false,
isPropellerCatapult: false,
isMotorBlocked: true,
isNotEnoughForce: true,
isBarometerDeadInAir: true,
isVibrating: true,
isAcceletorOverRange: false,
gpsNum: 217,
flightAction: 57,
motorStartFailedCause: 207,
nonGpsCause: 14,
waypointLimitMode: true,
battery: 118,
sWaveHeight: 236,
flyTime: 3007.6,
motorRevolution: 108,
version: 134,
droneType: 36,
imuInitFailReason: 139
}
{
longitude: 574535442034980700,
latitude: -7.092340267382283e+183,
altitude: -329.2,
speedX: -610.3,
speedY: 2028.4,
speedZ: 2069.8,
pitch: -1368.6,
roll: -3130.8,
yaw: -2317.3,
flightMode: 'GentleGPS',
rcOutcontrol: false,
appCommand: 235,
canIocWork: true,
groundOrSky: 'Sky',
isMotorUp: false,
isSwaveWork: true,
goHomeStatus: 'Cruise',
isVisionUsed: true,
voltageWarning: 1,
isImuPreheated: true,
modeChannel: 1,
isGpsValid: false,
isCompassError: false,
waveError: false,
gpsLevel: 7,
batteryType: 'Smart',
isOutOfLimit: true,
isGoHomeHeightModified: true,
isPropellerCatapult: false,
isMotorBlocked: true,
isNotEnoughForce: false,
isBarometerDeadInAir: false,
isVibrating: false,
isAcceletorOverRange: false,
gpsNum: 129,
flightAction: 'None',
motorStartFailedCause: 212,
nonGpsCause: 'SpeedErrorLarge',
waypointLimitMode: false,
battery: 36,
sWaveHeight: 232,
flyTime: 5782.8,
motorRevolution: 255,
version: 231,
droneType: 'N3',
imuInitFailReason: 190
}
@lvauvillier I'll share the flight log with you privately
While processing some M3E flight logs, I found the following record types to be unhandled. I have noted the FlightRecordDataType
from the DJI FlightRecordParsingLib
repo.
I also noticed that the output I get is missing some key data (e.g. RC, BATTERY, WEATHER), but they are present in the output I get from PhantomHelp.
ShowWarningFlightRecordDataType
VisionGroupDataType
RTKDifferenceDataType
AgricultureGroundStationPushData
npzeXkozKlNHPjUQ
GOAirLinkDataField
RemoteControllerDisplayField
FlightControllerCommonOSDField
I believe 55 might contain battery information, but I haven't had any luck decoding it.
I'm still trying to recursively process that very large dataset... seeing this one now.
thread 'main' panicked at src/main.rs:290:91:
called `Option::unwrap()` on a `None` value
stack backtrace:
0: rust_begin_unwind
at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/std/src/panicking.rs:645:5
1: core::panicking::panic_fmt
at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/panicking.rs:72:14
2: core::panicking::panic
at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/panicking.rs:127:5
3: core::option::Option<T>::unwrap
at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/option.rs:931:21
4: dji_log_parser::main
at /media/kfinisterre/bdb99222-a06f-476b-ae0c-a4110a7ef82e/dji-log-parser/src/main.rs:290:31
5: core::ops::function::FnOnce::call_once
at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Looks like the Longitude field is borked?
You can spot check with https://exifinfo.org, or on my Mac this shows up on the file info screen.
Same dataset as before... a few files trigger this error. Any idea what may cause it?
thread 'main' panicked at src/main.rs:46:45:
Unable to parse file: InfoParseError("\n โบโโโโโโโโโโโโโโโโโโโโโ
Backtrace โ
โโโโโโโโโโโโโโโโโโโโโธ\n\n 0: \u{1b}[1m\u{1b}[1mError: failed to fill whole buffer\u{1b}[22m\n \u{1b}[1mWhile parsing field 'app_version' in Info\u{1b}[22m\u{1b}[22m\n at src/layout/info.rs:79\n\n โบโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโธ\n\n")
stack backtrace:
0: rust_begin_unwind
at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1bpo0/library/std/src/panicking.rs:645:5bpo0/library/core/src/panicking.rs:72:14
1: core::panicking::panic_fmt
at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1
2: core::result::unwrap_failed
at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1bpo0/library/core/src/result.rs:1653:5bpo0/library/core/src/result.rs:1034:23
3: core::result::Result<T,E>::expect
at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1
4: dji_log_parser::main
at /media/kfinisterre/bdb99222-a06f-476b-ae0c-a4110a7ef82e/dji-log-parser/src/main.rs:46:18
5: core::ops::function::FnOnce::call_once
at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with RUST_BACKTRACE=full
for a verbose backtrace.
Unable to parse file: InfoParseError("invalid utf-8 sequence of 1 bytes from index 0 at 0x138")
Unable to parse file: InfoParseError("invalid utf-8 sequence of 1 bytes from index 15 at 0x14")
Unable to parse file: InfoParseError("invalid utf-8 sequence of 1 bytes from index 8 at 0x12e")
from: thread 'main' panicked at src/main.rs:41:45:
Any idea what causes this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.