Giter Club home page Giter Club logo

telemetry-parser's People

Contributors

adrianeddy avatar elvinc avatar gro2mi avatar hidream avatar iampete1 avatar ilya-epifanov avatar kernel-machine avatar vladimirp1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

telemetry-parser's Issues

Executable available?

Thanks for sharing this fantastic work!
Is there a compiled exacutable available anywhere for the less technically inclined like myself?

request: DJI Action 2

have noticed https://github.com/AdrianEddy/telemetry-parser/blob/master/src/dji/mod.rs - can you please elaborate on the current state of this? i'm asking from the gryoflow perspective 😼

./gyro2bb /Users/tom/Desktop/DJI_0005.MP4
Detected camera: DJI Action 2
Done in 4658.201 ms

./gyro2bb /Users/tom/Desktop/DJI_0008.MP4
Garbage found at the end of the file, removing 2098408 bytes from the end.
Detected camera: DJI Action 2
Done in 14480.611 ms

any value in sharing the result? regards

Question: Units for `TimeVector3`

Hi!

Background

I am currently implementing a parser for VideoIMUCapture-Android. For the start I planed to just use accelerometer and gyro data from the rich data format provided.

Problem

Gyroflow compiled against my custom version of telemetry-parser can open my data-file but complains that has a data-rate of 0 Hz. The data rate should in fact be 100Hz. I have a 21 second long test-video and gyro2bb detects 2154 samples.

Question

I assume that the time-scale is somehow screwed up. What is the time scale that TimeVector3 expects for its t value? Because it is float and not noted future I assumed seconds.

More Background / rubber duck programming attempt

I know, the next part could be a bit confusing without the code but maybe there are some useful details in in.

Here is the CSV that gets created when I call gyro2bb over on my sample file.

"Product","Blackbox flight data recorder by Nicholas Sherlock"
"loopIteration","time","gyroADC[0]","gyroADC[1]","gyroADC[2]","accSmooth[0]","accSmooth[1]","accSmooth[2]"
0,0,2.029940332177429,-2.0124407471936214,-7.647275308911268,-17946.859375,8310.0244140625,-4732.0458984375
1,9793,2.029940332177429,-2.0124407471936214,-7.647275308911268,-17946.859375,8310.0244140625,-4732.0458984375
2,19586,2.029940332177429,-2.0124407471936214,-7.647275308911268,-17946.859375,8310.0244140625,-4732.0458984375
3,29381,2.029940332177429,-2.0124407471936214,-7.647275308911268,-17946.859375,8310.0244140625,-4732.0458984375
4,39174,2.029940332177429,-2.0124407471936214,-7.647275308911268,-17946.859375,8310.0244140625,-4732.0458984375
5,48967,2.029940332177429,-2.0124407471936214,-7.647275308911268,-17946.859375,8310.0244140625,-4732.0458984375
6,58760,2.029940332177429,-2.0124407471936214,-7.647275308911268,-17946.859375,8310.0244140625,-4732.0458984375
7,68555,2.029940332177429,-2.0124407471936214,-7.647275308911268,-17946.859375,8310.0244140625,-4732.0458984375

I have no idea what the time column here should be but because it jumps from 0 to 9793 to 19586 it looks currently it is the time in nano seconds since the beginning of the recording.

If I take a look at the first 3 samples that get into my SampleInfo I see 144346.848063549, 144346.857856309 and 144346.867649903 as first 3 time stamps. That is a between the first and the second timestamp I see a 0.00979276 seconds difference, between the second and the third timestamp the difference is 0.009793594 seconds. This gives 102Hz

