
An AI-enabled robot should not ask “what can I do next?” until the system has answered a quieter question:
Can the robot trust the state it is about to act on?
That question belongs between perception and authority. It is not enough for the camera node to publish, the LiDAR to spin, the estimator to output a pose, and the planner to return a path. A robot can have all of those things and still be acting on stale localization, overconfident covariance, a half-dead obstacle layer, a drifting transform, or a perception model that is uncertain in exactly the part of the scene that matters.
For Physical AI systems, mobile robots, inspection robots, robot operator copilots, and ROS 2 autonomy stacks, I would make sensor confidence a gate. The gate does not prove the world is safe. It decides whether the current perception and localization evidence is good enough for the requested level of physical authority.
This article builds on the surrounding control stack: sensor-to-actuator timing budgets, debugging sensor fusion drift, degraded modes for AI-enabled robots, command validation for AI robot agents in ROS 2, runtime assurance for Physical AI robots, and robot autonomy release gates.
The Gate In One Sentence
A sensor confidence gate is a deterministic admission-control layer that checks whether perception, localization, maps, transforms, diagnostics, timestamps, and uncertainty are good enough for a specific robot action before autonomy is allowed to plan, continue, accelerate, manipulate, or recover.
The gate should sit before any authority increase:
1 | sensors and drivers |
The confidence gate is not a replacement for runtime assurance, emergency stops, watchdogs, or command validation. It has a narrower job: keep bad state from being treated as actionable state.
That distinction matters. Runtime assurance can veto unsafe motion while the robot is already operating. Command validation can reject an AI proposal before it becomes a ROS 2 action. A confidence gate decides whether the robot’s view of the world is fit for the authority being requested.
Confidence Is Not One Number
Robotics teams often compress confidence into a single threshold. That is convenient, but it hides the important failure modes.
Sensor confidence is a vector:
| Signal | What it says | Typical failure |
|---|---|---|
| Freshness | How old the observation, transform, map, or estimate is | Robot acts on old reality |
| Availability | Whether a required stream exists and is publishing | Planner silently loses a sensor |
| Rate stability | Whether the stream is arriving at the expected rhythm | Bursty input creates stale windows |
| Diagnostic state | Whether the sensor or driver reports OK, warning, or error | Hardware is unreliable but still publishing |
| Covariance | How uncertain the estimator says the measurement is | Weak evidence is treated as precise |
| Residual or innovation | Whether a measurement agrees with prediction | Sensor is inconsistent with the current state |
| Coverage | Whether the relevant part of the scene was observed | Robot plans through unobserved space |
| Classification confidence | Whether AI perception is certain enough for the decision | Object detection looks confident in the wrong place |
| Frame validity | Whether data is expressed in the expected coordinate frame | Correct measurement, wrong geometry |
| Operating-envelope match | Whether current conditions match the tested assumptions | Good stack, wrong floor, lighting, payload, or site |
The gate should evaluate these signals separately before it produces one decision. A single “confidence = 0.82” hides whether the robot is uncertain because the camera is occluded, the map is stale, the transform is invalid, or the AI classifier is unsure.
For a physical system, those differences change the safe response.
Authority Should Decide The Threshold
The same sensor state can be acceptable for one action and unacceptable for another.
A robot may be allowed to speak a diagnostic summary with low localization confidence. It may be allowed to rotate slowly in place with degraded obstacle confidence. It may be forbidden to navigate near people unless localization, obstacle data, speed estimate, and safety scanner diagnostics are all healthy.
Tie confidence gates to authority:
| Requested authority | Confidence requirement | Example decision |
|---|---|---|
| Read-only diagnostics | Logs and diagnostics available | Allow even if localization is weak |
| Operator advisory | Relevant perception visible but not motion-safe | Explain uncertainty; no motion |
| Low-speed supervised motion | Fresh localization, fresh obstacle layer, operator present | Allow with speed cap |
| Autonomous navigation | Fresh localization, costmap, TF, diagnostics, fallback path | Allow inside approved envelope |
| Manipulation near fixtures | Pose, perception, force/torque, collision model, gripper state | Require tighter gate and recovery plan |
| Recovery behavior | State good enough for the specific recovery path | Allow only bounded recovery |
| Production-speed motion | Full confidence contract and monitoring | Allow only if release evidence supports it |
This prevents a subtle failure: reusing a confidence score from a low-risk behavior to justify a high-risk one.
The right question is never “is localization confidence above 0.7?” It is “is this evidence sufficient for this motion, at this speed, in this workspace, with this supervision model?”
The Minimum Confidence Contract
For every motion-capable robot, I would start with a written contract like this:
1 | confidence_gate_id: warehouse-amr-base-motion-v1 |
Those values are examples, not defaults. The important thing is the shape of the contract:
- it names the authority it controls,
- it names the required inputs,
- it gives thresholds,
- it maps uncertainty to action,
- and it leaves evidence behind.
Without a contract, the behavior tree, planner, AI agent, and operator interface will each invent their own version of “good enough.”
Freshness Must Be Explicit
Freshness is the easiest confidence signal to under-engineer.
ROS 2 gives teams useful tools here. The ROS 2 design note on deadline, liveliness, and lifespan QoS frames deadline as a maximum interval between messages, liveliness as a way to know whether an entity is still alive, and lifespan as the period during which a message remains valid. Those are not only communication settings. For robots, they are confidence inputs.
A confidence gate should know:
| Item | Freshness question |
|---|---|
| Sensor message | When was the physical world sampled? |
| Driver output | When did the software publish it? |
| Transform | How old is the transform used to place the data? |
| State estimate | How old is the fused state when the planner reads it? |
| Costmap | How recently was relevant obstacle evidence updated? |
| Command | How old will the command be at the last software boundary? |
A stale LiDAR scan, stale costmap, stale transform, and stale localization estimate are different failures. They may all produce the same visible symptom: the robot moves as if the world has not changed.
So the gate should log the actual ages it used:
1 | { |
This is much more useful than “navigation failed.”
Covariance Needs Policy
Covariance is often treated as estimator plumbing. It should be part of the authority contract.
ROS messages already make uncertainty part of the data model. The sensor_msgs/Imu message documentation, for example, describes covariance fields for orientation, angular velocity, and linear acceleration, and it distinguishes unknown covariance from unavailable estimates. nav_msgs/Odometry carries pose and twist with covariance. That information should not disappear before the autonomy layer makes decisions.
The policy does not need to be complicated:
| Condition | Gate response |
|---|---|
| Covariance unknown for a required estimate | Do not grant high authority |
| Covariance rising but still inside cautious bound | Continue with speed cap or larger clearance |
| Covariance above motion threshold | Hold, relocalize, or ask for operator help |
| Covariance inconsistent with residuals | Treat as estimator health fault |
| Covariance reset after relocalization jump | Require fresh map/odom consistency before motion |
The anti-pattern is overconfident input. A filter that says “I know exactly where I am” while the robot is on a reflective floor with wheel slip and poor visual texture is not confidence. It is a missing warning.
A good gate can be boring:
1 | If pose covariance exceeds the navigation threshold: |
This connects confidence to behavior instead of letting uncertainty sit unused in a message field.
Diagnostics Are Not Safety, But They Are Evidence
ROS diagnostics are useful, but they are easy to misuse.
REP-107 describes a diagnostic system intended to report robot component status, support quick operator awareness, and preserve historical evidence. It also warns that diagnostics are not a halt mechanism and should not be treated as a tight keepalive.
That distinction is exactly right for confidence gates.
Diagnostics should feed the gate as evidence:
- camera driver warning,
- LiDAR packet loss,
- IMU saturation,
- encoder error count,
- motor controller temperature warning,
- safety scanner state,
- dropped-frame counter,
- clock-sync warning,
- GPU memory pressure,
- perception model health.
But a diagnostic warning should not be the only protection between the robot and unsafe motion. The gate should combine diagnostics with freshness, covariance, frame validity, and task authority.
For example:
| Diagnostic state | Gate interpretation |
|---|---|
| Sensor OK and fresh | Eligible for normal confidence evaluation |
| Sensor WARN but redundant sensor healthy | Consider degraded mode or speed cap |
| Sensor ERROR and required for action | Reject action or hold |
| Diagnostic stale | Treat the diagnostic source itself as unhealthy |
| Aggregator unavailable | Fail closed for high-authority behavior |
Diagnostics help explain the decision. They should not be the only decision.
Costmaps Need Confidence Too
Navigation stacks often treat the costmap as if it were simply “the map.” It is better to treat it as a time-bounded belief about occupied, free, and unknown space.
The Nav2 obstacle layer documentation exposes parameters such as observation sources, expected update rate, observation persistence, marking, clearing, and obstacle ranges. Those settings are confidence policy hiding in configuration. They decide how long obstacle evidence persists, what counts as an observation source, and whether stale or missing data continues to influence planning.
A confidence gate should ask:
- Which sources are required for this behavior?
- Which sources are optional or redundant?
- How old can each source be?
- Is the robot allowed to clear obstacles with this sensor?
- Is unknown space treated as blocked, cautious, or free?
- Does the current speed require a longer perception horizon?
- Was the relevant workspace actually observed recently?
This matters because costmap failures rarely announce themselves politely. A planner can return a valid path through an area that has simply not been observed recently. A depth camera can be blocked by glare while the local planner still has a smooth costmap. A LiDAR can keep publishing while part of the scene is outside its useful field of view.
The gate should be conservative near the edge of observation:
| Costmap condition | Authority response |
|---|---|
| All required sources fresh | Normal planning allowed |
| One redundant source degraded | Reduce speed or increase clearance |
| Required obstacle source stale | Hold or reject navigation |
| Unknown space ahead at current speed | Slow down, reobserve, or replan |
| Clearing source unhealthy | Do not assume obstacles disappeared |
| Dynamic obstacle detection weak | Require supervision or stop expansion |
The planner can still optimize paths. The confidence gate decides whether the planner’s input world is trustworthy enough.
Frame Confidence Is A Gate Input
The robot cannot trust a measurement if it cannot trust where that measurement lives.
REP-105 is still one of the most useful documents for mobile robot state: odom is continuous but drifts, map is globally meaningful but can jump, and each frame has a parent in the transform tree. That is not naming trivia. It is authority policy.
The confidence gate should check:
- required frame chain exists,
- transform timestamps are fresh,
- no duplicate authority is publishing the same transform,
map,odom, andbase_linkare being used for their intended roles,- static sensor transforms are loaded,
- localization jumps are handled before motion resumes,
- frame changes across maps, floors, or sites are explicit.
Frame failures are nasty because they can produce plausible values in the wrong place. A camera detection can be correct in camera coordinates and dangerous after a stale transform. A global pose can be valid in map and unsuitable for local control if the map -> odom update just jumped. A planner can be mathematically correct and physically wrong.
Frame confidence therefore belongs in the same gate as perception confidence.
AI Perception Should Not Bypass The Gate
Vision-language models, object detectors, segmentation models, scene classifiers, and learned policies can add useful perception to robots. They also introduce a confidence vocabulary that is easy to over-trust.
An AI model saying “I see a pallet” is not enough. The gate should ask:
| AI perception question | Why it matters |
|---|---|
| What region of the scene influenced the detection? | Confidence outside the motion path may be irrelevant |
| How old is the frame? | A good classification can be stale |
| Is the model calibrated for this camera, lighting, and site? | Lab confidence may not transfer |
| Is uncertainty exposed or hidden? | No uncertainty means no gate input |
| Is there a geometric cross-check? | Semantic confidence does not prove position |
| Is the output advisory or authoritative? | Recognition should not silently become motion permission |
For most robots, AI perception should produce evidence for a gate, not override the gate.
A useful pattern is:
1 | AI perception proposes: |
The model contributes a signal. It does not grant authority.
Degraded Modes Are The Product Of Confidence Gates
A confidence gate should not only return pass or fail.
Robots need intermediate behavior:
| Gate result | Robot behavior |
|---|---|
pass | Continue normal authority |
pass_with_constraints | Reduce speed, increase clearance, restrict task class |
defer | Wait for fresh state, then retry if the request is still valid |
relocalize | Run a bounded recovery routine |
hold | Stop accepting motion but keep the system alive |
reject | Refuse the requested action and explain the missing evidence |
safe_stop | Reduce physical energy because the evidence is not trustworthy |
This is where degraded modes become concrete. Instead of “camera bad, robot confused,” the system has a predictable transition:
1 | front_depth_camera WARN |
The confidence gate is not just a safety feature. It is a way to keep the robot useful while being honest about its evidence.
The Evidence Packet
Every confidence decision that blocks, degrades, or grants physical authority should be reconstructable.
At minimum, log:
| Evidence | Why it matters |
|---|---|
| Gate ID and version | Tells you which policy made the decision |
| Requested action and authority | Prevents context-free “confidence failed” records |
| Decision and reason code | Supports operator UX and incident review |
| Input ages | Shows stale data directly |
| Covariance values | Shows whether state uncertainty drove the decision |
| Diagnostic snapshot | Captures hardware/software health |
| TF age and frame chain | Preserves geometry evidence |
| Costmap source health | Explains planning-world validity |
| Perception model confidence | Captures AI perception uncertainty |
| Operating mode | Explains why the threshold applied |
| Recovery or downgrade action | Shows what the robot did next |
Example:
1 | { |
This is the kind of evidence that makes field debugging and release reviews less mystical.
The NIST Performance Assessment Framework for Robotic Systems is useful background because it treats robot performance as composed evidence across perception, mobility, dexterity, and safety. Confidence gates are the runtime version of that mindset: do not collapse a robot’s state into one demo outcome.
Test The Gate Like A Product Surface
The confidence gate needs its own tests. Do not assume it works because perception and planning work separately.
A practical test plan:
| Test | Expected gate behavior |
|---|---|
| Stop localization stream | Reject autonomous navigation; allow read-only diagnostics |
| Delay LiDAR messages | Fail freshness threshold before stale obstacle data is used |
| Inflate pose covariance | Downgrade to hold or relocalization |
| Drop depth camera but keep LiDAR | Continue only if the behavior allows redundancy |
| Corrupt frame ID | Reject motion and log frame-chain failure |
| Disable diagnostics aggregator | Fail closed for high-authority behavior |
| Replay old costmap | Reject or clear authority when lifespan expires |
| Simulate glare/occlusion | Reduce perception-dependent authority |
| Force model uncertainty high | Treat semantic output as advisory only |
| Recover confidence | Require stable evidence window before restoring authority |
The last row is important. Confidence should not instantly bounce back to normal after one good sample. A robot that oscillates between normal and degraded authority can be worse than a robot that simply stops.
Use a stability window:
1 | restore normal navigation only after: |
That turns recovery into an engineered transition instead of a lucky moment.
Where The Gate Belongs
In ROS 2 systems, the confidence gate can live in several places depending on the architecture:
| Placement | Good for | Watch out for |
|---|---|---|
| Behavior tree condition nodes | Navigation and task-level decisions | Policy scattered across many nodes |
| Action goal admission wrapper | AI proposals and operator commands | May miss continuous confidence changes |
| Supervisor node | Central authority and mode management | Can become a giant dependency knot |
| Runtime monitor input | Live veto and degradation | Must stay deterministic and fast |
| Lifecycle transition checks | Startup and activation gates | Does not solve mid-run confidence loss |
My default would be a supervisor-owned confidence service plus event stream:
1 | confidence supervisor |
Keep the gate boring. It should evaluate evidence, not run the autonomy stack.
The Design Rule
The design rule is simple:
Do not let autonomy consume perception as if publication meant truth.
Publication only means data exists. Confidence gating asks whether the data is recent, healthy, geometrically valid, uncertain in a known way, relevant to the action, and sufficient for the authority being requested.
That is the gap many Physical AI systems hit between a good lab demo and a reliable robot. The demo shows that perception can work. The gate decides when perception is trustworthy enough to act.
For a real robot, that difference is not academic. It is the line between an autonomy stack that is merely impressive and one that can degrade, explain itself, recover, and earn more physical authority over time.