A general Python-based successive convexification implementation which uses a JAX backend.
Project description
Getting Started
Installation
Stable
To grab the latest stable release simply run
pip install openscvx
to install OpenSCVx in your python environment.
Or using uv:
uv pip install openscvx
For optional dependencies:
pip install openscvx[gui,cvxpygen]
# or with uv
uv pip install openscvx[gui,cvxpygen]
Nightly
To install the latest development version (nightly):
pip install --pre openscvx
With optional dependencies:
pip install --pre openscvx[gui,cvxpygen]
Or using uv:
uv pip install --pre openscvx
# With optional dependencies
uv pip install --pre openscvx[gui,cvxpygen]
Note: The --pre flag tells pip/uv to install pre-release versions (e.g., 1.2.4.dev3) from PyPI.
Alternatively, for local development with the latest source:
# Clone the repo
git clone https://github.com/OpenSCvx/OpenSCvx.git
cd OpenSCvx
# Install in editable/development mode
pip install -e .
# or with uv
uv pip install -e .
Dependencies
The main packages are:
cvxpy- is used to formulate and solve the convex subproblemsjax- is used for determining the Jacobians using automatic differentiation, vectorization, and ahead-of-time (AOT) compilation of the dynamics and their Jacobiansnumpy- is used for numerical operationsdiffrax- is used for the numerical integration of the dynamicstermcolor- is used for pretty command line outputplotly- is used for all visualizations
These will be installed automatically, but can be installed via conda or pip if you are building from source.
GUI Dependencies (Optional)
For interactive 3D plotting and real-time visualization, additional packages are required:
pyqtgraph- is used for interactive 3D plotting and real-time visualizationPyQt5- provides the Qt5 GUI framework for pyqtgraphscipy- is used for spatial transformations in plotting functionsPyOpenGL- provides OpenGL bindings for Python, required for 3D plottingPyOpenGL_accelerate- (optional) speeds up PyOpenGL
For local development:
pip install -e ".[gui]"
CVXPYGen Dependencies (Optional)
For code generation and faster solver performance, CVXPYGen can be installed:
cvxpygen- enables code generation for faster solver performanceqocogen- custom solver backend for CVXPYGen (included with cvxpygen extras)
To install with CVXPYGen support:
pip install openscvx[cvxpygen]
Or for both GUI and CVXPYGen:
pip install openscvx[gui,cvxpygen]
CVXPYGen features include:
- Automatic C++ code generation for optimization problems
- Faster solver performance through compiled code
- Support for custom solver backends like QOCOGen
Local Development
This git repository can be installed using https
git clone https://github.com/OpenSCvx/OpenSCvx.git
or ssh
git clone git@github.com:OpenSCvx/OpenSCvx.git
Dependencies can then be installed using Conda or Pip
Via Conda
-
Clone the repo using https or ssh
-
Create a conda environment with Python:
conda create -n openscvx python>=3.9
-
Activate the environment:
conda activate openscvx
-
Install the package with dependencies:
pip install -e .
Or install with optional dependencies:
pip install -e ".[gui,cvxpygen]"
Via uv
-
Prerequisites
- Install uv
-
Clone the repo using https or ssh
-
Create virtual environment and install the package:
uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate uv pip install -e .
Or install with optional dependencies:
uv pip install -e ".[gui,cvxpygen]"
Via pip
-
Prerequisites Python >= 3.9
-
Clone the repo using https or ssh
-
Create virtual environment (called
venvhere) and source itpython3 -m venv venv source venv/bin/activate
-
Install the package with dependencies:
pip install -e .
Or install with optional dependencies:
pip install -e ".[gui,cvxpygen]"
Running Trajectory Optimization
See examples/ folder for several example trajectory optimization problems grouped by application.
To run a problem simply run any of the examples directly, for example:
python3 examples/abstract/brachistochrone.py
Note: To run the examples, you'll need to clone this repository and install OpenSCvx in editable mode (
pip install -e .). See the Local Development section above for detailed installation instructions.
and adjust the plotting as needed.
Check out the problem definitions inside examples/ to see how to define your own problems.
Code Structure
ToDos
- Standardized Vehicle and Constraint classes
- Implement QOCOGen with CVPYGEN
- Non-Dilated Time Propagation
- Save and reload the compiled JAX code
- Unified Mathematical Interface
- Auto-SCvx Weight Tuning
- Compiled at the subproblem level with JAX
- Single Shot propagation
What is implemented
This repo has the following features:
- Free Final Time
- Fully adaptive time dilation (
sis appended to the control vector) - Continuous-Time Constraint Satisfaction
- FOH and ZOH exact discretization (
tis a state so you can bring your own scheme) - Vectorized and Ahead-of-Time (AOT) Compiled Multishooting Discretization
- JAX Autodiff for Jacobians
Acknowledgements
This work was supported by a NASA Space Technology Graduate Research Opportunity and the Office of Naval Research under grant N00014-17-1-2433. The authors would like to acknowledge Natalia Pavlasek, Samuel Buckner, Abhi Kamath, Govind Chari, and Purnanand Elango as well as the other Autonomous Controls Laboratory members, for their many helpful discussions and support throughout this work.
Citation
Please cite the following works if you use the repository,
@ARTICLE{hayner2025los,
author={Hayner, Christopher R. and Carson III, John M. and Açıkmeşe, Behçet and Leung, Karen},
journal={IEEE Robotics and Automation Letters},
title={Continuous-Time Line-of-Sight Constrained Trajectory Planning for 6-Degree of Freedom Systems},
year={2025},
volume={},
number={},
pages={1-8},
keywords={Robot sensing systems;Vectors;Vehicle dynamics;Line-of-sight propagation;Trajectory planning;Trajectory optimization;Quadrotors;Nonlinear dynamical systems;Heuristic algorithms;Convergence;Constrained Motion Planning;Optimization and Optimal Control;Aerial Systems: Perception and Autonomy},
doi={10.1109/LRA.2025.3545299}}
@misc{elango2024ctscvx,
title={Successive Convexification for Trajectory Optimization with Continuous-Time Constraint Satisfaction},
author={Purnanand Elango and Dayou Luo and Abhinav G. Kamath and Samet Uzun and Taewan Kim and Behçet Açıkmeşe},
year={2024},
eprint={2404.16826},
archivePrefix={arXiv},
primaryClass={math.OC},
url={https://arxiv.org/abs/2404.16826},
}
@misc{chari2025qoco,
title = {QOCO: A Quadratic Objective Conic Optimizer with Custom Solver Generation},
author = {Chari, Govind M and A{\c{c}}{\i}kme{\c{s}}e, Beh{\c{c}}et},
year = {2025},
eprint = {2503.12658},
archiveprefix = {arXiv},
primaryclass = {math.OC},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openscvx-0.4.0.tar.gz.
File metadata
- Download URL: openscvx-0.4.0.tar.gz
- Upload date:
- Size: 33.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a793473e0aaea2bb57f21a84f95cdc2a0efecea55f3020834cf51f9ee1cb5a9
|
|
| MD5 |
39d403d0918c8d1b052e87215017fbbd
|
|
| BLAKE2b-256 |
7c41bc7e59aa98f4f57d68b0b55687b73b44803499630bc0634097c6443f1890
|
File details
Details for the file openscvx-0.4.0-py3-none-any.whl.
File metadata
- Download URL: openscvx-0.4.0-py3-none-any.whl
- Upload date:
- Size: 279.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b604b51d877c50ae4a40e7d01e95847f502c7abec996c61079cd3d241ae6982f
|
|
| MD5 |
5cec73e34776e29f04d26c3da094711f
|
|
| BLAKE2b-256 |
1e5a5bf644ebbb046b28a94a907c17da45cf5bc32324349fa844f240b95f97ad
|