C202 Prompts: AI Assistant Prompts for IMU and Camera-IMU Calibration
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
Section titled “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 and the Kalibr workflow’s datasheet prompt (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.
Here are the noise specifications from my IMU's datasheet. Convert them into a Kalibrimu.yaml: accelerometer_noise_density in m/s^2/sqrt(Hz), accelerometer_random_walk inm/s^3/sqrt(Hz), gyroscope_noise_density in rad/s/sqrt(Hz), gyroscope_random_walk inrad/s^2/sqrt(Hz). Show every unit conversion step. Angular random walk and velocity randomwalk on a datasheet are white-noise terms; a figure per sqrt(hour) is divided by 60 to getper 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 insteadof 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
Section titled “Check my static IMU log before the Allan analysis”- Inputs: the output of
rosbag infofor 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 and lab steps A3 to A5.
- 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.
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
Section titled “Read my Allan deviation table”- Inputs: the
allan_variance.csvwritten 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 (this prompt is adapted from the one there).
- How to check: the white-noise values should agree with what
analysis.pyprinted for each axis; read the τ = 1 s value off the plot yourself.
Here is the Allan deviation of my still IMU, one row per tau, columns tau [s], thenaccelerometer x, y, z [m/s^2] and gyroscope x, y, z [deg/s] (the allan_variance_ros CSVorder). 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'sunits (gyroscope in radians), and do not choose an inflation factor for me.Plan my camera–IMU recording
Section titled “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 and the Kalibr workflow, step 7.
- 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.
Plan a Kalibr camera-IMU calibration recording for my head rig. Camera rate: [Hz]. IMUrate: [Hz]. Target: [Aprilgrid, its size], fixed to [wall or table]. The rig is [how it isheld 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 checkduring recording that the target stays in view. Do not invent durations, speeds ordistances that are not in these rules; where my rig needs a number they do not give, say so.Review my Kalibr camera–IMU result
Section titled “Review my Kalibr camera–IMU result”- Inputs:
results-imucam.txt, theimu.yamlyou supplied, and a description of the report’s plots. - Tool: Kalibr.
- Relies on: results-imucam.txt, report-imucam.pdf and the Kalibr workflow’s report prompt.
- 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.
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 thedashed 3-sigma lines or not; biases inside their bounds or not; reprojection errors insidethe 3-sigma circle or not].Kalibr's conventions: T_ci maps IMU coordinates to camera coordinates, translations inmetres; t_imu = t_cam + timeshift; normalised residuals are errors divided by the noiseKalibr 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 residualssuggest the noise values are too small or too large, and whether the time shift andtransforms look plausible. List anything that looks wrong, most serious first, using onlywhat 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
Section titled “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, T_cam_imu and the Kalibr workflow’s camchain prompt.
- How to check: chaining
T_cn_cnm1with cam0’sT_cam_imushould reproduce cam1’sT_cam_imu; run the script on the Kalibr wiki’s example camchain from its YAML formats page as a test.
Write a Python script (NumPy, PyYAML) that loads a Kalibr camchain-imucam.yaml and, for eachcamera: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
Section titled “Fit my time offset against exposure time”- Inputs: several
camchain-imucam.yamlfiles, each from a recording at a different fixed exposure time. - Tool: Python; Kalibr outputs.
- Relies on: Offline estimation with Kalibr and the time-offset page’s prompts (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.
Write a Python script that reads several Kalibr camchain-imucam.yaml files recorded atdifferent fixed exposure times ([list: file, exposure in ms]), fits timeshift_cam_imuagainst 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 orend), and write the function that moves raw camera timestamps to mid-exposure given eachframe's exposure time. Do not claim a slope is "close enough" to a value; report it.Find my tracker’s time-offset sign convention
Section titled “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 (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.
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 signconvention and quote the line of code or documentation that defines it, and tell me whetherI must flip the sign of Kalibr's value. Also tell me whether the tracker estimates theoffset online and how to switch that on. If the sources I gave you do not settle theconvention, say so instead of guessing.Audit my two-IMU Kalibr result
Section titled “Audit my two-IMU Kalibr result”- Inputs: Kalibr’s
<bag>-imu.yamlandresults-imucam.txtfor 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 (this prompt is adapted from the one there) and imu.yaml: the output file.
- How to check: compute the lever-arm length from
T_i_byourself and compare it with the drawing.
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
Section titled “Sources”- Field guide: Kalibr File Reference, Kalibr Workflow, IMU Noise Models and Allan Variance, Camera-IMU Time Offset, Multiple IMUs and Head-to-Wrist Extrinsics.
- Kalibr wiki, ETH Zurich ASL: camera–IMU calibration, IMU noise model and YAML formats.
- Buchanan, R. 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. IEEE/RSJ IROS.