Visualizing Multi-Modal Data

Data visualization constitutes a vital component of data collection, particularly in scenarios where numerous data modalities exist. The rational presentation of data holds paramount significance in enhancing the efficiency of data collection and review. We provide a data viewer for users to watch the data streamed from MagiClaw in real-time or replay the recorded data to check the quality.

Install Data Viewer

First, you need to connect the control box and your PC to the same local network.

To set up the MagiClaw Viewer, first clone the repository:

git clone https://github.com/asMagiClaw/magiclaw-viewer.git
cd magiclaw-viewer

It's recommended to create conda environment, and install the required dependencies:

conda create -n magiclaw-viewer python=3.10
conda activate magiclaw-viewer
pip install -r requirements.txt

The viewer requires a configuration file to connect to the MagiClaw and visualize the data. The default configuration file is located at configs/viewer.yaml. You can modify this file to suit your setup, including the host and port of the control box. The file structure is as follows:

magiclaw_0:
  host: xx.xx.xx.xx
  port: 6300
magiclaw_1:
  host: xx.xx.xx.xx
  port: 6400

where magiclaw_0 and magiclaw_1 refer to the ID of the grippers, host refers to the IP address of the control box, and port refers to the port number. You need to change the values of host with the actual IP address of the control box. The values of port do not need to be changed, which is the default data ports of the control box.

Visualize Real-Time Data

After setting up the configuration, you can start the viewer by running the following command:

python viewer.py --mode live --number <number> --type <type>

where <number> refers to the number of the MagiClaw to connect to, including 1 and 2, and <type> refers to the type of MagiClaw, including magiclaw-in-hand and magiclaw-on-robot.

Then a new window will show the data streamed from the MagiClaw.

Review Recorded Data

To review recorded data, you can start the viewer by running the following command:

python viewer.py --mode replay --number <number> --type <type> --data_path <data_path>

where <number> refers to the number of the MagiClaw to connect to, including 1 and 2, <type> refers to the type of MagiClaw, including magiclaw-in-hand and magiclaw-on-robot, and <data_path> refers to the path of the recorded data file.

Last updated