Nav2 safety margins: stopping distance and inflation radius vs footprint

Short answer: Two Nav2 safety properties depend on relationships between parameters, not on any single value: whether the robot can stop inside your safety buffer at its configured speed and deceleration, and whether the costmap's inflation radius even covers the robot's own body. Each value can look reasonable alone and the combination be unsafe.

Stopping distance vs buffer

The distance to stop from speed v at constant deceleration a is:

d = v² / (2a)

With max_vel_x: 1.2 and acc_lim_x: 2.5, that's 1.44 / 5.0 = 0.288 m. If your approved minimum buffer is 0.15 m, the robot needs almost twice the buffer to stop.

NAV2_STOPPING_DISTANCE_RISK
velocity=1.2000 acceleration=2.5000 distance=0.2880 buffer=0.1500 result=fail

Where the buffer comes from: Saykai uses inflation_radius if it sits in the same node as the velocity parameters. Otherwise it uses the minimum buffer in your Safety Spec (min_bubble). In a standard Nav2 layout those live in different nodes, so the Safety Spec's minimum is the buffer.

What this does and doesn't model. It assumes constant deceleration at the configured acc_lim_x. That's a software limit, not measured braking. It also ignores perception and actuation latency. If real braking is weaker than acc_lim_x, the real stopping distance is longer. Deriving a max speed from measured braking and latency covers that.

Inflation radius vs footprint

If inflation_radius is smaller than robot_radius, the costmap's inflation doesn't extend past the robot's own body, so the planner can produce paths through gaps the robot can't physically clear. Typical Nav2 configs set the inflation radius to several times the robot radius, so a value below robot_radius is almost always a mistake.

local_costmap:
  local_costmap:
    ros__parameters:
      robot_radius: 0.22
      inflation_layer:
        inflation_radius: 0.10

This produces two findings: NAV2_INFLATION_RADIUS_VS_FOOTPRINT_RISK and, because 0.10 is also under the policy's 0.15 minimum, NAV2_MIN_BUBBLE_VIOLATION (observed=0.1000 limit=0.1500 operator=lt).

Why linters miss both

A linter sees 0.10 is a valid float and 1.2 is a valid float. Neither is wrong alone. The hazard is in the relationship: speed against deceleration against buffer, and inflation against footprint. Catching that means comparing values across parameters, and doing it on every pull request rather than after an incident.

See how Saykai gates these checks in CI.