Skip to content

6. Manage recording data

SamVanderstraeten edited this page Jan 16, 2023 · 1 revision

Recording data to train your model

To be able to train an AI model you need some data. You can gather data by driving your car around the track. If you 're using the docker container to control your car, all necessary software is already available! The only thing you need is an external computer to logon to your pi, or use that pc to send messages directly to the application.

ROS based

To send commands, for example to start recording data, we use ROS. (Robot Operating System) For more information about ROS see : ROS website

Toggle data recording

First of all, make sure you are connected with your Raspberry Pi and that you have an open terminal in the cardrivers container. View the Accessing your Raspberry Pi page to see the necessary steps to do this.

If you want to start recording, perform the following script :

rostopic pub /master/storage/start_recording std_msgs/Bool True --once

It then starts recording the manual input from the RC Controller with the video feed from the RPi.

To stop recording, perform the following script :

rostopic pub /master/storage/start_recording std_msgs/Bool False --once

To leave the shell execute the ´´´exit´´´ command.

If everything went well, you'll find that a folder /data/tubs has been created on the RPi with in it one or more subfolders (depending on how many times you started a recording), e.g.:

In this folder, you'll find all files needed to train an AI model, e.g.:

All data comes in pairs: a JPG image of the camera at a certain time and a JSON file with the sensor & steering data at the same moment. The JPG and JSON file will have the same label so you can easily match them and input them in a model training algorithm.