Releases: yeezhouyi/mpc_controller
Releases · yeezhouyi/mpc_controller
Real-time optimization and portability hardening
v0.2.1 — Real-Time Optimization and Portability Hardening
Performance
- Cached condensed-QP matrices and Hessian, rebuilding them only after Q/R/S hot updates.
- Reduced mean cycle time by 11.9% in a controlled WSL2 paired A/B benchmark: 3.06 ms → 2.69 ms.
- Reduced mean solve time by 10.1%: 2.88 ms → 2.59 ms.
- Reduced deadline miss rate from 4.32% to 3.33%.
- Preallocated per-cycle work vectors, reducing MPCController-layer Eigen heap allocations from 17+ to approximately 3.
- Reused OSQP wrapper conversion buffers.
Fixed
- Fixed Q/R/S hot-update ordering so the Hessian and gradient use consistent weights on the first updated cycle.
- Added
c_floatportability for single-precision OSQP builds through explicit element-wise conversion. - Removed per-cycle OSQP wrapper buffer allocations.
Validation
- Completed a controlled WSL2 paired A/B benchmark with 10 alternating runs and 5 matched pairs.
- All 10 runs passed the predefined failed-cycle quality gate.
- 4 of 5 paired comparisons showed lower cycle time after optimization.
- Native Linux runtime characterization remains planned for v0.2.2.
Known Limitation
The current performance benchmark was collected under Ubuntu 24.04 on WSL2. The reported results demonstrate the relative improvement between v0.2.0 and v0.2.1 under the same environment, but should not be interpreted as a hard real-time guarantee.
Real-time optimization and portability hardening
v0.2.1-rc1 — Real-Time Optimization and Portability Hardening
Highlights
- Cached condensed-QP matrices and Hessian, rebuilding them only after Q/R/S hot updates.
- Preallocated MPCController work vectors and reused OSQP conversion buffers.
- Added
c_floatportability through explicit element-wise conversion. - Fixed Q/R/S hot-update ordering so the Hessian and gradient remain consistent on the first updated cycle.
- Completed a controlled WSL2 paired A/B benchmark.
WSL2 Paired A/B Benchmark
The benchmark alternated v0.2.0 and v0.2.1-rc1 runs in a single WSL2 session to reduce environmental bias.
Metric | v0.2.0 | v0.2.1-rc1 | Change -- | -- | -- | -- Mean solve time | 2.88 ms | 2.59 ms | −10.1% Mean cycle time | 3.06 ms | 2.69 ms | −11.9% Deadline miss rate | 4.32% | 3.33% | −0.99 pp Optimal solve rate | 97.6% | 98.1% | +0.5 pp Position RMS error | 0.900 rad | 0.834 rad | −7.4%Four of five paired comparisons showed a lower cycle time after optimization. All ten runs passed the predefined failed-cycle quality gate.
Validation Status
- WSL2 paired A/B validation: completed.
- Native Ubuntu 24.04 benchmark: pending.
- Stable v0.2.1 release: pending native Linux validation.
Soft velocity constraints and warm-start hardening
v0.2.0 — Soft Velocity Constraints and Warm-Start Hardening
Highlights
- Added soft velocity constraints with L1/L2 slack penalties.
- Improved optimal solve rate from 59.5% to 97.7%.
- Reduced hold fallback events from 3,863 to 177.
- Reduced position RMS error from 1.94 rad to 1.13 rad.
- Reduced deadline miss rate from 88.3% to 16.3%.
- Eliminated sporadic sentinel NaN bursts across 22,179 post-fix control cycles.
Added
- Soft velocity constraints using slack variables.
- Extended diagnostics for solver status, residuals, fallback events, slack usage, cycle index, and deadline misses.
- Multi-run RRBot rosbag benchmark workflow.
- GitHub Actions CI for ROS2 Jazzy build and functional tests.
- CHANGELOG documentation.
Fixed
- Corrected condensed prediction matrix ordering.
- Corrected OSQP Hessian scaling.
- Added OSQP workspace reuse and incremental updates.
- Fixed input-rate constraint timestep scaling.
- Fixed partitioned warm-start shifting for
z = [U, ε]. - Added finite-value validation before reusing warm-start solutions.
- Prevented invalid slack diagnostics from infeasible solver cycles.
- Removed the placeholder Diff-Drive launch file that did not load the MPC controller.
Benchmark Environment
- ROS2 Jazzy
- Ubuntu 24.04 under WSL2
- Gazebo Sim RRBot 2-DOF manipulator
- Controller target rate: 100 Hz
- Post-fix clean aggregate: runs 02–04, 7,870 cycles
Known Limitations
- The current WSL2 benchmark does not yet achieve stable 100 Hz execution.
- Further optimization will focus on cached Hessian construction, Eigen buffer preallocation, OSQP tuning, and native Linux testing.
What's Changed
- chore: remove placeholder diff-drive launch
- docs: add CHANGELOG.md
- fix: correct OSQP dependency in package.xml
- ci: add GitHub Actions build and test workflow
- docs: add ROS2/License/Version badges to README header