Skip to content

ProxMPC 2.0.0: bounded per-cycle latency, predictive avoidance, and a re-measured comparison - #5

Merged
simone-contorno merged 174 commits into
mainfrom
release/2.0.0
Sep 14, 2026
Merged

simone-contorno merged 174 commits into
mainfrom
release/2.0.0

Conversation

@simone-contorno

@simone-contorno simone-contorno commented Sep 13, 2026 •

Copy link
Copy Markdown
Owner

Description

Releases ProxMPC 2.0.0 from main's 1.0.0. 174 commits, 110 files, +10,875 / −1,386.

Two defects in 1.0.0 made a per-cycle latency guarantee impossible: the SQP loop defaulted to 100 iterations and re-linearised up to 99 more times around an already-corrupted iterate after a failed solve, and guess: true named a QP warm start that never happened because init() rebuilt the workspace 20 times a second. Worst-case cycles of 300 ms were measured on three separate cells. Both are fixed: the worst observed cycle is now 33.5 ms and no cycle in 100 runs exceeded the 50 ms budget.

The second theme is avoidance. 1.0.0's reference was obstacle-blind, so yielding to a crossing mover cost tracking error while racing across did not, and the solver nearly always raced. The reference now yields, and — the part that actually changed behaviour — the yield caps the solver's forward speed bound rather than only lowering a cruise target the keep-out term outweighs. Predictive ProxMPC is now the fewest-collision controller in the comparison at 3/50 over ten obstacle cells, against 8/50 for the next best.

Every comparison figure was re-measured in a single 435-run matrix recorded back-to-back on one host, replacing the merged two-session set published previously.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds capability)
  • Breaking change (existing behavior, interfaces, or parameters change)
  • Documentation only
  • Build, packaging, or CI

Behavioral impact

  • Does this change any command the controller produces? yes — see below.
  • Does it touch a safety path? yes — the footprint veto now walks the predicted trajectory as far as the stopping distance instead of checking a single pose ahead; the solver-failure brake ramps in control space through the model; obstacle keep-outs are centred on base_link and bound one object per slot per cycle; solver acceptance is transactional, so a rejected cycle no longer advances retained state.
  • Does it change a default parameter value? yes:
    • prox_mpc_core: warm_start false → true; max_iter_sqp 100 → 1.
    • prox_mpc_controller: predict_obstacles false → true; model_plugin prox_mpc_core/Bicycle → prox_mpc_core/Unicycle.
    • allow_reversing is new, default false, and narrows the linear control bound to [0, v_max]. 1.0.0 had no such switch and its solver could always plan reverse, so a deployment that upgrades without setting it loses reverse travel. With true and no explicit model_params.v_min, reverse is capped at 0.15 m/s. The shipped Gazebo demo configs set it true.

Behaviour that changes on upgrade without any parameter being set: inside the goal-checker xy tolerance the reference is pinned to the goal pose instead of tracking the robot's own projection, and a platform with no steering channel turns on the spot for the last of the heading. A deployment that relied on the controller stalling at a terminal heading error and a recovery behaviour taking over will now see the controller close that error itself.

New parameters — reverse_from_plan_orientation, direction_switch_standstill_speed_mps, direction_switch_dwell_s, goal_settle_hysteresis_m, prediction_forward_shadow_s, obstacle_yield_band_m, obstacle_yield_caps_speed — are all inert at their defaults. The full upgrade contract is in prox_mpc_controller/doc/migration.md.

ProxMpcController gains cached mapping members and readModelMapping(), and its protected surface changes: fillStaticObstacles, reduceCostmap and publishDiagnostics change signature, and a_dec_lin_/a_dec_ang_ become fallback_ramp_lin_/fallback_ramp_ang_. This release is therefore wire compatible but not ABI compatible, and source compatible only for pluginlib and parameter users: a class deriving from ProxMpcController must be updated. No .msg field is added, removed, renamed, retyped or reordered, so no type hash or CDR layout changes.

Verification

  • colcon build --symlink-install passes
  • colcon test passes with no new failures
  • Added or updated tests covering the changed behavior
  • Ran a launch or simulation reproduction (described below)

Every CI configuration was reproduced locally and run to completion:

Configuration Result
Normal (Release) 7 packages, 504 tests, 0 failures
build-and-test flags (RelWithDebInfo + --coverage) 7 packages, 504 tests, 0 failures
sanitizers (Debug + ASan/UBSan, detect_leaks=1) 7 packages, Eigen assertions live across 80 translation units, 504 tests, 0 failures
clang-tsa (-Werror=thread-safety, clang-18) 7 packages, exit 0
Dependency license inventory OK

prox_mpc_controller alone contributes 138 tests, across test_prox_mpc_controller (102) and test_controller_contracts (36).

Simulation reproduction, mode (b2): a 435-run Nav2 matrix (7 controllers × 11 scenarios × 5 repeats, 10 for MPPI on the obstacle cells) plus the 40-run mode-(b1) core-sim matrix, recorded back-to-back on one idle host. Every cell was validated against its own stack log for the controller actually receiving a path; four cells hit a Nav2 bring-up transient and were re-run rather than recorded.

Simulation reproduction, mode (a): Gazebo Harmonic was re-run for this release — five runs of the demo's open-room traverse on the shipped demo parameters, the only change being publish_diagnostics, which is opt-in telemetry that publishes when subscribed and does not touch control.

Goal reached          5/5, 0 recoveries
Cross-track RMS       5.76 +/- 1.23 mm  (against AMCL + simulated lidar)
Solve p50 / p95       0.364 +/- 0.036 / 1.382 +/- 0.199 ms
Cycles over 50 ms     0
Mean SQP iterations   1.00 across 966 control cycles
QP status histogram   966/966 PROXQP_SOLVED

The real-time iteration therefore holds under real physics, and the PROXQP_PRIMAL_INFEASIBLE reports recorded in Section 5 for mode (b2) do not occur in mode (a) at all.

Full results: doc/controller-comparison-results.md.

Two CI failures found and fixed on this branch

The first CI run on this PR was red. Both causes were diagnosed and fixed rather than retried.

