You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a26cb25
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/simulation/isaac_sim/overhead_camera.md
+26-15Lines changed: 26 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,25 +70,38 @@ The three constants (`OVERHEAD_ALTITUDE_M`, `OVERHEAD_COVERAGE_M`, `OVERHEAD_PX_
70
70
|`OVERHEAD_COVERAGE_M`|`200.0`| Side length of the captured square (m). |
71
71
|`OVERHEAD_PX_PER_METER`|`4.0`| Texture density. Increase for sharper text/markings; capped at `max_resolution=2048`. |
72
72
73
-
The camera is positioned at world origin `(0, 0)`. If your scene's points of interest are off-origin, shift the camera's `prim_path` xform after `add_orthographic_camera` returns:
73
+
### Re-centering or transforming the camera
74
+
75
+
By default the camera sits over world origin `(0, 0)`. For an off-origin area of interest, pass `center_x_m` / `center_y_m` to both helpers — they take care of the camera xform and the spec topics the GCS reads:
`1024` over a 200 m scene gives ~5 cells/m. If the 3D panel slows down, drop back toward `768`. Any change here also requires bumping `OVERHEAD_PX_PER_METER` on the sim side (otherwise you're sampling a low-resolution source more densely).
117
-
118
129
To change other rendering behavior (alpha, lighting), edit `_build_sim_ground_marker` directly. To force a re-render, restart the GCS visualizer.
The anchor only affects the geographic location reported via GPS; nothing in the scene moves. Pick something close to where you want the drones to "be" — Foxglove's Map panel will center on it, and any GPS-referenced inputs to your stack will be relative to it.
57
57
58
+
## Scene prep helpers — `scene_prep.py`
59
+
60
+
`simulation/isaac-sim/utils/scene_prep.py` is the small toolbox of stage preparation helpers `example_multi_drone_scene_import.py` uses inside its post-load callback (after the stage is loaded, before drones spawn). The full file has more — what's documented here is what you'll reach for in 95% of scenes.
Recursively applies `UsdPhysics.CollisionAPI` to every `UsdGeom.Mesh` under the given prim. Imported environment USDs are usually visual-only; without this, drones fall through buildings.
84
+
85
+
```python
86
+
stage_prim = stage.GetPrimAtPath("/World/stage")
87
+
add_colliders(stage_prim)
88
+
```
89
+
90
+
Skips prims that already have the API applied. Run it on the stage root after `scale_stage_prim` returns.
91
+
92
+
### Lighting — `add_dome_light`
93
+
94
+
In case the scene is missing any lights, this adds a dome light that can act like an overhead 'sun'.
95
+
96
+
```python
97
+
add_dome_light(
98
+
stage,
99
+
prim_path="/World/DomeLight",
100
+
intensity=3500.0,
101
+
exposure=-5.0, # negative = darker; tune per scene
102
+
)
103
+
```
104
+
105
+
### Overhead camera — `add_orthographic_camera` + `add_overhead_camera_publisher`
106
+
107
+
Used as a pair: one drops an orthographic camera over the scene, the other wires an OmniGraph to publish its frame plus three Float32 spec topics (`coverage_m`, `center_x_m`, `center_y_m`) the GCS uses to texture a ground plane in Foxglove's 3D panel.
108
+
109
+
```python
110
+
cam_path = add_orthographic_camera(
111
+
stage,
112
+
prim_path="/World/MapCamera",
113
+
altitude_m=165.0,
114
+
coverage_m=225.0,
115
+
scene_scale_factor=scene_scale_factor,
116
+
center_x_m=0.0, # set if your area of interest isn't at world origin
117
+
center_y_m=0.0,
118
+
)
119
+
add_overhead_camera_publisher(
120
+
parent_graph_path="/World/MapCameraGraph",
121
+
camera_prim_path=cam_path,
122
+
topic="/sim/overhead/image",
123
+
spec_topic="/sim/overhead/spec",
124
+
center_x_topic="/sim/overhead/center_x",
125
+
center_y_topic="/sim/overhead/center_y",
126
+
frame_id="map",
127
+
coverage_m=225.0,
128
+
center_x_m=0.0,
129
+
center_y_m=0.0,
130
+
pixels_per_meter=10.0,
131
+
domain_id=0,
132
+
)
133
+
```
134
+
135
+
Full setup, GCS-side rendering, and tuning knobs are on the **[Overhead Camera](overhead_camera.md)** page.
136
+
137
+
### Saving a self-contained copy — `save_scene_as_contained_usd`
138
+
139
+
For scenes you'd like to keep working with offline (no Nucleus connection), or for sharing a scene with collaborators, collect the root USD plus every referenced asset (textures, MDLs, sublayers) into a local directory:
140
+
141
+
```python
142
+
save_scene_as_contained_usd(
143
+
source_usd_url=ENV_URL,
144
+
output_dir="/tmp/collected_scene",
145
+
)
146
+
```
147
+
148
+
The collected folder contains a standalone root USD with relative references — load it directly via `omniverse://localhost/...` or a local file path. Note that this collects the **source USD as-is**: scale, colliders, dome light, and any other stage edits applied in this post-load callback are *not* baked into the saved copy. To capture the live stage with your modifications, first export the in-memory stage to a USD on disk (e.g. via `stage.GetRootLayer().Export(...)`) and pass that exported path as `source_usd_url`.
0 commit comments