ssqp 0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ssqp-0.1/CMakeLists.txt +264 -0
- ssqp-0.1/LICENSE +31 -0
- ssqp-0.1/PKG-INFO +312 -0
- ssqp-0.1/README.md +299 -0
- ssqp-0.1/THIRD_PARTY_NOTICES.md +341 -0
- ssqp-0.1/cmake/GenerateEmbeddedUrdf.cmake +36 -0
- ssqp-0.1/cmake/VendorHpipm.cmake +125 -0
- ssqp-0.1/cmake/VendorNanobind.cmake +34 -0
- ssqp-0.1/cmake/VendorPinocchio.cmake +431 -0
- ssqp-0.1/cmake/VerifyStaticDependencies.cmake +54 -0
- ssqp-0.1/cmake/WheelConfig.cmake +8 -0
- ssqp-0.1/cmake/patch-urdfdom.cmake +39 -0
- ssqp-0.1/examples/assets/urdf/a1/a1.urdf +615 -0
- ssqp-0.1/examples/assets/urdf/double_pendulum/double_pendulum.urdf +117 -0
- ssqp-0.1/examples/assets/urdf/g1/g1_23dof.urdf +903 -0
- ssqp-0.1/examples/assets/urdf/go2/go2.urdf +1132 -0
- ssqp-0.1/examples/assets/urdf/panda/panda.urdf +318 -0
- ssqp-0.1/examples/assets/urdf/talos/talos.urdf +1858 -0
- ssqp-0.1/external/json/LICENSE.MIT +21 -0
- ssqp-0.1/external/json/single_include/nlohmann/json.hpp +25830 -0
- ssqp-0.1/external/json/single_include/nlohmann/json_fwd.hpp +187 -0
- ssqp-0.1/external/tracy/LICENSE +27 -0
- ssqp-0.1/external/tracy/public/TracyClient.F90 +1292 -0
- ssqp-0.1/external/tracy/public/TracyClient.cpp +45 -0
- ssqp-0.1/external/tracy/public/client/TracyAlloc.cpp +43 -0
- ssqp-0.1/external/tracy/public/client/TracyArmCpuTable.hpp +419 -0
- ssqp-0.1/external/tracy/public/client/TracyCallstack.cpp +1481 -0
- ssqp-0.1/external/tracy/public/client/TracyCallstack.h +39 -0
- ssqp-0.1/external/tracy/public/client/TracyCallstack.hpp +170 -0
- ssqp-0.1/external/tracy/public/client/TracyCpuid.hpp +12 -0
- ssqp-0.1/external/tracy/public/client/TracyDebug.hpp +27 -0
- ssqp-0.1/external/tracy/public/client/TracyDxt1.cpp +644 -0
- ssqp-0.1/external/tracy/public/client/TracyDxt1.hpp +11 -0
- ssqp-0.1/external/tracy/public/client/TracyFastVector.hpp +118 -0
- ssqp-0.1/external/tracy/public/client/TracyKCore.cpp +121 -0
- ssqp-0.1/external/tracy/public/client/TracyKCore.hpp +37 -0
- ssqp-0.1/external/tracy/public/client/TracyLock.hpp +548 -0
- ssqp-0.1/external/tracy/public/client/TracyOverride.cpp +26 -0
- ssqp-0.1/external/tracy/public/client/TracyProfiler.cpp +5068 -0
- ssqp-0.1/external/tracy/public/client/TracyProfiler.hpp +1104 -0
- ssqp-0.1/external/tracy/public/client/TracyRingBuffer.hpp +141 -0
- ssqp-0.1/external/tracy/public/client/TracyRocprof.cpp +556 -0
- ssqp-0.1/external/tracy/public/client/TracyScoped.hpp +207 -0
- ssqp-0.1/external/tracy/public/client/TracyStringHelpers.hpp +41 -0
- ssqp-0.1/external/tracy/public/client/TracySysPower.cpp +164 -0
- ssqp-0.1/external/tracy/public/client/TracySysPower.hpp +44 -0
- ssqp-0.1/external/tracy/public/client/TracySysTime.cpp +120 -0
- ssqp-0.1/external/tracy/public/client/TracySysTime.hpp +36 -0
- ssqp-0.1/external/tracy/public/client/TracySysTrace.cpp +1469 -0
- ssqp-0.1/external/tracy/public/client/TracySysTrace.hpp +28 -0
- ssqp-0.1/external/tracy/public/client/TracyThread.hpp +90 -0
- ssqp-0.1/external/tracy/public/client/tracy_SPSCQueue.h +148 -0
- ssqp-0.1/external/tracy/public/client/tracy_concurrentqueue.h +1441 -0
- ssqp-0.1/external/tracy/public/client/tracy_rpmalloc.cpp +3519 -0
- ssqp-0.1/external/tracy/public/client/tracy_rpmalloc.hpp +363 -0
- ssqp-0.1/external/tracy/public/client/windows/TracyETW.cpp +553 -0
- ssqp-0.1/external/tracy/public/common/TracyAlign.hpp +27 -0
- ssqp-0.1/external/tracy/public/common/TracyAlloc.hpp +72 -0
- ssqp-0.1/external/tracy/public/common/TracyApi.h +16 -0
- ssqp-0.1/external/tracy/public/common/TracyColor.hpp +690 -0
- ssqp-0.1/external/tracy/public/common/TracyForceInline.hpp +20 -0
- ssqp-0.1/external/tracy/public/common/TracyMutex.hpp +24 -0
- ssqp-0.1/external/tracy/public/common/TracyProtocol.hpp +168 -0
- ssqp-0.1/external/tracy/public/common/TracyQueue.hpp +1008 -0
- ssqp-0.1/external/tracy/public/common/TracySocket.cpp +752 -0
- ssqp-0.1/external/tracy/public/common/TracySocket.hpp +155 -0
- ssqp-0.1/external/tracy/public/common/TracyStackFrames.cpp +123 -0
- ssqp-0.1/external/tracy/public/common/TracyStackFrames.hpp +22 -0
- ssqp-0.1/external/tracy/public/common/TracySystem.cpp +401 -0
- ssqp-0.1/external/tracy/public/common/TracySystem.hpp +45 -0
- ssqp-0.1/external/tracy/public/common/TracyTaggedUserlandAddress.hpp +47 -0
- ssqp-0.1/external/tracy/public/common/TracyVersion.hpp +14 -0
- ssqp-0.1/external/tracy/public/common/TracyWinFamily.hpp +16 -0
- ssqp-0.1/external/tracy/public/common/TracyYield.hpp +28 -0
- ssqp-0.1/external/tracy/public/common/tracy_lz4.cpp +2720 -0
- ssqp-0.1/external/tracy/public/common/tracy_lz4.hpp +847 -0
- ssqp-0.1/external/tracy/public/common/tracy_lz4hc.cpp +1636 -0
- ssqp-0.1/external/tracy/public/common/tracy_lz4hc.hpp +405 -0
- ssqp-0.1/external/tracy/public/libbacktrace/LICENSE +29 -0
- ssqp-0.1/external/tracy/public/libbacktrace/alloc.cpp +174 -0
- ssqp-0.1/external/tracy/public/libbacktrace/backtrace.hpp +186 -0
- ssqp-0.1/external/tracy/public/libbacktrace/config.h +26 -0
- ssqp-0.1/external/tracy/public/libbacktrace/dwarf.cpp +4455 -0
- ssqp-0.1/external/tracy/public/libbacktrace/elf.cpp +7605 -0
- ssqp-0.1/external/tracy/public/libbacktrace/fileline.cpp +412 -0
- ssqp-0.1/external/tracy/public/libbacktrace/filenames.hpp +52 -0
- ssqp-0.1/external/tracy/public/libbacktrace/internal.hpp +435 -0
- ssqp-0.1/external/tracy/public/libbacktrace/macho.cpp +1367 -0
- ssqp-0.1/external/tracy/public/libbacktrace/mmapio.cpp +115 -0
- ssqp-0.1/external/tracy/public/libbacktrace/posix.cpp +109 -0
- ssqp-0.1/external/tracy/public/libbacktrace/sort.cpp +113 -0
- ssqp-0.1/external/tracy/public/libbacktrace/state.cpp +76 -0
- ssqp-0.1/external/tracy/public/tracy/Tracy.hpp +280 -0
- ssqp-0.1/external/tracy/public/tracy/TracyC.h +401 -0
- ssqp-0.1/external/tracy/public/tracy/TracyCUDA.hpp +1367 -0
- ssqp-0.1/external/tracy/public/tracy/TracyD3D11.hpp +466 -0
- ssqp-0.1/external/tracy/public/tracy/TracyD3D12.hpp +500 -0
- ssqp-0.1/external/tracy/public/tracy/TracyLua.hpp +488 -0
- ssqp-0.1/external/tracy/public/tracy/TracyMetal.hmm +644 -0
- ssqp-0.1/external/tracy/public/tracy/TracyOpenCL.hpp +414 -0
- ssqp-0.1/external/tracy/public/tracy/TracyOpenGL.hpp +325 -0
- ssqp-0.1/external/tracy/public/tracy/TracyVulkan.hpp +747 -0
- ssqp-0.1/include/model/Container.hpp +50 -0
- ssqp-0.1/include/model/Model.hpp +949 -0
- ssqp-0.1/include/model/presets/Presets.hpp +23 -0
- ssqp-0.1/include/model/stagewise/Factories.hpp +238 -0
- ssqp-0.1/include/model/stagewise/Function.hpp +43 -0
- ssqp-0.1/include/model/stagewise/StageConstraints.hpp +92 -0
- ssqp-0.1/include/model/stagewise/StageCost.hpp +73 -0
- ssqp-0.1/include/model/stagewise/StageDynamics.hpp +136 -0
- ssqp-0.1/include/model/stagewise/predefined/Constraints.hpp +868 -0
- ssqp-0.1/include/model/stagewise/predefined/Costs.hpp +847 -0
- ssqp-0.1/include/model/terrain/Terrain.hpp +54 -0
- ssqp-0.1/include/model/terrain/predefined/FlatTerrain.hpp +32 -0
- ssqp-0.1/include/model/terrain/predefined/HeightmapTerrain.hpp +52 -0
- ssqp-0.1/include/model/terrain/predefined/SlopeTerrain.hpp +37 -0
- ssqp-0.1/include/model/terrain/predefined/StepTerrain.hpp +41 -0
- ssqp-0.1/include/param_search/search.hpp +136 -0
- ssqp-0.1/include/pinocchio_wrapper/PinocchioWrapper.hpp +272 -0
- ssqp-0.1/include/solvers/admm_qp.hpp +155 -0
- ssqp-0.1/include/solvers/hpipm_qp.hpp +123 -0
- ssqp-0.1/include/solvers/lqr.hpp +109 -0
- ssqp-0.1/include/solvers/mpc.hpp +99 -0
- ssqp-0.1/include/solvers/qp.hpp +37 -0
- ssqp-0.1/include/solvers/ssqp.hpp +399 -0
- ssqp-0.1/include/sqp_step/filter.hpp +24 -0
- ssqp-0.1/include/sqp_step/merit.hpp +20 -0
- ssqp-0.1/include/sqp_step/step.hpp +23 -0
- ssqp-0.1/include/sqp_step/types.hpp +42 -0
- ssqp-0.1/include/types.hpp +419 -0
- ssqp-0.1/pyproject.toml +73 -0
- ssqp-0.1/python/bindings.cpp +68 -0
- ssqp-0.1/python/model/Model.cpp +1040 -0
- ssqp-0.1/python/model/constraints/Constraints.cpp +951 -0
- ssqp-0.1/python/model/constraints/constraints_entry.cpp +16 -0
- ssqp-0.1/python/model/costs/Costs.cpp +1113 -0
- ssqp-0.1/python/model/costs/costs_entry.cpp +16 -0
- ssqp-0.1/python/model/dynamics/Dynamics.cpp +396 -0
- ssqp-0.1/python/model/dynamics/dynamics_entry.cpp +16 -0
- ssqp-0.1/python/model/model_entry.cpp +46 -0
- ssqp-0.1/python/model/model_reference.hpp +51 -0
- ssqp-0.1/python/model/terrain/Terrain.cpp +103 -0
- ssqp-0.1/python/model/terrain/terrain_entry.cpp +16 -0
- ssqp-0.1/python/solvers/FlatVec.cpp +47 -0
- ssqp-0.1/python/solvers/mpc.cpp +122 -0
- ssqp-0.1/python/solvers/search.cpp +129 -0
- ssqp-0.1/python/solvers/solvers_entry.cpp +27 -0
- ssqp-0.1/python/solvers/ssqp.cpp +732 -0
- ssqp-0.1/src/model/Container.tpp +48 -0
- ssqp-0.1/src/model/Model.cpp +1835 -0
- ssqp-0.1/src/model/Model.tpp +1600 -0
- ssqp-0.1/src/model/presets/Presets.cpp +58 -0
- ssqp-0.1/src/model/stagewise/Factories.tpp +1046 -0
- ssqp-0.1/src/model/stagewise/Function.cpp +17 -0
- ssqp-0.1/src/model/stagewise/StageConstraints.cpp +81 -0
- ssqp-0.1/src/model/stagewise/StageCosts.cpp +31 -0
- ssqp-0.1/src/model/stagewise/StageDynamics.cpp +79 -0
- ssqp-0.1/src/model/stagewise/predefined/Constraints.cpp +1568 -0
- ssqp-0.1/src/model/stagewise/predefined/Costs.cpp +2231 -0
- ssqp-0.1/src/model/terrain/Terrain.cpp +44 -0
- ssqp-0.1/src/model/terrain/Terrain.tpp +17 -0
- ssqp-0.1/src/model/terrain/predefined/FlatTerrain.cpp +31 -0
- ssqp-0.1/src/model/terrain/predefined/HeightmapTerrain.cpp +122 -0
- ssqp-0.1/src/model/terrain/predefined/SlopeTerrain.cpp +39 -0
- ssqp-0.1/src/model/terrain/predefined/StepTerrain.cpp +55 -0
- ssqp-0.1/src/param_search/search.cpp +384 -0
- ssqp-0.1/src/pinocchio_wrapper/PinocchioWrapper.cpp +890 -0
- ssqp-0.1/src/solvers/admm_qp.cpp +792 -0
- ssqp-0.1/src/solvers/hpipm_qp.cpp +536 -0
- ssqp-0.1/src/solvers/lqr.cpp +544 -0
- ssqp-0.1/src/solvers/mpc.cpp +196 -0
- ssqp-0.1/src/solvers/qp.cpp +15 -0
- ssqp-0.1/src/solvers/ssqp.cpp +1592 -0
- ssqp-0.1/src/solvers/ssqp.tpp +644 -0
- ssqp-0.1/src/sqp_step/filter.tpp +42 -0
- ssqp-0.1/src/sqp_step/merit.tpp +20 -0
- ssqp-0.1/src/sqp_step/step.tpp +40 -0
- ssqp-0.1/src/sqp_step/types.cpp +50 -0
- ssqp-0.1/src/types.cpp +263 -0
ssqp-0.1/CMakeLists.txt
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.22)
|
|
2
|
+
project(ssqp VERSION 0.1 LANGUAGES CXX)
|
|
3
|
+
|
|
4
|
+
# Only affects single-config generators (Makefiles, Ninja); ssqp's own
|
|
5
|
+
# optimization level is set explicitly below regardless (see
|
|
6
|
+
# ENABLE_PROFILING), so this is mainly so `cmake --install` doesn't report
|
|
7
|
+
# an empty configuration name when the user didn't pass -DCMAKE_BUILD_TYPE.
|
|
8
|
+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
9
|
+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
|
10
|
+
endif()
|
|
11
|
+
|
|
12
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
13
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
14
|
+
|
|
15
|
+
# Turn off for binaries that must run on CPUs other than the build machine's
|
|
16
|
+
option(SSQP_MARCH_NATIVE "Compile with -march=native" ON)
|
|
17
|
+
set(SSQP_ARCH_FLAG "" CACHE STRING "Architecture flag used when SSQP_MARCH_NATIVE is OFF, e.g. -march=x86-64-v3")
|
|
18
|
+
|
|
19
|
+
if(SSQP_MARCH_NATIVE)
|
|
20
|
+
set(SSQP_ARCH_FLAG "-march=native")
|
|
21
|
+
endif()
|
|
22
|
+
add_compile_options(-fPIC ${SSQP_ARCH_FLAG})
|
|
23
|
+
|
|
24
|
+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
|
25
|
+
|
|
26
|
+
# --- Options ---
|
|
27
|
+
option(WITH_HPIPM "Link against HPIPM and BLASFEO" ON)
|
|
28
|
+
option(ENABLE_PROFILING "Enable Tracy profiling" OFF)
|
|
29
|
+
option(DISABLE_LOGGING "Add -DDISABLE_LOGGING compile flag" OFF)
|
|
30
|
+
option(BUILD_EXAMPLES "Build example executables" OFF)
|
|
31
|
+
option(BUILD_TESTS "Build tests" ON)
|
|
32
|
+
option(BUILD_PYTHON "Build the Python extension" ON)
|
|
33
|
+
option(ENABLE_SANITIZERS "Enable address, undefined-behavior, and leak checks" OFF)
|
|
34
|
+
|
|
35
|
+
# If set, link against a prebuilt Pinocchio package (as produced by the
|
|
36
|
+
# `package-pinocchio` target) instead of fetching and building it from
|
|
37
|
+
# source. Such a package bundles its own Boost headers/static libs, so this
|
|
38
|
+
# also removes ssqp's Boost dependency. Must match the target architecture.
|
|
39
|
+
set(SSQP_PREBUILT_PINOCCHIO_DIR "" CACHE PATH "Path to a prebuilt Pinocchio package (see cmake/VendorPinocchio.cmake)")
|
|
40
|
+
|
|
41
|
+
# Same idea for BLASFEO/HPIPM (only relevant if WITH_HPIPM is ON), as
|
|
42
|
+
# produced by the `package-hpipm` target.
|
|
43
|
+
set(SSQP_PREBUILT_HPIPM_DIR "" CACHE PATH "Path to a prebuilt HPIPM/BLASFEO package (see cmake/VendorHpipm.cmake)")
|
|
44
|
+
|
|
45
|
+
# BLASFEO kernel selection when building it from source (see
|
|
46
|
+
# cmake/VendorHpipm.cmake)
|
|
47
|
+
option(SSQP_BLASFEO_AUTO_TARGET "Let BLASFEO pick its kernels for the build machine" ON)
|
|
48
|
+
set(SSQP_BLASFEO_TARGET "GENERIC" CACHE STRING "BLASFEO target used when SSQP_BLASFEO_AUTO_TARGET is OFF")
|
|
49
|
+
|
|
50
|
+
# --- Output directories ---
|
|
51
|
+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
52
|
+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
53
|
+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
54
|
+
|
|
55
|
+
# --- Core library ---
|
|
56
|
+
find_package(Eigen3 REQUIRED NO_MODULE)
|
|
57
|
+
|
|
58
|
+
file(GLOB_RECURSE LIB_SOURCES "src/*.cpp")
|
|
59
|
+
list(APPEND LIB_SOURCES "external/tracy/public/TracyClient.cpp")
|
|
60
|
+
|
|
61
|
+
add_library(ssqp STATIC ${LIB_SOURCES})
|
|
62
|
+
|
|
63
|
+
# --- Embedded URDF presets ---
|
|
64
|
+
# Bakes select URDFs into the binary so Model::Structure::from_preset can
|
|
65
|
+
# build a model without the caller supplying a urdf_path. Each preset only
|
|
66
|
+
# regenerates when its own URDF (or the generator script) changes, not on
|
|
67
|
+
# every configure.
|
|
68
|
+
set(SSQP_PRESET_NAMES go2 a1 panda g1 talos double_pendulum)
|
|
69
|
+
set(SSQP_PRESET_URDFS ${CMAKE_CURRENT_SOURCE_DIR}/examples/assets/urdf/go2/go2.urdf
|
|
70
|
+
${CMAKE_CURRENT_SOURCE_DIR}/examples/assets/urdf/a1/a1.urdf
|
|
71
|
+
${CMAKE_CURRENT_SOURCE_DIR}/examples/assets/urdf/panda/panda.urdf
|
|
72
|
+
${CMAKE_CURRENT_SOURCE_DIR}/examples/assets/urdf/g1/g1_23dof.urdf
|
|
73
|
+
${CMAKE_CURRENT_SOURCE_DIR}/examples/assets/urdf/talos/talos.urdf
|
|
74
|
+
${CMAKE_CURRENT_SOURCE_DIR}/examples/assets/urdf/double_pendulum/double_pendulum.urdf)
|
|
75
|
+
set(SSQP_PRESET_SYMBOLS go2_urdf a1_urdf panda_urdf g1_urdf talos_urdf double_pendulum_urdf)
|
|
76
|
+
|
|
77
|
+
list(LENGTH SSQP_PRESET_NAMES SSQP_PRESET_COUNT)
|
|
78
|
+
math(EXPR SSQP_PRESET_LAST_INDEX "${SSQP_PRESET_COUNT} - 1")
|
|
79
|
+
|
|
80
|
+
set(SSQP_PRESET_URDF_HEADERS "")
|
|
81
|
+
foreach(_i RANGE ${SSQP_PRESET_LAST_INDEX})
|
|
82
|
+
list(GET SSQP_PRESET_NAMES ${_i} _name)
|
|
83
|
+
list(GET SSQP_PRESET_URDFS ${_i} _urdf)
|
|
84
|
+
list(GET SSQP_PRESET_SYMBOLS ${_i} _symbol)
|
|
85
|
+
set(_header "${CMAKE_CURRENT_BINARY_DIR}/generated/model/presets/${_name}_urdf.hpp")
|
|
86
|
+
|
|
87
|
+
add_custom_command(
|
|
88
|
+
OUTPUT ${_header}
|
|
89
|
+
COMMAND ${CMAKE_COMMAND}
|
|
90
|
+
-DIN_URDF=${_urdf}
|
|
91
|
+
-DOUT_HEADER=${_header}
|
|
92
|
+
-DSYMBOL=${_symbol}
|
|
93
|
+
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/GenerateEmbeddedUrdf.cmake
|
|
94
|
+
DEPENDS ${_urdf} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/GenerateEmbeddedUrdf.cmake
|
|
95
|
+
COMMENT "Embedding ${_name} URDF preset"
|
|
96
|
+
)
|
|
97
|
+
list(APPEND SSQP_PRESET_URDF_HEADERS ${_header})
|
|
98
|
+
endforeach()
|
|
99
|
+
|
|
100
|
+
add_custom_target(ssqp_generate_presets DEPENDS ${SSQP_PRESET_URDF_HEADERS})
|
|
101
|
+
add_dependencies(ssqp ssqp_generate_presets)
|
|
102
|
+
|
|
103
|
+
target_include_directories(ssqp
|
|
104
|
+
PUBLIC
|
|
105
|
+
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
106
|
+
${CMAKE_CURRENT_SOURCE_DIR}
|
|
107
|
+
${CMAKE_CURRENT_SOURCE_DIR}/examples
|
|
108
|
+
${CMAKE_CURRENT_SOURCE_DIR}/external/tracy/public
|
|
109
|
+
${CMAKE_CURRENT_SOURCE_DIR}/external/json/single_include
|
|
110
|
+
PRIVATE
|
|
111
|
+
${CMAKE_CURRENT_BINARY_DIR}/generated
|
|
112
|
+
)
|
|
113
|
+
target_link_libraries(ssqp PUBLIC Eigen3::Eigen)
|
|
114
|
+
|
|
115
|
+
if(ENABLE_SANITIZERS)
|
|
116
|
+
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
|
117
|
+
message(FATAL_ERROR "ENABLE_SANITIZERS requires GCC or Clang")
|
|
118
|
+
endif()
|
|
119
|
+
target_compile_options(ssqp PUBLIC -O1 -g -fno-omit-frame-pointer
|
|
120
|
+
-fsanitize=address,undefined -fno-sanitize-recover=all)
|
|
121
|
+
target_link_options(ssqp PUBLIC -fsanitize=address,undefined)
|
|
122
|
+
elseif(ENABLE_PROFILING)
|
|
123
|
+
target_compile_options(ssqp PUBLIC -g -O2 -pthread -fno-omit-frame-pointer)
|
|
124
|
+
target_compile_definitions(ssqp PUBLIC TRACY_ENABLE TRACY_MEMORY)
|
|
125
|
+
target_link_libraries(ssqp PUBLIC pthread)
|
|
126
|
+
else()
|
|
127
|
+
target_compile_options(ssqp PUBLIC -O3)
|
|
128
|
+
endif()
|
|
129
|
+
|
|
130
|
+
if(DISABLE_LOGGING)
|
|
131
|
+
target_compile_definitions(ssqp PUBLIC DISABLE_LOGGING)
|
|
132
|
+
endif()
|
|
133
|
+
|
|
134
|
+
if(WITH_HPIPM)
|
|
135
|
+
include(VendorHpipm)
|
|
136
|
+
target_link_libraries(ssqp PRIVATE hpipm_vendored)
|
|
137
|
+
target_compile_definitions(ssqp PUBLIC WITH_HPIPM=1)
|
|
138
|
+
endif()
|
|
139
|
+
|
|
140
|
+
include(VendorPinocchio)
|
|
141
|
+
target_link_libraries(ssqp PRIVATE pinocchio_vendored)
|
|
142
|
+
|
|
143
|
+
# --- Examples ---
|
|
144
|
+
if(BUILD_EXAMPLES)
|
|
145
|
+
file(GLOB_RECURSE EXAMPLE_SOURCES "examples/trajgen/c++/*.cpp")
|
|
146
|
+
|
|
147
|
+
foreach(EXAMPLE_FILE ${EXAMPLE_SOURCES})
|
|
148
|
+
file(RELATIVE_PATH REL_PATH
|
|
149
|
+
"${CMAKE_CURRENT_SOURCE_DIR}/examples/trajgen/c++"
|
|
150
|
+
${EXAMPLE_FILE}
|
|
151
|
+
)
|
|
152
|
+
string(REGEX REPLACE "\\.cpp$" "" REL_BASE ${REL_PATH})
|
|
153
|
+
string(REPLACE "/" "-" TARGET_NAME ${REL_BASE})
|
|
154
|
+
get_filename_component(EXE_NAME ${REL_BASE} NAME)
|
|
155
|
+
get_filename_component(EXE_DIR ${REL_BASE} DIRECTORY)
|
|
156
|
+
|
|
157
|
+
add_executable(${TARGET_NAME} ${EXAMPLE_FILE})
|
|
158
|
+
target_link_libraries(${TARGET_NAME} PRIVATE ssqp)
|
|
159
|
+
|
|
160
|
+
if(EXE_DIR)
|
|
161
|
+
set_target_properties(${TARGET_NAME} PROPERTIES
|
|
162
|
+
OUTPUT_NAME ${EXE_NAME}
|
|
163
|
+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/${EXE_DIR}"
|
|
164
|
+
)
|
|
165
|
+
else()
|
|
166
|
+
set_target_properties(${TARGET_NAME} PROPERTIES
|
|
167
|
+
OUTPUT_NAME ${EXE_NAME}
|
|
168
|
+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
|
169
|
+
)
|
|
170
|
+
endif()
|
|
171
|
+
endforeach()
|
|
172
|
+
endif()
|
|
173
|
+
|
|
174
|
+
# --- Tests ---
|
|
175
|
+
if(BUILD_TESTS)
|
|
176
|
+
enable_testing()
|
|
177
|
+
|
|
178
|
+
file(GLOB_RECURSE TEST_SOURCES CONFIGURE_DEPENDS "tests/src/*.cpp")
|
|
179
|
+
add_executable(run_tests "tests/run_tests.cpp" ${TEST_SOURCES})
|
|
180
|
+
|
|
181
|
+
target_include_directories(run_tests PRIVATE tests/include)
|
|
182
|
+
target_link_libraries(run_tests PRIVATE ssqp)
|
|
183
|
+
# Discover at CTest time so new cases require no manually maintained list.
|
|
184
|
+
# Each case runs in its own process: a segfault does not hide later cases.
|
|
185
|
+
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/discover_ssqp_tests.cmake"
|
|
186
|
+
CONTENT "set(SSQP_TEST_BINARY \"$<TARGET_FILE:run_tests>\")\nset(SSQP_TEST_SOURCE \"${CMAKE_CURRENT_SOURCE_DIR}\")\ninclude(\"${CMAKE_CURRENT_SOURCE_DIR}/tests/DiscoverTests.cmake\")\n")
|
|
187
|
+
set_property(DIRECTORY APPEND PROPERTY TEST_INCLUDE_FILES
|
|
188
|
+
"${CMAKE_CURRENT_BINARY_DIR}/discover_ssqp_tests.cmake")
|
|
189
|
+
|
|
190
|
+
set_target_properties(run_tests PROPERTIES
|
|
191
|
+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests"
|
|
192
|
+
)
|
|
193
|
+
endif()
|
|
194
|
+
|
|
195
|
+
# --- Python bindings ---
|
|
196
|
+
if(BUILD_PYTHON)
|
|
197
|
+
# SKBUILD_SABI_COMPONENT is set by scikit-build-core for stable ABI wheels
|
|
198
|
+
find_package(Python 3.10 REQUIRED COMPONENTS Interpreter Development.Module ${SKBUILD_SABI_COMPONENT})
|
|
199
|
+
|
|
200
|
+
include(VendorNanobind)
|
|
201
|
+
|
|
202
|
+
file(GLOB_RECURSE BINDINGS_SOURCES "python/*.cpp")
|
|
203
|
+
# Uses the stable ABI on Python 3.12+ when Development.SABIModule was found
|
|
204
|
+
# above, so one wheel covers later versions
|
|
205
|
+
nanobind_add_module(ssqpy STABLE_ABI ${BINDINGS_SOURCES})
|
|
206
|
+
target_link_libraries(ssqpy PRIVATE ssqp)
|
|
207
|
+
|
|
208
|
+
set_target_properties(ssqpy PROPERTIES
|
|
209
|
+
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bindings"
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
# The Python extension is a shared object, so it necessarily keeps the
|
|
213
|
+
# platform C/C++ runtime dependencies. This target makes sure that the
|
|
214
|
+
# libraries owned by SSQP and its vendored dependencies remain static.
|
|
215
|
+
find_program(SSQP_READELF_EXECUTABLE readelf)
|
|
216
|
+
if(SSQP_READELF_EXECUTABLE)
|
|
217
|
+
add_custom_target(verify-static-dependencies
|
|
218
|
+
COMMAND ${CMAKE_COMMAND}
|
|
219
|
+
-DSSQP_READELF_EXECUTABLE=${SSQP_READELF_EXECUTABLE}
|
|
220
|
+
-DSSQP_PYTHON_MODULE=$<TARGET_FILE:ssqpy>
|
|
221
|
+
-DSSQP_STATIC_LIBRARY=$<TARGET_FILE:ssqp>
|
|
222
|
+
-DSSQP_AR=${CMAKE_AR}
|
|
223
|
+
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/VerifyStaticDependencies.cmake
|
|
224
|
+
DEPENDS ssqpy
|
|
225
|
+
COMMENT "Checking SSQP and Python dependencies are static"
|
|
226
|
+
VERBATIM
|
|
227
|
+
)
|
|
228
|
+
else()
|
|
229
|
+
message(WARNING
|
|
230
|
+
"readelf was not found; verify-static-dependencies is unavailable")
|
|
231
|
+
endif()
|
|
232
|
+
|
|
233
|
+
# Keep the caller's PYTHONPATH, which pip's isolated build environment
|
|
234
|
+
# uses to expose its build requirements (e.g. NumPy)
|
|
235
|
+
set(SSQP_STUBGEN_PYTHONPATH ${NB_STUBGEN_PYTHONPATH})
|
|
236
|
+
if(DEFINED ENV{PYTHONPATH})
|
|
237
|
+
string(APPEND SSQP_STUBGEN_PYTHONPATH ":$ENV{PYTHONPATH}")
|
|
238
|
+
endif()
|
|
239
|
+
|
|
240
|
+
add_custom_command(TARGET ssqpy POST_BUILD
|
|
241
|
+
COMMAND ${CMAKE_COMMAND} -E env "PYTHONPATH=${SSQP_STUBGEN_PYTHONPATH}" --
|
|
242
|
+
${Python_EXECUTABLE} -m nanobind.stubgen
|
|
243
|
+
-m ssqpy
|
|
244
|
+
-M ${CMAKE_BINARY_DIR}/bindings/py.typed
|
|
245
|
+
-r
|
|
246
|
+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bindings
|
|
247
|
+
COMMENT "Generating Python stubs for ssqpy..."
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
# `cmake --install .` (after building) drops ssqpy straight into
|
|
251
|
+
# site-packages for whichever Python interpreter it was built against
|
|
252
|
+
# (Python_SITEARCH is an absolute path, so this installs there directly
|
|
253
|
+
# regardless of CMAKE_INSTALL_PREFIX), so it's importable from a normal
|
|
254
|
+
# Python environment without manually managing PYTHONPATH. When built as
|
|
255
|
+
# a wheel by scikit-build-core, the install prefix is the wheel root
|
|
256
|
+
if(SKBUILD)
|
|
257
|
+
set(SSQP_PYTHON_INSTALL_DIR .)
|
|
258
|
+
else()
|
|
259
|
+
set(SSQP_PYTHON_INSTALL_DIR ${Python_SITEARCH})
|
|
260
|
+
endif()
|
|
261
|
+
install(TARGETS ssqpy LIBRARY DESTINATION ${SSQP_PYTHON_INSTALL_DIR})
|
|
262
|
+
install(FILES ${CMAKE_BINARY_DIR}/bindings/py.typed DESTINATION ${SSQP_PYTHON_INSTALL_DIR})
|
|
263
|
+
install(DIRECTORY ${CMAKE_BINARY_DIR}/bindings/ssqpy/ DESTINATION ${SSQP_PYTHON_INSTALL_DIR}/ssqpy)
|
|
264
|
+
endif()
|
ssqp-0.1/LICENSE
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Nick Karydakis
|
|
4
|
+
Copyright (c) 2025-2026 Konstantinos Chatzilygeroudis
|
|
5
|
+
Copyright (c) 2025-2026 Laboratory of Automation and Robotics, University of Patras, Greece
|
|
6
|
+
All rights reserved.
|
|
7
|
+
|
|
8
|
+
Redistribution and use in source and binary forms, with or without
|
|
9
|
+
modification, are permitted provided that the following conditions are met:
|
|
10
|
+
|
|
11
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
12
|
+
list of conditions and the following disclaimer.
|
|
13
|
+
|
|
14
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
15
|
+
this list of conditions and the following disclaimer in the documentation
|
|
16
|
+
and/or other materials provided with the distribution.
|
|
17
|
+
|
|
18
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
19
|
+
contributors may be used to endorse or promote products derived from
|
|
20
|
+
this software without specific prior written permission.
|
|
21
|
+
|
|
22
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
23
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
24
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
25
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
26
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
27
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
28
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
29
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
30
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
31
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
ssqp-0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ssqp
|
|
3
|
+
Version: 0.1
|
|
4
|
+
Summary: Structure-exploiting SQP solver for nonlinear optimal control, trajectory generation and MPC
|
|
5
|
+
License-Expression: BSD-3-Clause
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
License-File: THIRD_PARTY_NOTICES.md
|
|
8
|
+
Project-URL: Repository, https://github.com/upatras-lar/ssqp
|
|
9
|
+
Project-URL: Documentation, https://lar.upatras.gr/ssqp
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Requires-Dist: numpy
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# SSQP
|
|
15
|
+
|
|
16
|
+
[](https://github.com/upatras-lar/ssqp/actions/workflows/ci.yml)
|
|
17
|
+
[](https://github.com/upatras-lar/ssqp/blob/main/LICENSE)
|
|
18
|
+

|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
SSQP is a structure-exploiting Sequential Quadratic Programming (SQP) solver
|
|
22
|
+
for nonlinear optimal control problems. It is designed for trajectory
|
|
23
|
+
generation and real-time Model Predictive Control (MPC), with native support
|
|
24
|
+
for manifold-valued states such as floating-base orientations.
|
|
25
|
+
|
|
26
|
+
SSQP solves problems of the form
|
|
27
|
+
|
|
28
|
+
```math
|
|
29
|
+
\begin{aligned}
|
|
30
|
+
\min_{x,u}\quad &\sum_{k=0}^{H-1} \ell_k(x_k,u_k) + \ell_H(x_H) \\
|
|
31
|
+
\text{subject to}\quad &x_{k+1}=f_k(x_k,u_k), &&0\leq k < H,\\
|
|
32
|
+
&c_k(x_k,u_k)\geq 0, &&0\leq k < H,\\
|
|
33
|
+
&c_H(x_H)\geq 0.
|
|
34
|
+
\end{aligned}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
At every SQP iteration, SSQP linearizes the dynamics and constraints and
|
|
38
|
+
quadratizes the costs to form a stagewise, banded Quadratic Program (QP). A
|
|
39
|
+
line search uses the QP solution to update the nonlinear trajectory.
|
|
40
|
+
|
|
41
|
+
The full documentation is available on the
|
|
42
|
+
[documentation site](DOCS_URL), including the
|
|
43
|
+
[installation guide](DOCS_URL/getting-started/installation/),
|
|
44
|
+
[Python quickstart](DOCS_URL/getting-started/quickstart/),
|
|
45
|
+
concepts, examples, and generated [Python](DOCS_URL/reference/)
|
|
46
|
+
and [C++](DOCS_URL/cpp-reference/) API references.
|
|
47
|
+
|
|
48
|
+
## Features
|
|
49
|
+
|
|
50
|
+
- Structure-exploiting SQP for finite-horizon optimal control.
|
|
51
|
+
- Euclidean and manifold-valued state components.
|
|
52
|
+
- Custom or predefined dynamics, costs, constraints, and terrain models.
|
|
53
|
+
- Kinematics, ForwardDynamics, InverseDynamics, and ReducedInverseDynamics
|
|
54
|
+
formulations.
|
|
55
|
+
- ADMM QP solver by default, with optional HPIPM/BLASFEO support.
|
|
56
|
+
- Receding-horizon MPC with warm starts and bounded per-step iteration counts.
|
|
57
|
+
- C++17 library and Python bindings through nanobind.
|
|
58
|
+
- Deterministic regression, finite-difference, and sanitizer-enabled tests.
|
|
59
|
+
|
|
60
|
+
## Repository layout
|
|
61
|
+
|
|
62
|
+
| Path | Contents |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| `include/`, `src/` | C++ library headers and implementation |
|
|
65
|
+
| `python/` | `ssqpy` Python bindings |
|
|
66
|
+
| `examples/trajgen/` | Offline trajectory-generation examples |
|
|
67
|
+
| `examples/mujoco_mpc/` | MPC examples using MuJoCo |
|
|
68
|
+
| `examples/real_mpc/` | MPC examples for real systems |
|
|
69
|
+
| `benchmarks/` | Solver and formulation benchmarks |
|
|
70
|
+
| `examples/visualizer/` | Trajectory visualization utilities |
|
|
71
|
+
| `examples/models/` | Custom model implementations and utilities |
|
|
72
|
+
| `examples/assets/` | URDF and MJCF model assets |
|
|
73
|
+
| `tests/` | Unit, regression, gradient, and sanitizer test infrastructure |
|
|
74
|
+
| `external/` | Repository-vendored dependencies such as JSON and Tracy |
|
|
75
|
+
| `cmake/` | Dependency and packaging build logic |
|
|
76
|
+
|
|
77
|
+
## Installation
|
|
78
|
+
|
|
79
|
+
Prebuilt wheels are available for Linux x86_64 and Python 3.10 or newer:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
pip install ssqp
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The package provides the `ssqpy` module. The wheels require a CPU with AVX2
|
|
86
|
+
and FMA (Intel Haswell, AMD Excavator or newer). On older CPUs, importing
|
|
87
|
+
`ssqpy` fails with an illegal instruction error, so build from source instead,
|
|
88
|
+
as described below.
|
|
89
|
+
|
|
90
|
+
## Dependencies
|
|
91
|
+
|
|
92
|
+
The default source build requires:
|
|
93
|
+
|
|
94
|
+
- A C++17 compiler
|
|
95
|
+
- CMake 3.22 or newer
|
|
96
|
+
- Eigen3
|
|
97
|
+
- Boost headers and static Filesystem and Serialization archives, when
|
|
98
|
+
available. If the headers or either static archive is unavailable, CMake
|
|
99
|
+
fetches the matching Boost sources and builds PIC static archives
|
|
100
|
+
automatically.
|
|
101
|
+
- Git and network access for the first build
|
|
102
|
+
- Python 3.10 or newer and NumPy when Python bindings are enabled
|
|
103
|
+
|
|
104
|
+
Pinocchio and its URDF parser dependencies are fetched and built by CMake.
|
|
105
|
+
Nanobind is fetched when the Python bindings are enabled. HPIPM and BLASFEO
|
|
106
|
+
are fetched only when `WITH_HPIPM=ON`.
|
|
107
|
+
|
|
108
|
+
Clone the repository with its submodules:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
git clone --recurse-submodules https://github.com/upatras-lar/ssqp.git
|
|
112
|
+
cd ssqp
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Building
|
|
116
|
+
|
|
117
|
+
Configure and build from the repository root:
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
cmake -S . -B build
|
|
121
|
+
cmake --build build -j"$(nproc)"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The first build compiles the pinned external dependencies and can take some
|
|
125
|
+
time. Reusing the same build directory keeps those dependencies incremental;
|
|
126
|
+
subsequent builds rebuild only targets affected by changed source files.
|
|
127
|
+
|
|
128
|
+
The default configuration builds the Python bindings and tests. The compiled
|
|
129
|
+
library is placed under `build/lib`, the Python module under
|
|
130
|
+
`build/bindings`, and the test runner under `build/tests`.
|
|
131
|
+
|
|
132
|
+
The Boost components used by Pinocchio are always linked statically. The
|
|
133
|
+
`ssqpy` extension still uses the normal platform C and C++ runtime libraries,
|
|
134
|
+
but it does not depend on shared Boost, Pinocchio, URDF, HPIPM, or BLASFEO
|
|
135
|
+
libraries. Verify this for a completed build with:
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
cmake --build build --target verify-static-dependencies
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### CMake options
|
|
142
|
+
|
|
143
|
+
Pass options during configuration with `-DNAME=VALUE`:
|
|
144
|
+
|
|
145
|
+
| Option | Default | Description |
|
|
146
|
+
| --- | --- | --- |
|
|
147
|
+
| `WITH_HPIPM` | `ON` | Build and enable the HPIPM/BLASFEO QP backend |
|
|
148
|
+
| `BUILD_PYTHON` | `ON` | Build the `ssqpy` Python module |
|
|
149
|
+
| `BUILD_TESTS` | `ON` | Build the unit and regression tests |
|
|
150
|
+
| `BUILD_EXAMPLES` | `OFF` | Build the C++ trajectory-generation examples |
|
|
151
|
+
| `ENABLE_PROFILING` | `OFF` | Enable Tracy profiling support |
|
|
152
|
+
| `DISABLE_LOGGING` | `OFF` | Compile out SSQP logging |
|
|
153
|
+
| `ENABLE_SANITIZERS` | `OFF` | Enable AddressSanitizer and UndefinedBehaviorSanitizer |
|
|
154
|
+
| `SSQP_BOOST_VERSION` | `1.86.0` | Boost release fetched when no system Boost headers are available |
|
|
155
|
+
| `SSQP_MARCH_NATIVE` | `ON` | Compile SSQP and Pinocchio with `-march=native` |
|
|
156
|
+
| `SSQP_ARCH_FLAG` | empty | Architecture flag used instead when `SSQP_MARCH_NATIVE` is `OFF`, e.g. `-march=x86-64-v3` |
|
|
157
|
+
| `SSQP_BLASFEO_AUTO_TARGET` | `ON` | Let BLASFEO pick its kernels for the build machine |
|
|
158
|
+
| `SSQP_BLASFEO_TARGET` | `GENERIC` | BLASFEO target used when `SSQP_BLASFEO_AUTO_TARGET` is `OFF`, e.g. `X64_INTEL_HASWELL` |
|
|
159
|
+
|
|
160
|
+
For example, to build with the C++ examples:
|
|
161
|
+
|
|
162
|
+
```sh
|
|
163
|
+
cmake -S . -B build -DBUILD_EXAMPLES=ON
|
|
164
|
+
cmake --build build -j"$(nproc)"
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
By default the build uses `-march=native` and lets BLASFEO pick its kernels for
|
|
168
|
+
the build machine, so generated binaries and prebuilt dependency packages are
|
|
169
|
+
tied to the architecture on which they were built. To build binaries that run
|
|
170
|
+
on other machines, turn off `SSQP_MARCH_NATIVE` and `SSQP_BLASFEO_AUTO_TARGET`,
|
|
171
|
+
and set `SSQP_ARCH_FLAG` and `SSQP_BLASFEO_TARGET` to the oldest CPU family you
|
|
172
|
+
want to support. The PyPI wheels use the settings in
|
|
173
|
+
`cmake/WheelConfig.cmake`.
|
|
174
|
+
|
|
175
|
+
### Prebuilt dependencies
|
|
176
|
+
|
|
177
|
+
Pinocchio and, when HPIPM is enabled, HPIPM/BLASFEO can be supplied as
|
|
178
|
+
prebuilt packages instead of being compiled from source:
|
|
179
|
+
|
|
180
|
+
```sh
|
|
181
|
+
cmake -S . -B build \
|
|
182
|
+
-DSSQP_PREBUILT_PINOCCHIO_DIR=/path/to/prebuilt/pinocchio \
|
|
183
|
+
-DSSQP_PREBUILT_HPIPM_DIR=/path/to/prebuilt/hpipm
|
|
184
|
+
cmake --build build -j"$(nproc)"
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
On a machine that has already built the dependencies from source, create the
|
|
188
|
+
packages with:
|
|
189
|
+
|
|
190
|
+
```sh
|
|
191
|
+
cmake --build build --target package-pinocchio
|
|
192
|
+
cmake --build build --target package-hpipm
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
The resulting packages are written to `build/prebuilt/pinocchio` and
|
|
196
|
+
`build/prebuilt/hpipm`. They must match the target compiler, architecture, and
|
|
197
|
+
CPU features.
|
|
198
|
+
|
|
199
|
+
## Python bindings
|
|
200
|
+
|
|
201
|
+
Install the built module into the Python environment selected by CMake:
|
|
202
|
+
|
|
203
|
+
```sh
|
|
204
|
+
cmake --install build
|
|
205
|
+
python -c "import ssqpy; print('ssqpy imported successfully')"
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
For a build-local setup, use `PYTHONPATH` instead:
|
|
209
|
+
|
|
210
|
+
```sh
|
|
211
|
+
export PYTHONPATH="$PWD/build/bindings:$PYTHONPATH"
|
|
212
|
+
python -c "import ssqpy; print('ssqpy imported successfully')"
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
The examples provide a helper that sets this path:
|
|
216
|
+
|
|
217
|
+
```sh
|
|
218
|
+
cd examples
|
|
219
|
+
source setup_env.sh
|
|
220
|
+
python trajgen/python/di.py
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
The `di.py` example defines a double-integrator dynamics model and quadratic
|
|
224
|
+
tracking cost, constructs an `ssqpy.model.Model`, and solves it with
|
|
225
|
+
`ssqpy.solvers.ssqp`. Custom dynamics subclass
|
|
226
|
+
`ssqpy.model.dynamics.StageDynamics`; custom costs subclass
|
|
227
|
+
`ssqpy.model.costs.StageCost`.
|
|
228
|
+
|
|
229
|
+
## Solvers and MPC
|
|
230
|
+
|
|
231
|
+
The default QP backend is SSQP's ADMM implementation. HPIPM can be selected as such, provided the build includes it:
|
|
232
|
+
|
|
233
|
+
```python
|
|
234
|
+
params = ssqpy.solvers.ssqpParams()
|
|
235
|
+
params.qp_solver_type = ssqpy.solvers.QPSolverType.HPIPM
|
|
236
|
+
solver = ssqpy.solvers.ssqp(model, params)
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
For receding-horizon control, `ssqpy.solvers.MPC` repeatedly solves the OCP
|
|
240
|
+
with a small iteration budget, applies the first control, feeds back the
|
|
241
|
+
current state, and warm-starts the next solve:
|
|
242
|
+
|
|
243
|
+
```python
|
|
244
|
+
mpc = ssqpy.solvers.MPC(model, sqp_iters=5, qp_iters=50)
|
|
245
|
+
mpc.reinitialize(initial_state)
|
|
246
|
+
|
|
247
|
+
while running:
|
|
248
|
+
state = read_state()
|
|
249
|
+
x, u = mpc.step(state)
|
|
250
|
+
apply_control(u.stage(0))
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
See the [MPC concept guide](DOCS_URL/concepts/mpc/) and
|
|
254
|
+
`examples/mujoco_mpc/` for complete control loops.
|
|
255
|
+
|
|
256
|
+
## Examples
|
|
257
|
+
|
|
258
|
+
The [examples README](https://github.com/upatras-lar/ssqp/blob/main/examples/README.md) describes the available examples.
|
|
259
|
+
They cover offline trajectory generation, simulated MPC, real-system MPC,
|
|
260
|
+
adaptive pendulum models, benchmarks, and trajectory visualization.
|
|
261
|
+
|
|
262
|
+
The documentation includes walkthroughs for:
|
|
263
|
+
|
|
264
|
+
- Pendubot swing-up
|
|
265
|
+
- Panda circle trajectory generation
|
|
266
|
+
- Go2 jumping with contact scheduling
|
|
267
|
+
- Panda circle tracking with MuJoCo MPC
|
|
268
|
+
|
|
269
|
+
## Testing
|
|
270
|
+
|
|
271
|
+
Build and run the standard test suite:
|
|
272
|
+
|
|
273
|
+
```sh
|
|
274
|
+
cmake -S . -B build
|
|
275
|
+
cmake --build build --target run_tests -j"$(nproc)"
|
|
276
|
+
ctest --test-dir build --output-on-failure -j"$(nproc)"
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
CTest discovers each test case separately, so a crash or timeout in one case
|
|
280
|
+
does not prevent the remaining cases from running. To run a subset directly:
|
|
281
|
+
|
|
282
|
+
```sh
|
|
283
|
+
build/tests/run_tests --list
|
|
284
|
+
build/tests/run_tests --filter Regression_
|
|
285
|
+
build/tests/run_tests --filter gammafGradTest --seed 42
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Failed test diagnostics are written to `tests/logs/<test-name>.txt`. See
|
|
289
|
+
[`tests/README.md`](https://github.com/upatras-lar/ssqp/blob/main/tests/README.md) for the correctness coverage, deterministic
|
|
290
|
+
seeding, finite-difference checks, sanitizer builds, and leak-detection notes.
|
|
291
|
+
|
|
292
|
+
## Citing
|
|
293
|
+
|
|
294
|
+
If you use SSQP in your work, please cite it as
|
|
295
|
+
|
|
296
|
+
```bibtex
|
|
297
|
+
@misc{ssqpsoftware,
|
|
298
|
+
author = {Nick Karydakis and Konstantinos Chatzilygeroudis},
|
|
299
|
+
title = {{SSQP}: A Structure-Exploiting Sequential Quadratic Programming Solver},
|
|
300
|
+
howpublished = {Online resource / Software},
|
|
301
|
+
year = {2026},
|
|
302
|
+
url = {https://github.com/upatras-lar/ssqp},
|
|
303
|
+
urldate = {2026-10-08}
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Development status
|
|
308
|
+
|
|
309
|
+
SSQP is under active development. While most of the source API, Python bindings,
|
|
310
|
+
build system and documentation are not expected to change drastically, this
|
|
311
|
+
might still be the case before the release of version 1.0, as we potentially
|
|
312
|
+
restructure to improve performance.
|