hyperdrone 0.1.8__tar.gz → 0.1.9__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.
Files changed (41) hide show
  1. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/PKG-INFO +6 -5
  2. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/README.md +4 -2
  3. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/__init__.py +1 -1
  4. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_environment.py +10 -8
  5. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_native/environment/environment.h +5 -2
  6. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/examples/__init__.py +1 -6
  7. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/examples/data.py +13 -5
  8. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/examples/drone_flythrough.py +1 -2
  9. hyperdrone-0.1.9/hyperdrone/examples/hyperdrone_videos/my_world_preview.h +17 -0
  10. hyperdrone-0.1.9/hyperdrone/examples/my_world.h +17 -0
  11. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/examples/shots.py +20 -20
  12. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/examples/spy.py +4 -3
  13. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/examples/visual_inertial_localization.py +4 -4
  14. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/pyproject.toml +2 -2
  15. hyperdrone-0.1.8/hyperdrone/examples/my_world.h +0 -17
  16. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/.gitignore +0 -0
  17. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_components.py +0 -0
  18. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_control.py +0 -0
  19. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_native/common/control.h +0 -0
  20. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_native/common/jit_host.h +0 -0
  21. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_native/common/models.h +0 -0
  22. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_native/dynamics/CMakeLists.txt +0 -0
  23. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_native/dynamics/host.cpp +0 -0
  24. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_native/dynamics/iface.h +0 -0
  25. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_native/dynamics/impl.cpp +0 -0
  26. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_native/environment/CMakeLists.txt +0 -0
  27. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_native/environment/environment.cpp +0 -0
  28. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_native/environment/impl.cpp +0 -0
  29. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_native/rotorcraft/CMakeLists.txt +0 -0
  30. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_native/rotorcraft/rotorcraft.cpp +0 -0
  31. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_parameters.py +0 -0
  32. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_rotorcraft.py +0 -0
  33. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/_spy.py +0 -0
  34. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/camera.py +0 -0
  35. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/dynamics/__init__.py +0 -0
  36. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/dynamics/_component.py +0 -0
  37. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/dynamics/_config.py +0 -0
  38. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/dynamics/_sim.py +0 -0
  39. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/env.py +0 -0
  40. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/examples/.gitignore +0 -0
  41. {hyperdrone-0.1.8 → hyperdrone-0.1.9}/hyperdrone/gym/__init__.py +0 -0
@@ -1,19 +1,18 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: hyperdrone
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: The fastest drone simulator: L2F multirotor dynamics and RL environments on the HyperLux raytracer.
5
5
  Author-email: Jonas Eschmann <jonas.eschmann@gmail.com>
6
6
  License: MIT
7
7
  Requires-Python: >=3.10
8
8
  Requires-Dist: conta>=0.0.1
9
- Requires-Dist: hyperlux==0.1.8
9
+ Requires-Dist: hyperlux==0.1.9
10
10
  Requires-Dist: nanobind>=2.0
11
11
  Requires-Dist: numpy
12
12
  Provides-Extra: examples
13
13
  Requires-Dist: imageio; extra == 'examples'
14
14
  Requires-Dist: imageio-ffmpeg; extra == 'examples'
15
15
  Requires-Dist: matplotlib; extra == 'examples'
16
- Requires-Dist: scipy>=1.15; extra == 'examples'
17
16
  Provides-Extra: gym
18
17
  Requires-Dist: gymnasium>=1.0; extra == 'gym'
19
18
  Description-Content-Type: text/markdown
@@ -247,14 +246,16 @@ Entity wrappers share their own pose writes in `prepare_entity_poses`: `render`
247
246
 
248
247
  The target-frame task requires one agent and one selected observation camera; auxiliary physical cameras remain available. It pre-renders a bank of episode setups (drone, scene placement, cameras, brightness and target perturbations), one per instance, in one pass. A reset refreshes this bank when its age reaches `TARGET_BANK_REFRESH_STEPS` simulation steps (a compile-time task constant, default 32) or the scene changes. Otherwise, resets adopt setups in turn and copy the selected camera's target frame without rendering; resets beyond the instance count within one refresh reuse setups. Each episode's drone and cameras come from its setup, so `set_instance_parameters` rejects drone and camera overrides for this task; a replayed spawn re-renders its target frame.
249
248
 
249
+ `Config` defaults to `fidelity="veryhigh"` and `anti_aliasing_grid=2` (2×2 AA); fidelity accepts `low`, `medium`, `high`, and `veryhigh`, and AA grids are 1 (disabled), 2, 3, or 4. Custom spec headers select `SHADING`, `ENABLE_ANTI_ALIASING`, and `ANTI_ALIASING_GRID_SIZE` directly.
250
+
250
251
  `Config(motion_blur_samples=8)` enables camera and propeller motion blur for presets and tasks; valid counts are 1 (default, disabled), 2, 4, 8, 16, and 32. Custom spec headers control `ENABLE_MOTION_BLUR` and `MOTION_BLUR_SAMPLES` directly.
251
252
 
