# C202 Prompts: AI Assistant Prompts for IMU and Camera-IMU Calibration

> Copy-paste prompts for an AI assistant from the C202 IMU course: convert datasheet noise to Kalibr's imu.yaml, check a static IMU log, read an Allan deviation table, plan a camera-IMU recording, review a Kalibr camera-IMU result, check the transforms against the rig, fit the time offset against exposure, find a tracker's sign convention and audit a two-IMU result. 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/c202/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 degrees and radians, flip a time offset's sign or invent a noise value 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 IMU datasheet to a Kalibr imu.yaml

- **Inputs:** the datasheet's noise table, the IMU's rate and its ROS topic.
- **Tool:** Kalibr.
- **Relies on:** [Getting the values from a datasheet](https://egocam.ai/kalibr/kalibr-file-reference/#getting-the-values-from-a-datasheet) and the [Kalibr workflow's datasheet prompt](https://egocam.ai/kalibr/kalibr-workflow/#compute-imu-noise-values-from-a-datasheet) (this prompt is adapted from it).
- **How to check:** redo one conversion by hand (°/s/√Hz × π/180; µg/√Hz × 9.80665e-6; a per-√h figure ÷ 60), and confirm the random walks are marked as not given if the datasheet has none.

```text
Here are the noise specifications from my IMU's datasheet. Convert them into a Kalibr
imu.yaml: accelerometer_noise_density in m/s^2/sqrt(Hz), accelerometer_random_walk in
m/s^3/sqrt(Hz), gyroscope_noise_density in rad/s/sqrt(Hz), gyroscope_random_walk in
rad/s^2/sqrt(Hz). Show every unit conversion step. Angular random walk and velocity random
walk on a datasheet are white-noise terms; a figure per sqrt(hour) is divided by 60 to get
per sqrt(second). Say which datasheet values are typical and which are maximum.
If the datasheet gives no bias random walk, say so plainly and leave a placeholder instead
of inventing one. The IMU runs at [rate] Hz on topic [topic].

[paste the datasheet's noise table]
```

## Check my static IMU log before the Allan analysis

- **Inputs:** the output of `rosbag info` for the static bag, the IMU's nominal rate, and optionally a CSV of IMU timestamps exported from the bag.
- **Tool:** allan_variance_ros (before running it).
- **Relies on:** [Lesson 2](https://egocam.ai/university/c202/lesson-2-measuring-imu-noise/#how-long-to-record) and [lab steps A3 to A5](https://egocam.ai/university/c202/lab/#a3-record-the-static-log).
- **How to check:** the expected message count is rate × duration, which you can compute yourself; plot the time differences the script reports and look for bursts and gaps.

```text
I will compute an Allan deviation from this static IMU recording with allan_variance_ros.
Nominal IMU rate: [Hz]. Here is `rosbag info` for the bag: [paste].
1. Compare the message count with rate x duration and report the shortfall in per cent.
2. Write a Python script that reads a CSV of IMU header timestamps in nanoseconds
   [path, column name], computes the time differences, reports their median, minimum,
   maximum and how many exceed 1.5x the nominal interval, and flags timestamps that go
   backwards. Plot the differences against time.
3. Write the allan_variance_ros config file with the keys imu_topic, imu_rate,
   measure_rate and sequence_time, with measure_rate equal to imu_rate and sequence_time
   covering the whole recording.
Do not suggest any pass/fail threshold that is not in what I gave you.
```

## Read my Allan deviation table

- **Inputs:** the `allan_variance.csv` written by allan_variance_ros, or any table of τ against per-axis Allan deviation, and the record length.
- **Tool:** any; the numbers go into Kalibr's `imu.yaml`.
- **Relies on:** [IMU Noise Models and Allan Variance](https://egocam.ai/calibration/imu-noise-and-allan-variance/#read-an-allan-deviation-table) (this prompt is adapted from the one there).
- **How to check:** the white-noise values should agree with what `analysis.py` printed for each axis; read the τ = 1 s value off the plot yourself.

```text
Here is the Allan deviation of my still IMU, one row per tau, columns tau [s], then
accelerometer x, y, z [m/s^2] and gyroscope x, y, z [deg/s] (the allan_variance_ros CSV
order). Record length: [hours]. Sample rate: [Hz].

[paste table]

For each axis:
1. Fit a line of fixed slope -1/2 to the white-noise region and give its value at tau = 1 s
   (noise density). Say which tau range you used.
2. Fit a line of fixed slope +1/2 only to the rising branch and give its value at tau = 3 s
   (random walk). Say which tau range you used.
3. Give the curve minimum and the minimum divided by 0.664, and say which is the IEEE 952
   bias instability coefficient.
4. Flag any region with slope -1 (quantization) or +1 (ramp or trend).
5. Give the percentage error 1/sqrt(2*(T_record/tau - 1)) at the longest tau of each fit.
Then give the three-axis mean and the largest axis for each value, converted to Kalibr's
units (gyroscope in radians), and do not choose an inflation factor for me.
```

## Plan my camera–IMU recording

- **Inputs:** the rig's camera and IMU rates, the target, and what you can and cannot do physically with the rig.
- **Tool:** Kalibr.
- **Relies on:** [Lesson 3](https://egocam.ai/university/c202/lesson-3-kalibr-camera-imu/#the-recording-the-target-stays-still-the-rig-moves) and the [Kalibr workflow, step 7](https://egocam.ai/kalibr/kalibr-workflow/#7-record-the-cameraimu-dataset).
- **How to check:** every axis gets a rotation and a translation, the target stays in view, the plan starts and ends at rest, and every number in it is cited to the sources in the prompt.

```text
Plan a Kalibr camera-IMU calibration recording for my head rig. Camera rate: [Hz]. IMU
rate: [Hz]. Target: [Aprilgrid, its size], fixed to [wall or table]. The rig is [how it is
held or worn].

Follow these sourced rules and cite which one each step serves:
- Kalibr's camera-IMU guide: the target is fixed and the rig moves to excite all IMU axes
  (rotation and translation); avoid shocks at the beginning and end when picking it up;
  keep motion blur low with low shutter times and good illumination; good results were
  obtained with a 20 Hz camera and a 200 Hz IMU.
- Furgale, Rehder and Siegwart (2013): recordings of typically 1-2 minutes; their own were
  about 90 s at an average absolute angular velocity of about 55 deg/s.
- The target must stay in view of the cameras throughout.
Give an ordered list of motions, one axis at a time and then combined, and a way to check
during recording that the target stays in view. Do not invent durations, speeds or
distances that are not in these rules; where my rig needs a number they do not give, say so.
```

## Review my Kalibr camera–IMU result

- **Inputs:** `results-imucam.txt`, the `imu.yaml` you supplied, and a description of the report's plots.
- **Tool:** Kalibr.
- **Relies on:** [results-imucam.txt](https://egocam.ai/kalibr/kalibr-file-reference/#results-imucamtxt-cameraimu-calibration), [report-imucam.pdf](https://egocam.ai/kalibr/kalibr-file-reference/#report-imucampdf-cameraimu-calibration) and the [Kalibr workflow's report prompt](https://egocam.ai/kalibr/kalibr-workflow/#read-a-cameraimu-calibration-report).
- **How to check:** go through each point the assistant raises against the report yourself. It must not have applied any pass mark; the field guide's sources give none.

```text
Here is my Kalibr results-imucam.txt, the imu.yaml I supplied, and what the report shows:
[IMU measurement-rate plot flat or not; accelerometer and gyroscope residuals inside the
dashed 3-sigma lines or not; biases inside their bounds or not; reprojection errors inside
the 3-sigma circle or not].
Kalibr's conventions: T_ci maps IMU coordinates to camera coordinates, translations in
metres; t_imu = t_cam + timeshift; normalised residuals are errors divided by the noise
Kalibr was told to expect (the imu.yaml values, discretised with update_rate, and
--reprojection-sigma, 1.0 px by default, for the cameras).
Explain what each section of the file means for my calibration, whether the residuals
suggest the noise values are too small or too large, and whether the time shift and
transforms look plausible. List anything that looks wrong, most serious first, using only
what is in the file and my description. Do not apply pass/fail thresholds.

[paste results-imucam.txt]
[paste imu.yaml]
```

## Check my camchain-imucam against the rig

- **Inputs:** `camchain-imucam.yaml`, and the IMU's position and orientation in each camera's frame from a caliper or the mechanical drawing.
- **Tool:** Python with NumPy.
- **Relies on:** [How Kalibr names transforms](https://egocam.ai/kalibr/kalibr-file-reference/#how-kalibr-names-transforms), [T_cam_imu](https://egocam.ai/kalibr/kalibr-file-reference/#t_cam_imu) and the [Kalibr workflow's camchain prompt](https://egocam.ai/kalibr/kalibr-workflow/#check-a-camchain-for-problems).
- **How to check:** chaining `T_cn_cnm1` with cam0's `T_cam_imu` should reproduce cam1's `T_cam_imu`; run the script on the Kalibr wiki's example camchain from its YAML formats page as a test.

```text
Write a Python script (NumPy, PyYAML) that loads a Kalibr camchain-imucam.yaml and, for each
camera:
1. Checks each 3x3 rotation is orthonormal with determinant +1.
2. Prints the translation of T_cam_imu (the IMU's position in that camera's frame) and the
   translation of its inverse (the camera's position in the IMU frame), in millimetres.
3. Prints the rotation as roll, pitch, yaw in degrees, and says which camera axis each IMU
   axis maps to when the rotation is close to a signed permutation.
4. For cam1 and later, checks that T_cn_cnm1 times the previous camera's T_cam_imu equals
   this camera's T_cam_imu, and prints the difference.
5. Compares the IMU positions with my measured values: [values, with their frame].
Kalibr's convention: T_a_b maps a point from frame b into frame a.

[paste camchain-imucam.yaml]
```

## Fit my time offset against exposure time

- **Inputs:** several `camchain-imucam.yaml` files, each from a recording at a different fixed exposure time.
- **Tool:** Python; Kalibr outputs.
- **Relies on:** [Offline estimation with Kalibr](https://egocam.ai/calibration/camera-imu-time-offset/#offline-estimation-with-kalibr) and the [time-offset page's prompts](https://egocam.ai/calibration/camera-imu-time-offset/#prompts-you-can-give-an-ai) (this prompt is adapted from the first one there).
- **How to check:** with two exposures you can compute the slope by hand; it should match the script's.

```text
Write a Python script that reads several Kalibr camchain-imucam.yaml files recorded at
different fixed exposure times ([list: file, exposure in ms]), fits timeshift_cam_imu
against exposure time for each camera, and reports the slope, intercept and residuals.
Kalibr's convention is t_imu = t_cam + timeshift_cam_imu. Explain what a slope near +0.5,
0 or -0.5 says about where the camera timestamps sit in the exposure (start, middle or
end), and write the function that moves raw camera timestamps to mid-exposure given each
frame's exposure time. Do not claim a slope is "close enough" to a value; report it.
```

## Find my tracker's time-offset sign convention

- **Inputs:** your VIO or SLAM system's config files and, if possible, its source or documentation.
- **Tool:** your tracker (for example OpenVINS or VINS-Mono).
- **Relies on:** [The sign convention](https://egocam.ai/calibration/camera-imu-time-offset/#the-sign-convention) (this prompt is adapted from the third one on that page).
- **How to check:** the assistant must quote the line of code or documentation that states the convention; open it and read it yourself.

```text
I pass Kalibr's timeshift_cam_imu (t_imu = t_cam + shift) into my visual-inertial tracker,
[name and version]. Here are its config files and the relevant source or documentation:
[paste or link]. Find the parameter that holds the camera-IMU time offset, state its sign
convention and quote the line of code or documentation that defines it, and tell me whether
I must flip the sign of Kalibr's value. Also tell me whether the tracker estimates the
offset online and how to switch that on. If the sources I gave you do not settle the
convention, say so instead of guessing.
```

## Audit my two-IMU Kalibr result

- **Inputs:** Kalibr's `<bag>-imu.yaml` and `results-imucam.txt` for a rig with two IMUs, the IMU driver settings, and the IMUs' relative position from the drawing.
- **Tool:** Kalibr.
- **Relies on:** [Multiple IMUs and Head-to-Wrist Extrinsics](https://egocam.ai/calibration/multi-imu-and-wrist-extrinsics/#audit-a-multi-imu-kalibr-result) (this prompt is adapted from the one there) and [imu.yaml: the output file](https://egocam.ai/kalibr/kalibr-file-reference/#imuyaml-the-output-file).
- **How to check:** compute the lever-arm length from `T_i_b` yourself and compare it with the drawing.

```text
Here are my Kalibr <bag>-imu.yaml and results-imucam.txt for a rigid head rig with two IMUs
(imu0, imu1), plus my IMU driver settings: [paste]
1. Report the lever-arm length (mm) and rotation angle (degrees) of imu1's T_i_b and compare
   them with my drawing values: [translation and rotation].
2. Tell me whether imu1's time_offset is 0 (Kalibr assumed the IMUs were synchronised) or
   came from --imu-delay-by-correlation, and what that implies for accuracy.
3. Check that the file's keys match the IMU model I chose ([model]), and flag scale factors
   in M far from 1, giving the values rather than a verdict.
```

## Sources

- Field guide: [Kalibr File Reference](https://egocam.ai/kalibr/kalibr-file-reference/), [Kalibr Workflow](https://egocam.ai/kalibr/kalibr-workflow/), [IMU Noise Models and Allan Variance](https://egocam.ai/calibration/imu-noise-and-allan-variance/), [Camera-IMU Time Offset](https://egocam.ai/calibration/camera-imu-time-offset/), [Multiple IMUs and Head-to-Wrist Extrinsics](https://egocam.ai/calibration/multi-imu-and-wrist-extrinsics/).
- Kalibr wiki, ETH Zurich ASL: [camera–IMU calibration](https://github.com/ethz-asl/kalibr/wiki/camera-imu-calibration), [IMU noise model](https://github.com/ethz-asl/kalibr/wiki/IMU-Noise-Model) and [YAML formats](https://github.com/ethz-asl/kalibr/wiki/Yaml-formats).
- Buchanan, R. [allan_variance_ros](https://github.com/ori-drs/allan_variance_ros), Oxford Robotics Institute (commit `1d54b60`).
- Furgale, P., Rehder, J. and Siegwart, R. (2013). [Unified temporal and spatial calibration for multi-sensor systems](https://doi.org/10.1109/IROS.2013.6696514). *IEEE/RSJ IROS*.
