also looking at this
feat: add VTOL scenario playback to the mission workspace
#84
26 files
+1336
-66
| @@ -9,10 +9,11 @@ export default defineCommand({ | ||
| 9 | 9 | options: { |
| 10 | 10 | '--scenario <name>': { description: vtolHoverScenarios.join(', '), default: 'hover' }, |
| 11 | 11 | '--seconds <n>': { description: 'Maximum virtual duration, 2..180 seconds', default: '60' }, |
| 12 | '--electrical': { description: 'Use modeled electrical load, battery loss and delayed energy measurements', default: false }, | |
| 12 | 13 | }, |
| 13 | 14 | handle(options) { |
| 14 | 15 | try { |
| 15 | const result = runVehicleSimulation(createVtolHoverProfile(options.scenario), { scenario: options.scenario, seconds: Number(options.seconds) }) | |
| 16 | const result = runVehicleSimulation(createVtolHoverProfile(options.scenario, { electrical: options.electrical }), { scenario: options.scenario, seconds: Number(options.seconds) }) | |
| 16 | 17 | const { trace, path, ...report } = result |
| 17 | 18 | const expectedStatus = options.scenario === 'hover' ? 'completed' : options.scenario === 'host-loss' ? 'host-lost' : 'blocked' |
| 18 | 19 | const observedFlight = path.some(row => row.truthPositionM[2] < -1 && row.actuators.slice(0, 4).some(n => n > 0)) |