[/home/stefano/git/private/telemetry-parser/src/phone_apps/video_imu_capture/mod.rs:80] (first_timestamp_ms, last_timestamp_ms, gyro.len(), accl.len(), magn.len()) = (
    144346848.063549,
    144367933.73032,
    2154,
    2154,
    2154,
)
[/home/stefano/git/private/telemetry-parser/src/phone_apps/video_imu_capture/mod.rs:82] (&gyro[i], &accl[i]) = (
    TimeVector3 {
        t: 144346.848063549,
        x: -0.13347013294696808,
        y: -0.03512371703982353,
        z: -0.03542914241552353,
    },
    TimeVector3 {
        t: 144346.848063549,
        x: -2.3105692863464355,
        y: 4.057629108428955,
        z: 8.763114929199219,
    },
)
[/home/stefano/git/private/telemetry-parser/src/phone_apps/video_imu_capture/mod.rs:82] (&gyro[i], &accl[i]) = (
    TimeVector3 {
        t: 144346.857856309,
        x: -0.13347013294696808,
        y: -0.03512371703982353,
        z: -0.03542914241552353,
    },
    TimeVector3 {
        t: 144346.857856309,
        x: -2.3105692863464355,
        y: 4.057629108428955,
        z: 8.763114929199219,
    },
)
[/home/stefano/git/private/telemetry-parser/src/phone_apps/video_imu_capture/mod.rs:82] (&gyro[i], &accl[i]) = (
    TimeVector3 {
        t: 144346.867649903,
        x: -0.13347013294696808,
        y: -0.03512371703982353,
        z: -0.03542914241552353,
    },
    TimeVector3 {
        t: 144346.867649903,
        x: -2.3105692863464355,
        y: 4.057629108428955,
        z: 8.763114929199219,
    },
)

This is why I assume my time units are maybe screwed up when gyroscope calculates a data rate of 0 Hz from a file with 2154 samples in about 21 seconds.

Missing GPS info?

This is great, but the output CSV seems to be missing a lot of information like GPS?

I can see GPS there in the output, but it seems to be thrown away in the csv output?

$ ./gyro2bb --dump GOPR1417.MP4
...
, z: 139 }, Vector3 { x: 4191, y: -2049, z: 311 }, Vector3 { x: 4307, y: -1731, z: 242 }, Vector3 { x: 4649, y: -1681, z: 111 }, Vector3 { x: 4693, y: -1613, z: 119 }, Vector3 { x: 4521, y: -1271, z: 121 }, Vector3 { x: 4240, y: -517, z: 166 }, Vector3 { x: 4005, y: 494, z: 125 }, Vector3 { x: 3944, y: 1021, z: 375 }, Vector3 { x: 4137, y: 876, z: 597 }, Vector3 { x: 4381, y: 788, z: 612 }, Vector3 { x: 4280, y: 480, z: 646 }, Vector3 { x: 4069, y: 99, z: 456 }, Vector3 { x: 3973, y: -255, z: 206 }, Vector3 { x: 3820, y: -711, z: 183 }, Vector3 { x: 3711, y: -991, z: 125 }, Vector3 { x: 3350, y: -1224, z: 430 }, Vector3 { x: 2934, y: -1237, z: 655 }, Vector3 { x: 2743, y: -1160, z: 912 }, Vector3 { x: 2715, y: -946, z: 1156 }, Vector3 { x: 3026, y: -953, z: 844 }, Vector3 { x: 3512, y: -1071, z: 658 }, Vector3 { x: 3864, y: -1148, z: 770 }, Vector3 { x: 4381, y: -1092, z: 390 }, Vector3 { x: 5108, y: -1093, z: -147 }, Vector3 { x: 5309, y: -1126, z: -237 }, Vector3 { x: 5111, y: -1098, z: -134 }, Vector3 { x: 5134, y: -978, z: -488 }, Vector3 { x: 5243, y: -724, z: -920 }, Vector3 { x: 5143, y: -436, z: -1199 }, Vector3 { x: 4680, y: -220, z: -1299 }, Vector3 { x: 3989, y: -102, z: -1101 }, Vector3 { x: 3760, y: 36, z: -966 }, Vector3 { x: 3881, y: 290, z: -981 }, Vector3 { x: 4169, y: 472, z: -1032 }, Vector3 { x: 4227, y: 324, z: -963 }, Vector3 { x: 4136, y: 46, z: -823 }, Vector3 { x: 4028, y: -211, z: -542 }]
Accelerometer             Unit                      SIUN                                              : m/s²
Accelerometer             Temperature               TMPC                                              : 37.25
Accelerometer             Scale                     SCAL                                              : 418
Accelerometer             Count                     TSMP                                              : 6500
Accelerometer             0x5449434b                TICK                                              : 98377
GPS5                      Name                      STNM                                              : GPS (Lat., Long., Alt., 2D speed, 3D speed)
GPS5                      Unit                      UNIT                                              : degdegmm/sm/s
GPS5                      Scale                     SCAL                                              : [10000000, 10000000, 1000, 1000, 100]
GPS5                      Count                     TSMP                                              : 585
GPS5                      0x47505335                GPS5                                              : [[98366205, 1233808163, 78862, 14149, 1410], [98366275, 1233808173, 78873, 14185, 1415], [98366345, 1233808182, 78890, 14212, 1419], [98366414, 1233808191, 78903, 14208, 1422], [98366483, 1233808201, 78919, 14128, 1421], [98366553, 1233808209, 78935, 14158, 1413], [98366624, 1233808220, 78977, 14254, 1416], [98366695, 1233808230, 79003, 14318, 1426], [98366766, 1233808239, 79036, 14305, 1432], [98366835, 1233808248, 79038, 14227, 1431], [98366904, 1233808259, 79054, 14208, 1423], [98366974, 1233808268, 79069, 14187, 1421], [98367044, 1233808277, 79083, 14206, 1419], [98367114, 1233808287, 79100, 14273, 1421], [98367185, 1233808297, 79108, 14368, 1428], [98367256, 1233808308, 79113, 14398, 1437], [98367326, 1233808317, 79120, 14347, 1440], [98367396, 1233808326, 79143, 14277, 1435], [98367466, 1233808336, 79166, 14273, 1428]]
GPS5                      0x47505346                GPSF                                              : 3
GPS5                      0x47505350                GPSP                                              : 453
GPS5                      0x47505355                GPSU                                              : 2017-12-11 09:06:18.345 UTC
GPS5                      0x5449434b                TICK                                              : 98400
ISOG                      Name                      STNM                                              : Sensor gain (ISO x100)
ISOG                      Count                     TSMP                                              : 806
ISOG                      0x49534f47                ISOG                                              : [2.9510086, 2.938307, 2.938307, 2.938307, 2.9215407, 2.9215407, 2.9215407, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644, 2.9049644]
ISOG                      0x5449434b                TICK                                              : 98401
Done in 159.480 ms

