Add article on analyzing the logs

This commit is contained in:
Oleg Kalachev 2024-06-02 11:46:32 +03:00
parent 72b2cf49d5
commit 1a22350775
5 changed files with 73 additions and 1 deletions

View File

@ -9,7 +9,7 @@
* Simple and clean Arduino based source code.
* Acro and Stabilized flight using remote control.
* Precise simulation using Gazebo.
* In-RAM logging.
* [In-RAM logging](docs/log.md).
* Command line interface through USB port.
* Wi-Fi support.
* MAVLink support.

BIN
docs/img/flightplot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
docs/img/foxglove.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
docs/img/plotjuggler.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

72
docs/log.md Normal file
View File

@ -0,0 +1,72 @@
# Log analysis
Flix quadcopter uses RAM to store flight log data. The default log capacity is 10 seconds at 100 Hz. This configuration can be adjusted in the `log.ino` file.
To perform log analysis, you need to download the log right after the flight without powering off the drone. Then you can use several tools to analyze the log data.
## Log download
To download the log, connect the ESP32 using USB right after the flight and run the following command:
```bash
make log
```
Logs are stored in `tools/log/*.csv` files.
## Analysis
### PlotJuggler
The recommended tool for log analysis is PlotJuggler.
<img src="img/plotjuggler.png" width="500">
1. Install PlotJuggler using the [official instructions](https://github.com/facontidavide/PlotJuggler?tab=readme-ov-file#installation).
2. Run PlotJuggler and drag'n'drop the downloaded log file there. Choose `t` column to be used as X axis.
You can open the most recent downloaded file using the command:
```bash
make plot
```
You can perform both log download and run PlotJuggler in one command:
```bash
make log plot
```
### FlightPlot
FlightPlot is a powerful tool for analyzing logs in [ULog format](https://docs.px4.io/main/en/dev_log/ulog_file_format.html). This format is used in PX4 and ArduPilot flight software.
<img src="img/flightplot.png" width="500">
1. [Install FlightPlot](https://github.com/PX4/FlightPlot).
2. Flix repository contains a tool for converting CSV logs to ULog format. Build the tool using [the instructions](../tools/csv_to_ulog/README.md) and convert the log you want to analyze.
3. Run FlightPlot and drag'n'drop the converted ULog-file there.
### Foxglove Studio
Foxglove is a tool for visualizing and analyzing robotics data with very rich functionality. It can import various formats, but mainly focuses on its own format, called [MCAP](https://mcap.dev).
<img src="img/foxglove.png" width="500">
1. Install Foxglove Studio from the [official website](https://foxglove.dev/download).
2. Flix repository contains a tool for converting CSV logs to MCAP format. First, install its dependencies:
```bash
cd tools
pip install -r requirements.txt
```
3. Convert the log you want to analyze:
```bash
csv_to_mcap.py log_file.csv
```
4. Open the log in Foxglove Studio using *Open local file* command.