build-and-test. Adopting Nav2's warning policy (5e63e43) brought -Werror together with -Wnull-dereference. GCC 13 raises that warning inside libstdc++'s own <regex> headers — stl_algobase.h, reached through regex_traits::transform_primary — once --coverage changes its inlining decisions, which is why the coverage build hits it and an ordinary build does not. The report is attributed to the translation unit that instantiates the template rather than to the header, so -Wno-system-headers does not reach it. Fixed by keeping the diagnostic but not letting it fail the build, applied to all seven packages so the duplicated policy block stays identical.

sanitizers. ComputeSkipsVetoWithoutFootprint produced its degenerate footprint by setting an empty one. nav2 1.3.13 refuses that and keeps the previous footprint, where 1.3.12 accepted it silently — the guard string does not appear in 1.3.12's libraries at all. On 1.3.13 the fixture's real footprint therefore survived, the veto ran against the lethal cost the test fills, and the command came back braked. Its warning is throttled and the preceding test had just logged one, so the failure surfaced as a bare zero with no visible cause. Fixed by using a two-point footprint: non-empty, so nav2's own guard passes — it compares begin against end, not size against three — and still short of the controller's size() >= 3, so the branch under test is reached on both versions. The premise is now asserted rather than assumed, so a nav2 that also refuses two points fails saying which condition broke.

Neither was a flake, and the second is an upstream behaviour change rather than anything this release introduced. Note that CI now installs nav2 1.3.13 while the benchmark figures in this PR were measured on 1.3.12, which is what the comparison document records.

Checklist

  • Interfaces and their docs are in sync with the code
  • package.xml / CMakeLists.txt updated, and a THIRD_PARTY_LICENSES.md row added for the new ament_cmake_pytest test dependency
  • CHANGELOG.rst updated for all seven packages
  • No secrets, keys, or credentials in the diff
  • Documentation updated where behavior or configuration changed

Merge note

Squash and merge, matching how v1.0.0 was released (bdb66d7), so main keeps one commit per release. The repository ruleset already restricts merges to squash and requires linear history, so this is enforced rather than conventional.

Do not delete release/2.0.0 on merge — it is where this release's granular, bisectable history lives, the role dev played for 1.0.0. CONTRIBUTING.md is updated in this PR to state that convention.

Reported honestly, in both directions

  • The reactive preset moved 37 % → 53 % on the two-mover cells. Fixing allow_reversing removed an escape the costmap-only path had been relying on; restoring reverse and changing nothing else recovered it to 11/30. It is now documented as a single-obstacle configuration.
  • Vector Pursuit reached the goal 1/5 on static_box — its own stall, on stock binaries.
  • blind_multi_0 remains the predictive preset's one weak cell at 3/5.
  • The reactive preset's 9/50 PROXQP_PRIMAL_INFEASIBLE reports are real and unexplained; three candidate causes were tested and eliminated. Impact is about one braked cycle in a thousand, with no infeasible cycle ever traced to a collision.
  • Re-running the unchanged stock peer binaries moved them by up to 8 points, so 8 points on 50 runs is the noise floor these counts should be read against.

- reject nc > np at configure time, mirroring the existing np < 1,
  nc < 1 and dt <= 0 fatal checks (surplus control nodes are
  well-formed dead weight in the core solver, but not a configuration
  a user meant to set)
- reject a non-finite dt: the existing "dt <= 0.0" comparison is false
  for NaN, so a NaN dt previously passed the structural gate silently
- clamped parameters (q_pos, q_theta, s_factor, r_weight, w_weight,
  max_solve_time, safety_margin, robot_radius, cbf_gamma,
  obstacle_cluster_radius, obstacle_timeout, dynamic_speed_threshold,
  prediction_uncertainty_growth, max_dynamic_obstacle_radius) now
  check finiteness before the range logic; a non-finite value falls
  back to the parameter's declared default instead of passing every
  "<"/">" comparison unclamped
- clamp a negative max_solver_failures to 0, matching the existing
  max_obstacles clamp shape, instead of leaving it negative
- reject a non-finite transformed plan pose the same way a non-finite
  robot pose is already rejected; without this, a corrupted point
  beyond the sampled horizon was never read by the reference sampler
  and the cycle drove normally, oblivious to the corruption elsewhere
  in the plan
- collapse a degenerate zero-length segment (a duplicate consecutive
  plan position) by walking forward to the next segment with positive
  length for the heading reference, instead of feeding atan2(0, 0) a
  degenerate delta
- seed the curvature estimator's first heading delta from the plan's
  own sampled tangent instead of the robot's yaw, so an initial
  tracking-error offset no longer inflates the estimated curvature on
  a straight plan
- guard the warm-start control shift in solve(): with Nc == 1 there is
  no previous control row to shift into, so the unconditional shift
  read one row before the start of the buffer
- reject Nc > Np in MPC::setNc, mirroring the existing structural
  checks; surplus control nodes are well-formed dead weight in the
  solver (larger QP, no memory-safety issue) rather than a
  configuration a caller meant to set. Np may not be known yet when
  setNc runs, so the comparison is skipped until setNp establishes it
- reject a non-finite dt in MPC::setdt: the previous "dt <= 0.0"
  comparison is false for NaN and let it through silently
- emit a deterministic unit-length fallback normal when the predicted
  position is at or near an obstacle center, instead of dividing by
  only a floored norm. At exact coincidence that division emitted
  (0, 0); for any positive norm below the floor it emitted a
  down-scaled, non-unit vector. Either way slack was left as the sole
  thing resisting the constraint
- skip the discrete-time CBF coupling term when either the current or
  the previous node's obstacle slot is unfilled (holds the far
  sentinel). The default per-node fill does not preserve slot identity
  across nodes, so a sentinel paired with a real obstacle at the next
  node inflated the coupling term by several orders of magnitude on
  ordinary approach geometry once cbf_gamma < 1. The check is gated on
  cbf_gamma < 1, so it costs nothing at the shipped default of 1.0
- reject setIneq() bound indices at or beyond the model's declared
  state/control dimension where that dimension is already known,
  instead of silently accepting an index that later indexes the QP
  rows out of range
- report updateIneq() calls that name a bound the model has not
  declared, instead of silently doing nothing
