Expose all OSQP settings in marinholab::solvers::osqp (C++ & Python) - #1
Merged
Conversation
Mirror the marinholab-solvers-qpoases wrapper structure for the OSQP wrapper: - Move the C++ API into namespace marinholab::solvers::osqp under include/marinholab/solvers/osqp.h (was M3 / include/OSQP_solver.h). - Expose every OSQPSettings field in Configuration (all 31, native snake_case, defaults from osqp_set_default_settings()) plus the wrapper-specific use_hotstart option; also expose the OSQP enums (LinsysSolverType, PreconditionerType, Status) to Python. - CMake: build a marinholab_osqp static lib + _core pybind11 module, and an optional standalone C++ example behind BUILD_EXAMPLES=ON (example/example.cpp, target example_osqp). - Python: add a _core.pyi type stub, py.typed, pyrightconfig.json and package_data so the stub ships in the wheel; fully type-annotate the wrapper (pyright clean, 0/0). - Docs: expand README (C++ API, all config tables, C++ example, pyright section) and add AGENTS.md. Verified: CMake build, pyright (0 errors / 0 warnings), doxygen (0 warnings), and the Python + C++ examples all run. Co-authored-by: openhands <openhands@all-hands.dev>
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.
Summary
Mirrors the
marinholab-solvers-qpoaseswrapper structure for the OSQP wrapper, exposing all OSQP configuration parameters in both C++ and Python.Note
This PR was created by an AI agent (OpenHands) on behalf of the repository maintainer.
What changed
C++ API — new namespace & full settings
marinholab::solvers::osqpunderinclude/marinholab/solvers/osqp.h(previouslynamespace M3ininclude/OSQP_solver.h, now removed).Configurationnow exposes all 31OSQPSettingsfields (native snake_case, defaults fromosqp_set_default_settings()) plus the wrapper-specificuse_hotstartoption.src/core_function.cppmaps the fullConfigurationinto OSQP settings via_to_osqp_settings().Python bindings
src/core.cppexposes every config field plus the three OSQP enums (LinsysSolverType,PreconditionerType,Status)._core.pyitype stub,py.typedmarker,pyrightconfig.json, andpackage_datainsetup.pyso the stub ships in the wheel.Build system (matches the qpoases convention)
marinholab_osqpstatic lib +_corepybind11 module.BUILD_EXAMPLES=ON(example/example.cpp, targetexample_osqp).Docs
README.md(C++ API usage, all configuration tables, C++ example, pyright section).AGENTS.mdwith project conventions.Verification
pyright— 0 errors / 0 warningsdoxygen— 0 warnings (C++ code is doxygen-compliant)python -m marinholab.solvers.osqp.example) and C++ example (example_osqp) both run and produce the expected solutionx ≈ [0.2, 1.0].Notes
max_iter,eps_abs,eps_rel,eps_prim_inf,eps_dual_inf). This is breaking for any existing Python callers that used the previous names (maximum_iterations,eps_absolute,eps_relative, …) — they've been updated in the examples/evaluation script.