# Robot Teacher Guide

Guide for Robot Teachers on collecting teleoperation data and working with simulation environments.

## Setup

1. Clone the repo (with submodules):
   ```bash
   git clone --recurse-submodules <repo-url>
   cd sim-improvement
   ```

2. Sync dependencies:
   ```bash
   uv sync
   ```

## Data Collection (Teleoperation)

Data is collected via dual SpaceMouse teleoperation in Isaac Lab simulation environments.

### Prerequisites

- Two 3Dconnexion SpaceMouse devices connected
- NVIDIA GPU with CUDA support

### Running Teleoperation

```bash
sudo chmod 666 /dev/hidraw*

CUDA_VISIBLE_DEVICES=0 uv run scripts/teleop.py \
  --task LBM-Scenario-ImplicitRelativeIK-State \
  --scene_path ./envs/lbm_configs/1_riverway_drying_rack/HangMugFromDryingRack.json \
  --library_dir ./envs/lbm_usd_library \
  --enable_cameras
```

### Teleop Arguments

| Argument | Description | Default |
|---|---|---|
| `--task` | Environment task name | (required) |
| `--scene_path` | Path to scene config JSON | `None` |
| `--library_dir` | Path to shared USD model library | `None` |
| `--run_folder` | Output directory for recorded trajectories | `teleop_data` |
| `--pos_sensitivity` | Position sensitivity | `0.15` |
| `--rot_sensitivity` | Rotation sensitivity | `0.4` |
| `--num_envs` | Number of parallel environments | `1` |
| `--enable_cameras` | Enable camera rendering | (flag) |
| `--overwrite` | Overwrite existing run folder | (flag) |

### Controls

- **Left SpaceMouse**: Controls left arm (6-DOF pose)
- **Right SpaceMouse**: Controls right arm (6-DOF pose)
- **Right button (either mouse)**: Reset the environment
- **Left button**: Toggle Gripper Open/Close

Each action is 14-dimensional: `[left_ik(6), right_ik(6), left_gripper(1), right_gripper(1)]`.

### Available Scenes

| Scene | Config Path |
|---|---|
| Hang Mug from Drying Rack | `envs/lbm_configs/1_riverway_drying_rack/HangMugFromDryingRack.json` |
| Apple from Bowl into Bin | `envs/lbm_configs/2_riverway_shelf/AppleFromBowlIntoBin.json` |
| Bell Pepper in Bin | `envs/lbm_configs/2_riverway_shelf/BellPepperInBin.yaml` |
| Banana on Saucer | `envs/lbm_configs/3_cabot_breakfast/BananaOnSaucer.json` |
| Cup in Center | `envs/lbm_configs/3_cabot_breakfast/CupInCenter.json` |
| Separate Fruits | `envs/lbm_configs/4_cabot_kitchen_tabletop/SeparateFruits.json` |
