This is an application that creates videos with data plotted in graph through the libraries matplotlib and ffmpeg. The plotted data correspond to samples from the sensors embedded in the module MPU-9250 (accelerometer, gyroscope and magnetometer) and GPS data (speed).
First, clone this repository:
git clone https://github.com/Intelligent-Vehicle-Perception/MPU-9250-Data-Plot-Video-Creator.git
Next, you need to download ffmpeg and add to environment variables.
To generate the videos, first configure the variables in the file settings.py:
- dataset: dataset to be plotted.
- folder: folder where the data is.
- ini: time the plot starts.
- end: time the plot ends.
- side: side to be plotted (left or right).
After configuration, run the following command to create the video:
python src/plot_video.py
Or run the following command to show live graph:
python src/plot_show.py
Below, an example of a frame from one of the generated videos.
To join videos side by side, we used the following command:
ffmpeg -i video1.mp4 -i video2.mp4 -filter_complex '[0:v]pad=iw*2:ih[int];[int][1:v]overlay=W/2:0[vid]' -map [vid] -c:v libx264 -crf 23 -preset veryfast output.mp4
To cite this repository, use the reference below:
@software{menegazzo3960614,
author = {Jeferson Menegazzo and Aldo von Wangenheim},
title = {{MPU-9250 Data Plot Video Creator}},
month = jul,
year = 2020,
publisher = {Zenodo},
version = {1.0.5},
doi = {10.5281/zenodo.3960614},
url = {https://github.com/Intelligent-Vehicle-Perception/MPU-9250-Data-Plot-Video-Creator}
}
This project is under Attribution-NonCommercial-NoDerivatives 4.0 International License (CC BY-NC-ND 4.0). Please see License File for more information.