Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
409 lines (379 loc) · 14.1 KB
/
Copy pathpyproject.toml
File metadata and controls
409 lines (379 loc) · 14.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
[project]
name = "crazyflow_experiments"
version = "0.1.0"
description = "Experiments to assess the Crazyflow simulator."
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.8,<3.14"
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
]
dependencies = [
"matplotlib",
]
[project.optional-dependencies]
racing = [
"lsy_drone_racing"
]
crazyflow = [
"crazyflow @ git+https://github.com/learnsyslab/crazyflow.git@d28ec70", # pinned to what is essentially 0.4
"numpy>=2.0.0,<3",
"jax[cuda]>=0.7.2,!=0.10.2", # 0.10.2 XLA:GPU miscompiles for larger swarms
"mujoco==3.3.7",
"fire>=0.7.1,<0.8",
"ml-collections",
"polars>=1.35.0,<2",
"array-api-compat",
"array-api-extra",
"toml>=0.10.2",
"imageio[ffmpeg]>=2.37.0",
"tqdm",
]
deploy = [
"drone-estimators",
"cflib @ git+https://github.com/bitcraze/crazyflie-lib-python.git@2df6f85",
"lark>=1.1.8", # to remove warning created by cfclient using old version of lark
]
mppi = ["dppy"]
rl = [
"flax",
"optax",
"gymnasium",
"jax[cuda]>=0.7.2",
]
# Gaussian splat rendering. Only the vision experiments need it, and splax rasterizes with CUDA
# kernels only, so it is kept out of the environments that have to run on CPU.
vision = [
"crazyflow[splats] @ git+https://github.com/learnsyslab/crazyflow.git@d28ec70", # pinned to what is essentially 0.4
"splax>=0.2.2",
"pycolmap==4.1.1", # must match the COLMAP build
"dm-pix", # used for structural splat loss
"wandb",
"opencv-python",
"imageio[ffmpeg]",
"pygame"
]
[tool.pixi.workspace]
channels = ["conda-forge", "https://prefix.dev/conda-forge"]
platforms = [
"linux-64",
"linux-aarch64",
{ name = "linux-64-cuda12", platform = "linux-64", cuda = "12" },
{ name = "linux-64-cuda121", platform = "linux-64", cuda = "12.1" },
]
[tool.pixi.dependencies]
python = "*"
setuptools = "*"
packaging = "<26" # For cflib
ruff = "*"
# Every environment runs the same suite, see [tool.pixi.tasks]. Left open because
# gym-pybullet-drones requires pytest>=9, and a global pin keeps every environment solvable.
pytest = ">=7.3"
polars = "<2" # The benchmark tests read results with it, so every environment must collect it
# No single environment can hold every feature, since aerial-gym pins Python 3.8 and vision builds
# for a different CUDA platform. The suite skips whatever the active environment cannot import, so
# `test` is meaningful everywhere and `test-all` fans the same suite out across all environments.
[tool.pixi.tasks]
# Must run before `pixi install`, since solving the aerial-gym environment needs the isaacgym path
setup-isaacgym = "tools/setup_isaacgym.sh"
test = "pytest"
test-all = { depends-on = [
{ task = "test", environment = "figure8" },
{ task = "test", environment = "learn2fly" },
{ task = "test", environment = "throw" },
{ task = "test", environment = "racing" },
{ task = "test", environment = "mppi" },
{ task = "test", environment = "sim2real" },
{ task = "test", environment = "crazyflow" },
{ task = "test", environment = "flightning" },
{ task = "test", environment = "l2f" },
{ task = "test", environment = "flightmare" },
{ task = "test", environment = "diff-aero" },
{ task = "test", environment = "pybullet" },
{ task = "test", environment = "vision" },
{ task = "test", environment = "aerial-gym" },
] }
[tool.pixi.pypi-options]
prerelease-mode = "allow" # Allow all pre-release versions
# cfclient pins PyQt6 below 6.8, but the Qt bundled with the wheels has to follow the minor version of
# qt6-main from ROS: the ROS setup puts the conda libraries on LD_LIBRARY_PATH, where they shadow the
# wheel's, and Qt's platform plugin only loads against libraries of its own minor version.
dependency-overrides = { pyqt6 = ">=6.9,<6.10", pyqt6-qt6 = ">=6.9,<6.10" }
[tool.pixi.target.linux.dependencies]
libgl-devel = "*"
# The pip CUDA wheels do not run on the Jetson GPU and the flight scripts only need JAX on the CPU
[tool.pixi.target.linux-aarch64.activation.env]
JAX_PLATFORMS = "cpu"
[tool.pixi.environments]
# CPU-only environments pin linux-64 so they are not solved for the CUDA platforms as well
default = { platforms = ["linux-64"] }
crazyflow = { features = ["crazyflow"], platforms = ["linux-64"] }
aerial-gym = { features = ["aerial-gym"] }
diff-aero = { features = ["diff-aero"] }
pybullet = { features = ["pybullet", "crazyflow"], platforms = ["linux-64"] }
sim2real = { features = ["kilted", "crazyflow", "deploy"], platforms = ["linux-64", "linux-aarch64"] }
sysid = { features = ["kilted", "crazyflow", "deploy", "sysid"], platforms = ["linux-64", "linux-aarch64"] }
racing = { features = ["kilted", "crazyflow", "deploy", "racing"], platforms = ["linux-64"] }
mppi = { features = ["kilted", "crazyflow", "deploy", "mppi"], platforms = ["linux-64"] }
# The RL experiments share one feature set, named after the experiment they run
figure8 = { features = ["kilted", "crazyflow", "deploy", "rl"]}
learn2fly = { features = ["kilted", "crazyflow", "deploy", "rl"]}
throw = { features = ["kilted", "crazyflow", "deploy", "rl"]}
vision = { features = ["kilted", "crazyflow", "deploy", "vision"] }
flightning = { features = ["flightning"] }
l2f = { features = ["l2f", "crazyflow"], platforms = ["linux-64"] }
flightmare = { features = ["flightmare", "crazyflow"], platforms = ["linux-64"] }
# Crazyflow feature
[tool.pixi.feature.crazyflow]
[tool.pixi.feature.crazyflow.dependencies]
python = "<3.14" # MuJoCo has no wheels for Python 3.14
h5py = ">=3.16.0,<4"
[tool.pixi.feature.crazyflow.pypi-dependencies]
crazyflow_experiments = { path = ".", editable = true }
# sysid feature
[tool.pixi.feature.sysid.dependencies]
pandas = ">=2.0" # lol_sysid.py reads the identification logs with it
pyulog = "*" # data_converter_px4.py reads the identification logs with it
[tool.pixi.feature.racing]
[tool.pixi.feature.racing.pypi-dependencies]
lsy_drone_racing = { git = "https://github.com/learnsyslab/lsy_drone_racing.git", rev = "54e64cf" , extras = ["deploy"]}
# Gaussian splat rendering feature
[tool.pixi.feature.vision]
platforms = ["linux-64-cuda12"] # splax rasterizes with CUDA kernels only
# Build dependencies for tools/build_colmap.sh, which compiles COLMAP with CASPAR
[tool.pixi.feature.vision.dependencies]
cmake = "*"
ninja = "*"
pkg-config = "*"
git = "*"
c-compiler = "*"
cxx-compiler = "*"
cuda-nvcc = ">=12.8,<13" # 12.8 is the first release that targets sm_120
cuda-cudart-dev = "*"
libcurand-dev = "*"
libboost-devel = "*"
eigen = "*"
eigen-abi-devel = "*"
ceres-solver = "*"
libopenblas = { version = "*", build = "openmp_*" } # Prevent OpenBLAS warnings
suitesparse = "*"
metis = "*"
glog = "*"
gflags = "*"
openimageio = "*"
glew = "*"
sqlite = "*"
[tool.pixi.feature.vision.tasks]
# Must run before the first reconstruction to build COLMAP with CASPAR
colmap-build = "tools/build_colmap.sh"
# aerial-gym feature
[tool.pixi.feature.aerial-gym]
platforms = ["linux-64-cuda121"]
[tool.pixi.feature.aerial-gym.dependencies]
python = "==3.8" # Aerial-gym only works with Python 3.8
pytorch = "==1.13.1"
torchvision = "==0.14.1"
numpy = "==1.23.0"
pytorch-gpu = "*"
fvcore = "*"
iopath = "*"
polars = ">=1.5.0,<2"
fire = ">=0.7.0,<0.8"
[tool.pixi.feature.aerial-gym.pypi-dependencies]
crazyflow_experiments = { path = ".", editable = true }
torchaudio = "*"
pytorch3d = "*"
warp-lang = "==1.0.0" # Required by aerial-gym
isaacgym = { path = "submodules/isaacgym/python", editable = true } # Fetched by tools/setup_isaacgym.sh
urdfpy = { git="https://github.com/mmatl/urdfpy", rev="5466842" }
aerial-gym = { path = "submodules/aerial_gym_simulator", editable = true }
[tool.pixi.feature.aerial-gym.activation.env]
LD_LIBRARY_PATH = "$PIXI_PROJECT_ROOT/.pixi/envs/aerial-gym/lib"
# diff-aero feature
[tool.pixi.feature.diff-aero]
platforms = ["linux-64-cuda121"]
[tool.pixi.feature.diff-aero.dependencies]
python = ">=3.10,<3.12" # Requires open3d, which only has wheels for Python up to 3.11
pytorch = ">=2.0"
polars = ">=1.35.1,<2"
torchvision = ">=0.24.0,<0.25"
omegaconf = ">=2.3.0,<3"
pytorch-gpu = "*"
pytorch3d = ">=0.7.9,<0.8"
tensordict = ">=0.11.0,<0.12"
hydra-core = ">=1.3.2,<2"
tensorboard = ">=2.20.0,<3"
line_profiler = ">=5.0.2,<6"
opencv = ">=4.13.0,<5"
imageio = ">=2.37.0,<3"
open3d = ">=0.19.0,<0.20"
onnxruntime = ">=1.24.2,<2"
einops = ">=0.8.2,<0.9"
fire = ">=0.7.1,<0.8"
[tool.pixi.feature.diff-aero.pypi-dependencies]
taichi = "==1.7.4"
crazyflow_experiments = { path = ".", editable = true }
# gym-pybullet-drones feature
[tool.pixi.feature.pybullet]
[tool.pixi.feature.pybullet.dependencies]
numpy = "*"
polars = ">=1.35.1,<2"
fire = ">=0.7.1,<0.8"
toml = "*"
tqdm = "*"
[tool.pixi.feature.pybullet.pypi-dependencies]
gym-pybullet-drones = { path = "submodules/gym-pybullet-drones", editable = true } # , rev = "310e45a"
crazyflow_experiments = { path = ".", editable = true }
[tool.pixi.feature.flightning]
platforms = ["linux-64-cuda121"]
[tool.pixi.feature.flightning.activation] # install scripts
scripts = ["tools/setup_flightning.sh"]
[tool.pixi.feature.flightning.dependencies]
python = ">=3.9"
polars = ">=1.35.0,<2"
fire = ">=0.7.1,<0.8"
tqdm = ">=4.67.3,<5"
[tool.pixi.feature.flightning.pypi-dependencies]
crazyflow_experiments = { path = ".", editable = true }
jax = { version = ">=0.8.1", extras = ["cuda12"] }
chex = "*"
jax-dataclasses = "*"
flax = ">=0.12.3"
flightning = { path = "submodules/rpg_flightning", editable = true }
# l2f feature
[tool.pixi.feature.l2f]
[tool.pixi.feature.l2f.dependencies]
python = ">=3.9"
polars = ">=1.35.0,<2"
fire = ">=0.7.1,<0.8"
numpy = "*"
gcc = "*" # for building the l2f extension
gxx = "*" # for building the l2f extension
[tool.pixi.feature.l2f.pypi-dependencies]
crazyflow_experiments = { path = ".", editable = true }
l2f = ">=2.0.18"
# Flightmare feature
[tool.pixi.feature.flightmare]
[tool.pixi.feature.flightmare.activation] # install scripts
scripts = ["tools/setup_flightmare.sh"]
[tool.pixi.feature.flightmare.dependencies]
# Flightmare toolchain is outdated. Pinned versions are necessary to avoid build or runtime errors
python = "==3.11" # the newest version pybind11 2.10 supports
# flightlib uses -Ofast, which allows NaN guards to be skipped. GCC 13 began doing so, which
# silently rejects every command and freezes the simulation, so GCC MUST be lower
gcc = "8.5.*" # closest available to original
gxx = "8.5.*"
cmake = "<4"
make = "*"
git = "*" # flightlib downloads googletest, pybind11, yaml-cpp and Eigen at configure time
libopencv = "4.*" # flightlib includes the OpenCV C API headers, dropped in OpenCV 5
zeromq = "*"
zmqpp = "*"
polars = ">=1.35.0,<2"
fire = ">=0.7.1,<0.8"
numpy = "*"
pyyaml = "*"
pyzmq = "*" # required to communicate with Unity. Flightmare does not expose render bindings
curl = "*" # Unity download
xz = "*" # Unity extraction
[tool.pixi.feature.flightmare.pypi-dependencies]
crazyflow_experiments = { path = ".", editable = true }
# ROS kilted feature
[tool.pixi.feature.kilted]
channels = ["https://prefix.dev/robostack-kilted"]
[tool.pixi.feature.kilted.activation] # install scripts
scripts = ["tools/setup_mocap.sh", "tools/setup_mavros_msgs.sh", "tools/setup_acados.sh"]
# acados neither builds nor generates code on aarch64 without extra work, so the companion computers
# of the PX4 vehicles do without it. They do build the motion capture tracking, which publishes the
# pose to the MAVROS running next to it.
[tool.pixi.feature.kilted.target.linux-aarch64.activation]
scripts = ["tools/setup_mocap.sh", "tools/setup_mavros_msgs.sh"]
[tool.pixi.feature.kilted.dependencies]
python = ">=3.10"
pip = "*"
uv = "*"
ros-kilted-desktop = "*"
ros-kilted-geographic-msgs = "*" # mavros_msgs, built by tools/setup_mavros_msgs.sh, needs it
ros2-distro-mutex = "0.12.*" # Pinned for motion_capture_tracking
cmake = "==3.26.0" # Pinned for motion_capture_tracking
make = "==4.4.1" # Pinned for motion_capture_tracking
compilers = ">=1.9.0, <1.11.0" # Pinned for motion_capture_tracking
libboost = "==1.86.0" # Pinned for motion_capture_tracking
colcon-common-extensions = "*"
rosdep = "*"
pkg-config = "*"
ninja = "*"
rosbags = ">=0.10.9,<0.11"
openblas = "*"
[tool.pixi.feature.kilted.pypi-dependencies]
drone-estimators = { path = "submodules/drone-estimators", editable = true }
cflib = "*"
# The Crazyflie GUI, for the lab machines. Its PyQt6 has no aarch64 wheels at the Qt version of ROS.
[tool.pixi.feature.kilted.target.linux-64.pypi-dependencies]
cfclient = ">2022"
# rl feature
[tool.pixi.feature.rl]
platforms = ["linux-64-cuda121"]
[tool.pixi.feature.rl.pypi-dependencies]
wandb = "*"
[tool.setuptools.packages.find]
include = ["crazyflow_experiments*"]
exclude = ["submodules*"]
[tool.pytest.ini_options]
testpaths = ["tests"]
# The ROS launch test plugins import every test module during collection to look for a launch
# description and abort the session on module skips. We use module skips for the test suite, so we
# have to disable the plugins
addopts = "-p no:launch_testing -p no:launch_ros"
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".git",
".git-rewrite",
".ipynb_checkpoints",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".venv",
".vscode",
"__pypackages__",
"_build",
"build",
"dist",
"site-packages",
"venv",
"docs/conf.py",
]
line-length = 100
indent-width = 4
target-version = "py311"
[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "I", "D", "TCH", "ANN"]
ignore = ["ANN401", "D106"]
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.per-file-ignores]
"benchmark/*" = ["D100", "D103"]
"experiments/benchmark/*" = ["D"]
"tests/*" = ["D100", "D103", "D104"]
"examples/*" = ["D100", "D103"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.flake8-annotations]
suppress-dummy-args = true
suppress-none-returning = true
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = true
line-ending = "auto"
docstring-code-format = true
docstring-code-line-length = "dynamic"
[dependency-groups]
flightning = ["jax-dataclasses>=1.6.3,<2"]