openscvx 0.3.2.dev170__py3-none-any.whl
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.
Potentially problematic release.
This version of openscvx might be problematic. Click here for more details.
- openscvx/__init__.py +123 -0
- openscvx/_version.py +34 -0
- openscvx/algorithms/__init__.py +92 -0
- openscvx/algorithms/autotuning.py +24 -0
- openscvx/algorithms/base.py +351 -0
- openscvx/algorithms/optimization_results.py +215 -0
- openscvx/algorithms/penalized_trust_region.py +384 -0
- openscvx/config.py +437 -0
- openscvx/discretization/__init__.py +47 -0
- openscvx/discretization/discretization.py +236 -0
- openscvx/expert/__init__.py +23 -0
- openscvx/expert/byof.py +326 -0
- openscvx/expert/lowering.py +419 -0
- openscvx/expert/validation.py +357 -0
- openscvx/integrators/__init__.py +48 -0
- openscvx/integrators/runge_kutta.py +281 -0
- openscvx/lowered/__init__.py +30 -0
- openscvx/lowered/cvxpy_constraints.py +23 -0
- openscvx/lowered/cvxpy_variables.py +124 -0
- openscvx/lowered/dynamics.py +34 -0
- openscvx/lowered/jax_constraints.py +133 -0
- openscvx/lowered/parameters.py +54 -0
- openscvx/lowered/problem.py +70 -0
- openscvx/lowered/unified.py +718 -0
- openscvx/plotting/__init__.py +63 -0
- openscvx/plotting/plotting.py +756 -0
- openscvx/plotting/scp_iteration.py +299 -0
- openscvx/plotting/viser/__init__.py +126 -0
- openscvx/plotting/viser/animated.py +605 -0
- openscvx/plotting/viser/plotly_integration.py +333 -0
- openscvx/plotting/viser/primitives.py +355 -0
- openscvx/plotting/viser/scp.py +459 -0
- openscvx/plotting/viser/server.py +112 -0
- openscvx/problem.py +734 -0
- openscvx/propagation/__init__.py +60 -0
- openscvx/propagation/post_processing.py +104 -0
- openscvx/propagation/propagation.py +248 -0
- openscvx/solvers/__init__.py +51 -0
- openscvx/solvers/cvxpy.py +226 -0
- openscvx/symbolic/__init__.py +9 -0
- openscvx/symbolic/augmentation.py +630 -0
- openscvx/symbolic/builder.py +492 -0
- openscvx/symbolic/constraint_set.py +92 -0
- openscvx/symbolic/expr/__init__.py +222 -0
- openscvx/symbolic/expr/arithmetic.py +517 -0
- openscvx/symbolic/expr/array.py +632 -0
- openscvx/symbolic/expr/constraint.py +796 -0
- openscvx/symbolic/expr/control.py +135 -0
- openscvx/symbolic/expr/expr.py +720 -0
- openscvx/symbolic/expr/lie/__init__.py +87 -0
- openscvx/symbolic/expr/lie/adjoint.py +357 -0
- openscvx/symbolic/expr/lie/se3.py +172 -0
- openscvx/symbolic/expr/lie/so3.py +138 -0
- openscvx/symbolic/expr/linalg.py +279 -0
- openscvx/symbolic/expr/math.py +699 -0
- openscvx/symbolic/expr/spatial.py +209 -0
- openscvx/symbolic/expr/state.py +607 -0
- openscvx/symbolic/expr/stl.py +136 -0
- openscvx/symbolic/expr/variable.py +321 -0
- openscvx/symbolic/hashing.py +112 -0
- openscvx/symbolic/lower.py +760 -0
- openscvx/symbolic/lowerers/__init__.py +106 -0
- openscvx/symbolic/lowerers/cvxpy.py +1302 -0
- openscvx/symbolic/lowerers/jax.py +1382 -0
- openscvx/symbolic/preprocessing.py +757 -0
- openscvx/symbolic/problem.py +110 -0
- openscvx/symbolic/time.py +116 -0
- openscvx/symbolic/unified.py +420 -0
- openscvx/utils/__init__.py +20 -0
- openscvx/utils/cache.py +131 -0
- openscvx/utils/caching.py +210 -0
- openscvx/utils/printing.py +301 -0
- openscvx/utils/profiling.py +37 -0
- openscvx/utils/utils.py +100 -0
- openscvx-0.3.2.dev170.dist-info/METADATA +350 -0
- openscvx-0.3.2.dev170.dist-info/RECORD +79 -0
- openscvx-0.3.2.dev170.dist-info/WHEEL +5 -0
- openscvx-0.3.2.dev170.dist-info/licenses/LICENSE +201 -0
- openscvx-0.3.2.dev170.dist-info/top_level.txt +1 -0
openscvx/utils/utils.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import jax
|
|
2
|
+
import jax.numpy as jnp
|
|
3
|
+
import numpy as np
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def generate_orthogonal_unit_vectors(vectors=None):
|
|
7
|
+
"""
|
|
8
|
+
Generates 3 orthogonal unit vectors to model the axis of the ellipsoid via QR decomposition
|
|
9
|
+
|
|
10
|
+
Parameters:
|
|
11
|
+
vectors (np.ndarray): Optional, axes of the ellipsoid to be orthonormalized.
|
|
12
|
+
If none specified generates randomly.
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
np.ndarray: A 3x3 matrix where each column is a unit vector.
|
|
16
|
+
"""
|
|
17
|
+
if vectors is None:
|
|
18
|
+
# Create a random key
|
|
19
|
+
key = jax.random.PRNGKey(0)
|
|
20
|
+
|
|
21
|
+
# Generate a 3x3 array of random numbers uniformly distributed between 0 and 1
|
|
22
|
+
vectors = jax.random.uniform(key, (3, 3))
|
|
23
|
+
Q, _ = jnp.linalg.qr(vectors)
|
|
24
|
+
return Q
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
rot = np.array(
|
|
28
|
+
[
|
|
29
|
+
[np.cos(np.pi / 2), np.sin(np.pi / 2), 0],
|
|
30
|
+
[-np.sin(np.pi / 2), np.cos(np.pi / 2), 0],
|
|
31
|
+
[0, 0, 1],
|
|
32
|
+
]
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def gen_vertices(center, radii):
|
|
37
|
+
"""
|
|
38
|
+
Obtains the vertices of the gate.
|
|
39
|
+
"""
|
|
40
|
+
vertices = []
|
|
41
|
+
vertices.append(center + rot @ [radii[0], 0, radii[2]])
|
|
42
|
+
vertices.append(center + rot @ [-radii[0], 0, radii[2]])
|
|
43
|
+
vertices.append(center + rot @ [-radii[0], 0, -radii[2]])
|
|
44
|
+
vertices.append(center + rot @ [radii[0], 0, -radii[2]])
|
|
45
|
+
return vertices
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# TODO (haynec): make this less hardcoded
|
|
49
|
+
def get_kp_pose(t, init_pose):
|
|
50
|
+
loop_time = 40.0
|
|
51
|
+
loop_radius = 20.0
|
|
52
|
+
|
|
53
|
+
t_angle = t / loop_time * (2 * jnp.pi)
|
|
54
|
+
x = loop_radius * jnp.sin(t_angle)
|
|
55
|
+
y = x * jnp.cos(t_angle)
|
|
56
|
+
z = 0.5 * x * jnp.sin(t_angle)
|
|
57
|
+
return jnp.array([x, y, z]).T + init_pose
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def calculate_cost_from_boundaries(
|
|
61
|
+
x: np.ndarray, initial_type: np.ndarray, final_type: np.ndarray
|
|
62
|
+
) -> float:
|
|
63
|
+
"""Calculate cost from boundary condition objectives.
|
|
64
|
+
|
|
65
|
+
This function computes the total cost contribution from state boundary conditions
|
|
66
|
+
marked as "Minimize" or "Maximize" at initial and final times.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
x: State trajectory array of shape (N, n_states)
|
|
70
|
+
initial_type: Array of boundary condition types for initial states
|
|
71
|
+
final_type: Array of boundary condition types for final states
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
Total cost from minimize/maximize boundary conditions
|
|
75
|
+
|
|
76
|
+
Example:
|
|
77
|
+
>>> # State with final time to minimize
|
|
78
|
+
>>> x = np.array([[0.0, 5.0], [10.0, 20.0]]) # 2 nodes, 2 states
|
|
79
|
+
>>> initial_type = np.array(["Fix", "Free"])
|
|
80
|
+
>>> final_type = np.array(["Minimize", "Free"])
|
|
81
|
+
>>> cost = calculate_cost_from_boundaries(x, initial_type, final_type)
|
|
82
|
+
>>> cost # Returns x[-1, 0] = 10.0
|
|
83
|
+
"""
|
|
84
|
+
cost = 0.0
|
|
85
|
+
|
|
86
|
+
# Add costs from initial boundary conditions
|
|
87
|
+
for i, bc_type in enumerate(initial_type):
|
|
88
|
+
if bc_type == "Minimize":
|
|
89
|
+
cost += x[0, i]
|
|
90
|
+
elif bc_type == "Maximize":
|
|
91
|
+
cost -= x[0, i]
|
|
92
|
+
|
|
93
|
+
# Add costs from final boundary conditions
|
|
94
|
+
for i, bc_type in enumerate(final_type):
|
|
95
|
+
if bc_type == "Minimize":
|
|
96
|
+
cost += x[-1, i]
|
|
97
|
+
elif bc_type == "Maximize":
|
|
98
|
+
cost -= x[-1, i]
|
|
99
|
+
|
|
100
|
+
return cost
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: openscvx
|
|
3
|
+
Version: 0.3.2.dev170
|
|
4
|
+
Summary: A general Python-based successive convexification implementation which uses a JAX backend.
|
|
5
|
+
Author-email: Chris Hayner and Griffin Norris <haynec@uw.edu>
|
|
6
|
+
License: Apache Software License
|
|
7
|
+
Project-URL: Homepage, https://haynec.github.io/openscvx/
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: cvxpy>=1.6
|
|
14
|
+
Requires-Dist: qoco
|
|
15
|
+
Requires-Dist: numpy
|
|
16
|
+
Requires-Dist: jax
|
|
17
|
+
Requires-Dist: plotly
|
|
18
|
+
Requires-Dist: termcolor
|
|
19
|
+
Requires-Dist: diffrax
|
|
20
|
+
Requires-Dist: absl-py
|
|
21
|
+
Requires-Dist: flatbuffers
|
|
22
|
+
Requires-Dist: viser
|
|
23
|
+
Requires-Dist: matplotlib
|
|
24
|
+
Provides-Extra: gui
|
|
25
|
+
Requires-Dist: pyqtgraph; extra == "gui"
|
|
26
|
+
Requires-Dist: PyQt5; extra == "gui"
|
|
27
|
+
Requires-Dist: scipy; extra == "gui"
|
|
28
|
+
Requires-Dist: PyOpenGL; extra == "gui"
|
|
29
|
+
Requires-Dist: PyOpenGL_accelerate; extra == "gui"
|
|
30
|
+
Provides-Extra: cvxpygen
|
|
31
|
+
Requires-Dist: cvxpygen; extra == "cvxpygen"
|
|
32
|
+
Requires-Dist: qocogen; extra == "cvxpygen"
|
|
33
|
+
Provides-Extra: stl
|
|
34
|
+
Requires-Dist: stljax; extra == "stl"
|
|
35
|
+
Provides-Extra: lie
|
|
36
|
+
Requires-Dist: jaxlie; extra == "lie"
|
|
37
|
+
Provides-Extra: test
|
|
38
|
+
Requires-Dist: pytest; extra == "test"
|
|
39
|
+
Requires-Dist: scipy; extra == "test"
|
|
40
|
+
Requires-Dist: jaxlie; extra == "test"
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
|
|
43
|
+
<a id="readme-top"></a>
|
|
44
|
+
|
|
45
|
+
<img src="figures/openscvx_logo.svg" width="1200"/>
|
|
46
|
+
<p align="center">
|
|
47
|
+
<a href="https://github.com/haynec/OpenSCvx/actions/workflows/lint.yml"><img src="https://github.com/haynec/OpenSCvx/actions/workflows/lint.yml/badge.svg"/></a>
|
|
48
|
+
<a href="https://github.com/haynec/OpenSCvx/actions/workflows/tests-unit.yml"><img src="https://github.com/haynec/OpenSCvx/actions/workflows/tests-unit.yml/badge.svg"/></a>
|
|
49
|
+
<a href="https://github.com/haynec/OpenSCvx/actions/workflows/tests-integration.yml"><img src="https://github.com/haynec/OpenSCvx/actions/workflows/tests-integration.yml/badge.svg"/></a>
|
|
50
|
+
<a href="https://github.com/haynec/OpenSCvx/actions/workflows/nightly.yml"><img src="https://github.com/haynec/OpenSCvx/actions/workflows/nightly.yml/badge.svg"/></a>
|
|
51
|
+
<a href="https://github.com/haynec/OpenSCvx/actions/workflows/release.yml"><img src="https://github.com/haynec/OpenSCvx/actions/workflows/release.yml/badge.svg?event=release"/></a>
|
|
52
|
+
</p>
|
|
53
|
+
<p align="center">
|
|
54
|
+
<a href="https://arxiv.org/abs/2410.22596"><img src="http://img.shields.io/badge/arXiv-2410.22596-B31B1B.svg"/></a>
|
|
55
|
+
<a href="https://www.apache.org/licenses/LICENSE-2.0"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" alt="License: Apache 2.0"/></a>
|
|
56
|
+
</p>
|
|
57
|
+
|
|
58
|
+
<!-- PROJECT LOGO -->
|
|
59
|
+
<br />
|
|
60
|
+
|
|
61
|
+
<!-- GETTING STARTED -->
|
|
62
|
+
## Getting Started
|
|
63
|
+
|
|
64
|
+
### Installation
|
|
65
|
+
|
|
66
|
+
<details>
|
|
67
|
+
<summary>Stable</summary>
|
|
68
|
+
|
|
69
|
+
To grab the latest stable release simply run
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
pip install openscvx
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
to install OpenSCVx in your python environment.
|
|
76
|
+
|
|
77
|
+
Or using uv:
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
uv pip install openscvx
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
For optional dependencies:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
pip install openscvx[gui,cvxpygen]
|
|
87
|
+
# or with uv
|
|
88
|
+
uv pip install openscvx[gui,cvxpygen]
|
|
89
|
+
```
|
|
90
|
+
</details>
|
|
91
|
+
|
|
92
|
+
<details>
|
|
93
|
+
<summary>Nightly</summary>
|
|
94
|
+
|
|
95
|
+
To install the latest development version (nightly):
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
pip install --pre openscvx
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
With optional dependencies:
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
pip install --pre openscvx[gui,cvxpygen]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Or using uv:
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
uv pip install --pre openscvx
|
|
111
|
+
# With optional dependencies
|
|
112
|
+
uv pip install --pre openscvx[gui,cvxpygen]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Note:** The `--pre` flag tells pip/uv to install pre-release versions (e.g., `1.2.4.dev3`) from PyPI.
|
|
116
|
+
|
|
117
|
+
Alternatively, for local development with the latest source:
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
# Clone the repo
|
|
121
|
+
git clone https://github.com/haynec/OpenSCvx.git
|
|
122
|
+
cd OpenSCvx
|
|
123
|
+
|
|
124
|
+
# Install in editable/development mode
|
|
125
|
+
pip install -e .
|
|
126
|
+
# or with uv
|
|
127
|
+
uv pip install -e .
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
</details>
|
|
131
|
+
|
|
132
|
+
### Dependencies
|
|
133
|
+
|
|
134
|
+
The main packages are:
|
|
135
|
+
|
|
136
|
+
- `cvxpy` - is used to formulate and solve the convex subproblems
|
|
137
|
+
- `jax` - is used for determining the Jacobians using automatic differentiation, vectorization, and ahead-of-time (AOT) compilation of the dynamics and their Jacobians
|
|
138
|
+
- `numpy` - is used for numerical operations
|
|
139
|
+
- `diffrax` - is used for the numerical integration of the dynamics
|
|
140
|
+
- `termcolor` - is used for pretty command line output
|
|
141
|
+
- `plotly` - is used for all visualizations
|
|
142
|
+
|
|
143
|
+
These will be installed automatically, but can be installed via conda or pip if you are building from source.
|
|
144
|
+
|
|
145
|
+
#### GUI Dependencies (Optional)
|
|
146
|
+
|
|
147
|
+
For interactive 3D plotting and real-time visualization, additional packages are required:
|
|
148
|
+
|
|
149
|
+
- `pyqtgraph` - is used for interactive 3D plotting and real-time visualization
|
|
150
|
+
- `PyQt5` - provides the Qt5 GUI framework for pyqtgraph
|
|
151
|
+
- `scipy` - is used for spatial transformations in plotting functions
|
|
152
|
+
- `PyOpenGL` - provides OpenGL bindings for Python, required for 3D plotting
|
|
153
|
+
- `PyOpenGL_accelerate` - (optional) speeds up PyOpenGL
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
For local development:
|
|
157
|
+
|
|
158
|
+
```sh
|
|
159
|
+
pip install -e ".[gui]"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
#### CVXPYGen Dependencies (Optional)
|
|
163
|
+
|
|
164
|
+
For code generation and faster solver performance, CVXPYGen can be installed:
|
|
165
|
+
|
|
166
|
+
- `cvxpygen` - enables code generation for faster solver performance
|
|
167
|
+
- `qocogen` - custom solver backend for CVXPYGen (included with cvxpygen extras)
|
|
168
|
+
|
|
169
|
+
To install with CVXPYGen support:
|
|
170
|
+
|
|
171
|
+
```sh
|
|
172
|
+
pip install openscvx[cvxpygen]
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Or for both GUI and CVXPYGen:
|
|
176
|
+
|
|
177
|
+
```sh
|
|
178
|
+
pip install openscvx[gui,cvxpygen]
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
CVXPYGen features include:
|
|
182
|
+
- Automatic C++ code generation for optimization problems
|
|
183
|
+
- Faster solver performance through compiled code
|
|
184
|
+
- Support for custom solver backends like QOCOGen
|
|
185
|
+
|
|
186
|
+
### Local Development
|
|
187
|
+
|
|
188
|
+
This git repository can be installed using https
|
|
189
|
+
|
|
190
|
+
```sh
|
|
191
|
+
git clone https://github.com/haynec/OpenSCvx.git
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
or ssh
|
|
195
|
+
|
|
196
|
+
```sh
|
|
197
|
+
git clone git@github.com:haynec/OpenSCvx.git
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Dependencies can then be installed using Conda or Pip
|
|
201
|
+
|
|
202
|
+
<details>
|
|
203
|
+
<summary>Via Conda</summary>
|
|
204
|
+
|
|
205
|
+
1. Clone the repo using https or ssh
|
|
206
|
+
2. Create a conda environment with Python:
|
|
207
|
+
```sh
|
|
208
|
+
conda create -n openscvx python>=3.9
|
|
209
|
+
```
|
|
210
|
+
3. Activate the environment:
|
|
211
|
+
```sh
|
|
212
|
+
conda activate openscvx
|
|
213
|
+
```
|
|
214
|
+
4. Install the package with dependencies:
|
|
215
|
+
```sh
|
|
216
|
+
pip install -e .
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Or install with optional dependencies:
|
|
220
|
+
```sh
|
|
221
|
+
pip install -e ".[gui,cvxpygen]"
|
|
222
|
+
```
|
|
223
|
+
</details>
|
|
224
|
+
|
|
225
|
+
<details>
|
|
226
|
+
<summary>Via uv</summary>
|
|
227
|
+
|
|
228
|
+
1. Prerequisites
|
|
229
|
+
- Install [uv](https://docs.astral.sh/uv/getting-started/installation/)
|
|
230
|
+
2. Clone the repo using https or ssh
|
|
231
|
+
3. Create virtual environment and install the package:
|
|
232
|
+
```sh
|
|
233
|
+
uv venv
|
|
234
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
235
|
+
uv pip install -e .
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Or install with optional dependencies:
|
|
239
|
+
```sh
|
|
240
|
+
uv pip install -e ".[gui,cvxpygen]"
|
|
241
|
+
```
|
|
242
|
+
</details>
|
|
243
|
+
|
|
244
|
+
<details>
|
|
245
|
+
<summary>Via pip</summary>
|
|
246
|
+
|
|
247
|
+
1. Prerequisites
|
|
248
|
+
Python >= 3.9
|
|
249
|
+
2. Clone the repo using https or ssh
|
|
250
|
+
3. Create virtual environment (called `venv` here) and source it
|
|
251
|
+
```sh
|
|
252
|
+
python3 -m venv venv
|
|
253
|
+
source venv/bin/activate
|
|
254
|
+
```
|
|
255
|
+
4. Install the package with dependencies:
|
|
256
|
+
```sh
|
|
257
|
+
pip install -e .
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Or install with optional dependencies:
|
|
261
|
+
```sh
|
|
262
|
+
pip install -e ".[gui,cvxpygen]"
|
|
263
|
+
```
|
|
264
|
+
</details>
|
|
265
|
+
|
|
266
|
+
### Running Trajectory Optimization
|
|
267
|
+
|
|
268
|
+
See `examples/` folder for several example trajectory optimization problems grouped by application.
|
|
269
|
+
To run a problem simply run any of the examples directly, for example:
|
|
270
|
+
|
|
271
|
+
```sh
|
|
272
|
+
python3 examples/abstract/brachistochrone.py
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
> **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](#local-development) section above for detailed installation instructions.
|
|
276
|
+
|
|
277
|
+
and adjust the plotting as needed.
|
|
278
|
+
|
|
279
|
+
Check out the problem definitions inside `examples/` to see how to define your own problems.
|
|
280
|
+
|
|
281
|
+
## Code Structure
|
|
282
|
+
<img src="figures/oscvx_structure_full_dark.svg" width="1200"/>
|
|
283
|
+
|
|
284
|
+
## ToDos
|
|
285
|
+
|
|
286
|
+
- [X] Standardized Vehicle and Constraint classes
|
|
287
|
+
- [X] Implement QOCOGen with CVPYGEN
|
|
288
|
+
- [X] Non-Dilated Time Propagation
|
|
289
|
+
- [X] Save and reload the compiled JAX code
|
|
290
|
+
- [x] Unified Mathematical Interface
|
|
291
|
+
- [ ] Auto-SCvx Weight Tuning
|
|
292
|
+
- [ ] Compiled at the subproblem level with JAX
|
|
293
|
+
- [ ] Single Shot propagation
|
|
294
|
+
|
|
295
|
+
## What is implemented
|
|
296
|
+
|
|
297
|
+
This repo has the following features:
|
|
298
|
+
|
|
299
|
+
1. Free Final Time
|
|
300
|
+
2. Fully adaptive time dilation (```s``` is appended to the control vector)
|
|
301
|
+
3. Continuous-Time Constraint Satisfaction
|
|
302
|
+
4. FOH and ZOH exact discretization (```t``` is a state so you can bring your own scheme)
|
|
303
|
+
6. Vectorized and Ahead-of-Time (AOT) Compiled Multishooting Discretization
|
|
304
|
+
7. JAX Autodiff for Jacobians
|
|
305
|
+
|
|
306
|
+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
|
307
|
+
|
|
308
|
+
## Acknowledgements
|
|
309
|
+
|
|
310
|
+
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.
|
|
311
|
+
|
|
312
|
+
## Citation
|
|
313
|
+
|
|
314
|
+
Please cite the following works if you use the repository,
|
|
315
|
+
|
|
316
|
+
```tex
|
|
317
|
+
@ARTICLE{hayner2025los,
|
|
318
|
+
author={Hayner, Christopher R. and Carson III, John M. and Açıkmeşe, Behçet and Leung, Karen},
|
|
319
|
+
journal={IEEE Robotics and Automation Letters},
|
|
320
|
+
title={Continuous-Time Line-of-Sight Constrained Trajectory Planning for 6-Degree of Freedom Systems},
|
|
321
|
+
year={2025},
|
|
322
|
+
volume={},
|
|
323
|
+
number={},
|
|
324
|
+
pages={1-8},
|
|
325
|
+
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},
|
|
326
|
+
doi={10.1109/LRA.2025.3545299}}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
```tex
|
|
330
|
+
@misc{elango2024ctscvx,
|
|
331
|
+
title={Successive Convexification for Trajectory Optimization with Continuous-Time Constraint Satisfaction},
|
|
332
|
+
author={Purnanand Elango and Dayou Luo and Abhinav G. Kamath and Samet Uzun and Taewan Kim and Behçet Açıkmeşe},
|
|
333
|
+
year={2024},
|
|
334
|
+
eprint={2404.16826},
|
|
335
|
+
archivePrefix={arXiv},
|
|
336
|
+
primaryClass={math.OC},
|
|
337
|
+
url={https://arxiv.org/abs/2404.16826},
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
```tex
|
|
342
|
+
@misc{chari2025qoco,
|
|
343
|
+
title = {QOCO: A Quadratic Objective Conic Optimizer with Custom Solver Generation},
|
|
344
|
+
author = {Chari, Govind M and A{\c{c}}{\i}kme{\c{s}}e, Beh{\c{c}}et},
|
|
345
|
+
year = {2025},
|
|
346
|
+
eprint = {2503.12658},
|
|
347
|
+
archiveprefix = {arXiv},
|
|
348
|
+
primaryclass = {math.OC},
|
|
349
|
+
}
|
|
350
|
+
```
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
openscvx/__init__.py,sha256=cbl7UdPuAdaJZS_4XdjUo4fIXYQaFdxe8KHNMOSWjBE,2090
|
|
2
|
+
openscvx/_version.py,sha256=SH82FH3MFsNPj6mvzL0QI5N-iN8m06lJrfi9qV3JTtc,721
|
|
3
|
+
openscvx/config.py,sha256=-Yz3E5wj1OZAhPnMzveyPv2g2JRe9bHRsfAWQO_3GXg,16671
|
|
4
|
+
openscvx/problem.py,sha256=BLYigiBrpjpUcq3bWRDC0bWjYZS0lMNImZKgub-nLlA,28512
|
|
5
|
+
openscvx/algorithms/__init__.py,sha256=HJNIs9pBhxEwM0a52Z0sOJHjCTdLomTuAYZv7hoRXbA,2639
|
|
6
|
+
openscvx/algorithms/autotuning.py,sha256=P-8m_rZKZGprpR72eSlCwy0bBJ1yG4NiUE591xXrRRM,870
|
|
7
|
+
openscvx/algorithms/base.py,sha256=aQbOWpUjYJFmppnrkAoteYFEn-A5199uFdfpTcNZU_k,12293
|
|
8
|
+
openscvx/algorithms/optimization_results.py,sha256=3vzI8oz6JsGT5VsQdwta5tJ9_1XQkkJghhnEnEyvypE,7519
|
|
9
|
+
openscvx/algorithms/penalized_trust_region.py,sha256=cMYUW-DBUietehnjr7_etd54-iAbBh92QXxn4klTy3Y,14019
|
|
10
|
+
openscvx/discretization/__init__.py,sha256=y9X-PizVetlu5Dn5a_AjskSG3BsKet_TF90S7Yh2E50,1563
|
|
11
|
+
openscvx/discretization/discretization.py,sha256=F4thMrr1eG1LZilXSKeSDsjjjUumY3_Ssqd8344lHLo,7174
|
|
12
|
+
openscvx/expert/__init__.py,sha256=giqjmtL6H3r79L-oTY4MIoqxI0MBoV21FAAbdxetDz4,548
|
|
13
|
+
openscvx/expert/byof.py,sha256=30JmfxjTKhOEt3_DiSVUObmou5IrE4bVEVQxkbtPL0I,14264
|
|
14
|
+
openscvx/expert/lowering.py,sha256=iOHtbk9jGXz3I-Q-Qvf7qchr2l_ccDPNqgYJ1RcOI_w,17181
|
|
15
|
+
openscvx/expert/validation.py,sha256=MWF4YMysg23qlRbgvnE7erdN1keJt2WwkiYZ6K8IFiY,14352
|
|
16
|
+
openscvx/integrators/__init__.py,sha256=VPZ3OYMhWOirggQbxNV3NkktXDs4GLSiklmgQShgFnU,1483
|
|
17
|
+
openscvx/integrators/runge_kutta.py,sha256=0oFa2LCkH1PyxB8plzEAVw_i9hDs9T-NxXTTWEJTasE,9775
|
|
18
|
+
openscvx/lowered/__init__.py,sha256=P1xtMVkXWa3uz4tiJeTllurwGFeugdwxqU8h0Mt6uTo,942
|
|
19
|
+
openscvx/lowered/cvxpy_constraints.py,sha256=Duuvs7OPcG_mCoTtd4FGLhDSpxCj2d2Vy8pR-nkQxdw,642
|
|
20
|
+
openscvx/lowered/cvxpy_variables.py,sha256=trHm0Eke4WXS__OisE05XeotQThUbvrryafGDMZL9Ck,5387
|
|
21
|
+
openscvx/lowered/dynamics.py,sha256=ppaVnklzrUjXNTVrSqcEHzfeYx9Iy5ab_QRw4drm9kk,1504
|
|
22
|
+
openscvx/lowered/jax_constraints.py,sha256=9h96qKx_ZbK35S6OpvmthsI55FAk3-kdx3TVjSKiCVk,6063
|
|
23
|
+
openscvx/lowered/parameters.py,sha256=F01f08EKaRMHG_5eO0AXGWsDjaQ1qDJDq9gJSD1SawQ,1992
|
|
24
|
+
openscvx/lowered/problem.py,sha256=ukWn3DOd7D8qrMeo-DuagKSA-oDCWgNOmuSrBPjiVOI,2475
|
|
25
|
+
openscvx/lowered/unified.py,sha256=lE7Z4fqVmfuiPsRwqPW8yGtWbnyLLMwsIl1RYV-5IHM,30407
|
|
26
|
+
openscvx/plotting/__init__.py,sha256=DLvpls_XYwNngbQh0jSV4HjwE3hauAyQYivX-5IH9zw,2066
|
|
27
|
+
openscvx/plotting/plotting.py,sha256=RlbSXvzkDqqMo1sVd5MyVFhFd7dUi7HxCoAWNvyEJv8,25343
|
|
28
|
+
openscvx/plotting/scp_iteration.py,sha256=CmySkoNipQPrnPy-wLC2JDOOxQK-4Vj9TPPTf8wtHY0,11241
|
|
29
|
+
openscvx/plotting/viser/__init__.py,sha256=185IBr88RjIrSyZ6k6iISW7tiwsd0BiyzKpg_e209bk,4043
|
|
30
|
+
openscvx/plotting/viser/animated.py,sha256=LWPr12Xy9laMHJjBzLAgHzkI0cBwgqcTFxtYnHCfpGs,19983
|
|
31
|
+
openscvx/plotting/viser/plotly_integration.py,sha256=UUpiqdLAax-1WzPt2Z6CBPMxw7Qk_tP9YN9KTeVUhII,12229
|
|
32
|
+
openscvx/plotting/viser/primitives.py,sha256=YPqlHHHGfgeaDHlppFSRwmNWpj-UHFLnd4ZHhTGoHOM,10688
|
|
33
|
+
openscvx/plotting/viser/scp.py,sha256=WTGhjg11Qsy-PjDirGt_0U83GKTedVLmkN5Qt54VaFk,16103
|
|
34
|
+
openscvx/plotting/viser/server.py,sha256=m2ce3pwe0kVVh1hpYPYvSzsew_uD0X3RffzQk_Z2N18,3184
|
|
35
|
+
openscvx/propagation/__init__.py,sha256=XjlOoEwgo2Vow0uW0mMCcLIN53VzFBnSuer3ZzPqnbk,1851
|
|
36
|
+
openscvx/propagation/post_processing.py,sha256=SMNF01Q8KpZ4gSOcO1Mn-SuCLPtFlY_zsnfxMrEboYs,4057
|
|
37
|
+
openscvx/propagation/propagation.py,sha256=0WDlXehsVJpCRVB0wAXmHUVVSvKSGwudOuVczxZrH0s,8524
|
|
38
|
+
openscvx/solvers/__init__.py,sha256=1jCJAL3bLoOid2ilg1J2SrjMqLFqVH0dFkeKPi5lYmo,1810
|
|
39
|
+
openscvx/solvers/cvxpy.py,sha256=-MFSW8HUwI3qosGb2aizy_aXr-D9UGuoDk1JAnHmuYU,8051
|
|
40
|
+
openscvx/symbolic/__init__.py,sha256=aBwrKg6OnmbDL9pma9k4G009QWCOjM2Lmt_6MZPF7I4,294
|
|
41
|
+
openscvx/symbolic/augmentation.py,sha256=Y8HcmX26ECuvfZburLq_Po1DxPVHorwNBDYgY3ARXWA,25599
|
|
42
|
+
openscvx/symbolic/builder.py,sha256=Y5LsRFduMkhpErKvDiuXMfuoieRSGS2tT3D7ZJCkZdQ,19875
|
|
43
|
+
openscvx/symbolic/constraint_set.py,sha256=HtLKmXvji9B47l1jzd5fEJSAFAKX93vyzDwux1xxayM,3476
|
|
44
|
+
openscvx/symbolic/hashing.py,sha256=u9JJQpAskuC8mPntwdmWIdEtoL0BF96a-zbqkEXJX78,4320
|
|
45
|
+
openscvx/symbolic/lower.py,sha256=D7t_HzMmUhJb0sHpBcE5zBAlBljTctOAeciveBlFO-k,27038
|
|
46
|
+
openscvx/symbolic/preprocessing.py,sha256=8lcpb90eXcQPPGZ2VmiBeJyklf6FKT4_E9mwzvQLTUQ,30065
|
|
47
|
+
openscvx/symbolic/problem.py,sha256=kKwGXF7F0Tx4PITCu8hRftm-D3GvJJC1AgCgPgXfsLI,4464
|
|
48
|
+
openscvx/symbolic/time.py,sha256=M9owvALCVBhR7XuikRHxXN2jX6oHcU5M2hF6I7bMILI,4071
|
|
49
|
+
openscvx/symbolic/unified.py,sha256=xS94dp1kQTpmYGt-Eon-YoD9Vpa-8FJQnChPQnl4wFE,17500
|
|
50
|
+
openscvx/symbolic/expr/__init__.py,sha256=FdMepqHuaxtSxxDlX-XFKk2QdEcJap1DdMK51r36rcc,5398
|
|
51
|
+
openscvx/symbolic/expr/arithmetic.py,sha256=KJ6tf7DPshaJ1zp9gT2R020NY5MmKQ0rMQ7uYY7PXSg,16006
|
|
52
|
+
openscvx/symbolic/expr/array.py,sha256=ip8Ylzl5qjLRFzs2QthABYrdHkScNIE9AbPPN9kFAa0,22705
|
|
53
|
+
openscvx/symbolic/expr/constraint.py,sha256=5OAwPgNBRB4VB9H5ysLPRU_Getb9LnX2PVJqvBAVZjo,30430
|
|
54
|
+
openscvx/symbolic/expr/control.py,sha256=gvuJHmt1jrs5RyznUZeLAFjWVZV_sVZ3GWgyrG1JaRw,4861
|
|
55
|
+
openscvx/symbolic/expr/expr.py,sha256=4UHu5spm6Ia5ATkrbGHIGgXPGYG68V8vSxw_Ud_Niic,23873
|
|
56
|
+
openscvx/symbolic/expr/linalg.py,sha256=8brJhgZIs8SwWjb0GHLStkra8lLNkjUElnvf7flUlKw,8741
|
|
57
|
+
openscvx/symbolic/expr/math.py,sha256=6a2eu--pz5MO1tLLlZGPwb4dp2uHuKZfID9Kk4yMvAg,20682
|
|
58
|
+
openscvx/symbolic/expr/spatial.py,sha256=MPL2Y5Z9iZdd9sVEys5vvyI8-jmXvsAZ6uEnSIuGB8I,6609
|
|
59
|
+
openscvx/symbolic/expr/state.py,sha256=U3GHpm9Q47deAqRPg3Ee2gR7nNgr0I4FvYoj1W2z5-U,21937
|
|
60
|
+
openscvx/symbolic/expr/stl.py,sha256=2LHgJzEGiUORYJpeejhnZH-eghQL-NNrLDpcCcnt6Ag,5175
|
|
61
|
+
openscvx/symbolic/expr/variable.py,sha256=qqvBa5ZRpZqEK3wWgUzmVc34_FYcNh4OT6jDd74R0v4,12616
|
|
62
|
+
openscvx/symbolic/expr/lie/__init__.py,sha256=V7Ssy9JOxGl4bSfsGM6Cmz2Q2qrBwHLqmEzPLlLaCnE,2999
|
|
63
|
+
openscvx/symbolic/expr/lie/adjoint.py,sha256=7IYm1aKAj5rt9D3fYM_wDwp-hLxQ-asVapafZ-BkhpI,11567
|
|
64
|
+
openscvx/symbolic/expr/lie/se3.py,sha256=TeO1ZMH7XwdN8hoct285DDcmmnrX7szxafltqJU981A,5366
|
|
65
|
+
openscvx/symbolic/expr/lie/so3.py,sha256=yjTnbOjGRNTTgbQCMX6-h-GSVpj1vJEA_s560WIvxFc,4196
|
|
66
|
+
openscvx/symbolic/lowerers/__init__.py,sha256=vqW2Lb5FeTt8PxsJhfgtEpvWRU2kijF0fw6ws67R-N0,4233
|
|
67
|
+
openscvx/symbolic/lowerers/cvxpy.py,sha256=AJaPBIV-Bw8Sw0LM38DIsB1vbI0lg6w_0Kx1A50mJdA,45650
|
|
68
|
+
openscvx/symbolic/lowerers/jax.py,sha256=vuE-EhIVE-dvmjF9kEY8xF7uvjXlTijlj5eIUkzf_WM,48144
|
|
69
|
+
openscvx/utils/__init__.py,sha256=jO7gVvPklDsQXg_AwL929DcY2jLp2ZbNeyjYETOtEWY,402
|
|
70
|
+
openscvx/utils/cache.py,sha256=_LExCrntPw5mp0BPS9okgCc6ad_AMddWdQzft2vbnOs,3612
|
|
71
|
+
openscvx/utils/caching.py,sha256=NJYjCimXQGk-Pwsma9cncKyNzKB2FtJHUhos-sxRQB8,7320
|
|
72
|
+
openscvx/utils/printing.py,sha256=hnsKgyZTlU31JwdrVPBwPNLUkkjzRZ9v-kEbl-uZfMo,11733
|
|
73
|
+
openscvx/utils/profiling.py,sha256=C0n1TIoz17aXynYK16phjCIBO1zpDTii1MWUiCFUsyY,1028
|
|
74
|
+
openscvx/utils/utils.py,sha256=M25RHE_7DSr3Reaca0xCXnDSY9KHuqYvXdh5m1ZotEc,3047
|
|
75
|
+
openscvx-0.3.2.dev170.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
76
|
+
openscvx-0.3.2.dev170.dist-info/METADATA,sha256=UphS7rLZNXH1Pss1nTydpJm5Ge4Ck2wfDo6UjlLK4fQ,10549
|
|
77
|
+
openscvx-0.3.2.dev170.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
78
|
+
openscvx-0.3.2.dev170.dist-info/top_level.txt,sha256=nUT4Ybefzh40H8tVXqc1RzKESy_MAowElb-CIvAbd4Q,9
|
|
79
|
+
openscvx-0.3.2.dev170.dist-info/RECORD,,
|