# Assembled kit

<mark style="color:blue;">Check</mark> [<mark style="color:blue;">this video</mark> ](https://www.youtube.com/watch?v=IsTOK6ayfOo) <mark style="color:blue;">for setup instructions.</mark>

<mark style="color:green;">**Here's what has been done to your arms:**</mark>

* <mark style="color:green;">Set motor ids</mark>
* <mark style="color:green;">Calibration</mark>
* <mark style="color:green;">Teleoperation</mark>&#x20;

However, you will have to calibrate the arms again,

Follow the following steps, to get started:

1. <mark style="color:yellow;">Install LeRobot</mark>

Download the LeRobot source code:

```
git clone https://github.com/huggingface/lerobot.git
cd lerobot
```

Create a virtual environment with Python 3.10, using [`Miniconda`](https://docs.anaconda.com/miniconda/install/#quick-command-line-install)

```
conda create -y -n lerobot python=3.10
```

Then activate your conda environment, you have to do this each time you open a shell to use lerobot:

```
conda activate lerobot
```

When using `miniconda`, install `ffmpeg` in your environment:

```
conda install ffmpeg -c conda-forge
```

This usually installs `ffmpeg 7.X` for your platform compiled with the `libsvtav1` encoder. If `libsvtav1` is not supported (check supported encoders with `ffmpeg -encoders`), you can:

* Explicitly install `ffmpeg 7.X` using:

  ```
  conda install ffmpeg=7.1.1 -c conda-forge
  ```
* &#x20;If you want to bring your own ffmpeg: Install [ffmpeg build dependencies](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#GettheDependencies) and [compile ffmpeg from source with libsvtav1](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1), and make sure you use the corresponding ffmpeg binary to your install with `which ffmpeg`.

Install 🤗 LeRobot:

```
pip install -e .
```

#### Troubleshooting

If you encounter build errors, you may need to install additional dependencies: `cmake`, `build-essential`, and `ffmpeg libs`. To install these for linux run:

```
sudo apt-get install cmake build-essential python-dev pkg-config libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev pkg-config
```

#### 2. <mark style="color:yellow;">Find the USB ports associated with each arm</mark>

To connect servo board to the pc refer to [this picture.](https://partabot-1.gitbook.io/partabot/so-arm101/assembled-kit-pictures)

To find the port for each bus servo adapter, run this script:

```
lerobot-find-port
```

Example output:

```
Finding all available ports for the MotorBus.
['/dev/tty.usbmodem575E0032081', '/dev/tty.usbmodem575E0031751']
Remove the USB cable from your MotorsBus and press Enter when done.

[...Disconnect corresponding leader or follower arm and press Enter...]

The port of this MotorsBus is /dev/tty.usbmodem575E0032081
Reconnect the USB cable.
```

Where the found port is: `/dev/tty.usbmodem575E0032081` corresponding to your leader or follower arm.

3. <mark style="color:yellow;">**Calibrate**</mark>

Next, you’ll need to calibrate your robot to ensure that the leader and follower arms have the same position values when they are in the same physical position. The calibration process is very important because it allows a neural network trained on one robot to work on another.

**Follower**

Run the following command:

```
lerobot-calibrate \
    --robot.type=so101_follower \
    --robot.port=/dev/tty.usbmodem58760431551 \ # <- The port of your robot
    --robot.id=my_awesome_follower_arm # <- Give the robot a unique name
```

The video below shows how to perform the calibration. First you need to move the robot to the position where all joints are in the middle of their ranges. Then after pressing enter you have to move each joint through its full range of motion.

<mark style="color:purple;">Please refer to these</mark> [<mark style="color:purple;">joint movements</mark>](https://huggingface.co/docs/lerobot/so101#calibration-video) <mark style="color:purple;">for now as we work on our video.</mark>

**Leader**

Do the same steps to calibrate the leader arm, run the following command and follow calibration step:

```
lerobot-calibrate \
    --teleop.type=so101_leader \
    --teleop.port=/dev/tty.usbmodem58760431551 \ # <- The port of your robot
    --teleop.id=my_awesome_leader_arm # <- Give the robot a unique name
```

4. <mark style="color:yellow;">Teleoperate</mark>&#x20;

   Note that the `id` associated with a robot is used to store the calibration file. It’s important to use the same `id` when teleoperating, recording, and evaluating when using the same setup.

   Command:

   ```
   lerobot-teleoperate \
       --robot.type=so101_follower \
       --robot.port=/dev/tty.usbmodem58760431541 \
       --robot.id=my_awesome_follower_arm \
       --teleop.type=so101_leader \
       --teleop.port=/dev/tty.usbmodem58760431551 \
       --teleop.id=my_awesome_leader_arm
   ```

You are now ready to do more. [Follow...](https://huggingface.co/docs/lerobot/il_robots#record-a-dataset)\
\
Reach out to us at \[[hello@partabot.com](mailto:awantika@partabot.com)] if anything seems off — we’re here to help!
