Commit 9b9c817
authored
feat(drone): modernize drone for CLI + Rerun + replay (#1520)
* feat(drone): add CLI registration and RerunBridge support
Phase 1: CLI Registration + Rerun Integration
- Create blueprint directory structure (dimos/robot/drone/blueprints/)
- Add drone_basic blueprint (DroneConnectionModule + DroneCameraModule + RerunBridge)
- Add drone_agentic blueprint (full stack with tracking + agent + web)
- Register both blueprints in all_blueprints.py
- Replace FoxgloveBridge with RerunBridgeModule
- Add replay support via global_config.replay flag
- Maintain existing stream names for backward compatibility
Blueprints now support:
- dimos run drone-basic [--replay]
- dimos run drone-agentic [--replay]
* feat(drone): remove deprecated main() and mark old Drone class deprecated
Phase 2: Module Cleanup
- Remove main() function from drone.py (CLI now handles this)
- Remove __main__ block
- Add deprecation warning to old Drone(Robot) class
- Recommend using drone_basic or drone_agentic blueprints instead
The old class-based Robot pattern is being phased out in favor of
blueprint composition. Existing code using Drone() will still work
but should migrate to the new blueprints.
* feat(drone): delete deprecated Drone class and add ClockSyncConfigurator
- Remove deprecated Drone(Robot) class entirely from drone.py
- Delete drone.py file (functionality moved to blueprints)
- Update __init__.py to remove Drone export
- Add ClockSyncConfigurator to both blueprints (fixes LCM autoconf errors)
- Update test_drone.py to skip TestDroneFullIntegration (tested deprecated class)
- All remaining tests pass (22 passed, 1 skipped)
The Drone class-based pattern is fully deprecated. Use drone_basic or
drone_agentic blueprints instead.
* fix(drone): remove invalid autoconf=True from LCM() in rerun config
- Changed LCM(autoconf=True) to LCM() in both blueprints
- Matches Go2 blueprint pattern
- Fixes TypeError when loading blueprints
- Verified: dimos --replay run drone-basic works (modules deploy successfully)
* fix(drone): restore agentic blueprint to match original drone_agentic() signature
- Replace conditional viewer logic with direct FoxgloveBridge.blueprint()
- Use WebsocketVisModule.blueprint() instead of websocket_vis() alias
- Preserve exact module composition: DroneConnectionModule, DroneCameraModule,
DroneTrackingModule, WebsocketVisModule, FoxgloveBridge, GoogleMapsSkillContainer,
OsmSkill, agent, web_input
- Preserve exact remappings: (DroneTrackingModule, video_input → video),
(DroneTrackingModule, cmd_vel → movecmd_twist)
- Keep function-based _make_drone_agentic() with all original default params
- Module-level drone_agentic instance for CLI registry compatibility
- Export DRONE_SYSTEM_PROMPT in __all__
* feat(drone): add split Rerun blueprint (camera + 3D view)
Opens camera feed automatically on startup instead of requiring
manual panel navigation. Horizontal split: Camera (1/3) + 3D world (2/3).
* fix(drone): correct Rerun camera origin to world/video
DroneCameraModule subscribes on 'video' stream, not 'color_image'.
The Rerun entity path is world/video.
* fix(google-maps): gracefully handle missing API key
GoogleMapsSkillContainer now logs a warning instead of crashing
when GOOGLE_MAPS_API_KEY is not set. The module deploys but
returns 'not configured' for skill calls.
* fix(rerun): convert BGR/BGRA to RGB before sending to Rerun
Some Rerun versions don't render BGR color_model correctly,
causing blue-tinted video. Convert BGR→RGB and BGRA→RGBA in
_format_to_rerun() with numpy channel swap.
* Revert "fix(rerun): convert BGR/BGRA to RGB before sending to Rerun"
This reverts commit eda0390.
* fix(drone): correct replay BGR label and guard OsmSkill RemoteIn
- FakeDJIVideoStream: re-tag replay frames from BGR to RGB (GStreamer
outputs RGB but Aug 2025 recording used default BGR label)
- OsmSkill: guard .subscribe() with hasattr check for RemoteIn
compatibility when distributed across workers
* fix(drone): use primitive types in move() skill for Pydantic schema compat
Replace Vector3 parameter with x/y/z floats so Agent.on_system_modules()
can generate JSON schema for the skill. Vector3 is an IsInstanceSchema
which Pydantic cannot serialize.
* fix(drone): remove n_workers=4, add viewer/replay support to agentic blueprint
- Remove wrapper function, flatten to module-level autoconnect
- Remove .global_config(n_workers=4) that caused OsmSkill RemoteIn crash
- Remove .configurators(ClockSyncConfigurator())
- Add conditional viz: Rerun when --viewer rerun, Foxglove when --viewer foxglove
- Add --replay support (connection_string='replay')
* fix(drone): rewrite agentic blueprint to match Go2 pattern
Clean autoconnect() composition with _vis sub-blueprint for conditional
viewer selection. No _modules list, no .insert() hack.
* refactor(drone): compose agentic on top of basic blueprint
- drone_agentic now imports drone_basic and layers tracking + skills + agent
- Removed n_workers=4 and ClockSyncConfigurator from drone_basic
- Removed duplicate vis/replay logic from drone_agentic
- Removed fill_mode='wireframe' (invalid Rerun FillMode)
- Matches Go2 composition pattern
* docs(drone): update README for blueprint architecture, fix mypy
- Rewrite README for CLI-based usage (dimos run drone-basic/agentic)
- Document blueprint composition pattern
- Add indoor/outdoor mode, replay, Rerun/Foxglove visualization
- Keep RosettaDrone setup verbatim
- Add return type annotations to fix mypy no-untyped-def
* fix(rerun): fix rate limiter _last_log init and test cleanup
- Lazy-init _last_log in _on_message instead of start() so tests can
call _on_message without calling start() first
- Fix test mock to use spec=RerunConvertible so messages pass through
the visual override pipeline
- Add bridge.stop() cleanup to prevent thread leak warnings
* revert: remove bridge.py rate limiter changes from drone PR
These changes (rate limiter + test) were incorrectly added by the
subagent in the drone modernization branch. They belong in a separate PR.
* botched rebase revert1 parent 5bebf73 commit 9b9c817
File tree
14 files changed
+394
-603
lines changed- dimos
- agents/skills
- robot
- drone
- blueprints
- agentic
- basic
14 files changed
+394
-603
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
| |||
72 | 80 | | |
73 | 81 | | |
74 | 82 | | |
| 83 | + | |
| 84 | + | |
75 | 85 | | |
76 | 86 | | |
77 | 87 | | |
| |||
102 | 112 | | |
103 | 113 | | |
104 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
105 | 118 | | |
106 | 119 | | |
107 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
11 | 10 | | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
14 | 13 | | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 24 | + | |
22 | 25 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 26 | + | |
26 | 27 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 28 | + | |
| 29 | + | |
31 | 30 | | |
32 | | - | |
33 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
39 | 50 | | |
40 | 51 | | |
41 | 52 | | |
42 | | - | |
| 53 | + | |
43 | 54 | | |
44 | | - | |
45 | | - | |
| 55 | + | |
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
| |||
56 | 66 | | |
57 | 67 | | |
58 | 68 | | |
59 | | - | |
| 69 | + | |
60 | 70 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
64 | 76 | | |
65 | 77 | | |
66 | 78 | | |
| |||
124 | 136 | | |
125 | 137 | | |
126 | 138 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
133 | 149 | | |
134 | 150 | | |
135 | 151 | | |
136 | 152 | | |
137 | 153 | | |
138 | | - | |
| 154 | + | |
139 | 155 | | |
140 | 156 | | |
141 | 157 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
147 | 168 | | |
148 | 169 | | |
149 | 170 | | |
| |||
160 | 181 | | |
161 | 182 | | |
162 | 183 | | |
163 | | - | |
164 | 184 | | |
165 | 185 | | |
166 | 186 | | |
| |||
180 | 200 | | |
181 | 201 | | |
182 | 202 | | |
| 203 | + | |
| 204 | + | |
183 | 205 | | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
189 | 212 | | |
190 | 213 | | |
191 | | - | |
192 | | - | |
| 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 | + | |
193 | 251 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 252 | + | |
| 253 | + | |
198 | 254 | | |
199 | 255 | | |
200 | 256 | | |
201 | | - | |
202 | 257 | | |
| 258 | + | |
203 | 259 | | |
204 | | - | |
205 | 260 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 261 | + | |
| 262 | + | |
212 | 263 | | |
213 | 264 | | |
214 | 265 | | |
| |||
228 | 279 | | |
229 | 280 | | |
230 | 281 | | |
231 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
232 | 287 | | |
233 | 288 | | |
234 | 289 | | |
235 | 290 | | |
236 | 291 | | |
237 | 292 | | |
238 | | - | |
| 293 | + | |
239 | 294 | | |
240 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
241 | 304 | | |
242 | 305 | | |
243 | 306 | | |
244 | 307 | | |
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 | | - | |
| 308 | + | |
272 | 309 | | |
273 | 310 | | |
274 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
0 commit comments