Repository navigation
[APG-3280] Cherry-pick upstream #3806: dual-support OSQP v0.6.x and v1.0 - #2
Merged
Merged
Conversation
…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]>
bmagyar
approved these changes
Oct 19, 2026
johnsonTyler0511
marked this pull request as ready for review
October 19, 2026 20:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
APG-3280. Cherry-pick of upstream moveit/moveit2#3806 (820db5b) onto
locus_lyrical. No changes beyond the cherry-pick.Why
locus_lyricalno longer builds on current lyrical.moveit_core'sonline_signal_smoothing/acceleration_filter.cppuses the OSQP 0.6 API (c_int,csc,OSQPWorkspace,osqp_update_A), but lyrical'sosqp_vendormoved to OSQP 1.0.0 on 2026-08-11.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
AccelerationLimitedPluginsupport both OSQP 0.6.x and 1.0 (CMake detects the version), and updatesmoveit2_rolling.repos.Testing
ros:lyrical-ros-base: all MoveIt packages that locus_pick needs build.locus-lyrical) and locus_pick'spick_place_actionon top.move_to_named_target_mtc_task_test: 8 passed, 3 skipped, novector::reserve, and gdb's breakpoint onstd::__throw_length_errornever fired.Checklist
🤖 Generated with Claude Code