Skip to content

moveit_core: migrate AccelerationLimitedPlugin to OSQP v1.0 C A - #3806

Merged
nbbrooks merged 1 commit into
moveit:mainfrom
nbbrooks:nbbrooks/moveit-core-osqp-v1-migration
Aug 2, 2026
Merged

nbbrooks merged 1 commit into
moveit:mainfrom
nbbrooks:nbbrooks/moveit-core-osqp-v1-migration

Conversation

@nbbrooks

@nbbrooks nbbrooks commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Closes #3786

OSQP v1.0 redesigned the C API:

  • OSQPWorkspace* → OSQPSolver*
  • OSQPData aggregate removed; matrix/vector pointers passed directly to osqp_setup(...) instead of through a data struct
  • csc → OSQPCscMatrix, c_int → OSQPInt
  • osqp_update_A + osqp_update_bounds → osqp_update_data_mat + osqp_update_data_vec (single call each replaces both prior functions)
  • OSQPSettings.warm_start → OSQPSettings.warm_starting
  • Solution access via osqp_solver_->solution->x[0] (same shape as v0.6.x)

AccelerationLimitedPlugin is the sole OSQP consumer in moveit_core; port every call site to v1.0. Behavior of the QP is unchanged — same problem formulation, same iteration/settings, same solution semantics. Regression: 100% of AccelerationFilterTest (4 tests) passes after migration.

Companion change: moveit2_rolling.repos in #3760 will point osqp_vendor at moveit/osqp_vendor (which ships OSQP v1.0.0) instead of tier4/osqp_vendor (0.6.x). A rosdistro release of moveit/osqp_vendor is planned for lyrical + rolling; humble/jazzy/kilted continue on tier4's release path.

Description

Please explain the changes you made, including a reference to the related issue if applicable

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

@codecov

codecov Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.32%. Comparing base (f737f20) to head (c923306).

Files with missing lines Patch % Lines
...nline_signal_smoothing/src/acceleration_filter.cpp 78.58% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3806      +/-   ##
==========================================
+ Coverage   46.21%   46.32%   +0.12%     
==========================================
  Files         726      726              
  Lines       59510    59504       -6     
  Branches     7623     7624       +1     
==========================================
+ Hits        27497    27561      +64     
+ Misses      31845    31777      -68     
+ Partials      168      166       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nbbrooks
nbbrooks force-pushed the nbbrooks/moveit-core-osqp-v1-migration branch 3 times, most recently from 9d9d9ab to bfea31b Compare August 2, 2026 19:34
@nbbrooks

nbbrooks commented Aug 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

rolling-resolute (experimental) is failing as expected due to lack of warehouse-ros and other apt

…Plugin

OSQP shipped v1.0 with a redesigned C API. Rolling is expected to migrate
to the moveit-org fork of osqp_vendor (which vendors OSQP v1.0.0 under
cmake_minimum_required(3.16), naturally CMake-4-clean on Resolute), while
Humble/Jazzy/Kilted stay on tier4/osqp_vendor's apt-shipped 0.2.0 (v0.6.x).
Guard the two API paths so a single main branch supports both — matches
the distro-compat-guard policy in moveit#3751.

Version detection: CMake looks at the include directory the osqp::osqp
target resolved to and checks whether it contains v1's osqp_api_types.h.
That definition (MOVEIT_OSQP_V1) is passed PUBLIC into the compile so
consumers of moveit_acceleration_filter (notably the test binary) pick
the same branch as the .so — the guard controls a private member type
of AccelerationLimitedPlugin so a v1/v0.6 mismatch across TU boundaries
would be UB. Notes:

- osqp_VERSION cannot drive this — OSQP's shipped osqp-config-version.cmake
  sets PACKAGE_VERSION "0.0.0" (packaging bug, both major streams).
- Neither v0.6 nor v1 exposes a numeric preprocessor version macro
  (v0.6's OSQP_VERSION is a string literal; v1's numeric macros are in
  a non-installed private/version.h).
- Probing INTERFACE_INCLUDE_DIRECTORIES ties the compile-time branch
  selection to the same install CMake found, so a build environment with
  BOTH v0.6 (apt) and v1.0 (source-overlay) picks self-consistently.