configure() falls back to a declared default whenever a clamped or
range-checked parameter is non-finite, but only q_pos exercised that
path. Extend the case to every clamp_low/clamp_range call site (14
parameters in all) so each one's fallback is actually observed, either
through the value it seeds or, for max_solve_time (no accessor exists
for it), through a non-throwing configure() and a finite subsequent
command.
fillSlot writes the same obstacle triple at every node, so no test
built from it can produce a per-node slot discontinuity. Add
fillSlotRange, which fills only a node sub-range, and use it to place
a far-sentinel-then-real-obstacle transition at cbf_gamma = 0.5 --
exactly the geometry the coupled CBF coupling term must not blow up
on. Records the resulting QP status and largest obstacle slack.
EIGEN_NO_DEBUG is defined at directory scope in every package, so an
out-of-range Eigen access is invisible to the existing build-and-test
job regardless of what else it checks. Add a sanitizers job that
rebuilds Debug, cancels EIGEN_NO_DEBUG with a later -U in
CMAKE_CXX_FLAGS so Eigen's own bounds assertions run alongside
AddressSanitizer and UndefinedBehaviorSanitizer, and fails outright on
any diagnostic (-fno-sanitize-recover=all, no continue-on-error).

check_no_eigen_debug.py reads the flags that actually reached the
compiler back out of compile_commands.json and fails the job if NDEBUG
or EIGEN_NO_DEBUG is still in effect anywhere, so a future reordering
of the flags cannot silently turn the job back into a decoration.

EIGEN_NO_DEBUG stays defined for every ordinary build; nothing here
touches a package's CMakeLists.txt or its normal compile flags.

Document the new job and its local reproduction steps in
CONTRIBUTING.md alongside the existing build-and-test and clang-tsa
entries.
The goal-approach taper read the goal checker's xy tolerance as
hypot(position.x, position.y). Upstream SimpleGoalChecker tests
dx*dx + dy*dy <= T*T and writes the same scalar T into both fields,
so each field already is the radial bound and hypot reported
sqrt(2)*T. The taper therefore started about 41% farther from the
goal than configured and cut the cruise speed about 29% deeper at a
given remaining distance.

- take the minimum of the two fields instead, which is exactly T for
  every goal checker Nav2 ships and the conservative reading for a
  custom anisotropic checker
- record why this is not RPP's position.x-only read, so the
  divergence is not "corrected" back later

The existing guard already requires both fields finite and positive,
so the minimum needs no sentinel handling.
applySpeedLimit() wrote updateIneq("u", 0, -v_lim, v_lim), replacing
whatever lower bound the model declared. A model with an asymmetric
speed range - a reverse limit tighter than its forward one, or no
reverse travel at all - lost that asymmetry on the first speed-limit
request, and the NO_SPEED_LIMIT restore widened the lower bound to
-v_max instead of restoring the declared one.

- cache the model's declared lower speed bound as v_min_ in
  readModelBounds(), alongside the upper bound already cached there
- intersect the requested limit with the declared range on both
  sides instead of overwriting it

Both bundled models declare symmetric speed bounds, so the commanded
sequence for the unicycle and the bicycle is unchanged.
The horizon extraction skips NO_INFORMATION cells, so the optimizer
plans through unknown space, while the endpoint veto rejected it,
because NO_INFORMATION (255) is above the INSCRIBED_INFLATED_OBSTACLE
(253) threshold the veto tested. The robot therefore planned into
unknown space and braked at its boundary, and every such veto counted
toward the budget that escalates to NoValidControl, so an unknown-space
boundary could end the navigation task.

- treat NO_INFORMATION as non-colliding when the costmap reports
  isTrackingUnknown(), as RPP and MPPI both do
- judge every other cost at LETHAL_OBSTACLE rather than at
  INSCRIBED_INFLATED_OBSTACLE, because a polygon check has already
  been performed and an inflated cell is not by itself a collision

Both halves are upstream's policy in upstream's order, including the
consequence that a footprint whose maximum cost is NO_INFORMATION is
reported clear even with a lethal cell also under it. The in-loop QP
keep-out half-plane still carries that lethal cell, since extraction
includes it at costmap_cost_threshold and skips only NO_INFORMATION.
max_solve_time was described as bounding the worst-case solve so a
slow SQP cannot overrun the control cycle. It does not: the elapsed
check sits between SQP iterations, outside the QP solve, and
proxsuite exposes no time-based stop, so a single long sub-problem
runs to completion whatever the budget says. The loop also exits
reporting success when the QP that overran the budget converged, so
the budget does not by itself route the caller to its fail-safe.

- describe the mechanism as a soft budget that caps how many further
  sub-problems start
- name the bound that does hold per cycle, the iteration caps, and
  max_iter_sqp = 1 as the bounded real-time iteration

Comments only; no behavior change.
The comment claimed the current pose was projected onto the plan, but
the loop picked the nearest future vertex and took its arc length
directly, with no segment parameter. The starting offset s0 was
therefore quantized to the plan's vertex spacing - about 5 cm for the
NavFn and Smac plans emitted at the default 0.05 m costmap
resolution, and unbounded for a coarse or sparse third-party plan.

Project onto each candidate segment with the parameter clamped to
[0, 1] and take the arc length at the projected point. A duplicate
consecutive position carries no direction and projects onto its start
vertex; a single-pose plan and a plan tracked to its last vertex keep
the previous behavior.
robot_radius is a free parameter that sizes every obstacle keep-out
through d_safe = robot_radius + safety_margin, and nothing checked it
against the footprint the costmap carries. A user whose real
footprint is larger got a silently undersized keep-out with the
outline-only endpoint veto as the only remaining guard.

Compare it at configure() against the layered costmap's own
circumscribed radius and log a warning naming both radii, the
resulting d_safe, and the consequence. The parameter is never
overwritten, so an operator running a deliberately tighter disc keeps
it and no existing deployment stops loading.
The per-node costmap scan was centred on the plan reference, that is
on where the plan says the robot should be, while the QP linearizes
each node's keep-out half-plane about the robot's own predicted
position. Any cross-track error therefore had to be absorbed by the
search window, which is only d_safe + obstacle_cluster_radius wide.