252
253
  For repeatable shots, capture `points = env.spawn_points()` after a reset and save the returned dictionaries, then use `env.reset(mask, spawn_points=points)` with one entry per selected instance (a host mask). Each entry pins the active scene by content hash (the bare hash as recorded, or the constructor's reference form, `conta:HASH` or a store manifest entry), one drone-table index per agent in `"drone"`, scene translation/yaw, per-agent pose (`xyz, wxyz`), and shutter fraction. The reset uses constructor-supplied drone dynamics and camera mounts; velocity/motor initialization and task-specific randomization still follow their configured ranges. Scene changes remain explicit through `rotate_scene()`, which requires resetting every instance before further use; a shot for a different active scene is rejected.
253
254
 
254
255
  Manual composition of `Sim` and `HyperLux` (no MDP — rendering research, data
255
256
  generation) remains first-class: see `python -m hyperdrone.examples.drone_flythrough`
256
- for the wiring. `ClearanceSampler` lives in `hyperlux` — it rides the
257
- renderer's collision probes and is deterministic given a seed.
257
+ for the wiring. `hyperlux.FreeSpace` provides spawn positions from the same
258
+ free-space annotation table the environment uses, deterministic given a seed.
258
259
 
259
260
  ### Native spy
260
261
 
@@ -227,14 +227,16 @@ Entity wrappers share their own pose writes in `prepare_entity_poses`: `render`
227
227
 
228
228
  The target-frame task requires one agent and one selected observation camera; auxiliary physical cameras remain available. It pre-renders a bank of episode setups (drone, scene placement, cameras, brightness and target perturbations), one per instance, in one pass. A reset refreshes this bank when its age reaches `TARGET_BANK_REFRESH_STEPS` simulation steps (a compile-time task constant, default 32) or the scene changes. Otherwise, resets adopt setups in turn and copy the selected camera's target frame without rendering; resets beyond the instance count within one refresh reuse setups. Each episode's drone and cameras come from its setup, so `set_instance_parameters` rejects drone and camera overrides for this task; a replayed spawn re-renders its target frame.
229
229
 
230
+ `Config` defaults to `fidelity="veryhigh"` and `anti_aliasing_grid=2` (2×2 AA); fidelity accepts `low`, `medium`, `high`, and `veryhigh`, and AA grids are 1 (disabled), 2, 3, or 4. Custom spec headers select `SHADING`, `ENABLE_ANTI_ALIASING`, and `ANTI_ALIASING_GRID_SIZE` directly.
231
+
230
232
  `Config(motion_blur_samples=8)` enables camera and propeller motion blur for presets and tasks; valid counts are 1 (default, disabled), 2, 4, 8, 16, and 32. Custom spec headers control `ENABLE_MOTION_BLUR` and `MOTION_BLUR_SAMPLES` directly.
231
233
 
232
234
  For repeatable shots, capture `points = env.spawn_points()` after a reset and save the returned dictionaries, then use `env.reset(mask, spawn_points=points)` with one entry per selected instance (a host mask). Each entry pins the active scene by content hash (the bare hash as recorded, or the constructor's reference form, `conta:HASH` or a store manifest entry), one drone-table index per agent in `"drone"`, scene translation/yaw, per-agent pose (`xyz, wxyz`), and shutter fraction. The reset uses constructor-supplied drone dynamics and camera mounts; velocity/motor initialization and task-specific randomization still follow their configured ranges. Scene changes remain explicit through `rotate_scene()`, which requires resetting every instance before further use; a shot for a different active scene is rejected.
233
235
 
234
236
  Manual composition of `Sim` and `HyperLux` (no MDP — rendering research, data
235
237
  generation) remains first-class: see `python -m hyperdrone.examples.drone_flythrough`
236
- for the wiring. `ClearanceSampler` lives in `hyperlux` — it rides the
237
- renderer's collision probes and is deterministic given a seed.
238
+ for the wiring. `hyperlux.FreeSpace` provides spawn positions from the same
239
+ free-space annotation table the environment uses, deterministic given a seed.
238
240
 
239
241
  ### Native spy
240
242
 
@@ -14,7 +14,7 @@ import hyperlux
14
14
 
15
15
  __all__ = ["Config", "HyperDrone", "ImageObservation", "Rotorcraft", "articulate"]
16
16
 
17
- __version__ = "0.1.8"
17
+ __version__ = "0.1.9"
18
18
 
19
19
  if hyperlux.__version__ != __version__.split(".post")[0]:
20
20
  raise ImportError(f"hyperdrone {__version__} requires hyperlux {__version__.split('.post')[0]}, found hyperlux {hyperlux.__version__}: install the matching hyperlux release")
@@ -13,7 +13,8 @@ import numpy as np
13
13
 
14
14
  import conta
15
15
 
16
- from hyperlux import _jit as jit
16
+ from hyperlux import FIDELITY, _jit as jit
17
+ from hyperlux._config import VALID_ANTI_ALIASING_GRIDS
17
18
  from hyperlux._dlpack import is_cuda
18
19
  from hyperlux._outputs import VALID_MOTION_BLUR_SAMPLES
19
20
  from hyperlux.camera import CameraSpec, RGB, backend_requirement, validate_cameras
@@ -40,16 +41,13 @@ def component():
40
41
  return _components.component("environment", resolved.lower(), needs_cuda=resolved == "optix")
41
42
 
42
43
 
43
- _SHADING = {"low": 0, "medium": 1, "high": 2}
44
-
45
-
46
44
  @dataclass(frozen=True, kw_only=True)
47
45
  class Config:
48
46
  num_worlds: int = 1
49
47
  instances_per_world: int = 4
50
48
  width: int = 32
51
49
  height: int = 32
52
- fidelity: str = "high"
50
+ fidelity: str = "veryhigh"
53
51
  preset: str = "crazyflie"
54
52
  task: str = None
55
53
  num_agents: int = 1
@@ -59,6 +57,7 @@ class Config:
59
57
  spec_header: str = None
60
58
  device: str = None
61
59
  motion_blur_samples: int = 1
60
+ anti_aliasing_grid: int = 2
62
61
  dataset: str = "glb"
63
62
  control: str = "motor"
64
63
  actuation: str = "rotors"
@@ -78,10 +77,12 @@ class Config:
78
77
  raise ValueError(f"hyperdrone: unknown preset {self.preset!r} (one of {sorted(PRESETS)})")
79
78
  if self.task not in TASKS:
80
79
  raise ValueError(f"hyperdrone: unknown task {self.task!r} (one of {sorted(k for k in TASKS if k)} or None)")
81
- if self.fidelity not in _SHADING:
82
- raise ValueError(f"hyperdrone: unknown fidelity {self.fidelity!r} (one of {sorted(_SHADING)})")
80
+ if self.fidelity not in FIDELITY:
81
+ raise ValueError(f"hyperdrone: unknown fidelity {self.fidelity!r} (one of {sorted(FIDELITY)})")
83
82
  if type(self.motion_blur_samples) is not int or self.motion_blur_samples not in VALID_MOTION_BLUR_SAMPLES:
84
83
  raise ValueError(f"hyperdrone: motion_blur_samples must be one of {VALID_MOTION_BLUR_SAMPLES}")
84
+ if type(self.anti_aliasing_grid) is not int or self.anti_aliasing_grid not in VALID_ANTI_ALIASING_GRIDS:
85
+ raise ValueError(f"hyperdrone: anti_aliasing_grid must be one of {VALID_ANTI_ALIASING_GRIDS}")
85
86
  if self.task is not None and self.num_agents > 1:
86
87
  raise ValueError(f"hyperdrone: task {self.task!r} is single-agent")
87
88
  if self.task == "target_frame" and len(observation_mounts) != 1:
@@ -132,8 +133,9 @@ class Config:
132
133
  "HYPERDRONE_ENVIRONMENT_INSTANCES": self.instances_per_world,
133
134
  "HYPERDRONE_ENVIRONMENT_CAM_WIDTH": self.width,
134
135
  "HYPERDRONE_ENVIRONMENT_CAM_HEIGHT": self.height,
135
- "HYPERDRONE_ENVIRONMENT_SHADING": _SHADING[self.fidelity],
136
+ "HYPERDRONE_ENVIRONMENT_SHADING": FIDELITY.index(self.fidelity),
136
137
  "HYPERDRONE_ENVIRONMENT_MB_SAMPLES": self.motion_blur_samples,
138
+ "HYPERDRONE_ENVIRONMENT_AA_GRID": self.anti_aliasing_grid,
137
139
  "HYPERDRONE_ENVIRONMENT_PRESET": PRESETS[self.preset],
138
140
  "HYPERDRONE_ENVIRONMENT_TASK": TASKS[self.task],
139
141
  "HYPERDRONE_ENVIRONMENT_CONTROL": CONTROLS.index(self.control),
@@ -39,7 +39,7 @@
39
39
  #include "device_leases.h"
40
40
  #endif
41
41
 
42
- #if !defined(HYPERDRONE_ENVIRONMENT_NUM_WORLDS) || !defined(HYPERDRONE_ENVIRONMENT_INSTANCES) || !defined(HYPERDRONE_ENVIRONMENT_CAM_WIDTH) || !defined(HYPERDRONE_ENVIRONMENT_CAM_HEIGHT) || !defined(HYPERDRONE_ENVIRONMENT_SHADING) || !defined(HYPERDRONE_ENVIRONMENT_MB_SAMPLES) || !defined(HYPERDRONE_ENVIRONMENT_PRESET) || !defined(HYPERDRONE_ENVIRONMENT_TASK) || !defined(HYPERDRONE_ENVIRONMENT_N_AGENTS) || !defined(HYPERDRONE_ENVIRONMENT_N_CAMERA_AGENTS) || !defined(HYPERLUX_CAMERA_CONFIG_HEADER) || !defined(HYPERDRONE_ENVIRONMENT_DEVICE_CUDA) || !defined(HYPERDRONE_ENVIRONMENT_CONTROL) || !defined(HYPERDRONE_ENVIRONMENT_ACTUATION)
42
+ #if !defined(HYPERDRONE_ENVIRONMENT_NUM_WORLDS) || !defined(HYPERDRONE_ENVIRONMENT_INSTANCES) || !defined(HYPERDRONE_ENVIRONMENT_CAM_WIDTH) || !defined(HYPERDRONE_ENVIRONMENT_CAM_HEIGHT) || !defined(HYPERDRONE_ENVIRONMENT_SHADING) || !defined(HYPERDRONE_ENVIRONMENT_MB_SAMPLES) || !defined(HYPERDRONE_ENVIRONMENT_AA_GRID) || !defined(HYPERDRONE_ENVIRONMENT_PRESET) || !defined(HYPERDRONE_ENVIRONMENT_TASK) || !defined(HYPERDRONE_ENVIRONMENT_N_AGENTS) || !defined(HYPERDRONE_ENVIRONMENT_N_CAMERA_AGENTS) || !defined(HYPERLUX_CAMERA_CONFIG_HEADER) || !defined(HYPERDRONE_ENVIRONMENT_DEVICE_CUDA) || !defined(HYPERDRONE_ENVIRONMENT_CONTROL) || !defined(HYPERDRONE_ENVIRONMENT_ACTUATION)
43
43
  #error "every HYPERDRONE_ENVIRONMENT_* configuration define must be set (hyperdrone.Config.defines())"
44
44
  #endif
45
45
  #if HYPERDRONE_ENVIRONMENT_DEVICE_CUDA && !defined(HYPERDRONE_ENVIRONMENT_CUDA)
@@ -130,10 +130,13 @@ namespace HYPERLUX_MODULE_NAME {
130
130
  static constexpr TI CAM_HEIGHT = HYPERDRONE_ENVIRONMENT_CAM_HEIGHT;
131
131
  static constexpr bool ENABLE_MOTION_BLUR = HYPERDRONE_ENVIRONMENT_MB_SAMPLES > 1;
132
132
  static constexpr TI MOTION_BLUR_SAMPLES = HYPERDRONE_ENVIRONMENT_MB_SAMPLES;
133
+ static constexpr bool ENABLE_ANTI_ALIASING = HYPERDRONE_ENVIRONMENT_AA_GRID > 1;
134
+ static constexpr TI ANTI_ALIASING_GRID_SIZE = HYPERDRONE_ENVIRONMENT_AA_GRID;
133
135
  static constexpr TI MAX_DRONES = 8;
134
136
  using SHADING = rlt::utils::typing::conditional_t<HYPERDRONE_ENVIRONMENT_SHADING == 0, rlt::hyperlux::Low,
135
137
  rlt::utils::typing::conditional_t<HYPERDRONE_ENVIRONMENT_SHADING == 1, rlt::hyperlux::Medium,
136
- rlt::hyperlux::High>>;
138
+ rlt::utils::typing::conditional_t<HYPERDRONE_ENVIRONMENT_SHADING == 2, rlt::hyperlux::High,
139
+ rlt::hyperlux::VeryHigh>>>;
137
140
  };
138
141
  using BASE_WORLD = rlt::rl::environments::hyperdrone::World<WORLD_SPEC>;
139
142
  #if HYPERDRONE_ENVIRONMENT_TASK == 0
@@ -3,12 +3,7 @@
3
3
  Invoke a module with ``python -m hyperdrone.examples.<name>``.
4
4
  """
5
5
 
6
- __all__ = ["procthor_scene_path", "rigged_model_path"]
7
-
8
-
9
- def procthor_scene_path():
10
- from .data import procthor_scene_path as resolve
11
- return resolve()
6
+ __all__ = ["rigged_model_path"]
12
7
 
13
8
 
14
9
  def rigged_model_path(name):
@@ -1,9 +1,11 @@
1
- """Shared data resolution and download helpers for runnable examples."""
1
+ """Rigged drone assets for runnable examples."""
2
+
3
+ import os
4
+ from pathlib import Path
2
5
 
3
6
  import conta
4
- from hyperlux.examples.data import PROCTHOR_SCENE, override_path, procthor_scene_path
5
7
 
6
- __all__ = ["PROCTHOR_SCENE", "RIGGED_MODELS", "procthor_scene_path", "rigged_model_path"]
8
+ __all__ = ["RIGGED_MODELS", "rigged_model_path"]
7
9
 
8
10
  # body/prop_* assemblies, each a drone table asset (hyperdrone.HyperDrone(drones=...))
9
11
  RIGGED_MODELS = {
@@ -23,5 +25,11 @@ def rigged_model_path(name):
23
25
  """
24
26
  if name not in RIGGED_MODELS:
25
27
  raise KeyError(f"hyperdrone: unknown rigged model {name!r} (one of {sorted(RIGGED_MODELS)})")
26
- override = override_path(f"HYPERDRONE_{name.upper()}_PATH")
27
- return override if override is not None else conta.resolve(RIGGED_MODELS[name])
28
+ override_variable = f"HYPERDRONE_{name.upper()}_PATH"
29
+ override = os.environ.get(override_variable)
30
+ if override:
31
+ path = Path(override).expanduser().resolve()
32
+ if not path.is_file():
33
+ raise FileNotFoundError(f"hyperdrone: {override_variable} does not exist: {path}")
34
+ return path
35
+ return conta.resolve(RIGGED_MODELS[name])
@@ -92,8 +92,7 @@ def world_step(actions):
92
92
  print(f"backend={renderer.backend} dynamics={sim.device} drones={arguments.drones} "
93
93
  f"device_handoff={'yes' if device_handoff else 'no (host cameras)'}")
94
94
 
95
- sampler = hyperlux.ClearanceSampler(scene, clearance=0.5)
96
- positions = sampler.sample(arguments.drones, seed=0)
95
+ positions = hyperlux.FreeSpace(scene).sample(arguments.drones, seed=0)
97
96
  sim.reset()
98
97
  sim.state["position"] = positions
99
98
  update_cameras()
@@ -0,0 +1,17 @@
1
+ #pragma once
2
+ #include <rl_tools/rl/environments/hyperdrone/presets.h>
3
+ #include <cstddef>
4
+
5
+ namespace hyperdrone_user {
6
+ struct SPEC: rl_tools::rl::environments::hyperdrone::presets::X500FPV<float, std::size_t> {
7
+ static constexpr std::size_t INSTANCES_PER_ENVIRONMENT = 1;
8
+ static constexpr std::size_t CAM_WIDTH = 1920;
9
+ static constexpr std::size_t CAM_HEIGHT = 1080;
10
+ using SHADING = rl_tools::rendering::raytracing::High;
11
+ static constexpr bool ENABLE_MOTION_BLUR = true;
12
+ static constexpr std::size_t MOTION_BLUR_SAMPLES = 2;
13
+ static constexpr bool ENABLE_ANTI_ALIASING = true;
14
+ static constexpr std::size_t ANTI_ALIASING_GRID_SIZE = 1;
15
+ };
16
+ using WORLD = rl_tools::rl::environments::hyperdrone::World<SPEC>;
17
+ }
@@ -0,0 +1,17 @@
1
+ #pragma once
2
+ #include <rl_tools/rl/environments/hyperdrone/presets.h>
3
+ #include <cstddef>
4
+
5
+ namespace hyperdrone_user {
6
+ struct SPEC: rl_tools::rl::environments::hyperdrone::presets::X500FPV<float, std::size_t> {
7
+ static constexpr std::size_t INSTANCES_PER_ENVIRONMENT = 1;
8
+ static constexpr std::size_t CAM_WIDTH = 1920;
9
+ static constexpr std::size_t CAM_HEIGHT = 1080;
10
+ using SHADING = rl_tools::rendering::raytracing::High;
11
+ static constexpr bool ENABLE_MOTION_BLUR = true;
12
+ static constexpr std::size_t MOTION_BLUR_SAMPLES = 8;
13
+ static constexpr bool ENABLE_ANTI_ALIASING = true;
14
+ static constexpr std::size_t ANTI_ALIASING_GRID_SIZE = 2;
15
+ };
16
+ using WORLD = rl_tools::rl::environments::hyperdrone::World<SPEC>;
17
+ }
@@ -2,13 +2,13 @@
2
2
 
3
3
  HYPERDRONE_SHOTS = {
4
4
  "flight": [
5
- {"scene": "75d1d67a17ecd16bc3a214baa895240da8060df7", "drone": [0],
5
+ {"scene": "07b9d8e44f3891573b6292f8cc47bf7725a43b89", "drone": [0],
6
6
  "scene_translation": [-13.922904968261719, -15.025325775146484, 1.3523533344268799], "scene_yaw": [0.4156714379787445, -0.909514844417572],
7
7
  "poses": [[0.02483123540878296, 0.2238653004169464, -0.03233879804611206, 0.999871551990509, -0.015748994424939156, 0.0015137703157961369, 0.002552392892539501]],
8
8
  "shutter_fraction": 0.26944467425346375},
9
9
  ],
10
10
  "models": [
11
- {"scene": "75d1d67a17ecd16bc3a214baa895240da8060df7", "drone": [0, 0, 1, 2, 3, 4, 5],
11
+ {"scene": "07b9d8e44f3891573b6292f8cc47bf7725a43b89", "drone": [0, 0, 1, 2, 3, 4, 5],
12
12
  "scene_translation": [-3.92, -5.67, 1.15], "scene_yaw": [1.0, 0.0],
13
13
  "poses": [[-3.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0],
14
14
  [0.9, 1.15, 0.0, 1.0, 0.0, 0.0, 0.0],
@@ -22,37 +22,37 @@ HYPERDRONE_SHOTS = {
22
22
  "python_task": [
23
23
  [
24
24
  [
25
- {"scene": "75d1d67a17ecd16bc3a214baa895240da8060df7", "drone": [0],
25
+ {"scene": "07b9d8e44f3891573b6292f8cc47bf7725a43b89", "drone": [0],
26
26
  "scene_translation": [-9.681112289428711, -13.087503433227539, 1.1176472902297974], "scene_yaw": [0.6632893085479736, 0.7483630776405334],
27
27
  "poses": [[-0.00762544572353363, -0.03981609642505646, -0.08973178267478943, 0.9999476671218872, -0.0035761925391852856, 0.006472778040915728, 0.007071986794471741]],
28
28
  "shutter_fraction": 0.26944467425346375},
29
- {"scene": "75d1d67a17ecd16bc3a214baa895240da8060df7", "drone": [0],
29
+ {"scene": "07b9d8e44f3891573b6292f8cc47bf7725a43b89", "drone": [0],
30
30
  "scene_translation": [-1.8501107692718506, -12.506155967712402, 1.0338236093521118], "scene_yaw": [-0.9994587302207947, -0.03289758414030075],
31
31
  "poses": [[0.03288257122039795, -0.13699400424957275, -0.1390824168920517, 0.9999393224716187, 0.007283095736056566, 0.005793328862637281, -0.005892877001315355]],
32
32
  "shutter_fraction": 0.32239818572998047},
33
- {"scene": "75d1d67a17ecd16bc3a214baa895240da8060df7", "drone": [0],
33
+ {"scene": "07b9d8e44f3891573b6292f8cc47bf7725a43b89", "drone": [0],
34
34
  "scene_translation": [-14.249197006225586, -13.475068092346191, 1.4864710569381714], "scene_yaw": [0.017734983935952187, 0.9998427033424377],
35
35
  "poses": [[-0.016078755259513855, 0.01780208945274353, -0.11291337013244629, 0.9996297955513, 0.02092280052602291, -0.0062583512626588345, -0.016226304695010185]],
36
36
  "shutter_fraction": 0.5706594586372375},
37
- {"scene": "75d1d67a17ecd16bc3a214baa895240da8060df7", "drone": [0],
37
+ {"scene": "07b9d8e44f3891573b6292f8cc47bf7725a43b89", "drone": [0],
38
38
  "scene_translation": [-12.073918342590332, -1.8481298685073853, 1.598235845565796], "scene_yaw": [0.2934693396091461, -0.9559684991836548],
39
39
  "poses": [[0.008715391159057617, 0.0020002126693725586, 0.1922357976436615, 0.9999156594276428, -0.005756211932748556, 0.01155786495655775, -0.0013930725399404764]],
40
40
  "shutter_fraction": 0.28425922989845276},
41
41
  ],
42
42
  [
43
- {"scene": "75d1d67a17ecd16bc3a214baa895240da8060df7", "drone": [0],
43
+ {"scene": "07b9d8e44f3891573b6292f8cc47bf7725a43b89", "drone": [0],
44
44
  "scene_translation": [-4.677972316741943, -7.4678168296813965, 1.1567648649215698], "scene_yaw": [-0.2356981486082077, 0.9718263149261475],
45
45
  "poses": [[0.006789058446884155, 0.043398499488830566, -0.15778006613254547, 0.9999164938926697, -0.0020048420410603285, -0.010422294028103352, -0.007375652901828289]],
46
46
  "shutter_fraction": 0.9607979655265808},
47
- {"scene": "75d1d67a17ecd16bc3a214baa895240da8060df7", "drone": [0],
47
+ {"scene": "07b9d8e44f3891573b6292f8cc47bf7725a43b89", "drone": [0],
48
48
  "scene_translation": [-12.073918342590332, -1.8481298685073853, 1.598235845565796], "scene_yaw": [-0.3988626301288605, 0.9170106649398804],
49
49
  "poses": [[-0.0565536767244339, 0.056514859199523926, 0.14681872725486755, 0.9999821782112122, 0.005887492559850216, -0.00033877594978548586, -0.0009559224126860499]],
50
50
  "shutter_fraction": 0.6207172870635986},
51
- {"scene": "75d1d67a17ecd16bc3a214baa895240da8060df7", "drone": [0],
51
+ {"scene": "07b9d8e44f3891573b6292f8cc47bf7725a43b89", "drone": [0],
52
52
  "scene_translation": [-12.508974075317383, -6.498904705047607, 1.2405885457992554], "scene_yaw": [-0.4420495629310608, 0.8969905972480774],
53
53
  "poses": [[-0.21642781794071198, 0.1941518783569336, 0.24692600965499878, 0.9996837377548218, 0.007925396785140038, -0.00306935072876513, -0.02366827242076397]],
54
54
  "shutter_fraction": 0.5152565240859985},
55
- {"scene": "75d1d67a17ecd16bc3a214baa895240da8060df7", "drone": [0],
55
+ {"scene": "07b9d8e44f3891573b6292f8cc47bf7725a43b89", "drone": [0],
56
56
  "scene_translation": [-3.807861328125, -11.731026649475098, 1.1008825302124023], "scene_yaw": [-0.6806778311729431, -0.7325828671455383],
57
57
  "poses": [[-0.11530560255050659, -0.06898629665374756, 0.04134243726730347, 0.9998350143432617, 0.004136775620281696, -0.00396867236122489, 0.017237015068531036]],
58
58
  "shutter_fraction": 0.7834129333496094},
@@ -60,45 +60,45 @@ HYPERDRONE_SHOTS = {
60
60
  ],
61
61
  [
62
62
  [
63
- {"scene": "28d17959b463626d64257f0d9ea8e47daae68409", "drone": [0],
63
+ {"scene": "3ee4771c22b54fa7bb57022ac2eb5a015f387b4d", "drone": [0],
64
64
  "scene_translation": [-4.6484375, -2.122901201248169, 2.764207124710083], "scene_yaw": [0.17507365345954895, -0.9845553636550903],
65
65
  "poses": [[0.07350710034370422, 0.11919987201690674, 0.22892284393310547, 0.999942421913147, -0.00468216510489583, -0.0071291266940534115, -0.006513042841106653]],
66
66
  "shutter_fraction": 0.3345821499824524},
67
- {"scene": "28d17959b463626d64257f0d9ea8e47daae68409", "drone": [0],
67
+ {"scene": "3ee4771c22b54fa7bb57022ac2eb5a015f387b4d", "drone": [0],
68
68
  "scene_translation": [-4.507343769073486, -1.857880711555481, 1.7516262531280518], "scene_yaw": [0.02631618268787861, 0.999653697013855],
69
69
  "poses": [[0.20885935425758362, 0.05422109365463257, -0.22999438643455505, 0.9995139837265015, 0.012717027217149734, -0.024481365457177162, -0.01451560016721487]],
70
70
  "shutter_fraction": 0.9354366064071655},
71
- {"scene": "28d17959b463626d64257f0d9ea8e47daae68409", "drone": [0],
71
+ {"scene": "3ee4771c22b54fa7bb57022ac2eb5a015f387b4d", "drone": [0],
72
72
  "scene_translation": [-2.814218759536743, -1.476913571357727, 2.0680577754974365], "scene_yaw": [-0.051781363785266876, -0.9986584186553955],
73
73
  "poses": [[0.18485429883003235, 0.1725565493106842, -0.11228106915950775, 0.9999970197677612, 0.0017171987565234303, -0.00012418960977811366, 0.0017337874742224813]],
74
74
  "shutter_fraction": 0.46420279145240784},
75
- {"scene": "28d17959b463626d64257f0d9ea8e47daae68409", "drone": [0],
75
+ {"scene": "3ee4771c22b54fa7bb57022ac2eb5a015f387b4d", "drone": [0],
76
76
  "scene_translation": [-3.237499952316284, -1.8744444847106934, 1.0554769039154053], "scene_yaw": [-0.9471279978752136, 0.3208560049533844],
77
77
  "poses": [[-0.24050743877887726, 0.08421352505683899, -0.024986639618873596, 0.9990403652191162, 0.0048219277523458, 0.014237398281693459, 0.04113909602165222]],
78
78
  "shutter_fraction": 0.29924774169921875},
79
- {"scene": "28d17959b463626d64257f0d9ea8e47daae68409", "drone": [0],
79
+ {"scene": "3ee4771c22b54fa7bb57022ac2eb5a015f387b4d", "drone": [0],
80
80
  "scene_translation": [-3.801875114440918, -1.2781480550765991, 2.3212027549743652], "scene_yaw": [0.998591423034668, 0.0530577190220356],
81
81
  "poses": [[-0.12841659784317017, -0.08406314253807068, 0.09001362323760986, 0.9993000030517578, -0.03474640101194382, 0.004066430032253265, -0.013253585435450077]],
82
82
  "shutter_fraction": 0.8328272700309753},
83
83
  ],
84
84
  [
85
- {"scene": "28d17959b463626d64257f0d9ea8e47daae68409", "drone": [0],
85
+ {"scene": "3ee4771c22b54fa7bb57022ac2eb5a015f387b4d", "drone": [0],
86
86
  "scene_translation": [-5.212812423706055, -1.5266048908233643, 0.9921906590461731], "scene_yaw": [-0.941856861114502, -0.3360143303871155],
87
87
  "poses": [[-0.1830228865146637, -0.011578291654586792, 0.18445831537246704, 0.99955153465271, -0.022850843146443367, 0.012350345030426979, -0.01489906758069992]],
88
88
  "shutter_fraction": 0.9718446731567383},
89
- {"scene": "28d17959b463626d64257f0d9ea8e47daae68409", "drone": [0],
89
+ {"scene": "3ee4771c22b54fa7bb57022ac2eb5a015f387b4d", "drone": [0],
90
90
  "scene_translation": [-1.7324998378753662, -2.7688889503479004, 2.110248565673828], "scene_yaw": [0.2168676257133484, -0.9762009978294373],
91
91
  "poses": [[-0.1566864252090454, -0.018128693103790283, -0.1947084218263626, 0.9999434351921082, 0.00568796694278717, -0.007596616167575121, 0.00480719143524766]],
92
92
  "shutter_fraction": 0.9832250475883484},
93
- {"scene": "28d17959b463626d64257f0d9ea8e47daae68409", "drone": [0],
93
+ {"scene": "3ee4771c22b54fa7bb57022ac2eb5a015f387b4d", "drone": [0],
94
94
  "scene_translation": [-1.121093511581421, -1.7088066339492798, 1.4351948499679565], "scene_yaw": [0.8465277552604675, -0.5323445796966553],
95
95
  "poses": [[0.07651025056838989, 0.06163617968559265, 0.14944276213645935, 0.9991743564605713, -0.0031939048785716295, 0.013771872036159039, 0.03808886557817459]],
96
96
  "shutter_fraction": 0.26978811621665955},
97
- {"scene": "28d17959b463626d64257f0d9ea8e47daae68409", "drone": [0],
97
+ {"scene": "3ee4771c22b54fa7bb57022ac2eb5a015f387b4d", "drone": [0],
98
98
  "scene_translation": [-4.930624961853027, -1.1290737390518188, 1.498481035232544], "scene_yaw": [0.9980378150939941, 0.06261434406042099],
99
99
  "poses": [[-0.14647507667541504, 0.1865636706352234, -0.037316352128982544, 0.9993084073066711, -0.03679252415895462, 0.0034653746988624334, 0.004121959209442139]],
100
100
  "shutter_fraction": 0.518680214881897},
101
- {"scene": "28d17959b463626d64257f0d9ea8e47daae68409", "drone": [0],
101
+ {"scene": "3ee4771c22b54fa7bb57022ac2eb5a015f387b4d", "drone": [0],
102
102
  "scene_translation": [-2.2498435974121094, -2.305102825164795, 2.700920820236206], "scene_yaw": [0.12369344383478165, -0.9923204779624939],
103
103
  "poses": [[-0.23739929497241974, 0.16372668743133545, 0.2202252447605133, 0.999843180179596, -0.010392934083938599, -0.0026474292390048504, 0.014090439304709435]],
104
104
  "shutter_fraction": 0.8863464593887329},
@@ -5,8 +5,9 @@ import time
5
5
 
6
6
  import numpy as np
7
7
 
8
+ import hyperlux
8
9
  from hyperdrone import Config, HyperDrone
9
- from hyperdrone.examples.data import RIGGED_MODELS, procthor_scene_path
10
+ from hyperdrone.examples.data import RIGGED_MODELS
10
11
 
11
12
 
12
13
  def position_targets(env):
@@ -18,13 +19,13 @@ def position_targets(env):
18
19
 
19
20
  def main():
20
21
  parser = argparse.ArgumentParser(description=__doc__)
21
- parser.add_argument("scene", nargs="?", type=Path, help="local GLB (default: cached/downloaded ProcTHOR scene)")
22
+ parser.add_argument("scene", nargs="?", type=Path, help="local GLB (default: ProcTHOR-Train-1 from Train200)")
22
23
  arguments = parser.parse_args()
23
24
  if arguments.scene is not None and not arguments.scene.is_file():
24
25
  parser.error("scene must be an existing local GLB file")
25
26
 
26
27
  env = HyperDrone(
27
- arguments.scene or procthor_scene_path(),
28
+ arguments.scene or hyperlux.datasets.procthor.Train200()["ProcTHOR-Train-1"].reference,
28
29
  config=Config(instances_per_world=4, width=64, height=64, preset="x500_fpv", control="position"),
29
30
  drone_asset=RIGGED_MODELS["x500"],
30
31
  parameters={"dynamics": {"mdp": {"init": {"guidance": 1}}}},
@@ -12,11 +12,11 @@ import time
12
12
 
13
13
  import numpy as np
14
14
 
15
+ import hyperlux
15
16
  from hyperdrone import Config, HyperDrone
16
- from hyperdrone.examples.data import procthor_scene_path
17
17
 
18
18
  parser = argparse.ArgumentParser()
19
- parser.add_argument("-m", "--model", default=None, help="GLB scene (default: the ProcTHOR test scene)")
19
+ parser.add_argument("-m", "--model", default=None, help="GLB scene (default: ProcTHOR-Train-1 from Train200)")
20
20
  parser.add_argument("--instances", type=int, default=2)
21
21
  parser.add_argument("--width", type=int, default=160)
22
22
  parser.add_argument("--height", type=int, default=120)
@@ -28,9 +28,9 @@ arguments = parser.parse_args()
28
28
  GRAVITY = np.array([0.0, 0.0, -9.81])
29
29
 
30
30
  env = HyperDrone(
31
- [arguments.model or procthor_scene_path()],
31
+ [arguments.model or hyperlux.datasets.procthor.Train200()["ProcTHOR-Train-1"].reference],
32
32
  config=Config(instances_per_world=arguments.instances, width=arguments.width, height=arguments.height,
33
- fidelity="high", preset="x500_fpv_imu", task="visual_inertial_localization"),
33
+ fidelity="high", anti_aliasing_grid=1, preset="x500_fpv_imu", task="visual_inertial_localization"),
34
34
  seed=arguments.seed,
35
35
  )
36
36
  steps = arguments.steps or env.episode_step_limit
@@ -10,10 +10,10 @@ license = {text = "MIT"}
10
10
  description = "The fastest drone simulator: L2F multirotor dynamics and RL environments on the HyperLux raytracer."
11
11
  readme = "README.md"
12
12
  requires-python = ">=3.10"
13
- dependencies = ["numpy", "nanobind>=2.0", "conta>=0.0.1", "hyperlux==0.1.8"]
13
+ dependencies = ["numpy", "nanobind>=2.0", "conta>=0.0.1", "hyperlux==0.1.9"]
14
14
 
15
15
  [project.optional-dependencies]
16
- examples = ["scipy>=1.15", "matplotlib", "imageio", "imageio-ffmpeg"]
16
+ examples = ["matplotlib", "imageio", "imageio-ffmpeg"]
17
17
  gym = ["gymnasium>=1.0"]
18
18
 
19
19
  [tool.hatch.build]
@@ -1,17 +0,0 @@
1
- #pragma once
2
- #include <rl_tools/rl/environments/hyperdrone/presets.h>
3
- #include <cstddef>
4
-
5
- namespace hyperdrone_env_user {
6
- using T = float;
7
- using TI = std::size_t;
8
- struct SPEC: rl_tools::rl::environments::hyperdrone::presets::X500FPV<T, TI> {
9
- static constexpr TI INSTANCES_PER_ENVIRONMENT = 4;
10
- static constexpr TI CAM_WIDTH = 640;
11
- static constexpr TI CAM_HEIGHT = 640;
12
- using SHADING = rl_tools::rendering::raytracing::Medium;
13
- static constexpr bool ENABLE_MOTION_BLUR = true;
14
- static constexpr TI MOTION_BLUR_SAMPLES = 8;
15
- };
16
- using WORLD = rl_tools::rl::environments::hyperdrone::World<SPEC>;
17
- }
File without changes
File without changes