Code Monkey home page Code Monkey logo

blackbox-log-viewer's Introduction

Cleanflight Blackbox Explorer

Main explorer interface

This tool allows you to open logs recorded by Cleanflight's Blackbox feature in your web browser. You can seek through the log to examine graphed values at each timestep. If you have a flight video, you can load that in as well and it'll be played behind the log. You can export the graphs as a WebM video to share with others.

Installation

There are three methods of installation available:

Chrome Web Store method

The easiest way to get the explorer (if you have Google Chrome) is to install it from the Chrome Web Store:

https://chrome.google.com/webstore/detail/cleanflight-blackbox-expl/cahpidddaimdojnddnahjpnefajpheep

This will add it to your computer as a Chrome App.

Manual Chrome App install

Download the contents of this repository by clicking the "download ZIP" button on the right of this page. Unpack the zip somewhere on your computer. In Google Chrome, open up the Extensions page, tick the "developer mode" tickbox, click the "load unpacked extension" button, and point it at the unpacked folder. This will add it as a Chrome App.

Run as a webpage

Download the contents of this repository by clicking the "download ZIP" button on the right of this page. Unpack the zip somewhere on your computer, and double click "index.html" file to open it with your web browser.

Note that the "video export" feature is only available when opened with Google Chrome. Also, running it this way will limit the exported flight video to 500MB in size. Use one of the previous Chrome App install methods to unlock >500MB video export.

Usage

Click the "Open log file/video" button at the top right and select your logged ".TXT" file and your flight video (if you recorded one).

You can scroll through the log by clicking or dragging on the seek bar that appears underneath the main graph. The current time is represented by the vertical red bar in the center of the graph. You can also click and drag left and right on the graph area to scrub backwards and forwards.

Syncing your log to your flight video

The blackbox plays a short beep on the buzzer when arming, and this corresponds with the start of the logged data. You can sync your log against your flight video by pressing the "start log here" button when you hear the beep in the video. You can tune the alignment of the log manually by pressing the nudge left and nudge right buttons in the log sync section, or by editing the value in the "log sync" box. Positive values move the log toward the end of the video, negative values move it towards the beginning.

Customizing the graph display

Click the "Graph Setup" button on the right side of the display in order to choose which fields should be plotted on the graph. You may, for example, want to remove the default gyro plot and add separate gyro plots for each rotation axis. Or you may want to plot vbat against throttle to examine your battery's performance.

Notes

This tool has not been tested on Internet Explorer, but definitely won't work on versions earlier than version 9.

Your web browser must support the video codec that your flight video uses in order to play it. Firefox doesn't support H.264 videos on Mac, so if your video won't play, try Google Chrome instead. If it still won't play, follow the instructions in the next section to convert your video using Handbrake.

The best performing web browser tends to be Google Chrome, especially when trying to play your flight video at the same time.

This tool is currently in the Beta stage, so a number of key features have yet to be implemented:

  • There is no control over the amount of smoothing applied to the graph lines
  • There is no way to single-step between loop iterations with the arrow keys

Native app build via NW.js

Development

  1. Install node.js
  2. Change to project folder and run npm install.
  3. Run npm start to build & run the debug flavor.

App build and release