Centre each node's scan on the MPC's nominal trajectory instead. The
fill runs before solve(), which shifts the trajectory by one node
before assembling, so node k reads row k + 2 (clamped at the last
node) to land on the row its constraint will actually be linearized
about. Before the first solve the trajectory is zero, which is what
that first QP linearizes about too, so the two stay consistent.

Re-centring is necessary but not sufficient: at the default search
radius the fill is near-contact-only even at zero cross-track error,
and max_obstacles stays at 1, so one obstacle per node reaches the
solver. The knob and its per-cycle QP cost are now recorded where the
parameter is declared.
The static fill scanned, sorted and clustered independently at every
predicted node, so obstacle slot s could hold different physical
objects at adjacent nodes, and could hold the far sentinel at one
node and a real obstacle at the next. The coupled discrete-time CBF
compares slot s at node k against slot s at node k-1, which is only
meaningful when both describe the same object, so slot churn made the
coupling compare unrelated distances - the whole point of a CBF rate
below 1.

- chain each node's clustered representatives onto the object they
  continue, matching against the object's most recently seen position
  so an extended obstacle is followed as its nearest representative
  slides along it, and refusing a second claim on the same node
- give the per-cycle slot capacity to the objects that come closest
  to the horizon, and hold each object in its slot at every node it
  was seen at, leaving the far sentinel at the others

The added work is bounded by the slot capacity times the node count
and is negligible beside the costmap scan it follows.
The static obstacle fill held the costmap grid lock across the whole
per-node scan, sort, clustering and matrix writes, blocking the
costmap's own update thread through the most expensive part of the
control cycle. Only the cell reads need it.

- take the lock once per node, around worldToMap, getCost and
  mapToWorld, and release it before the sort, the clustering, the
  slot binding and the writes
- re-read the grid geometry inside each locked region, so a resize
  between nodes cannot send the scan out of bounds
- reuse the candidate and cluster buffers across nodes so the scan
  grows them at most once per cycle

The candidate set is unchanged, so the emitted obstacles are the same
whenever the map does not change mid-cycle.
getRobotFootprint() returns Costmap2DROS's padded footprint by value
and the grid mutex guards the cell data, not that member, so reading
it inside the lock implied a protection that does not exist and kept
the critical section longer than the cell reads need.

Copy the footprint before taking the lock and record that the copy is
a best-effort snapshot of an unsynchronised member - the same
per-cycle read the reference Nav2 controllers perform, which is what
keeps a runtime footprint update taking effect.
The fail-safe ramp built a body twist directly, ramping angular.z at
the model's du[1] bound. For the bundled bicycle that bound is a
steering acceleration, not a body-yaw acceleration, so the ramp had
no physical meaning on that model, and the path bypassed the model
entirely while the accepted command path goes through toTwist(). Only
the lower du bound was read, absolute-valued and applied to both
signs, so a model's asymmetric rate limits were discarded, and the
step used the configured dt rather than the inter-cycle period the
plugin already measures.

- ramp the model's own controls toward zero under its own control-rate
  bounds, each side's sign preserved, and map the result through
  toTwist(); the speed channel still ramps from the server-measured
  speed, and the channels with no measurement ramp from their last
  commanded value
- set the model state on the brake path, since the accepted path's
  setX runs past the veto and no braking cycle reaches it
- step with the measured inter-cycle period, clamped below at the
  configured step so the ramp is never slower than before and above
  so a stale measurement cannot produce an abrupt stop
- keep a twist-space ramp as the last resort when a model maps the
  braked controls to a non-finite twist, so the safety path can never
  publish one

For a unicycle, whose control is a body twist and whose toTwist is the
identity, the linear channel is unchanged; the angular channel now
ramps from the last commanded yaw rate rather than the measured one,
since nothing yet tells the controller which control is a yaw rate.

Existing brake and veto assertions that encode the old twist-space
semantics are left failing deliberately: they assert the behavior this
change corrects, and rewriting them here would remove the check that
would have caught the change being wrong.
steering_state_ advanced only on a fully accepted cycle, past the
finiteness, veto and mapping gates, so a braked or vetoed cycle left
the belief frozen at an angle the wheels no longer hold and the next
solve linearized about it. Every rejected cycle brakes, and a
downstream twist-to-steering converter straightens the wheels as the
commanded yaw rate falls, so the belief and the plant diverge exactly
on the cycles where recovery matters.

Decay it toward zero on the brake path at the model's own
steering-rate bound, before the braked controls are mapped, so the
emitted yaw rate matches the decayed angle. It stays an open-loop
belief, but one correct in direction and rate and bounded by the
model's own limit. A model that declares no steering rate keeps the
previous frozen behavior rather than moving at a rate it never
stated.
deactivate() reset latest_obstacles_ under obstacles_mutex_ and then
cleared predicted_obstacles_ outside it, two lines apart. The
controller server deactivates its action server first, which joins
the only thread that calls computeVelocityCommands, so this is safe
today - but on an upstream implementation detail this teardown should
not depend on, and the asymmetry reads as an oversight.

Extend the existing lock scope over both clears.
The header stated that the tracked-obstacle callback and
computeVelocityCommands run in the same controller-server executor,
and gave that as the reason obstacles_mutex_ exists. They do not: the
callback runs on the node executor and computeVelocityCommands on the
action server's own execution thread, so the two are concurrent and
the mutex is what makes the exchange safe. As written, the comment
was an argument for deleting the lock it justifies.

Comments only; no code token changed.
The doc comment named only part of what the function now caches,
leaving the steering-rate bounds and the control-vector sizing
undocumented.

Comments only; no code token changed.
The deceleration ramp on a rejected cycle steps with the measured
inter-cycle period, so a server running slower than dt still brakes at
the model's declared rate. That measurement is not always wanted: a
deployment that prefers the ramp independent of scheduling jitter had no
way to pin it.

Declare brake_period_s [s], default 0.0. At 0 the measured period is
used as before, clamped into [dt, 2*dt] so a stale reading cannot
collapse the ramp into a single step. A positive value overrides the
measurement and is used as-is. The default preserves the existing
command sequence exactly.

