-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
505 lines (464 loc) · 28.5 KB
/
Copy pathindex.html
File metadata and controls
505 lines (464 loc) · 28.5 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
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RoboFlow — AMR/AGV HMI Platform</title>
<meta name="description" content="Visual drag-and-drop robot programming with ROS 2 integration for AMR and AGV robots. No coding required.">
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><text y='26' font-size='28'>⬡</text></svg>">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/main.css?v=20">
<link rel="stylesheet" href="css/flow.css?v=20">
<link rel="stylesheet" href="css/remote.css?v=20">
<link rel="stylesheet" href="css/sim-3d.css?v=20">
</head>
<body>
<!-- ═══════════════════════════════════════════
TOP NAVIGATION
═══════════════════════════════════════════ -->
<nav id="main-nav" role="navigation" aria-label="Main navigation">
<div class="nav-brand">
<div class="brand-hex">⬡</div>
<div class="brand-text-wrap">
<span class="brand-name">RoboFlow</span>
<span class="brand-tag">AMR · AGV · ROS 2</span>
</div>
</div>
<div class="nav-modes" role="tablist" aria-label="Interface mode">
<button id="btn-flow-mode" class="mode-btn active" role="tab" aria-selected="true" title="Flow Canvas — Visual Programming">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="3" width="6" height="5" rx="1"/><rect x="16" y="3" width="6" height="5" rx="1"/><rect x="9" y="16" width="6" height="5" rx="1"/><path d="M5 8v4h14V8M12 12v4"/></svg>
Flow Canvas
</button>
<button id="btn-remote-mode" class="mode-btn" role="tab" aria-selected="false" title="Digital Remote Control">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="6" width="20" height="14" rx="3"/><circle cx="8" cy="13" r="2"/><circle cx="16" cy="10" r="1"/><circle cx="19" cy="13" r="1"/><circle cx="16" cy="16" r="1"/><circle cx="13" cy="13" r="1"/></svg>
Remote Control
</button>
</div>
<div class="nav-right">
<div id="connection-status" class="status-pill sim" title="Click to change connection mode">
<span class="status-dot"></span>
<span class="status-text">Simulation</span>
</div>
<button id="btn-settings" class="icon-btn nav-icon-btn" title="Open Settings (Ctrl+,)" aria-label="Open settings">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="3"/>
<path d="M12 1v2m0 18v2M4.22 4.22l1.42 1.42m12.72 12.72 1.42 1.42M1 12h2m18 0h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/>
</svg>
</button>
</div>
</nav>
<!-- ═══════════════════════════════════════════
SETTINGS DRAWER
═══════════════════════════════════════════ -->
<div id="settings-overlay" class="overlay hidden"></div>
<div id="settings-drawer" class="drawer hidden" role="dialog" aria-label="Settings panel" aria-modal="true">
<div class="drawer-header">
<h2 class="drawer-title">
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M12 1v2m0 18v2M4.22 4.22l1.42 1.42m12.72 12.72 1.42 1.42M1 12h2m18 0h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/></svg>
Settings
</h2>
<button id="btn-close-settings" class="icon-btn" title="Close settings" aria-label="Close settings">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button>
</div>
<div class="drawer-content">
<div class="settings-section">
<h3 class="settings-section-title">ROS 2 Connection</h3>
<label class="field-label" for="ros-url">WebSocket Bridge URL</label>
<div class="input-row">
<input id="ros-url" type="text" class="text-input" value="ws://localhost:9090" placeholder="ws://ROBOT_IP:9090">
<button id="btn-connect" class="btn-primary">Connect</button>
</div>
<button id="btn-simulate" class="btn-secondary full-width active">
<span class="sim-dot"></span>
Simulation Mode (No Robot)
</button>
<p class="field-hint">Install rosbridge: <code>ros2 launch rosbridge_server rosbridge_websocket_launch.xml</code></p>
</div>
<div class="divider"></div>
<div class="settings-section">
<h3 class="settings-section-title">ROS 2 flow backend (Ubuntu)</h3>
<p class="field-hint">With <code>ros2 launch roboflow_runner roboflow_backend.launch.py</code> running on your robot PC, paste its address here to push flows over HTTP.</p>
<label class="field-label" for="backend-url">Backend base URL</label>
<input id="backend-url" type="url" class="text-input" value="" placeholder="http://192.168.1.50:8765" autocomplete="off">
<div class="input-row" style="margin-top:10px">
<button type="button" id="btn-backend-test" class="btn-secondary">Test connection</button>
</div>
</div>
<div class="divider"></div>
<div class="settings-section">
<h3 class="settings-section-title">Voice → cloud LLM</h3>
<p class="field-hint">Without LLM, voice uses local keywords. With LLM, transcripts map to structured robot commands.</p>
<label class="field-label" style="display:flex;align-items:center;gap:8px;cursor:pointer">
<input type="checkbox" id="voice-llm-backend" />
Use backend <code>/api/voice/parse</code> (set <code>OPENAI_API_KEY</code> on the runner PC)
</label>
<label class="field-label" style="display:flex;align-items:center;gap:8px;cursor:pointer;margin-top:8px">
<input type="checkbox" id="voice-llm-direct" />
Call OpenAI-compatible API from browser (needs CORS — e.g. LM Studio, or a proxy)
</label>
<label class="field-label" for="voice-openai-base">API base URL (direct)</label>
<input id="voice-openai-base" type="text" class="text-input" value="https://api.openai.com/v1" placeholder="https://api.openai.com/v1" autocomplete="off">
<label class="field-label" for="voice-openai-model">Model (direct)</label>
<input id="voice-openai-model" type="text" class="text-input" value="gpt-4o-mini" placeholder="gpt-4o-mini" autocomplete="off">
<label class="field-label" for="voice-openai-key">API key (direct, stored in browser localStorage)</label>
<input id="voice-openai-key" type="password" class="text-input" value="" placeholder="sk-…" autocomplete="off">
<label class="field-label" style="display:flex;align-items:center;gap:8px;cursor:pointer;margin-top:10px">
<input type="checkbox" id="voice-speak-replies" />
AI speaks back (LLM reply + browser text-to-speech; uses <code>/api/voice/chat</code> on backend)
</label>
<label class="field-label" style="display:flex;align-items:center;gap:8px;cursor:pointer;margin-top:8px">
<input type="checkbox" id="voice-pause-mic-tts" checked />
Pause microphone while the robot is speaking (reduces echo)
</label>
</div>
<div class="divider"></div>
<div class="settings-section">
<h3 class="settings-section-title">Robot Configuration</h3>
<label class="field-label" for="robot-type">Robot Type</label>
<select id="robot-type" class="select-input">
<option value="amr">AMR — Autonomous Mobile Robot</option>
<option value="agv">AGV — Automated Guided Vehicle</option>
</select>
<label class="field-label" for="cmd-vel-topic">Velocity Topic</label>
<input id="cmd-vel-topic" type="text" class="text-input" value="/cmd_vel">
<label class="field-label" for="nav-topic">Navigation Action</label>
<input id="nav-topic" type="text" class="text-input" value="/navigate_to_pose">
<label class="field-label">Max Linear Speed</label>
<div class="slider-row">
<input type="range" id="max-linear-speed" min="0.1" max="3.0" step="0.1" value="1.2">
<span id="max-linear-speed-val" class="slider-val">1.2 m/s</span>
</div>
<label class="field-label">Max Angular Speed</label>
<div class="slider-row">
<input type="range" id="max-angular-speed" min="0.1" max="6.0" step="0.1" value="2.4">
<span id="max-angular-speed-val" class="slider-val">2.4 rad/s</span>
</div>
</div>
<div class="divider"></div>
<div class="settings-section">
<h3 class="settings-section-title">About</h3>
<p class="field-hint">RoboFlow v1.0 — HMI for AMR/AGV robots<br>Uses ROS 2 + rosbridge_suite + roslibjs</p>
</div>
</div>
</div>
<!-- ═══════════════════════════════════════════
MAIN APPLICATION AREA
═══════════════════════════════════════════ -->
<main id="app">
<!-- ─── FLOW CANVAS PANEL ─── -->
<div id="flow-panel" class="panel active" role="tabpanel" aria-label="Flow canvas programming">
<!-- Block Palette -->
<aside id="block-palette" aria-label="Block palette">
<div class="palette-header">
<span class="palette-title">
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="2"/><path d="M12 2v4m0 12v4M4.93 4.93l2.83 2.83m8.48 8.48 2.83 2.83M2 12h4m12 0h4M4.93 19.07l2.83-2.83m8.48-8.48 2.83-2.83"/></svg>
Blocks
</span>
</div>
<div class="palette-search-wrap">
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
<input id="palette-search" type="search" placeholder="Search blocks…" aria-label="Search blocks">
</div>
<div id="palette-categories" role="list" aria-label="Block categories"></div>
</aside>
<!-- Center: flow canvas + optional 3D sim dock -->
<div class="flow-canvas-wrap">
<!-- Canvas Area -->
<div id="canvas-container" tabindex="0" aria-label="Flow programming canvas. Drag blocks from the palette to create a robot program.">
<!-- The viewport div receives the pan/zoom CSS transform for pan/zoom -->
<div id="canvas-viewport">
<!-- Block nodes layer -->
<div id="canvas-el"></div>
<!-- SVG for connections — placed after canvas-el so it paints on top -->
<svg id="connections-svg"
xmlns="http://www.w3.org/2000/svg"
width="20000" height="20000"
style="position:absolute;top:0;left:0;overflow:visible;pointer-events:none"
aria-hidden="true">
<defs>
<marker id="arrow-default" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<polygon points="0 0, 8 3, 0 6" fill="#344d66"/>
</marker>
<marker id="arrow-hover" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<polygon points="0 0, 8 3, 0 6" fill="#00d4ff"/>
</marker>
<marker id="arrow-exec" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<polygon points="0 0, 8 3, 0 6" fill="#00ff88"/>
</marker>
<filter id="glow-cyan" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur stdDeviation="3" result="b"/>
<feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge>
</filter>
<filter id="glow-green" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur stdDeviation="4" result="b"/>
<feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge>
</filter>
</defs>
<g id="connections-group"></g>
<path id="preview-connection" fill="none" stroke="#00d4ff" stroke-width="2.5"
stroke-dasharray="10,5" opacity="0" pointer-events="none"/>
</svg>
</div>
<!-- Canvas Controls Overlay -->
<div id="canvas-controls" aria-label="Canvas zoom controls">
<button id="btn-zoom-in" class="canvas-ctrl-btn" title="Zoom In (+)">+</button>
<span id="zoom-label" class="zoom-label">100%</span>
<button id="btn-zoom-out" class="canvas-ctrl-btn" title="Zoom Out (-)">−</button>
<button id="btn-zoom-fit" class="canvas-ctrl-btn" title="Fit to screen (F)">
<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"/></svg>
</button>
</div>
<div id="canvas-hint" class="canvas-hint">
Drag blocks from the left panel · Connect ports · Scroll to zoom · Right-click block to delete
</div>
</div>
<div id="sim-resize-flow" class="sim-resize-handle" title="Drag to resize 3D panel" aria-hidden="true"></div>
<aside id="sim-dock-flow" class="sim-dock" aria-label="3D simulation">
<div class="sim-dock-header">
<button type="button" class="sim-dock-collapse-btn js-sim-collapse" aria-expanded="true" title="Show or hide 3D controls">▾</button>
<span class="sim-dock-title">3D sim</span>
</div>
<div class="sim-dock-toolbar">
<div class="sim-dock-row">
<span class="sim-dock-label">Room</span>
<label class="sim-opt"><input type="radio" name="sim-room-flow" class="js-sim-room" value="open"> Open</label>
<label class="sim-opt"><input type="radio" name="sim-room-flow" class="js-sim-room" value="plain" checked> Factory floor</label>
</div>
<div class="sim-dock-row sim-dock-row--cam">
<span class="sim-dock-label">View</span>
<label class="sim-opt" title="Chase cam behind the robot"><input type="radio" name="sim-cam-flow" class="js-sim-camera" value="follow" checked> Follow</label>
<label class="sim-opt" title="First-person robot-eye view"><input type="radio" name="sim-cam-flow" class="js-sim-camera" value="first"> 1st person</label>
<label class="sim-opt" title="Profile from the robot’s left (port) side"><input type="radio" name="sim-cam-flow" class="js-sim-camera" value="side"> Side</label>
<label class="sim-opt" title="Overhead map-style view"><input type="radio" name="sim-cam-flow" class="js-sim-camera" value="top"> Top</label>
</div>
<label class="sim-mirror-label sim-dock-mirror">
<input type="checkbox" class="js-sim-mirror-odom">
<span>Mirror <code>/odom</code></span>
</label>
<div class="sim-dock-row">
<button type="button" class="sim-mini-btn js-voice-toggle" title="Start/stop voice control">Voice</button>
<button type="button" class="sim-mini-btn js-sim-draw-path" title="Draw path on floor">Draw path</button>
<button type="button" class="sim-mini-btn js-sim-follow-path" title="Follow drawn path">Follow path</button>
<button type="button" class="sim-mini-btn js-sim-clear-path" title="Clear drawn path">Clear path</button>
</div>
<button type="button" class="js-sim-reset sim-dock-reset">Reset pose</button>
</div>
<div class="sim-viewport-wrap">
<div id="sim3d-container-flow" class="sim3d-container" aria-label="WebGL 3D view"></div>
<div class="sim-hud">
<span class="sim-hud-stats">speed 0.00 m/s acc 0.00 m/s² yaw acc 0.00 rad/s² cargo none</span>
<span class="sim-hud-pose">map x: 0.00 y: 0.00 θ: 0°</span>
<span class="sim-hud-twist">cmd vx: 0.00 vy: 0.00 ωz: 0.00</span>
</div>
</div>
</aside>
</div><!-- .flow-canvas-wrap -->
<!-- Properties Panel -->
<div id="properties-panel" aria-label="Block properties panel">
<div class="properties-header">
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 20h9M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>
<span id="properties-title">Properties</span>
</div>
<div id="properties-content">
<div class="properties-empty">
<div class="empty-icon">⬡</div>
<p>Select a block on the canvas to configure it</p>
</div>
</div>
</div>
</div>
<!-- ─── REMOTE CONTROL PANEL ─── -->
<div id="remote-panel" class="panel" role="tabpanel" aria-label="Digital remote control">
<!-- Left: Movement Joystick -->
<div class="remote-section" id="remote-left">
<div class="remote-section-label">MOVEMENT</div>
<div class="joystick-zone" id="joystick-movement-zone">
<div id="joystick-movement"></div>
<div class="joystick-axes">
<span>← X →</span>
<span>↕ Y</span>
</div>
</div>
<div class="joystick-readout">
<div class="readout-item"><span class="readout-label">Linear X</span><span class="readout-value" id="val-lx">0.000</span></div>
<div class="readout-item"><span class="readout-label">Linear Y</span><span class="readout-value" id="val-ly">0.000</span></div>
</div>
</div>
<!-- Center: Dashboard & Controls -->
<div class="remote-center">
<div class="robot-hud">
<div class="hud-ring" id="robot-status-ring">
<div class="hud-ring-inner">
<div class="hud-speed-val" id="speed-val-display">0.00</div>
<div class="hud-speed-unit">m/s</div>
<div class="hud-direction" id="direction-arrow">⬆</div>
</div>
</div>
<div class="hud-label">VELOCITY</div>
</div>
<div class="speed-control-wrap">
<label class="field-label">Speed Limit</label>
<div class="slider-row">
<span class="slider-min">10%</span>
<input type="range" id="remote-speed-limit" min="10" max="100" value="50">
<span class="slider-val" id="remote-speed-pct">50%</span>
</div>
</div>
<div class="remote-action-grid">
<button id="btn-estop" class="action-btn estop" title="Emergency Stop — all motion ceases immediately">
<span class="action-btn-icon">⛔</span>
<span class="action-btn-label">E-STOP</span>
</button>
<button id="btn-dock" class="action-btn">
<span class="action-btn-icon">⚓</span>
<span class="action-btn-label">Dock</span>
</button>
<button id="btn-undock" class="action-btn">
<span class="action-btn-icon">🚀</span>
<span class="action-btn-label">Undock</span>
</button>
<button id="btn-go-home" class="action-btn">
<span class="action-btn-icon">🏠</span>
<span class="action-btn-label">Home</span>
</button>
<button id="btn-lights-toggle" class="action-btn">
<span class="action-btn-icon">💡</span>
<span class="action-btn-label">Lights</span>
</button>
<button id="btn-horn" class="action-btn">
<span class="action-btn-icon">📢</span>
<span class="action-btn-label">Horn</span>
</button>
</div>
<div class="keyboard-hint">⌨ WASD / Arrow keys to drive | Space = E-Stop</div>
<div id="remote-sim-log" class="sim-log">
<div class="sim-log-header">
<span class="sim-log-dot"></span>
ROS Topic Feed
</div>
<div id="remote-sim-log-content" class="sim-log-content"></div>
</div>
</div>
<!-- Right: Rotation Joystick -->
<div class="remote-section" id="remote-right">
<div class="remote-section-label">ROTATION</div>
<div class="joystick-zone" id="joystick-rotation-zone">
<div id="joystick-rotation"></div>
<div class="joystick-axes">
<span>← ω →</span>
</div>
</div>
<div class="joystick-readout">
<div class="readout-item"><span class="readout-label">Angular Z</span><span class="readout-value" id="val-rz">0.000</span><span class="readout-unit">rad/s</span></div>
</div>
</div>
<div id="sim-resize-remote" class="sim-resize-handle" title="Drag to resize 3D panel" aria-hidden="true"></div>
<aside id="sim-dock-remote" class="sim-dock sim-dock-remote" aria-label="3D simulation">
<div class="sim-dock-header">
<button type="button" class="sim-dock-collapse-btn js-sim-collapse" aria-expanded="true" title="Show or hide 3D controls">▾</button>
<span class="sim-dock-title">3D sim</span>
</div>
<div class="sim-dock-toolbar">
<div class="sim-dock-row">
<span class="sim-dock-label">Room</span>
<label class="sim-opt"><input type="radio" name="sim-room-remote" class="js-sim-room" value="open"> Open</label>
<label class="sim-opt"><input type="radio" name="sim-room-remote" class="js-sim-room" value="plain" checked> Factory floor</label>
</div>
<div class="sim-dock-row sim-dock-row--cam">
<span class="sim-dock-label">View</span>
<label class="sim-opt" title="Chase cam behind the robot"><input type="radio" name="sim-cam-remote" class="js-sim-camera" value="follow" checked> Follow</label>
<label class="sim-opt" title="First-person robot-eye view"><input type="radio" name="sim-cam-remote" class="js-sim-camera" value="first"> 1st person</label>
<label class="sim-opt" title="Profile from the robot’s left (port) side"><input type="radio" name="sim-cam-remote" class="js-sim-camera" value="side"> Side</label>
<label class="sim-opt" title="Overhead map-style view"><input type="radio" name="sim-cam-remote" class="js-sim-camera" value="top"> Top</label>
</div>
<label class="sim-mirror-label sim-dock-mirror">
<input type="checkbox" class="js-sim-mirror-odom">
<span>Mirror <code>/odom</code></span>
</label>
<div class="sim-dock-row">
<button type="button" class="sim-mini-btn js-voice-toggle" title="Start/stop voice control">Voice</button>
<button type="button" class="sim-mini-btn js-sim-draw-path" title="Draw path on floor">Draw path</button>
<button type="button" class="sim-mini-btn js-sim-follow-path" title="Follow drawn path">Follow path</button>
<button type="button" class="sim-mini-btn js-sim-clear-path" title="Clear drawn path">Clear path</button>
</div>
<button type="button" class="js-sim-reset sim-dock-reset">Reset pose</button>
</div>
<div class="sim-viewport-wrap">
<div id="sim3d-container-remote" class="sim3d-container" aria-label="WebGL 3D view"></div>
<div class="sim-hud">
<span class="sim-hud-stats">speed 0.00 m/s acc 0.00 m/s² yaw acc 0.00 rad/s² cargo none</span>
<span class="sim-hud-pose">map x: 0.00 y: 0.00 θ: 0°</span>
<span class="sim-hud-twist">cmd vx: 0.00 vy: 0.00 ωz: 0.00</span>
</div>
</div>
</aside>
</div>
</main>
<!-- ═══════════════════════════════════════════
EXECUTION BAR (Flow mode)
═══════════════════════════════════════════ -->
<div id="execution-bar" role="toolbar" aria-label="Flow execution controls">
<div class="exec-left">
<button id="btn-run" class="exec-btn run" title="Run flow program (F5)">
<svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor"><polygon points="5,3 19,12 5,21"/></svg>
Run
</button>
<button id="btn-pause" class="exec-btn pause" disabled title="Pause execution (Space)">
<svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor"><rect x="6" y="4" width="4" height="16" rx="1"/><rect x="14" y="4" width="4" height="16" rx="1"/></svg>
Pause
</button>
<button id="btn-stop-exec" class="exec-btn stop" disabled title="Stop execution (Escape)">
<svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor"><rect x="4" y="4" width="16" height="16" rx="2"/></svg>
Stop
</button>
<button id="btn-run-ros2" class="exec-btn secondary" title="Send flow to Ubuntu ROS 2 backend (set URL in Settings)">
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2L2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5M2 12l10 5 10-5"/></svg>
Run on ROS 2
</button>
</div>
<div id="execution-log" class="exec-log" aria-live="polite" aria-label="Execution status">
<span class="exec-log-icon">●</span>
<span id="exec-status-text">Ready — Build your flow and press Run</span>
<span id="exec-step-badge" class="exec-step-badge hidden"></span>
</div>
<div class="exec-right">
<button id="btn-save" class="exec-btn secondary" title="Save flow as JSON">
<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>
Save
</button>
<button id="btn-load" class="exec-btn secondary" title="Load flow from JSON">
<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
Load
</button>
<button id="btn-clear" class="exec-btn secondary danger" title="Clear canvas">
<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"/><path d="M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6"/><path d="M10 11v6M14 11v6"/></svg>
Clear
</button>
<input type="file" id="load-file-input" accept=".json" style="display:none" aria-hidden="true">
</div>
</div>
<!-- Toast Notification Container -->
<div id="toast-container" aria-live="assertive" aria-label="Notifications"></div>
<!-- ═══════════════════════════════════════════
SCRIPTS — Order matters!
═══════════════════════════════════════════ -->
<!-- Three.js (3D sim) — before ros-bridge so cmd_vel can drive the fake robot -->
<script src="https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.min.js"></script>
<script src="js/sim-robot-3d.js?v=20"></script>
<!-- ROS 2 web bridge library -->
<script src="https://cdn.jsdelivr.net/npm/roslib@1.3.0/build/roslib.min.js"></script>
<!-- Virtual joystick library -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/nipplejs/0.10.1/nipplejs.min.js"></script>
<!-- App modules -->
<script src="js/ros-bridge.js?v=20"></script>
<script src="js/flow-blocks.js?v=20"></script>
<script src="js/flow-engine.js?v=20"></script>
<script src="js/flow-executor.js?v=20"></script>
<script src="js/remote.js?v=20"></script>
<script src="js/voice-control.js?v=20"></script>
<script src="js/app.js?v=20"></script>
</body>
</html>