# FineART robot description & camera parameters

Robot model and camera parameters for computing end-effector poses from FineART
`observation.state` / `action` and for relating them to the four camera streams.

```
robot/
├── trossen_dual_arm_SA.urdf     # both arms + all four camera frames, root link `world`
├── meshes/                      # from TrossenRobotics/trossen_arm_description (BSD-3, see LICENSE_trossen_arm_description)
├── joint_mapping.json           # the 14 state/action names → URDF joints
├── cameras/intrinsics.json      # K and distortion for the released 640×360 videos
└── examples/
    └── compute_ee_poses.py      # FK → per-frame EE pose CSV
```

## Robot

Trossen AI Stationary kit: two 6-DoF WidowX AI follower arms with parallel-jaw grippers.

**World frame:** z up. The right arm's base is at the origin facing +y; the left arm's base
is at (0, 0.915, 0) m facing −y, so the arms face each other across the table.

**State / action layout (14-D, per arm):**

| index | name | URDF joint | unit |
|---|---|---|---|
| 0 / 7 | `*_shoulder_pan` | `*_arm/joint_0` | rad |
| 1 / 8 | `*_shoulder_lift` | `*_arm/joint_1` | rad |
| 2 / 9 | `*_elbow_flex` | `*_arm/joint_2` | rad |
| 3 / 10 | `*_wrist_angle` | `*_arm/joint_3` | rad |
| 4 / 11 | `*_wrist_rotate` | `*_arm/joint_4` | rad |
| 5 / 12 | `*_gripper` | `*_arm/joint_5` | rad |
| 6 / 13 | `*_gripper_finger` | `*_arm/right_carriage_joint` | m (0 = closed, ~0.04 = open) |

> **Watch out:** `*_gripper` is the 6th revolute joint (wrist roll, ±π), **not** the gripper
> opening. The opening is `*_gripper_finger`. The URDF's `left_carriage_joint` is not a mimic
> joint; set it equal to `*_gripper_finger` (`joint_mapping.json` → `mirror_joints`).

Use `joint_mapping.json` rather than matching names by hand. If joint names don't resolve,
most FK libraries silently leave those joints at zero and you get a constant pose. Always
check that your EE trajectory actually moves.

**End-effector frame:** `left_arm/ee_gripper_link` / `right_arm/ee_gripper_link`, located
between the fingertips, 0.156 m beyond `link_6`.

```bash
pip install pin pandas pyarrow
python examples/compute_ee_poses.py --data data/chunk-000/file-000.parquet --episode 0
```

## Cameras

All four are Intel RealSense D405s, recorded at 1280×720 and released at 640×360 (an exact
0.5× downscale).

| stream | URDF frame | mounted on |
|---|---|---|
| `cam_high` | `cam_high_frame` | fixed, above the table |
| `cam_low` | `cam_low_frame` | fixed, at table height |
| `cam_left_wrist` | `left_arm/camera_color_optical_frame` | left arm, `link_6` |
| `cam_right_wrist` | `right_arm/camera_color_optical_frame` | right arm, `link_6` |

All four frames use the **optical convention** (z forward, x right, y down), so a point
`p_cam = inv(T_world_cam) @ p_world` projects with `cv2.projectPoints(p_cam, 0, 0, K, D)`.
For wrist cameras, `T_world_cam` depends on the arm's joint state; compute it with FK.

### Intrinsics (`cameras/intrinsics.json`)

Pinhole + `plumb_bob` distortion (OpenCV `[k1, k2, p1, p2, k3]`), already scaled to 640×360.

These are **nominal** values: the per-role median of the D405 factory calibrations across
the units used during collection. Different units were used over the course of collection
and the release does not record which unit filmed which episode. Individual units deviate
from nominal by up to ~4 px in focal length (≈1%) and ~7 px in principal point.

### Extrinsics

The camera poses in the URDF are **nominal mounting transforms** from the rig design, not
per-rig calibrations. They agree with the static transforms published by the recording stack
to within 1.5° (the wrist mount chain matches exactly).

What to expect:
- **Wrist cameras:** attached through the D405 mount chain, so they follow the arm exactly
  and are the most reliable.
- **`cam_high`:** projected end-effectors typically land on or within a few tens of pixels of
  the gripper.
- **`cam_low`:** the least certain.

Treat any TF tree built from these as approximate. If you need sub-centimetre camera
poses, refine per episode, e.g. by aligning projected gripper positions with detections.

## Known limitations

- No depth: only RGB was recorded.
- No per-episode camera serial, rig ID or per-rig extrinsic calibration in this release.
- About 0.1% of source recordings were captured at 640×480 rather than 1280×720. The nominal
  intrinsics do not apply exactly to those episodes.

## Attribution

Meshes and the base arm description are from
[TrossenRobotics/trossen_arm_description](https://github.com/TrossenRobotics/trossen_arm_description)
under the BSD 3-Clause License (`meshes/LICENSE_trossen_arm_description`).