The ramp saturates at zero in either mode, so an over-large step
shortens the stop rather than reversing or overshooting it.
Slot capacity was awarded to the objects with the smallest closest
approach anywhere on the horizon. That ranking degrades as the horizon
grows: at a long np the slot can go to an encounter many seconds out
that is re-planned long before it happens, while an obstacle the robot
passes within a metre of at node 2 gets no in-loop constraint at all.
Nothing in the diagnostics reveals it.

Rank by the earliest node an object is seen at instead, ties broken by
closest approach. Time to encounter is invariant to horizon length,
because extra nodes are appended past the ones that decide the order,
and it is the rule Autoware's cruise planner uses.

The order is unchanged when every candidate is first seen at the same
node, which is the case at the shipped horizon and scan radius.
Both bundled production models (Bicycle, Unicycle) declare symmetric
speed and control-rate bounds, so no test built from them can show a
controller defect that discards bound asymmetry (for example widening
a reverse limit, or braking a robot at its forward deceleration rate
while it is reversing). Add AsymmetricBoundsModel: the same finite
linear-integrator dynamics as NonFiniteTwistModel, but with a tighter
reverse speed cap and a harder braking rate than accelerating rate.
Register it through the same pluginlib path as the existing fixture
and document it in the package README and description.
Three assertions encoded the pre-Wave-2 semantics and went red once
the brake and the costmap scan changed underneath them:

- The bicycle brake ramp no longer ramps angular.z directly from the
  measured yaw rate; it decays the steering belief at the model's
  steering-rate bound and derives the yaw rate as v * sin(delta) / L
  through toTwist(), the same seam the accepted command path uses.
  Seed a non-zero steering belief so the decay is observable and
  assert the derived value instead of the old twist-space ramp.
- The static obstacle scan now centers on the MPC's own nominal
  trajectory instead of the reference argument fillStaticObstacles no
  longer reads. Drive the centering through mpc()->setX() so the
  "out of grid" and "near the obstacle" cases are still expressible,
  and size the horizon so two nodes read distinct nominal rows.

Also extend StubGoalChecker with an asymmetric-tolerance constructor
(kept alongside the existing isotropic one) for follow-up coverage of
the goal-tolerance taper, which the equal-tolerance stub cannot reach.
StubGoalChecker previously wrote the same value into both tolerance
axes, so no existing case could tell std::min(x, y) apart from
hypot(x, y) or an x-only reading: add an isotropic case that pins the
taper at a distance where the two readings disagree, and an
anisotropic case that pins the conservative-minimum reading against
both alternatives.

Add the unknown-space veto cases the endpoint-veto side was missing
(extraction already had one): INSCRIBED_INFLATED_OBSTACLE alone no
longer vetoes, LETHAL_OBSTACLE still does, and NO_INFORMATION does not
veto when the costmap tracks unknown space.

A fourth case (a footprint spanning both NO_INFORMATION and LETHAL)
was expected to be masked by the unknown cell, matching an inherited
upstream property the veto's own code comment describes. Measured
directly against the installed nav2_costmap_2d, that does not
reproduce: the lethal reading wins regardless of cell-visit order, so
the veto stays conservative. The test pins the behaviour actually
observed rather than the documented-but-unverified one.

Add a speed-limit test on the new AsymmetricBounds fixture asserting
the lower bound is intersected with the model's own range rather than
replaced, including through the NO_SPEED_LIMIT restore path, which
previously discarded a model's reverse-speed asymmetry.

Add a static-obstacle test showing the costmap scan follows the MPC's
own nominal trajectory rather than the plan reference.
Add two plan-projection tests (a sparse plan, a self-intersecting
one) showing tracked progress is projected onto the true nearest
segment point instead of snapping to whichever vertex happens to be
closest, which could otherwise jump tracking onto a distant,
unrelated branch.
Add coverage for the brake ramp's control-space rework: it steps with
the measured inter-cycle period by default, floored at the configured
dt and capped at twice it so a real stall shortens the ramp instead of
collapsing it to one abrupt step; a positive brake_period_s pins the
step and ignores elapsed time entirely; the ramp saturates at zero
rather than crossing into the opposite sign; each direction ramps at
its own declared rate rather than a single symmetric magnitude; and
the bicycle command is derived through the model's own toTwist physics
(v * sin(delta) / L) rather than a twist-space ramp of the measured
yaw rate.

The ceiling case needs the non-finite-pose fail path rather than a
second solver-failure cycle: publishDiagnostics() resets the timing
reference early in every cycle that reaches the solver, so a
solver-failure brake always measures a near-zero elapsed time no
matter how long the previous cycle took. The non-finite-pose path
reaches the brake before that reset runs, so it is the one that can
observe a real stall.
The veto checked the predicted pose one step ahead. One step spans v*dt,
0.05 m at the 0.5 m/s operating point, while braking from that speed at the
model's declared rate covers v^2 / (2a) = 0.25 m. The check therefore found
an obstacle five times later than the point at which the robot could still
stop short of it, so the guard fired without being able to act on what it
found.

The walk now continues along the predicted trajectory until the cumulative
arc length passes the stopping distance, which keeps the lookahead
proportional to speed and costs one footprint test per step of travel
rather than one per horizon node. A model declaring no usable deceleration
rate falls back to the single-step check.
The costmap-only fill reacts to where an obstacle was seen rather than
where it is going, and that is the weaker configuration once more than one
obstacle moves: across the six multi-obstacle cells it takes 12 collisions
in 30 runs against 1 in 30 for the predictive fill, on the same geometry
and the same perception.

Shipping it off by default meant the out-of-box configuration was the worse
one, and a deployment had to know to opt in. With no tracker publishing, or
a stale message, the fill already degrades to the costmap-only path, so the
new default costs a subscription and a marker publisher rather than a
behavior change; predict_obstacles false reproduces the old behavior
bit-for-bit.

BREAKING CHANGE: predict_obstacles now defaults to true. A deployment that
relies on the costmap-only fill and does not set the parameter explicitly
will subscribe to tracked_obstacles and act on it once a tracker publishes.
Set predict_obstacles false to keep the previous behavior.
The footprint veto now walks the predicted trajectory to the robot's
stopping distance rather than checking a single pose one step ahead, so the
README, the architecture flow, the sequence diagram, the avoidance section
and the deployment note all described a check narrower than the one that
runs.

