openscvx 0.1.0__py3-none-any.whl → 0.1.2__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 +0 -0
- openscvx/_version.py +21 -0
- openscvx/augmentation/__init__.py +0 -0
- openscvx/augmentation/ctcs.py +44 -0
- openscvx/augmentation/dynamics_augmentation.py +122 -0
- openscvx/config.py +247 -0
- {constraints → openscvx/constraints}/ctcs.py +27 -3
- {constraints → openscvx/constraints}/nodal.py +17 -11
- openscvx/constraints/violation.py +67 -0
- openscvx/discretization.py +170 -0
- openscvx/dynamics.py +41 -0
- openscvx/integrators.py +139 -0
- openscvx/io.py +81 -0
- openscvx/ocp.py +160 -0
- openscvx/plotting.py +632 -0
- openscvx/post_processing.py +36 -0
- openscvx/propagation.py +135 -0
- openscvx/ptr.py +149 -0
- openscvx/trajoptproblem.py +337 -0
- openscvx/utils.py +80 -0
- {openscvx-0.1.0.dist-info → openscvx-0.1.2.dist-info}/METADATA +61 -18
- openscvx-0.1.2.dist-info/RECORD +27 -0
- openscvx-0.1.2.dist-info/top_level.txt +1 -0
- constraints/violation.py +0 -26
- openscvx-0.1.0.dist-info/RECORD +0 -10
- openscvx-0.1.0.dist-info/top_level.txt +0 -1
- {constraints → openscvx/constraints}/__init__.py +0 -0
- {constraints → openscvx/constraints}/boundary.py +0 -0
- {openscvx-0.1.0.dist-info → openscvx-0.1.2.dist-info}/WHEEL +0 -0
- {openscvx-0.1.0.dist-info → openscvx-0.1.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openscvx
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: A general Python-based successive convexification implementation which uses a JAX backend.
|
|
5
5
|
Home-page: https://haynec.github.io/openscvx/
|
|
6
6
|
Author: Chris Hayner and Griffin Norris
|
|
7
7
|
Author-email: haynec@uw.edu
|
|
@@ -26,10 +26,15 @@ Dynamic: license-file
|
|
|
26
26
|
|
|
27
27
|
<img src="figures/openscvx_logo.svg" width="1200"/>
|
|
28
28
|
<p align="center">
|
|
29
|
-
<a href="https://github.com//haynec/OpenSCvx/actions/workflows/
|
|
29
|
+
<a href="https://github.com//haynec/OpenSCvx/actions/workflows/website.yml/badge.svg"><img src="https://github.com//haynec/OpenSCvx/actions/workflows/website.yml/badge.svg"/></a>
|
|
30
30
|
<a href="https://arxiv.org/abs/2410.22596"><img src="http://img.shields.io/badge/arXiv-2410.22596-B31B1B.svg"/></a>
|
|
31
31
|
<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>
|
|
32
32
|
</p>
|
|
33
|
+
<p align="center">
|
|
34
|
+
<a href="https://github.com//haynec/OpenSCvx/actions/workflows/ci.yml/badge.svg"><img src="https://github.com//haynec/OpenSCvx/actions/workflows/ci.yml/badge.svg"/></a>
|
|
35
|
+
<a href="https://github.com//haynec/OpenSCvx/actions/workflows/nightly.yml/badge.svg"><img src="https://github.com//haynec/OpenSCvx/actions/workflows/nightly.yml/badge.svg"/></a>
|
|
36
|
+
<a href="https://github.com//haynec/OpenSCvx/actions/workflows/release.yml/badge.svg"><img src="https://github.com//haynec/OpenSCvx/actions/workflows/release.yml/badge.svg"/></a>
|
|
37
|
+
</p>
|
|
33
38
|
|
|
34
39
|
<!-- PROJECT LOGO -->
|
|
35
40
|
<br />
|
|
@@ -37,20 +42,50 @@ Dynamic: license-file
|
|
|
37
42
|
<!-- GETTING STARTED -->
|
|
38
43
|
## Getting Started
|
|
39
44
|
|
|
40
|
-
|
|
41
45
|
### Installation
|
|
46
|
+
|
|
47
|
+
To grab the latest stable release simply run
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
pip install openscvx
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
to install OpenSCVx in your python environment.
|
|
54
|
+
|
|
55
|
+
<details>
|
|
56
|
+
<summary>Install Development / Nightly Version</summary>
|
|
57
|
+
|
|
58
|
+
If you want the pre-release version, you can install the latest `nightly` build with:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ --pre --upgrade openscvx
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This command will also upgrade an existing `nightly` install to the latest version
|
|
65
|
+
Or if you want a specific pre-release version this can be installed with
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ openscvx==1.2.3.dev45
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
where `1.2.3.dev45 => <major>.<minor>.<patch>.dev<XY>` corresponds to your exact version
|
|
72
|
+
</details>
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
#### Dependencies
|
|
76
|
+
|
|
42
77
|
The main packages are:
|
|
43
|
-
- ```cvxpy``` - is used to formulate and solve the convex subproblems
|
|
44
|
-
- ```jax``` - is used for determining the Jacobians using automatic differentiation, vectorization, and ahead-of-time (AOT) compilation of the dynamics and their Jacobians
|
|
45
|
-
- ```numpy``` - is used for numerical operations
|
|
46
|
-
- ```diffrax``` - is used for the numerical integration of the dynamics
|
|
47
|
-
- ```termcolor``` - is used for pretty command line output
|
|
48
|
-
- ```plotly``` - is used for all visualizations
|
|
49
78
|
|
|
79
|
+
- `cvxpy` - is used to formulate and solve the convex subproblems
|
|
80
|
+
- `jax` - is used for determining the Jacobians using automatic differentiation, vectorization, and ahead-of-time (AOT) compilation of the dynamics and their Jacobians
|
|
81
|
+
- `numpy` - is used for numerical operations
|
|
82
|
+
- `diffrax` - is used for the numerical integration of the dynamics
|
|
83
|
+
- `termcolor` - is used for pretty command line output
|
|
84
|
+
- `plotly` - is used for all visualizations
|
|
50
85
|
|
|
51
|
-
These can be installed via conda or pip.
|
|
86
|
+
These will be installed automatically, but can be installed via conda or pip if you are building from source.
|
|
52
87
|
<details>
|
|
53
|
-
<summary>Via Conda
|
|
88
|
+
<summary>Via Conda</summary>
|
|
54
89
|
|
|
55
90
|
1. Clone the repo
|
|
56
91
|
```sh
|
|
@@ -87,11 +122,11 @@ These can be installed via conda or pip.
|
|
|
87
122
|
See `examples/` folder for several example trajectory optimization problems.
|
|
88
123
|
To run a problem simply run `examples/main.py` with:
|
|
89
124
|
|
|
90
|
-
```
|
|
91
|
-
python3
|
|
125
|
+
```sh
|
|
126
|
+
python3 examples/main.py
|
|
92
127
|
```
|
|
93
128
|
|
|
94
|
-
To change which example is run by `main` simply replace the `
|
|
129
|
+
To change which example is run by `main` simply replace the `problem` import line:
|
|
95
130
|
|
|
96
131
|
```python
|
|
97
132
|
# other imports
|
|
@@ -99,10 +134,11 @@ from examples.params.dr_vp import problem
|
|
|
99
134
|
# rest of code
|
|
100
135
|
```
|
|
101
136
|
|
|
137
|
+
and adjust the plotting as needed.
|
|
102
138
|
Check out the problem definitions inside `examples/params` to see how to define your own problems.
|
|
103
139
|
|
|
104
|
-
|
|
105
140
|
## ToDos
|
|
141
|
+
|
|
106
142
|
- [X] Standardized Vehicle and Constraint classes
|
|
107
143
|
- [X] Implement QOCOGen with CVPYGEN
|
|
108
144
|
- [X] Non-Dilated Time Propagation
|
|
@@ -110,8 +146,12 @@ Check out the problem definitions inside `examples/params` to see how to define
|
|
|
110
146
|
- [ ] Compiled at the subproblem level with JAX
|
|
111
147
|
- [ ] Save and reload the compiled JAX code
|
|
112
148
|
- [ ] Single Shot propagation
|
|
149
|
+
- [ ] Unified Mathematical Interface
|
|
150
|
+
|
|
113
151
|
## What is implemented
|
|
152
|
+
|
|
114
153
|
This repo has the following features:
|
|
154
|
+
|
|
115
155
|
1. Free Final Time
|
|
116
156
|
2. Fully adaptive time dilation (```s``` is appended to the control vector)
|
|
117
157
|
3. Continuous-Time Constraint Satisfaction
|
|
@@ -122,11 +162,14 @@ This repo has the following features:
|
|
|
122
162
|
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
|
123
163
|
|
|
124
164
|
## Acknowledgements
|
|
165
|
+
|
|
125
166
|
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.
|
|
126
167
|
|
|
127
168
|
## Citation
|
|
169
|
+
|
|
128
170
|
Please cite the following works if you use the repository,
|
|
129
|
-
|
|
171
|
+
|
|
172
|
+
```tex
|
|
130
173
|
@ARTICLE{hayner2025los,
|
|
131
174
|
author={Hayner, Christopher R. and Carson III, John M. and Açıkmeşe, Behçet and Leung, Karen},
|
|
132
175
|
journal={IEEE Robotics and Automation Letters},
|
|
@@ -139,7 +182,7 @@ Please cite the following works if you use the repository,
|
|
|
139
182
|
doi={10.1109/LRA.2025.3545299}}
|
|
140
183
|
```
|
|
141
184
|
|
|
142
|
-
```
|
|
185
|
+
```tex
|
|
143
186
|
@misc{elango2024ctscvx,
|
|
144
187
|
title={Successive Convexification for Trajectory Optimization with Continuous-Time Constraint Satisfaction},
|
|
145
188
|
author={Purnanand Elango and Dayou Luo and Abhinav G. Kamath and Samet Uzun and Taewan Kim and Behçet Açıkmeşe},
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
openscvx/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
openscvx/_version.py,sha256=bSmADqydH8nBu-J4lG8UVuR7hnU_zcwhnSav2oQ0W0A,511
|
|
3
|
+
openscvx/config.py,sha256=8Cl5O0ekf9MGNDTEeMHsp1C4XvY9NfJQkxd80lvnafM,10296
|
|
4
|
+
openscvx/discretization.py,sha256=YF3mEeyYHgyTWQVNQsqpi1Mv72zDLyNfaMJSWqxj34c,4745
|
|
5
|
+
openscvx/dynamics.py,sha256=X9sPpxUGGbdsnvQzgyrb_939N9ctBSsWVyI1eXtOKpc,1118
|
|
6
|
+
openscvx/integrators.py,sha256=msIS-1Ehj-9TJLHfoCMs3vdyZ8NXz-TM0RII6aqRf4E,3821
|
|
7
|
+
openscvx/io.py,sha256=fOvNWQWAegcN1gejeToaNbXenP5H5bAifNU8edJvdk4,4127
|
|
8
|
+
openscvx/ocp.py,sha256=L_509EQiMsI6s5gBYlYyxKaHEzzRdpo-XAMjliCU3Rc,7544
|
|
9
|
+
openscvx/plotting.py,sha256=fCvWJV4qWMhVyJlh18s12S_5xhj6EviF-_FuP0tWjx4,31207
|
|
10
|
+
openscvx/post_processing.py,sha256=TP1gi4TVlDS2HHpdqaIPCqfM5o4w7a7RCMU3Pu3czHw,1024
|
|
11
|
+
openscvx/propagation.py,sha256=XNezQnAM-NXb9L7aHUgKQOBn0CNUPeGGDL3_BbGoODU,3758
|
|
12
|
+
openscvx/ptr.py,sha256=itDTR6RQUphnU226jaeRaAKuia-6v8U3MqAdw5-BYOk,5268
|
|
13
|
+
openscvx/trajoptproblem.py,sha256=3yufy-egU7m0NV834TH8csY1HJqM90Is7VYw0gQe3pk,11996
|
|
14
|
+
openscvx/utils.py,sha256=zmkKyto8Jowe_RAdOe8K0w6gzOu4JfxmX1RUL-3OFlY,2408
|
|
15
|
+
openscvx/augmentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
+
openscvx/augmentation/ctcs.py,sha256=m1jdALXSqHq3WD6lCBAUI7FR0Sfs8aCYr66h0EwE4z4,1707
|
|
17
|
+
openscvx/augmentation/dynamics_augmentation.py,sha256=7PL-mMfSmIIfMiXjdbXTolxOgUFSolzKpLu8WAmD384,4271
|
|
18
|
+
openscvx/constraints/__init__.py,sha256=OOUcYEVoDWOSY50s2TbjpDjl3dRR3U04gRxmOyjbddY,258
|
|
19
|
+
openscvx/constraints/boundary.py,sha256=yEhEnkKJ5f8NUeTksigEJjgBeE_YyuG_PJb_DWxg0L4,1541
|
|
20
|
+
openscvx/constraints/ctcs.py,sha256=V763033aV82nAu7y4653KsAs11A7RpUysR_oUcnLfko,2572
|
|
21
|
+
openscvx/constraints/nodal.py,sha256=YCS0cwUurA2OTQcHBb1EQqLxNt_w3MX8Nj8FH3GYClo,1726
|
|
22
|
+
openscvx/constraints/violation.py,sha256=aIdDhHd-UndT0XB2QeuwLBKSNSAUWVkha_GeHOw9cQg,2362
|
|
23
|
+
openscvx-0.1.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
24
|
+
openscvx-0.1.2.dist-info/METADATA,sha256=MDHeKrpE_3FKRiQD5fVKVzNBWerOvcY0vfapGSRTlbk,6911
|
|
25
|
+
openscvx-0.1.2.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
|
26
|
+
openscvx-0.1.2.dist-info/top_level.txt,sha256=nUT4Ybefzh40H8tVXqc1RzKESy_MAowElb-CIvAbd4Q,9
|
|
27
|
+
openscvx-0.1.2.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
openscvx
|
constraints/violation.py
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
from collections import defaultdict
|
|
2
|
-
|
|
3
|
-
import jax.numpy as jnp
|
|
4
|
-
|
|
5
|
-
def get_g_func(constraints_ctcs: list[callable, callable]):
|
|
6
|
-
def g_func(x: jnp.array, u: jnp.array, node: int) -> jnp.array:
|
|
7
|
-
g_sum = 0
|
|
8
|
-
for g in constraints_ctcs:
|
|
9
|
-
g_sum += g(x,u, node)
|
|
10
|
-
return g_sum
|
|
11
|
-
return g_func
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def get_g_funcs(constraints_ctcs: list[callable]) -> list[callable]:
|
|
15
|
-
# Bucket by idx
|
|
16
|
-
groups: dict[int, list[callable]] = defaultdict(list)
|
|
17
|
-
for c in constraints_ctcs:
|
|
18
|
-
if c.idx is None:
|
|
19
|
-
raise ValueError(f"CTCS constraint {c} has no .idx assigned")
|
|
20
|
-
groups[c.idx].append(c)
|
|
21
|
-
|
|
22
|
-
# Build and return a list of get_g_func(funcs) in idx order
|
|
23
|
-
return [
|
|
24
|
-
get_g_func(funcs)
|
|
25
|
-
for idx, funcs in sorted(groups.items(), key=lambda kv: kv[0])
|
|
26
|
-
]
|
openscvx-0.1.0.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
constraints/__init__.py,sha256=OOUcYEVoDWOSY50s2TbjpDjl3dRR3U04gRxmOyjbddY,258
|
|
2
|
-
constraints/boundary.py,sha256=yEhEnkKJ5f8NUeTksigEJjgBeE_YyuG_PJb_DWxg0L4,1541
|
|
3
|
-
constraints/ctcs.py,sha256=05epAuo_mNm1AieNB6FWatkv0wOT1ebD4FdngIROljY,1788
|
|
4
|
-
constraints/nodal.py,sha256=a3CRI7sYBNoOk2wZz9n7nyUuQUjzAGIjRmuHlgBSidk,1592
|
|
5
|
-
constraints/violation.py,sha256=wKLNhInHoXXannf2J_nLtvm3dWOMZrhJy3mJLG4CTX0,809
|
|
6
|
-
openscvx-0.1.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
7
|
-
openscvx-0.1.0.dist-info/METADATA,sha256=ZbXvwULoTxc2J-cEnIeLMSD9_Y8oF5apulorFcPW45o,5323
|
|
8
|
-
openscvx-0.1.0.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
|
9
|
-
openscvx-0.1.0.dist-info/top_level.txt,sha256=Ds3M1gQqAzOk7AV8lNXNhnWOw2RcoP7DfhXImFehbzI,12
|
|
10
|
-
openscvx-0.1.0.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
constraints
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|