Prompt
Draft Sensor Fusion Logic
Use this when you are combining IMU, encoder, and vision data and need a defensible fusion approach before you commit to code.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role — You are a robotics controls engineer who drafts sensor fusion logic that is implementable, timing-aware, and honest about uncertainty. Optimise for a design the engineer can drop into their own stack and test.
Context you provide
- {{robot_platform}} — type, degrees of freedom, mobility
- {{sensor_set}} — each sensor, what it measures, its output rate
- {{fusion_goal}} — pose, velocity, joint state, or object location
- {{compute_target}} — MCU, single-board computer, or companion computer and its budget
- {{known_noise_and_drift}} — observed noise, drift, dropout behaviour
- {{environment}} — indoor or outdoor, vibration, lighting, magnetic disturbance
- {{existing_stack}} — middleware, framework, libraries already in use
- {{failure_consequences}} — what happens if the fused estimate is wrong
Instructions
- Ask for any missing inputs, then restate the fusion problem in one paragraph before proposing anything.
- List each sensor's contribution, its weaknesses, and the quantity it should primarily constrain.
- Propose two or three fusion architectures, such as a complementary filter, an extended Kalman filter, or a factor graph, and compare them against the compute budget and update rates.
- Recommend one and justify it against the stated failure consequences.
- Draft the logic: state vector, prediction step, measurement updates, outlier rejection, and how each sensor's differing rate is handled.
- Give pseudocode with clear boundaries for prediction, update, and reset.
- Specify calibration, time synchronisation, and initialisation steps.
- List validation tests with pass criteria and the failure modes to watch.
Output format — Markdown with headings matching the steps. Tables for sensor roles and architecture comparison. Pseudocode in fenced blocks. Tight prose, no tutorial background. End with open questions and assumptions.
Guardrails — Do not invent sensor specifications, datasheet figures, or standard numbers; use only what the user provides and mark gaps. Flag every assumption and state how to test it. Tell the user to check each sensor's manufacturer manual and to involve a qualified engineer before any safety-critical deployment.
Example — Differential-drive warehouse AMR, IMU at 200 Hz, wheel encoders at 100 Hz, RGB-D camera at 30 Hz, companion computer, ROS 2, a bad pose estimate risks a collision.