The parameter tables carried three stale defaults and semantics:
predict_obstacles now defaults to true, allow_reversing false narrows the
linear control bound rather than only the reference, and model_params.v_min
is forwarded on its own when negative.
ProxQP was re-initialized with init() on every solve, which rebuilds the
workspace and discards the previous primal/dual iterate. The guess
parameter therefore never selected a warm start at all: the only policies
reachable were ProxQP's own cheap starts, and the factorization was thrown
away and recomputed 20 times a second.

The workspace is now built once and updated in place, so the factorization
and the previous iterate carry over and the solver starts from the last
solution. WARM_START is used rather than WARM_START_WITH_PREVIOUS_RESULT
because the latter also carries the proximal step sizes, and unused
obstacle slots are padded with a far sentinel whose rows are ~1e6 in
magnitude, so step sizes tuned against that scaling would cripple the next
solve.

In-place update requires a fixed sparsity structure - ProxQP silently
ignores an update whose pattern moved, which would drop the keep-out rows
and let the robot drive through an obstacle. The structure is declared once
from the positions setE and setC write and the values written into it each
cycle, structural zeros included; a pattern from sparseView() would move as
the half-plane normals and the model Jacobians pass through zero.
WarmStartPreservesTheKeepOutRows pins the constraint across a 70-cycle run
on the update path and checks the warm and cold paths agree.

The implementation is the one prototyped on feat/qp-warm-start, ported to
the current tree, with the cold path keeping its own policy so guess false
still reaches NO_INITIAL_GUESS.

BREAKING CHANGE: warm_start defaults to true, so the solver reuses its
workspace and iterate across cycles instead of rebuilding them. Set
warm_start false to restore the previous per-cycle re-initialization.
The global costmap already marked unobserved cells NO_INFORMATION; the
local costmap did not set the parameter and took Jazzy's default of false,
so every cell the sensor had not swept - the area behind the robot above
all - was published as free space.

The controller reads the local costmap for both the in-loop keep-out fill
and the footprint veto, so it was being told the robot had observed ground
it had not. Marking it unknown does not by itself change what the
controller plans, since the fill skips NO_INFORMATION cells and the veto
treats them as clear once the costmap tracks them, but it stops the map
asserting something false to every consumer that reads it, the planner and
the recovery behaviors included.
Nothing guards the area behind the robot. The in-loop keep-out fill skips
NO_INFORMATION cells and the footprint veto treats them as clear once the
costmap tracks unknown space, so a reverse manoeuvre runs into whatever the
sensors never observed.

Enabling allow_reversing previously inherited the model's own lower bound,
which is a modelling limit rather than a safety choice - for the bundled
models it is -v_max, so turning reversing on silently authorised reverse at
full cruise speed into the one direction nothing watches. Reverse is now
capped at 0.15 m/s unless model_params.v_min names a bound, which is how a
platform with rear sensing states its real envelope.

The cap is mitigation, not protection: a slow reverse into an unseen
obstacle is still a collision, and the documentation says so rather than
implying the direction is guarded.
The fill scans one present-time costmap around every predicted node, so a
moving obstacle is constrained where it currently is rather than where it
will be - an error of v_obs * t_node, up to a metre at the far end of a 2 s
horizon. Correcting it needs motion information, which is what the tracker
supplies, so the limit is inherent to the costmap-only path rather than a
tuning shortfall.

It shows up only with more than one mover: a single obstacle leaves a free
corridor wide enough to absorb the late reaction, and two close it.
Three defaults changed in incompatible ways since 1.0.0: warm_start and
predict_obstacles both default to true, and model_plugin defaults to the
unicycle. allow_reversing also narrows the control box rather than only the
reference, which changes the feasible set rather than the reference alone.

Four of the seven packages are public ABI and wire surfaces on the jazzy
buildfarm, so the whole repository moves together to keep the released set
aligned. prox_mpc_msgs carries no interface change; its version follows the
others.
… reverse

robot_radius was 0.22 m against a costmap footprint whose circumscribed
radius is 0.234 m, so d_safe was sized 14 mm inside the robot's own outline
and the controller emitted its undersized-keep-out warning on every run.
The four presets that set it now name 0.234; the costmap entries stay at
0.22, since the footprint is what the circumscribed radius is measured
from.

The demo enables reverse travel with an explicit -0.15 m/s bound. Backing
out is what the costmap-only fill has left when two movers close the gap in
front of it - the fill only knows where obstacles were - and measured over
30 multi-obstacle runs it is worth 6 collisions and 0.16 m of margin. The
waffle's 360-degree scanner sees behind the robot and the Collision Monitor
already in the cmd_vel chain projects the footprint along the commanded
twist, reverse included, so the manoeuvre is guarded here. The shipped
controller default stays forward-only: a library cannot check whether an
integrator's platform has rear coverage.

That last point also corrects the reverse cap's stated rationale, which
claimed nothing guards the area behind the robot. Rear obstacles are
guarded exactly as far as the platform observes them; what no guard covers
is genuinely unobserved space, in any direction.
The undersized-keep-out warning reported the circumscribed radius at three
decimals and advised raising robot_radius to that printed value. Nav2 pads a
circular footprint into a 16-gon, so the radius carries more precision than
the format shows: a 0.22 m radius with the default 0.01 m padding
circumscribes at 0.234142 m, printed as 0.234. An operator following the
message exactly set 0.234 and tripped the same warning again.

The circumscribed radius is now reported at four decimals and the advice is
rounded up to the millimetre it is printed at, so acting on the message
satisfies the check. The four presets that set robot_radius move to 0.235,
which is that value for this footprint; the costmap entries stay at 0.22,
since the footprint is what the radius is measured from.
robot_radius is a geometric fact - the circumscribed radius of the
footprint the costmap carries - while safety_margin is the discretionary
part of the keep-out. Correcting the first from 0.22 to 0.235 without
touching the second widened d_safe from 0.320 to 0.335 m, and that measured
worse where it matters: across 30 multi-obstacle runs the predictive preset
went from 2 collisions to 5 and the reactive from 17 to 20, with both mean
gaps falling. A gap between two obstacles needs 2*d_safe to stay feasible,
so 15 mm per side asks 30 mm more of every gap; where one was marginal the
constraint turns infeasible, the slack absorbs it, and the path cuts closer
than it did before.

