> ## 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.

# Control your robot arm

> How to remote control a robot arm with a keyboard, in VR, with an API or a leader arm?

phosphobot lets you control the SO-100 or SO-101 robot arm with:

* your keyboard
* a game controller
* the HTTP API
* the Meta Quest app
* a leader arm or another follower arm
* by playing back a recording
* with AI

You can also control other kind of robots and [write your own controllers.](https://github.com/phospho-app/phosphobot/tree/main/phosphobot)

<Note>
  If you don't have a robot arm, you can get hardware [here](https://robots.phospho.ai/).
</Note>

## Prerequisites

To control your robot, you need to install [phosphobot](/installation). Make sure the robot was [calibrated with phosphobot](/so-100/quickstart). No robot? Get one [here](https://robots.phospho.ai/?utm_source=docs).

<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>

## Control with a keyboard

Use `phosphobot` to control your SO-100, SO-101, or any supported robot arm with your keyboard, using the **arrow keys** to move the robot arm in the desired direction.

<iframe className="w-full aspect-video" src="https://www.youtube.com/embed/Yun4Twtm_wc" title="so100 so101 robot arm keyboard control" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerPolicy="strict-origin-when-cross-origin" allowFullScreen />

Go to `localhost` in your web browser to access the phosphobot dashboard. Go to **Keyboard Control**. Click on the **Start robot** button to start controlling the robot arm with your keyboard. Click on the **Stop robot** button to stop controlling the robot arm with your keyboard.

## Control with a game controller

You can control your robot arm using standard game controllers (Xbox, PlayStation, or similar) for more intuitive and ergonomic control.

<iframe className="w-full aspect-video" src="https://www.youtube.com/embed/JQupdd2VOqA" title="so100 so101 robot arm gamepad control" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerPolicy="strict-origin-when-cross-origin" allowFullScreen />

1. **Connect your controller** to your computer via USB or Bluetooth.

2. Go to `localhost` in your web browser to access the phosphobot dashboard. Navigate to the **Control** page and select the **Gamepad control** tab.

3. **Press any button** on your controller to activate it. The dashboard will detect your controller automatically.

4. The robot will **start moving automatically** once the gamepad is detected.

**Control mapping:**

* **Left stick**: Rotate (X-axis) and move up/down (Y-axis)
* **Right stick**: Strafe left/right (X-axis) and move forward/backward (Y-axis)
* **D-Pad or face buttons (ABXY)**: Wrist pitch and roll control
* **L1/R1 bumpers**: Toggle gripper open/close
* **L2/R2 triggers**: Analog gripper control (0-100%)
* **Start/Menu**: Move arm to sleep position

<Info>
  The gamepad control feature requires a browser with Gamepad API support (Chrome/Edge 21+, Firefox 29+, Safari 10.1+).
</Info>

## Control in Virtual Reality

Control your robot arm in virtual reality with the Meta Quest app. This app lets you control your robot arm in VR, using the Meta Quest controllers.

<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>

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

<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.**

## Control with a leader arm

phosphobot supports one or multiple leader arms. A leader arm is a robot arm that you can use to control another robot arm, called the follower arm. The leader arm is used to control the follower arm in real time, allowing you to control the follower arm as if you were physically present.

<iframe className="w-full aspect-video" src="https://www.youtube.com/embed/sTJ4D8w7LhY" title="VR Control tutorial" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerPolicy="strict-origin-when-cross-origin" allowFullScreen />

1. Plug the leader arm.

2. Calibrate the leader arm the same way you calibrated the robot arm.

3. Go to the phosphobot dashboard, in the **Control** page and click on the **Leader Arm** section.

<Note>You have more than one pair leader/follower arms, using the + button to add more</Note>

### Does the leader arm need to be calibrated?

Yes, the leader arm needs to be calibrated the same way you calibrated the robot arm. The calibration is done in the **Calibration** page of the phosphobot dashboard.

### Can you do bimanual teleoperation with two leader arms? Can I control two robot arms with two leader arms?

Yes, you can control two robot arms with two leader arms. You need to plug both leader arms and calibrate them the same way you calibrated the robot arms. Then, go to the **Control** page of the phosphobot dashboard and click on the **Leader Arm** section. You can add multiple leader arms by clicking on the + button.

### Is the leader arm mandatory?

No, the leader arm is optional. You can control the robot arm with the keyboard, the game controller, the HTTP API, or the Meta Quest app without a leader arm. The leader arm is just an additional way to control the robot arm.

## Control with the HTTP API

Once your phosphobot server is running, you can send your first command to the robot arm.

<Warning>
  Make sure the robot is well fixed and the area around is clear before sending
  any command.
</Warning>

1. Go to the interactive API docs on the phosphobot dashboard: [localhost/docs](http://localhost/docs). On the control module, the address [phosphobot.local/docs](http://phosphobot.local/docs). This page lets you send commands to the robot arm.

2. Trigger the `/move/init` endpoint to initialize the robot (click `Try it out` and then press `Execute`).

3. Your robot arm moves to the default position. *It's alive!* 🎉

4. Now, you can call the `/move/absolute` endpoint to move the robot to a specific position. The distances are in centimeters, and the angles in degrees.

## Control by playing back a recording

You can [record episodes](./dataset-recording.mdx) and then play them back to control the robot arm using [the recording feature](../recording/play-recording).

## Control with AI

You can [train an AI model](./training) and then run [AI control.](./inference) Basically, the AI model will predict the next position of the robot based on the previous position and what the cameras sees. This is a whole [area of research.](../learn/policies)

## What's next?

<Card title="Record a dataset" icon="database" iconType="regular" href="/basic-usage/dataset-recording">
  How to record a dataset with your robot
</Card>
