📌 置頂: 請把任何比你弱勢的用路人當作你的至親對待。跟前車保持安全車距 (2秒以上)。

Playing Openpilot data logs locally without connect.comma.ai

In

Tags:



by

Although most of the development tools from Openpilot are designed to interact with data on the cloud server from comma.ai, they also have the capability to work with data locally. However, the documentation for these tools may not make it clear how to use them in this way.

Fortunately, your device stores all of your Openpilot data logs on its own storage, so you can use tools like tools/replay or tools/plotjuggler to work with your local data instead of uploading and downloading data from connect.comma.ai. This can save a lot of time and effort.

This post provides a guide on how to access and work with local data using tools/replay and tools/plotjuggler.

0. Grabbing data logs from your device

To follow the steps in this guide, you will need to have SSH, ssh-keys, and connect your device to your hotspot or Wi-Fi. If you need help setting up SSH, please refer to the openpilot docs/SSH. We will assume that you have already set up SSH correctly for the rest of this guide.

A. By scp

a. Get all data from your device:

b. Get specific segment from your device

For example, if I want to get segment 42 of 2022-12-11--19-22-46 route, then the command should be:

B. By rsync

If you want to obtain rlog files without any videos and maintain the directory structure, using scp can be challenging. However, you can use rsync to achieve this easily.

For example, the following command can be used to obtain all rlog files and maintain the directory structure:

This will give us something like this:

1. Plotjuggler

Plotjuggler originally only supported cloud data, but added support for local data with the ntegan1 PR at May 9, 2022.

Assume we had the data directory above. First we will need to change the directory name to match how plotjuggler parse it by:

Then we can make plotjuggler to read and parse from our local data:

If we want to change the directory name back, we can run this:

2. Replay

Similarly, tools/replay also only support cloud data before deanlee’s PR at Sep 20, 2021.

Assume we had the data directory above. We can use --data_dir option to replay data locally:

Note that, even though the directory does not contain dongle id, you still need to provide it in your command line argument (it could be fake as any 16 digit hex).

If you don’t want to – or you don’t have videos in your directory, you will need to pass --no-vipc to tell replay not to output videos.

3. Qt Cabana

Qt Cabana also support --data_dir option for local data logs, and it support from day one thanks to Dean Lee!

Assume we had the data directory above. We can use --data_dir option to replay data locally:

Note that Qt Cabana required at least road cam or qcam exist (we reuse loader from replay, but not allowing REPLAY_FLAG_NO_VIPC flag), otherwise it will shows the following error message:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.