- The .hpp keeps a header-probe fallback so LSP/clang-tidy standalone
  (which don't run through our CMakeLists) still get a plausible value.

API-shape guards inside acceleration_filter.{hpp,cpp}:
- OSQPWorkspace* ↔ OSQPSolver* (member type on AccelerationLimitedPlugin)
- v0.6 c_int + csc typedefs are aliased to v1's OSQPInt + OSQPCscMatrix
  at namespace scope so most of the file reads in v1 naming
- OSQPData aggregate populated in the OSQPDataWrapper constructor on
  v0.6 only; v1 doesn't have it
- updateA calls osqp_update_A (v0.6) vs osqp_update_data_mat (v1)
- updateData calls osqp_update_bounds (v0.6) vs osqp_update_data_vec (v1)
- osqp_setup takes (&workspace, &data, &settings) on v0.6 vs
  (&solver, &P, q, &A, l, u, m, n, &settings) on v1
- OSQPSettings.warm_start on v0.6 vs warm_starting on v1

Field names on csc/OSQPCscMatrix (n, m, i, p, x, nzmax, nz) are identical
so CSCWrapper stays as one implementation. osqp_solve and solution access
(->solution->x[0]) are also identical between versions.

Also introduces moveit2_rolling.repos pointing osqp_vendor at
moveit/osqp_vendor's OSQP v1.0.0 merge commit so rolling-ci actually
compiles the v1 code path (without this the v1 branch would only see
first compile on the Resolute buildfarm). Coordinates with moveit#3760 which
introduces the same file for a different reason — whichever lands
second reconciles.

Verified end-to-end in a fresh ubuntu:resolute + ROS Rolling container:
- With moveit/osqp_vendor@main (OSQP v1.0.0): moveit_core builds clean,
  4/4 AccelerationFilterTest cases pass
- With tier4/[email protected] (OSQP v0.6.2): moveit_core builds clean,
  4/4 AccelerationFilterTest cases pass

Refs moveit#3786, moveit#3760.
@nbbrooks
nbbrooks force-pushed the nbbrooks/moveit-core-osqp-v1-migration branch from bfea31b to c923306 Compare August 2, 2026 22:25
@nbbrooks
nbbrooks merged commit 820db5b into moveit:main Aug 2, 2026
11 of 13 checks passed
@github-project-automation github-project-automation Bot moved this to ✅ Done in MoveIt Aug 2, 2026
nbbrooks added a commit to moveit/osqp_vendor that referenced this pull request Aug 3, 2026
This fork exists because tier4#25 (the OSQP v1.0 migration) has
sat open since 2026-07-30 with no maintainer response, and MoveIt's Resolute
release is blocked behind it. moveit_core now requires the OSQP v1.0 C API
(moveit/moveit2#3806), and ros/rosdistro#52943 repoints lyrical and rolling
at this fork.

Set the maintainers to the people who will be on the hook for it here.
Esteve Fernandez is retained as <author> -- he wrote the package, and this
only changes who maintains it going forward. tier4/osqp_vendor continues to
serve humble/jazzy/kilted unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
nbbrooks added a commit to moveit/osqp_vendor that referenced this pull request Aug 3, 2026
This fork exists because tier4#25 (the OSQP v1.0 migration) has
sat open since 2026-07-30 with no maintainer response, and MoveIt's Resolute
release is blocked behind it. moveit_core now requires the OSQP v1.0 C API
(moveit/moveit2#3806), and ros/rosdistro#52943 repoints lyrical and rolling
at this fork.

Set the maintainers to the people who will be on the hook for it here.
Esteve Fernandez is retained as <author> -- he wrote the package, and this
only changes who maintains it going forward. tier4/osqp_vendor continues to
serve humble/jazzy/kilted unchanged.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
johnsonTyler0511 added a commit to locusrobotics/moveit2 that referenced this pull request Oct 19, 2026
[APG-3280] Cherry-pick upstream moveit#3806: dual-support OSQP v0.6.x and v1.0
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.

migrate to OSQP v1.0 C API for rolling-resolute buildfarm release

1 participant