Won't compile on rust 1.55?

I get the following error on rust 1.55 (mac OS 11.6, M1):

error[E0599]: no variant or associated item named `Vec_String` found for enum `tags_impl::TagValue` in the current scope
   --> src/gopro/klv.rs:71:40
    |
71  |                           _ => TagValue::Vec_String(ValueType::new(|d| Self::parse_strings(d), |v| format!("{:?}", v), tag_data.to_vec())),
    |                                          ^^^^^^^^^^ variant or associated item not found in `tags_impl::TagValue`
...
85  | /         types! {
86  | |             b'b' => (i8,  |d| d.read_i8()),
87  | |             b'B' => (u8,  |d| d.read_u8()),
88  | |             b's' => (i16, |d| d.read_i16::<BigEndian>()),
...   |
97  | |             b'Q' => (f64, |d| Ok(d.read_i32::<BigEndian>()? as f64 + (d.read_u32::<BigEndian>()? as f64 / 4294967295.0))),
98  | |         }
    | |_________- in this macro invocation
    |
   ::: src/tags_impl.rs:103:9
    |
103 |           pub enum TagValue {
    |           ----------------- variant or associated item `Vec_String` not found here
    |
    = note: this error originates in the macro `types` (in Nightly builds, run with -Z macro-backtrace for more info)

Haven't dabbled with macros yet, but is it that this variant is not generated somehow?

Windows version of the app does not open

Good day

I have Windows 10. I tried the v0.2.7, 32 & 64 versions and tried running it as administrator.

When I double-click the .exe file, nothing happens.

Do you have an explanation on how to use the telemetry-parser?

Am I using it incorrectly, do I need a prerequisite or can Windows security be blocking the app?

Thanks for the great work.

expected magic word 00 61 73 6d, found 3c 21 44 4f @+0

Hi.

Thanks for your work on this. This is my first time trying to use wasm in a project and I've also never touched rust in my life, so I thank you in advance for your patience.

I have the following worker.ts:

import init, { Parser } from './pkg/telemetry_parser.js';

addEventListener('message', (event) => {
  console.log(event);
  switch (event.data.type) {
    case 'file': {
      console.log(
        event.data.file.name,
        event.data.file instanceof File ? 'is file' : 'is not file'
      );
      const videoId = event.data.videoId;

      const file: File = event.data.file;

      console.log(file instanceof ArrayBuffer);
      file.arrayBuffer().then((buffer) => {
        init().then(() => {
          const parsed = new Parser(new Uint8Array(buffer), 'test');

          const telemetry = parsed.telemetry(false);

          console.log(telemetry);

          postMessage({ videoId, extractComplete: telemetry });
        });
      });
      break;
    }
  }
});

I also made the following change to telemtry_parser.js:

async function __wbg_init(input) {
  if (wasm !== undefined) return wasm;

  if (typeof input === 'undefined') {
    input = new URL('/public/telemetry_parser_bg.wasm', location.origin);
  }
   // ..... etc

When I dispatch the file, so far it manages to get as far as instantiating the parser before throwing:
CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0

Please let me know what I can do to help debug this, if possible

Thanks!

Insta360 accel unit wrong

I think the unit for the accelerometer data of Insta360 files seems to be wrong.

if self.is_raw_gyro {
    let accl_scale = 32768.0 / self.acc_range.unwrap_or(16.0); // ± 16g
    ...
}

...
insert_tag(&mut map, tag!(parsed Accelerometer, Unit, "Accelerometer unit", String, |v| v.to_string(), "m/s²".into(),  Vec::new()));

Does this mean that the accel uni in normalized_imu is always g?

Thanks!

Crash on opening semi-corrupt GoPro file

I recorded some video's with a GoPro Session5 which were stopped mid-flight. Also my latest video, which I stopped manually, gave the same problem. The GoPro could repair the latest video, all the files were still on the SD card and a new copy simply worked. I don't have the original files of the old ones anymore and I can't get the GoPro to automagically repair them :(

07:49:39 [WARN] Garbage found at the end of the file, removing 31067 bytes from the end.
07:49:39 [DEBUG] (1) default: QT_QUICK_CONTROLS_TEXT_SELECTION_BEHAVIOR ""
07:49:39 [ERROR] thread '' panicked at 'called Result::unwrap() on an Err value: InvalidData("zero timescale in mdhd")': C:\Users\runneradmin.cargo\git\checkouts\telemetry-parser-19821e7ac6d09f51\06e6f80\src\util.rs:102

Video causing the crash:
https://drive.google.com/file/d/1Gh-DMn6P78dij9ER9IfQrBYWBJBIxuw9/view?usp=share_link

How to make sense of data (from wasm)?

Hi,

I'm testing the WASM script for a Go Pro 10 video. I'm having a lot of success, but would like to understand how to read this data:
image

With the 10 GPS points given, how to they relate to each other? Do I assume they're equidistant by x milliseconds apart, and if so, what is x?

Thanks

Failed to identify as OpenCamera Sensor format since the data in scientific notation

hello, i record a video in OpenCamera Sensor APP in my phone , and it produces a gyro data in csv file. but this project failed to identify the correct format because some of the number recorded in scientific notation( it has 'E', just like this:) .
image

Then i just try to make the data show as actual text , and it success to identify the csv file. Hope for further improving so i don't need modify the csv file manually.

Question: Scale Calculation Accelerometer

"Accelerometer": {
"Name": "Accelerometer",
"Data": "[Vector3 { x: 2523, y: 1871, z: 4855 }, Vector3 { x: 1787, y: 1191, z: 4347 }, Vector3 { x: 807, y: -11, z: 2759 }, Vector3 { x:
"Unit": "m/s\u00b2",
"Matrix": "[[0.0, 0.0, 1.0, 0.0, -1.0, 0.0, 1.0, 0.0, 0.0]]",
"Scale": "418",
"Count": "231",
"Orientation": "ZyX",
"OrientationIn": "YxZ",
"OrientationOut": "ZXY"
},
Hi bit of a dumb question but I need clarification on the following point,
How does scale relate to the values in data ? ie how to get z in ms/^2 ?
I am using a gopro
Cheers

DJI *.srt new feature

Hi, will gyroflow work with DJI *.srt files? If this data is useful, I will be happy to write the code for this part.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.