safety_margin therefore moves to 0.085, holding d_safe at the 0.320 m that
measured best while the radius stays honest. The previous configuration was
not better because 0.320 is special; it was better because an undersized
radius and a generous margin happened to cancel.
The three result documents described a controller that no longer exists:
they predated max_iter_sqp defaulting to 1, the QP warm start, the veto
change, the predictive default, and the keep-out correction, and quoted a
keep-out of 0.42 m that no preset has used since.

Every table is regenerated from a merged 435-run index: the five peer
controllers from the full matrix at commit 5132c97, both ProxMPC presets
from the 110-run campaign at 9d0117a that followed the keep-out correction.
The split and its reason are stated at the top rather than left implicit,
since robot_radius moved to the footprint's circumscribed radius and
safety_margin absorbed it to hold d_safe at 0.320 m.

The conclusions are re-derived rather than re-numbered. Predictive ProxMPC
is now reported as the field's most reliable avoider at 6% of 50 obstacle
runs against 16% for the next best, and the release's largest behavioural
change is stated as what it is: worst-case cycle latency fell from 300 ms
to inside the budget on every run, from two defects rather than tuning.

Three things are recorded that the previous documents would not have said.
The reactive preset's multi-obstacle rate rose from 40% to 50%, and the
cause is named - forbidding reverse removed an escape the costmap-only path
relied on. A solver report that appears on 14 of 50 reactive runs is
unexplained after three candidate causes were tested and eliminated. And
these rates move by 4 points on 15 mm of keep-out, so the documents now say
plainly at what scale their own numbers should be read.
Section 7 briefly carried observations from a bring-up check rather than
from a measured navigation run. Mode (a) re-validation is deferred, so the
section says only that it was not re-run and still reflects the v1.0.0
baseline, as it did before.
- allow_reversing now narrows the linear control bound to [0, v_max]
  when false, rather than only filtering which plan pose the reference
  tracked. An unguarded reverse is capped at 0.15 m/s where the model
  names no v_min, because whether a platform senses behind itself is a
  property of its sensor rather than of this plugin.
- New reverse_from_plan_orientation, default false, splits reading
  travel direction out of the plan from opening the control box. NavFn
  and Smac 2D leave every pose at the identity quaternion, which is
  indistinguishable from a straight reverse plan, so trusting them drove
  whole paths backwards instead of turning around.
- Travel direction is a latched mode gated on standstill and a dwell, so
  a cusp is driven the way a vehicle drives one - arrive, stop, shift,
  pull away - rather than re-decided from plan geometry every cycle.
- Inside the goal-checker xy tolerance the reference is pinned to the
  goal pose, and a platform with no steering channel turns on the spot
  for the last of the heading. The previous reference had arc reach
  remaining^2 / xy_tol, so it collapsed to a stub carried along by the
  robot's own projection and never reached the goal orientation.
- New prediction_forward_shadow_s, obstacle_yield_band_m and
  obstacle_yield_caps_speed, all inert at their defaults. The cap bounds
  the solver's forward speed instead of lowering a cruise target the
  obstacle term outweighs, floored at the speed still reachable this
  step so the QP keeps a feasible first control, with the reverse bound
  left alone so the robot can back away.
- The footprint veto walks the predicted trajectory as far as the
  stopping distance rather than checking one pose ahead.

BREAKING CHANGE: allow_reversing false now forbids reverse travel in the
solver, not only in the reference. Set reverse_from_plan_orientation
true to restore the previous reading of plan pose orientations.
- Both Nav2 parameter files keep allow_reversing: true, so the demo
  shows the robot backing up to adjust and then pursuing the path
  forward. Reverse used to read as a shuffle near the goal; that was the
  reference collapsing inside the goal tolerance, not reverse itself.
  Measured over cmd_vel_nav, reverse-enabled now completes every demo
  scenario faster than forward-only (27.8 s against 38.6, 12.2 against
  19.8, 9.5 against 21.7) with no Failed to make progress events against
  two for forward-only.
- The predictive file sets obstacle_yield_band_m: 0.5 and
  obstacle_yield_caps_speed: true, so the robot waits for a crossing
  mover rather than racing it. Not set in the non-predictive file, which
  runs no tracker and has no predictions to act on.
- The local costmap tracks unknown space, so cells the sensor has not
  swept are marked NO_INFORMATION instead of published as free.
- Record why the two demo obstacles together do not exercise the
  predictive path: the box occludes the walker for about 71% of the
  approach, so no moving track survives confirm_count.
record_scenarios.py captured a fixed-length clip starting before the goal
was sent, so the goal delay and the stack's start-up latency were dead
time in the clip and a retried goal shortened it. It now captures a
longer raw window and trims the clip to open 0.3 s before the robot first
moves, read from /odom at the same 1 mm threshold that releases the
scenario's obstacles. A robot that never moved keeps the head of the
capture and prints a warning, so a failed navigation is not mistaken for
a good clip.

- A scenario may set its own clip length with video.duration_s;
  dynamic_circle sets 25 s so the orbit is seen through to the goal.
- The mode-(b2) run index is rebuilt from the records on disk, so
  re-running a subset no longer leaves stale rows from an earlier
  matrix in the index.
- Cover the clip timing with a pytest that needs no ROS graph.
The predictive preset now sets allow_reversing, obstacle_yield_band_m and
obstacle_yield_caps_speed, so the measured configuration is the one the
controller documents as its shipped predictive behaviour. Without the cap
the yield only lowers a cruise target the obstacle term outweighs and the
solver swerves at full speed past a closing mover instead of slowing:
measured on dynamic_circle over ten runs, this configuration passes behind
the mover 10/10 against 4/10 and holds three times the worst-case
clearance, with no collisions either way.

