Koch 1.1

The lerobot docs keep changing, which is super annoying. Hopefully am calibrating this for the last time.

Issues:

  • right follower: the elbow flex is fcked up, and the shoulder pan is fucked up

TODO: I need to pin the port to a particular arm, so that every time it unplugs, its the same.

Calibration

The calibration was a little confusing.

Each motor has a reading from 0 to 4095.

    "wrist_roll": {
        "id": 5,
        "drive_mode": 0,
        "homing_offset": -1975,
        "range_min": 0,
        "range_max": 4095
    },
  • The homing offset will be set such that the mid point is actually the midpoint, so you don’t suffer from underflow./overflow afterwards

We also specify the range min and the range max.

def write_calibration(self, calibration_dict: dict[str, MotorCalibration], cache: bool = True) -> None:
        for motor, calibration in calibration_dict.items():
            self.write("Homing_Offset", motor, calibration.homing_offset)
            self.write("Min_Position_Limit", motor, calibration.range_min)
            self.write("Max_Position_Limit", motor, calibration.range_max)
 
        if cache:
            self.calibration = calibration_dict

The leader doing weird circles is something that needs to be fixed.

Ports

Finding the ports

lerobot-find-port

These are the ports when I plug the usb adapter into the top place.

Follower left

/dev/tty.usbmodem14201

Follower right

/dev/tty.usbmodem1301

Leader left

/dev/tty.usbmodem1201

Leader right

/dev/tty.usbmodem1101

Calibrate

lerobot-calibrate \
    --robot.type=bi_koch_follower \
    --robot.left_arm_port=/dev/tty.usbmodem114201 \
    --robot.right_arm_port=/dev/tty.usbmodem11301 \
    --robot.id=bimanual_follower
lerobot-calibrate \
    --teleop.type=bi_koch_leader \
    --teleop.left_arm_port=/dev/tty.usbmodem1201 \
    --teleop.right_arm_port=/dev/tty.usbmodem1101 \
    --teleop.id=bimanual_leader

Teleop

python -m lerobot.teleoperate \
    --robot.type=bi_koch_follower \
    --robot.left_arm_port=/dev/tty.usbmodem14201 \
    --robot.right_arm_port=/dev/tty.usbmodem1301 \
    --robot.id=bimanual_follower \
    --teleop.type=bi_koch_leader \
    --teleop.left_arm_port=/dev/tty.usbmodem1201 \
    --teleop.right_arm_port=/dev/tty.usbmodem1101 \
    --teleop.id=bimanual_leader \
    --robot.cameras="{ top: {type: opencv, index_or_path: 0, width: 640, height: 360, fps: 30}, front: {type: opencv, index_or_path: 1, width: 640, height: 360, fps: 30}}" \
    --display_data=true

Record a dataset

HF_USER=Gongsta python -m lerobot.record \
    --robot.type=bi_koch_follower \
    --robot.left_arm_port=/dev/tty.usbmodem14201 \
    --robot.right_arm_port=/dev/tty.usbmodem1301 \
    --robot.id=bimanual_follower \
    --teleop.type=bi_koch_leader \
    --teleop.left_arm_port=/dev/tty.usbmodem1201 \
    --teleop.right_arm_port=/dev/tty.usbmodem1101 \
    --teleop.id=bimanual_leader \
    --robot.cameras="{ top: {type: opencv, index_or_path: 0, width: 640, height: 360, fps: 30}, front: {type: opencv, index_or_path: 1, width: 640, height: 360, fps: 30}}" \
      --display_data=true \
      --dataset.repo_id=${HF_USER}/koch-baby-tshirt-folding \
      --dataset.num_episodes=100 \
      --dataset.reset_time_s=15 \
      --dataset.episode_time_s=180 \
      --dataset.single_task="Fold the t-shirt and put it in the bin" \
      --resume=True

Training