> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phospho.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Record a robotics dataset

> How to record a robotics dataset with your robot?

The easiest way to record datasets is to use the phospho Meta Quest app to control your robot arm.

Recorded datasets are saved in the `lerobot_v2` format from **[LeRobot](https://huggingface.co/lerobot)** and uploaded to your HuggingFace account.

<iframe className="w-full aspect-video" src="https://www.youtube.com/embed/AQ-xgCTdj_w?si=NDTtX1nISABjzmbA" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerPolicy="strict-origin-when-cross-origin" allowFullScreen />

Alternatively, you can implement your own dataset recording logic on top of the phospshobot API. Use the [Start Recording Episode](/recording/start-recording-episode) and [Stop Recording Episode](/recording/stop-recording-episode) endpoints to start and stop recording episodes. You can also read the [joints positions](/control/read-joints).

## Prerequisites

1. You need a robot arm such as the SO-100, the SO-101, or [other compatible hardware](https://github.com/phospho-app/phosphobot). Get the [phosphot starter pack here](https://robots.phospho.ai).
2. Install [the phosphobot software](/installation)

<CodeGroup>
  ```bash macOS theme={null}
  curl -fsSL https://raw.githubusercontent.com/phospho-app/phosphobot/main/install.sh | bash
  ```

  ```bash Linux theme={null}
  curl -fsSL https://raw.githubusercontent.com/phospho-app/phosphobot/main/install.sh | sudo bash
  ```

  ```powershell Windows theme={null}
  powershell -ExecutionPolicy ByPass -Command "irm https://raw.githubusercontent.com/phospho-app/phosphobot/main/install.ps1 | iex"
  ```

  ```bash uv (Linux and macOS) theme={null}
  # Install uv: https://docs.astral.sh/uv/
  curl -LsSf https://astral.sh/uv/install.sh | sh

  # Run phosphobot
  uvx phosphobot@latest run
  ```

  ```powershell uv (Windows) theme={null}
  # Install uv: https://docs.astral.sh/uv/
  powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

  # Run phosphobot
  uvx phosphobot@latest run
  ```
</CodeGroup>

3. Connect your cameras to the computer. Start the phosphobot server.

```bash theme={null}
phosphobot run
```

4. Complete the [quickstart](/so-100/quickstart) and check that you can [control your robot](/basic-usage/teleop).
5. You have the **[phosphobot teleoperation app](/examples/teleop)** is installed on your **Meta Quest 2, Pro, 3 or 3s**

<CardGroup>
  <Card title="Subscribe to phospho pro to unlock VR control" icon="vr-cardboard" href="https://phospho.ai/pro">
    Unlock access to VR Control, advanced AI training, and more.
  </Card>

  <Card title="Lifetime access to the phospho teleoperation app" icon="meta" href="https://www.meta.com/en-gb/experiences/phospho-teleoperation/8873978782723478/">
    Get the phospho teleoperation app on the Meta Store for Meta Quest 2, Pro, 3, and 3s.
  </Card>
</CardGroup>

<Info> If you bought our [phospho starter pack](https://robots.phospho.ai/starter-pack), you should have received a link to get the phospho teleoperation Meta Quest app. Please [reach out](mailto:contact@phospho.ai) if not.</Info>

# 1. Set up your Hugging Face token

To sync datasets, you need a Hugging Face token with write access. Follow these steps to generate one:

1. Log in to your Hugging Face account. You can create [one here for free](https://huggingface.co)

2. Go to **Profile** and click **Access Tokens** in the sidebar.

3. Select the **Write** option to grant write access to your account. This is necessary for creating new datasets and uploading files. Name your token and click **Create token**.

4. **Copy the token** and **save it** in a secure place. You will need it later.

5. Make sure the phosphobot server is running. Open a browser and access `localhost` or `phosphobot.local` if you're using the control module. Then go to the Admin Configuration.

6. **Paste the Hugging Face token**, and **save it**.

<img src="https://mintcdn.com/phospho/KyjRjlykwZZrI-pN/assets/admin-settings-huggingface.png?fit=max&auto=format&n=KyjRjlykwZZrI-pN&q=85&s=f90ede52900f3b401fbeedd56ac9625f" alt="Paste your huggingface token here" width="747" height="183" data-path="assets/admin-settings-huggingface.png" />

## 2. Set your dataset name and parameters

Go to the *Admin Configuration* page of your phospshobot dashboard. You can adjust settings. The most important are:

* **Dataset Name**: The name of the dataset you want to record.
* **Task**: A text description of the task you're about to record. For example: *"Pick up the lego brick and put it in the box"*. This helps you remember what you recorded and is used by some AI models to understand the task.
* **Camera**: The cameras you want to record. By default, all cameras are recorded. You can select the cameras to record in the Admin Configuration.
* **Video Codec**: The video codec used to record the videos. The default is `AVC1`, which is the most efficient codec. If you're having compatibility issues due to unavailable codecs (eg on Linux), switch to `mp4v` which is more compatible.

## 3. How to record a dataset using the phosphobot teleoperation Meta Quest app?

<Info>The phospho teleoperation app works with a [Meta Quest](https://www.meta.com/fr/quest/quest-3/?srsltid=AfmBOorMLUmJKFQr35ssCi1DDqSNgpHk0sLHqo_tHG8kgclCYbMToAPa). Compatible models: Pro, 2, 3, 3s.</Info>

1. In the Meta Quest, open the phospho teleop application. Wait a moment, then you should see a row displaying **phosphobot** or your computer name. Click the **Connect** button using the `Trigger Button`.

<Note>Make sure you're connected to the same WiFi as the phosphobot server or the control module</Note>

<Info>If you don't see the server, check the IP address and port of the server in the phosphobot dashboard and enter it manually.</Info>

<img src="https://mintcdn.com/phospho/KyjRjlykwZZrI-pN/assets/meta-quest-server-list.png?fit=max&auto=format&n=KyjRjlykwZZrI-pN&q=85&s=09c9aeba27c4b18d84b9e02287738576" alt="Select Phosphobot server" width="382" height="297" data-path="assets/meta-quest-server-list.png" />

2. After connecting, you'll see the list of connected cameras and recording options.

* Move the windows with the `Grip button` to organize your space.
* Enable preview to see the camera feed. Check the **camera angles** and adjust their positions if needed.

<Info>We recommend **disabling** the camera preview to save bandwidth.</Info>

<img src="https://mintcdn.com/phospho/KyjRjlykwZZrI-pN/assets/names_buttons.jpg?fit=max&auto=format&n=KyjRjlykwZZrI-pN&q=85&s=91ffeecef9d928f4c39418b172a55abb" alt="Meta Quest controller button names" width="365" height="537" data-path="assets/names_buttons.jpg" />

3. Press `A` once to start teleoperation and begin moving your controller.

   * The robot will naturally follow the movement of your controller. Press the `Trigger button` to close the gripper.
   * Press `A` again to stop the teleoperation. The robot will stop.

4. Press `B` to start recording. You can leave the default settings for your first attempt.

   * Press `B` again to stop the recording.
   * Press `Y` (left controller) to discard the recording.

5. Continue teleoperating and stop the recording by pressing `B` when you're done.

6. The recording is automatically saved in **LeRobot v2** format and **uploaded to your HuggingFace account.**

## 4. Check your dataset

Datasets are saved on the computer running the phosphobot server at `~/phosphobot/recordings/DATASET_NAME` folder in the phosphobot directory. Explore the recordings in the phosphobot dashboard using the *Dataset Browser*.

If you added your Hugging Face token in the dashboard, the recorded datasets are **automatically uploaded to your HuggingFace account.**

Go to your [Hugging Face profile](https://huggingface.co) to see the uploaded datasets.

## 5. Visualize your dataset

Once your dataset is uploaded to HuggingFace, you can view it using the [LeRobot Dataset Visualizer](https://huggingface.co/spaces/lerobot/visualize_dataset).

<img src="https://mintcdn.com/phospho/KyjRjlykwZZrI-pN/assets/lerobot_dataset_viz.png?fit=max&auto=format&n=KyjRjlykwZZrI-pN&q=85&s=88c803f176c2f4aa179f3e8efc006bf4" alt="LeRobot dataset visualizer" width="1266" height="892" data-path="assets/lerobot_dataset_viz.png" />

<Note>
  The dataset visualizer only works with the `AVC1` video codec. If you used another codec, you may see black screens in the video preview.
  Preview directly the videos files in a video player by opening your recording locally: `~/phosphobot/recordings/lerobot_v2/DATASET_NAME/video`.
</Note>

Looking good? You're ready to train your AI model!

# What's next

<Card title="Train an AI model" icon="brain" iconType="regular" href="/basic-usage/training">
  How to train an AI model from a dataset you recorded
</Card>
