# C401 Prompts: AI Assistant Prompts for Processing Egocentric Footage

> Copy-paste prompts for an AI assistant from the C401 processing course: convert a recording to the EuRoC layout, choose a SLAM system by licence and lens, diagnose a failing trajectory, evaluate a trajectory, lift hands into the world frame, write an annotation boundary rule, audit machine labels, and export to LeRobotDataset v3.0. Each states its inputs, the tool it targets, how to check the output and the field guide page it relies on.

Page: https://egocam.ai/university/c401/prompts/

These prompts hand one practical job each to an AI assistant (Claude, ChatGPT, Gemini or another). Paste your own files and values where the square brackets are. Each prompt states what it needs, which tool it targets, how to check what comes back, and the field guide page whose facts it relies on.

An assistant can mix up a pose's frame, reorder a quaternion or invent a threshold as easily as a person can. The prompts tell it not to, and every one ends with a check you run yourself. Treat the output as a draft until that check passes.

## Convert my recording to the EuRoC folder layout

- **Inputs:** your recording's container and topic or stream names, the camera and IMU rates, and how the cameras are synchronised.
- **Tool:** Python, for Basalt's `euroc` dataset type.
- **Relies on:** [lab, step B1](https://egocam.ai/university/c401/lab/#step-b1-put-the-recording-in-the-euroc-folder-layout).
- **How to check:** every file name in `cam0/data.csv` exists in both image folders; the first and last camera timestamps fall inside the IMU's range; `basalt_vio` loads the folder.

```text
Write a Python script that converts my recording into the folder layout Basalt's euroc
reader expects:
- mav0/cam0/data.csv: one line per frame, "timestamp_ns,filename"; lines starting with # are
  skipped
- mav0/cam0/data/ and mav0/cam1/data/: the images. Basalt looks up cam1's image using cam0's
  file name, so a stereo pair must share one timestamp
- mav0/imu0/data.csv: "timestamp_ns,gyro_x,gyro_y,gyro_z,accel_x,accel_y,accel_z"
My recording: [container: MCAP / rosbag2 / VRS / folders], camera streams [names, rate],
IMU stream [name, rate, units], sync [hardware trigger / other].
Do not resample or shift any timestamp; if left and right timestamps differ, stop and
report the differences instead of pairing them silently. Print the camera and IMU time
ranges at the end.
```

## Choose a SLAM system for my rig and licence

- **Inputs:** cameras, lens field of view, shutter, IMU and sync method; compute; licence constraint.
- **Tool:** any; the answer names systems.
- **Relies on:** [SLAM and VIO Systems Compared](https://egocam.ai/processing/slam-vio-systems-compared/#choosing-by-constraint) and [Lesson 1](https://egocam.ai/university/c401/lesson-1-camera-poses/#choosing-a-system).
- **How to check:** every licence and lens claim in the answer matches the repository's licence file and the field guide's table.

```text
Our rig: [cameras, lens FOV, shutter], [IMU, sync], mounted on [head / wrist]. Compute:
[CPU / GPU]. Licence constraint: [closed commercial product / research only].
Use only these facts:
- GPL-3.0: ORB-SLAM3, VINS-Mono, VINS-Fusion, OpenVINS, DSO, DM-VIO. Permissive: Basalt
  (BSD-3-Clause), Kimera, DROID-SLAM, DPVO. Non-commercial: MASt3R-SLAM.
- Fisheye without rectification: ORB-SLAM3, VINS-Mono/Fusion, OpenVINS, Basalt. DSO, DM-VIO
  and the learned trackers expect pinhole or undistorted images.
- Online calibration: OpenVINS (intrinsics, extrinsics, time offset); VINS-Mono/Fusion
  (extrinsics, time offset). Others take calibration as input.
- Visual-only systems without an IMU are up to scale.
List the systems that fit, what each would need from us, and what we lose with each. Do not
recommend a camera count or layout.
```

## Diagnose my trajectory failures

- **Inputs:** a description of the rig and of when the trajectory goes wrong.
- **Tool:** any SLAM system.
- **Relies on:** [Running SLAM on Wearable Footage](https://egocam.ai/processing/slam-on-wearable-footage/#failure-modes-and-published-fixes) (this prompt is adapted from the one there).
- **How to check:** each diagnosis names the measurement that would confirm it; run that measurement before changing anything.

```text
Our head-worn rig is [cameras, shutter, IMU, sync]. Our trajectories go wrong [at the start
of clips / during fast head turns / when the hands fill the view / over long sessions].
Using the RoboCap, MEgoVista, UMI, HaWoR and EPIC Fields papers, match each symptom to the
failure mode those papers describe and the fix they used. Tell me which fixes need new
hardware and which are processing changes, and what measurement would confirm each
diagnosis. Do not invent thresholds; where a number would be needed, say so.
```

## Evaluate my trajectory against a reference

- **Inputs:** an estimated trajectory file and a reference trajectory, with their formats.
- **Tool:** Python.
- **Relies on:** [VIO Benchmarks and Ground Truth](https://egocam.ai/processing/vio-benchmarks-and-ground-truth/) and [Lesson 1](https://egocam.ai/university/c401/lesson-1-camera-poses/#scoring-a-trajectory).
- **How to check:** comparing a trajectory with itself gives zero; on a TUM VI `room` sequence, the ATE should agree with the number Basalt prints after `align_se3`.

```text
Write Python that compares an estimated trajectory with a reference trajectory.
Estimate format: [e.g. Basalt trajectory.csv: timestamp_ns, px, py, pz, qw, qx, qy, qz].
Reference format: [e.g. EuRoC state_groundtruth_estimate0/data.csv].
1. Associate poses by timestamp within a tolerance I pass in, and report unmatched poses.
2. Compute ATE after one rigid SE(3) alignment of the whole trajectory, and RPE on
   1-second segments.
3. Say which frame each trajectory is in (IMU body or camera), and stop if they differ,
   instead of comparing them.
Print the alignment used, the number of matched poses, ATE (RMS) and RPE.
```

## Lift camera-frame hands into the world frame

- **Inputs:** per-frame camera-frame hand keypoints or MANO joints, per-frame camera poses, and the camera-to-IMU transform if the poses are of the IMU.
- **Tool:** Python with NumPy.
- **Relies on:** [Hand-Object Interaction in World Space](https://egocam.ai/processing/hand-object-interaction-in-world-space/) and [Lesson 2](https://egocam.ai/university/c401/lesson-2-hands-and-body/#from-the-camera-frame-to-the-world-frame).
- **How to check:** a hand held still while the head turns stays still in the world frame; plot one wrist trajectory in both frames.

```text
Write Python that moves per-frame hand joints from the camera frame into a gravity-aligned
world frame. Inputs: hand joints [N x 21 x 3] in the camera frame at timestamps [t];
poses T_world_imu at timestamps [t] (position + quaternion, order [x,y,z,w or w,x,y,z]);
the camera-to-IMU transform T_imu_cam from my calibration.
Compute T_world_cam = T_world_imu * T_imu_cam and apply it to every joint. Match hands to
poses by timestamp and report frames without a pose. Then report world-frame error against
my reference two ways: aligning only the first frames (W-MPJPE, drift counts) and aligning
the whole sequence (WA-MPJPE). Do not report PA-MPJPE as a position error.
```

## Write a boundary rule for my annotation guide

- **Inputs:** your task list and a few example clips described in words.
- **Tool:** your annotation tool's guide.
- **Relies on:** [Annotation Types](https://egocam.ai/processing/annotation-types/#write-a-boundary-rule-into-the-guide) and [Lesson 3](https://egocam.ai/university/c401/lesson-3-labels-and-annotation/#write-a-boundary-rule-into-the-guide).
- **How to check:** have two annotators label the same clips with the rule and compare their boundaries as IoU; the published study reported 0.63 IoU without a rule and 0.83 with one.

```text
Write the action-boundary section of an annotation guide for these tasks: [task list].
Use the Rubicon Boundaries idea from Moltisanti et al. (2017): each interaction has a
pre-actional phase (the final approach that enables the goal) and an actional phase that
ends when the goal is reached. For each task, give the start and end rule in one sentence,
two worked examples from my clips [describe], and the ambiguous cases annotators should
flag rather than guess. Do not set accuracy targets; I will measure agreement myself.
```

## Audit machine-made labels

- **Inputs:** a sample of generated captions or labels with their clips, and any metadata (objects, hands visible).
- **Tool:** Python plus a human review sheet.
- **Relies on:** [Automatic Labelling with Models](https://egocam.ai/processing/automatic-labelling/#how-pipelines-check-model-labels) and [Lesson 3](https://egocam.ai/university/c401/lesson-3-labels-and-annotation/#how-labels-get-checked).
- **How to check:** a person reviews the random sample the script draws; the error rate comes from that review, not from the rules.

```text
Write a Python audit for automatically generated clip captions. Inputs: a JSONL file with
clip_id, caption, start_s, end_s, and metadata (objects in the episode, hands visible).
1. Rule gates, as in PhysBrain: flag captions that name an object not in the metadata,
   mention a hand that is not visible, or describe steps out of time order.
2. Draw a random sample of [N] clips for human review, stratified by task, and write a
   review sheet with columns for correct / wrong hand / wrong object / wrong action /
   missing step.
3. After review, compute the error rate with a confidence interval.
Do not set an acceptance threshold; report the rate and let me decide.
```

## Export my episodes to LeRobotDataset v3.0

- **Inputs:** per-episode image folders or video, per-frame poses, task strings, frame rate.
- **Tool:** lerobot (v0.7.0 API).
- **Relies on:** [lab, part C](https://egocam.ai/university/c401/lab/#part-c-export-to-lerobotdataset-v30-and-read-it-back) and [Training Formats](https://egocam.ai/processing/training-formats-lerobot-rlds/#writing-a-v30-dataset-call-finalize).
- **How to check:** the dataset loads with `LeRobotDataset(repo_id, root=...)`; one sample's state equals the source pose; `num_frames` equals the frames you kept.

```text
Write a Python script that exports my episodes to LeRobotDataset v3.0 with the lerobot
library, using only LeRobotDataset.create(repo_id, fps, features, root=...), add_frame()
(each frame dict includes a "task" key and no "timestamp" or "frame_index"),
save_episode() after each episode, and finalize() in a finally block.
Features: observation.images.[camera] as dtype "video" with shape (H, W, 3) and names
["height", "width", "channels"]; observation.state as float32 [describe fields, frame,
units, quaternion order].
lerobot sets timestamps from frame_index / fps, so check that frames are evenly spaced and
end the episode at any gap larger than [tolerance]. Write my calibration file to
meta/calibrations/[device_id].json. Do not subtract quaternions; if you compute rotation
deltas, use rotvec(q[t+1] * inverse(q[t])).
My data: [describe folders and files].
```

## Sources

- Field guide: [SLAM and VIO Systems Compared](https://egocam.ai/processing/slam-vio-systems-compared/), [Running SLAM on Wearable Footage](https://egocam.ai/processing/slam-on-wearable-footage/), [VIO Benchmarks and Ground Truth](https://egocam.ai/processing/vio-benchmarks-and-ground-truth/), [Hand-Object Interaction in World Space](https://egocam.ai/processing/hand-object-interaction-in-world-space/), [Annotation Types](https://egocam.ai/processing/annotation-types/), [Automatic Labelling with Models](https://egocam.ai/processing/automatic-labelling/), [Training Formats: LeRobot, RLDS and Friends](https://egocam.ai/processing/training-formats-lerobot-rlds/).
- Basalt: [`dataset_io_euroc.h`](https://gitlab.com/VladyslavUsenko/basalt/-/blob/master/include/basalt/io/dataset_io_euroc.h) and [VIO and mapping guide](https://gitlab.com/VladyslavUsenko/basalt/-/blob/master/doc/VioMapping.md).
- Hugging Face: [LeRobotDataset v3.0 docs](https://huggingface.co/docs/lerobot/lerobot-dataset-v3), [lerobot v0.7.0 `dataset_writer.py`](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/datasets/dataset_writer.py).
- Moltisanti et al. (2017). [Trespassing the boundaries: labeling temporal bounds for object interactions in egocentric video](http://arxiv.org/abs/1703.09026). arXiv.
- Lin et al. (2025). [PhysBrain](https://arxiv.org/abs/2512.16793). arXiv.
