Skip to content

[APG-3280] Cherry-pick upstream #3806: dual-support OSQP v0.6.x and v1.0 - #2

Merged
johnsonTyler0511 merged 1 commit into
locus_lyricalfrom
APG-3280-osqp-1.0
Oct 19, 2026
Merged

johnsonTyler0511 merged 1 commit into
locus_lyricalfrom
APG-3280-osqp-1.0

Conversation

@johnsonTyler0511

@johnsonTyler0511 johnsonTyler0511 commented Oct 19, 2026 •

Copy link
Copy Markdown

Description

APG-3280. Cherry-pick of upstream moveit/moveit2#3806 (820db5b) onto locus_lyrical. No changes beyond the cherry-pick.

Why

  • locus_lyrical no longer builds on current lyrical. moveit_core's online_signal_smoothing/acceleration_filter.cpp uses the OSQP 0.6 API (c_int, csc, OSQPWorkspace, osqp_update_A), but lyrical's osqp_vendor moved to OSQP 1.0.0 on 2026-08-11.
  • The JFrog 999.0.0 lyrical debs were built from this branch around 2026-07-05, against the old dependencies. In locus_pick's lyrical CI (locus_pick#179), every MoveToNamedTarget plan with those debs throws std::length_error: vector::reserve. The same test passes against this branch built from source on current lyrical, so the debs need rebuilding, and that needs this fix.

What

  • Upstream's change makes AccelerationLimitedPlugin support both OSQP 0.6.x and 1.0 (CMake detects the version), and updates moveit2_rolling.repos.

Testing

  • Built this branch (d1b5987 + this commit) from source in ros:lyrical-ros-base: all MoveIt packages that locus_pick needs build.
  • Built MTC (locus-lyrical) and locus_pick's pick_place_action on top. move_to_named_target_mtc_task_test: 8 passed, 3 skipped, no vector::reserve, and gdb's breakpoint on std::__throw_length_error never fired.
  • Not yet done: rebuilding and republishing the JFrog lyrical debs from this branch, then re-running locus_pick#179.

Checklist

  • Required by CI: Code is auto formatted using clang-format (upstream commit, unchanged)
  • Extend the tutorials / documentation (n/a, cherry-pick)
  • Document API changes in MIGRATION.md (n/a, no API change)
  • Create tests, which fail without this PR (n/a, cherry-pick)

🤖 Generated with Claude Code

…Plugin (moveit#3806)

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.

(cherry picked from commit 820db5b)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@johnsonTyler0511
johnsonTyler0511 marked this pull request as ready for review October 19, 2026 20:22
@johnsonTyler0511
johnsonTyler0511 merged commit 2b4ab5d into locus_lyrical Oct 19, 2026
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.

3 participants