The tasks are defined in gulpfile.js and can be run either via gulp <task-name> (if the command is in PATH or via ../node_modules/gulp/bin/gulp.js <task-name>:

  1. Optional, install gulp npm install --global gulp-cli.
  2. Run gulp <taskname> [[platform] [platform] ...].

List of possible values of <task-name>:

  • dist copies all the JS and CSS files in the ./dist folder.
  • apps builds the apps in the ./apps folder [1].
  • debug builds debug version of the apps in the ./debug folder [1].
  • release zips up the apps into individual archives in the ./release folder [1].

[1] Running this task on macOS or Linux requires Wine, since it's needed to set the icon for the Windows app (build for specific platform to avoid errors).

Build or release app for one specific platform

To build or release only for one specific platform you can append the plaform after the task-name. If no platform is provided, only for the platform you are builing from will be build.

  • MacOS use gulp <task-name> --osx64
  • Linux use gulp <task-name> --linux64
  • Windows use gulp <task-name> --win32
  • ChromeOS use gulp <task-name> --chromeos

You can also use multiple platforms e.g. gulp <taskname> --osx64 --linux64.

macOS DMG installation background image

The release distribution for macOS uses a DMG file to install the application. The PSD source for the DMG backgound image can be found in the root (dmg-background.png). After changing the source, export the image to PNG format in folder ./images/.

Flight video won't load, or jumpy flight video upon export

Some flight video formats aren't supported by Chrome, so the viewer can't open them. You can fix this by re-encoding your video using the free tool Handbrake. Open your original video using Handbrake. In the output settings, choose MP4 as the format, and H.264 as the video codec.

Because of Google Bug #66631, Chrome is unable to accurately seek within H.264 videos that use B-frames. This is mostly fine when viewing the flight video inside Blackbox Explorer. However, if you use the "export video" feature, this bug will cause the flight video in the background of the exported video to occasionally jump backwards in time for a couple of frames, causing a very glitchy appearance.

To fix that issue, you need to tell Handbrake to render every frame as an intraframe, which will avoid any problematic B-frames. Do that by adding "keyint=1" into the Additional Options box:

Handbrake settings

Hit start to begin re-encoding your video. Once it finishes, you should be able to load the new video into the Blackbox Explorer.

License

This project is licensed under GPLv3.

blackbox-log-viewer's People

Contributors

basdelfos avatar borisbstyle avatar fedorcomander avatar garykeeble avatar hydra avatar johnnyruz avatar jrussellsmyth avatar martinbudden avatar mcgivergim avatar mikeller avatar pawel-spychalski avatar rav-rav avatar stefanfeederle avatar steveamor avatar thenickdude 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

Watchers

 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

blackbox-log-viewer's Issues

Video Export Stops Midway

Currently, I'm new to Cleanflight and I've been having some trouble.
I flew my tricopter and recorded about 8:00 of blackbox data, and then tried to overlay it with matching Mobius footage as usual. The rendering in Blackbox Explorer goes smoothly, but then stops at 52.8% every time.

I'm running OS X, both videos were done at 30FPS 720P w/ 0% dimming.
This issue seems to be specific to these files, as those from a later flight render just fine.

Ability to zoom in the timeline

It would be nice to be able to change reporing time interval to see more clearly differences between loop to loop and smaller ripples or even to zoom out to see the bigger picture.

Can't play log but log is loaded

Hi,

I want to look my log in viewer but I can't play it in my Chrome. Sometimes shows WebGL error. I can load the log into viewer but the viewer shows me blank, the graph don't exist.
I'm using Windows 8.1 32bit, Ati Radeon Xpress 1100.

I Googled for WebGL error and give me result that is from VGA driver. I have updated it but still no luck. Any how to fix this?

Thanks

Blackbox explorer freeze at the calculating screen

Hi,

I'm using this tool and works very well but when i try to render a logfile without video, i have the screen that say calculating and it freeze at this point. I can move the windows, the app is working but the render won't start.

I'm under windows 10, the app is installed by chrome.
thank you.

Plus quad not supported in viewer

I recently got some logs tearing around in my Mitsuko and found there is no way to change the visualization from a X quad to a + quad. This would be helpful in visualizing how much the rear motor is working to providing forward thrust.

It's clear the rear motor (1 on the + quad) corresponds to the back left motor (1 on the X quad), of course, but it would be nice if the visualization matched the data.

screen shot 2015-12-10 at 12 39 50 am

unable to open spectrum analyser

I use the latest blackbox explorer (9333f41).

I open a log file and it can be seen, however the "View/hide analyser display" doesn't seem to work at all. When clicked, the window is not shown and the icon doesn't turn yellow.

Did it change? It used to work for me some time ago...
How to debug it further?

overlay % does not seems to work

overlay % does not seems to work, using 80% or 20% seems to give the same video result.

also give possibility to specify desired overlay, i've got some dark video where a 10% or even 0% should be sufficient.

add acceleration (and maybe estimated speed) graphic

if the log data contain heading we can estimate the G vector, and subract it to the acceeleration vector, so we get the real acceleration along the 3 axis.

Integrating those acceleration also give a rough estimation of the speed, that would be nice to have.

Separate the log parsing code out into a reusable library?

Hi there, a long term follower of cleanflgiht blackbox log analysis here. I'm wondering if folks are fine to sparate the parsing code in flightlog_parser.js out into a reusable library that can be used by third-party apps? The reason for the ask is, with the current logging logic in the firmware, especially with all the field encodings and frame format, it's really hard to code something from ground-up (nor does it make much economic sense) just to work with the logging code that was written over 5 years ago. Hopefully with a separate library, it'll make things easier and encourage a richer ecosystem around PID tuning and issue diagnosis, as other developers can focus on high-level data representations instead of worrying about all the nitty-gritty encoding/frame format issues.

exported video file size

taking gp4 file and rendering it to 966x540 60fps, that 5 min file comes out to 137mb

import it into bblv and render at 720 and the file is 1.03 gig

any hints on how to reduce exported file size?

blackbox quad icon jumping

when I run my log file the icon on the upper left display of the quad, jerks madly in all directions, the graphs display ok. Is this a icon rendering error or is it actually what is recorded incorrectly ?

Add ability to customize graph color

I prefer my graph colors to be consistent, so that I can learn to intuitively read the graphs. For example, I always set my graphs up with P, then I, then D so that the colors are consistent. If I have P and D turned on but I turned off, I set the traces up as 1:P, 2:D, 3:D, so that the 3rd trace overlays the 2nd trace and maintains the same color as if the 2nd, I trace, was on. This is kind of cumbersome. Ideally, I'd like to be able to assign a color to each of the traces manually and have that setting remembered. For example, in a master configuration, assign PID_P[pitch] = cyan across all graphs; PID_I[pitch]=magenta; and so forth.

Add ability to go frame by frame with arrow keys

Similar to the way quicktime player works (or any video player) it would be immensely helpful to be able to use the left / right arrow keys to go frame by frame. Shift arrow could go 10 frames.

In Firefox, Playback stops when trying to jump to a certain spot in the graph

When attempting to click the graph below the main window in Firefox (Windows 7, 37.0.1), most of the time, playback stops as if it was reset to the beginning and paused, the red bar disappears, and playback can not be resumed. Seemingly at random, it does work to skip to the spot in the graph, but only rarely and not the same spot twice. Also, the index timer in the bottom right displays NaN:NaN:NaN when this happens.
ff

None of this occurs with Chrome, using the exact same log file and exact same log viewer.

Exporting video always Calculating

I tried on Debian Jessie Mate, Ubuntu Mate 16.04 (now fresh install) & Chrome 53.0.2785.116 (64-bit) at all times and nothing happens, always Calculating... the file size, and no rendering.

Here is the DeveloperTools console output:
http://imgur.com/a/eypT0

Add graph setup profiles

I have several common setups that I use for analysis. It'd be nice to be able to switch between them without having to manually set them up every time.

View MAVLink Log Files

Hello!
I want to add the ability to use blackbox-log-viewer with MAVLink .bin (log files)
Currently i think about some kind of log file converter from MAVLink .bin files to blackbox .txt
Is there some relevant projects/papers/blog post that i should read?
I found good description of Blackbox protocol. Should I learn it or it will be enough to use included libraries?
Can you suggest better approach? Any help will be welcomed! Thx in advance!

add ability to change orientation of 3D quad/motor visualization

feature request:
add the ability to change the axis orientation for the 3D quad so that it can be seen from sides and front&rear, versus only being able to view it 'from above' (as it is now). This would help in diagnosing issues with roll & pitch movement (oscillations, bounce-back, etc.) by being able to better view small changes in the quad's attitude.

Jumpy video when exported

Using the Chrome App, the video is jumpy. An example can be seen here:

https://www.youtube.com/watch?v=sbt2P54ZjRQ&feature=youtu.be

The video feed comes from the Fatshark V2 on board DVR. The format was not supported, so it was converted to H264, H264 forced 30FPS and MP4 (using handbrake).

MP4 did not work, and both H264 formats jumped like in the Youtube video.

When viewed in the chrome app, everything looks fine though.

OS: Mac OS 10.10.4
Chrome: 44.0.2403.155 (64-bit)

Standalone app in Firefox does not work

Firefox seems not to be able to run the blackbox-log-viewer as standalone app.
Steps to reproduce:

  1. Install firefox quantum 68.0.1 (64-bit) on Ubuntu
  2. Download full zip of blackbox-log-viewer from github and unzip it to a folder
  3. Run firefox and open the index.html page
  4. See debug console:
    20:06:57.789 require does not exist, maybe inside chrome index.js:84:17 20:06:57.788 ReferenceError: chrome is not defined main.js:1892:9 20:06:57.792 ReferenceError: chrome is not defined release_checker.js:16:5 20:06:57.809 ReferenceError: chrome is not definedlocalization.js:9:9
    Try to open any BBL file, nothing will happen.

Error opening log: No logs in this file could be parsed successfully

Hi, on both blackbox_decode and the blackbox-log-viewer, i am getting the following message when i open one of the .TXT files from my Blackbox SD card:

Error opening log: No logs in this file could be parsed successfully

I can't seem to get the tool to accept any of the files, yet they are a few hundred kilobytes big. My looptime is 1600, is that too low? i've seen a proper looking logfile and mine looks totally garbled.
Thanks.

screen shot 2015-06-30 at 23 16 58
screen shot 2015-06-30 at 23 16 20
screen shot 2015-06-30 at 23 20 32

log truncated error

Hi !

I have no issue to read my log files with blackbox_render tool.
But when i try to load them into blackbox explorer then it says : "Error : Log is truncated, contains no data"

I record with those settings :
115200,26,3,0,1,1,0
baud,escape,esc#,mode,verb,echo,ignoreRX

Blackbox is triggered from a switch.

And I import my log files directly from the SD card (i cannot plug openlog TX to my FC to import from cleanflight).

May you please tell me what is going wrong?
i've attached a log as example.
LOG00016.zip

unable to open logfile in viewer

I currently struggle to open a blackbox logfile within the viewer. I am able to extract it using the tools but there seems to be no interaction with the viewer once I try to open it. Please see below the decoding (it might be possible that entry 2 is causing this) and the attached logfile

blackbox_decode LOG00134.TXT
Decoding log 'LOG00134.TXT' to 'LOG00134.01.csv'...

Log 1 of 4, start 00:10.546, end 01:25.804, duration 01:15.257

Statistics
Looptime 1882 avg 458.0 std dev (24.3%)
I frames 2312 38.1 bytes avg 88195 bytes total
P frames 34570 24.5 bytes avg 846409 bytes total
E frames 1 12.0 bytes avg 12 bytes total
S frames 46 4.0 bytes avg 184 bytes total
Frames 36882 25.3 bytes avg 934604 bytes total
Data rate 490Hz 12467 bytes/s 124700 baud

17 frames failed to decode, rendering 115 loop iterations unreadable. 38360 iterations are missing in total (38367ms, 50.98%)

Decoding log 'LOG00134.TXT' to 'LOG00134.02.csv'...

Log 2 of 4Statistics
E frames 1 12.0 bytes avg 12 bytes total
Frames 0
Data rate: Unknown, no timing information available.

1 iterations are missing in total (0ms, 100.00%)

Decoding log 'LOG00134.TXT' to 'LOG00134.03.csv'...

Log 3 of 4, start 02:25.534, end 02:29.398, duration 00:03.864

Statistics
Looptime 999 avg 23.2 std dev (2.3%)
I frames 121 33.7 bytes avg 4074 bytes total
P frames 1812 21.8 bytes avg 39527 bytes total
E frames 2 9.0 bytes avg 18 bytes total
S frames 1 4.0 bytes avg 4 bytes total
Frames 1933 22.6 bytes avg 43601 bytes total
Data rate 500Hz 11579 bytes/s 115800 baud

1932 loop iterations weren't logged because of your blackbox_rate settings (1931ms, 49.99%)

Decoding log 'LOG00134.TXT' to 'LOG00134.04.csv'...

Log 4 of 4, start 03:16.295, end 03:27.295, duration 00:11.000

Statistics
Looptime 999 avg 23.5 std dev (2.4%)
I frames 338 34.4 bytes avg 11642 bytes total
P frames 5043 22.6 bytes avg 113946 bytes total
E frames 2 9.0 bytes avg 18 bytes total
S frames 5 4.0 bytes avg 20 bytes total
Frames 5381 23.3 bytes avg 125588 bytes total
Data rate 489Hz 11548 bytes/s 115500 baud

3 frames failed to decode, rendering 14 loop iterations unreadable. 120 iterations are missing in total (119ms, 1.09%)
5500 loop iterations weren't logged because of your blackbox_rate settings (5499ms, 50.00%)

log00134 txt

Fix automatic color assignment for graph lines

Improve the automatic color assignment for graph lines so that similar traces across multiple graphs will receive similar coloring (e.g. if you have P, I, D plotted for pitch and Gyro, P, I, D plotted for roll, the PID terms should receive the same coloring even though they don't appear in the same order on the graph legends).

Unable to render graph

When log file is opened after video file, no graph will be rendered. The other way around works just fine.

Saving Graph Setup

It would be nice to be able to save different graph setups so you don't have to reconfigure each time when looking to different things.

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.