Also record the QP status histogram and the SQP / QP external iteration
maxima per run.
Re-recorded against the shipped configuration, so the clips show the
behaviour the presets now enable rather than the previous one, and each
clip opens as the robot starts moving instead of on a frozen scene.
dynamic_circle runs 25 s so the orbit is seen through to the goal.
Every mode-(b2) figure now comes from one 435-run matrix recorded
back-to-back on one host, plus the 40-run core-sim matrix taken in the
same session. This replaces the merged two-session set published
previously and removes the cross-session caveat: no row's comparability
depends on two campaigns being close enough any more.

- Predictive ProxMPC is the fewest-collision controller in the field at
  3/50 over the ten obstacle cells, and holds the widest median closest
  approach on the two-mover cells at +0.151 m. Its worst-case
  single-mover margin is +0.212 m while its cross-track max fell to
  0.376 m: it yields by slowing rather than swerving.
- Reported in both directions: the reactive preset moved 37% to 53% on
  the multi-mover cells, Vector Pursuit reached the goal 1/5 on
  static_box, and blind_multi_0 remains the predictive preset's one weak
  cell. Re-running unchanged peer binaries moved them by up to 8 points,
  which is the noise floor these counts are read against.
- Confirm the static_box peak-slack figure as a first-cycle
  initialisation transient: it now appears on every run of both models,
  which is what the subscription race predicts.
- State where the figures were measured rather than naming a deployment
  target, and tighten the single-obstacle compute ratio to the range the
  data supports.
- Scope the pending Gazebo note to its own tracking and solve figures,
  pointing at the demo guide for the reverse and yield runs measured
  there.
ament_cmake_pytest entered prox_mpc_benchmark's package.xml with the
recorder's clip-timing test, and the inventory gate fails on a declared
rosdep key with no attribution decision behind it. It is part of the ROS
2 Jazzy distribution set the blanket row already covers.
The dev branch is being removed: it held the pre-squash 1.0.0 history and
has carried nothing that main does not since, so describing it as the
integration branch no longer matched what happens. CI only runs on pull
requests to main in any case.

State the release convention instead, which is what 1.0.0 actually did
and what 2.0.0 follows: prepare on release/<version>, squash-merge into
main so main carries one commit per release, and keep the release branch
so that release's granular history stays reachable.
Every access already took obstacles_mutex_, but without the annotation
the Clang thread-safety gate could not see it, so a future unguarded
access would have compiled clean. Verified against the gate itself:
-Werror=thread-safety builds all seven packages, which it would not have
done had any of the twelve access sites been outside the lock.
Section 7 carried v1.0.0-era figures because mode (a) was blocked on the
host's GPU driver. The driver is in place, so the cell was re-run on the
shipped demo parameters: five runs of the open-room traverse, the only
change being publish_diagnostics, which is opt-in telemetry that
publishes when subscribed and does not touch control.

- 5/5 reach the goal with 0 recoveries; cross-track RMS 5.76 +/- 1.23 mm
  against AMCL and a simulated lidar.
- The real-time iteration holds under real physics: mean SQP iterations
  1.00 across 966 cycles, none over the 50 ms budget, and all 966 QP
  solves returned PROXQP_SOLVED - the infeasibility reports of Section 5
  do not appear in this mode at all.
- Per-cycle compute is about 1.9x the mode-(b2) median, which is the
  physics, sensor pipeline and AMCL sharing the host, not a regression.

The solve-time difference against the v1.0.0 figures is reported but
deliberately not attributed: that run used a different controller
configuration as well as different code, so the two are not a controlled
comparison. The tracking figure is unchanged within its spread.

Also drops the now-false 'Gazebo reflects v1.0.0' caveats from the root
README and the benchmark README, and states the coverage as five runs of
one open cell rather than a comparison.
Adopting Nav2's warning policy brought -Werror together with
-Wnull-dereference. GCC 13 raises that warning inside libstdc++'s own
<regex> headers - stl_algobase.h, reached through
regex_traits::transform_primary - once --coverage changes its inlining
decisions, which is why the coverage build hits it and an ordinary build
does not. The report is attributed to the translation unit that
instantiates the template rather than to the header, so
-Wno-system-headers does not reach it.

Keep the diagnostic and stop it failing the build. Applied to all seven
packages so the duplicated policy block stays identical.
ComputeSkipsVetoWithoutFootprint produced its degenerate footprint by
setting an empty one. nav2 1.3.13 refuses that ("a footprint must
contain at least one point") and keeps the previous footprint, where
1.3.12 accepted it silently; the string does not appear in 1.3.12's
libraries at all. On 1.3.13 the fixture's real footprint therefore
survived, the veto ran against the lethal cost the test fills, and the
command came back braked - the assertion's opposite. Its warning is
throttled and the preceding test had just logged one, so the failure
looked like a bare zero with no cause.

Use two points instead of none: non-empty, so nav2's own guard passes -
it compares begin against end, not size against three - and still short
of the controller's `size() >= 3`, so the branch under test is reached
on both versions. Assert that premise rather than assume it, so a nav2
that also refuses two points fails saying which condition broke.
- CITATION.cff: version 2.0.0, date-released matching the 2.0.0
  CHANGELOG date, so citation tooling stops reporting 1.0.0.
- SECURITY.md: the supported-versions table names 2.0.0, as the
  latest-release-only policy below it requires.
- SECURITY.md: the CI summary names the sanitizers job and the
  -Werror=thread-safety gate this release added, so it no longer
  understates what CI checks.
- prox_mpc_controller CHANGELOG: mark allow_reversing Breaking. 1.0.0
  had no such parameter and its solver always admitted reverse, so the
  false default removes reverse travel on upgrade.
- prox_mpc_controller CHANGELOG: describe reverse_from_plan_orientation
  as a new opt-in rather than a restored pre-release reading.
- migration.md: add a section on reverse travel becoming opt-in, and
  correct the sentence that said the default reproduced 1.0.0.
- migration.md: mark the protected signature changes and renames
  source-incompatible for a derived class, add publishDiagnostics, and
  correct the counts to three methods and twenty-nine members.
- prox_mpc_demo CHANGELOG: the parameter files set allow_reversing,
  which 1.0.0's did not carry.
@simone-contorno
simone-contorno merged commit ae5cf05 into main Sep 14, 2026
3 checks passed
@simone-contorno
simone-contorno deleted the release/2.0.0 branch September 15, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant