ReviewOS

also looking at this

stacks/drone

feat: model VTOL electrical consumption and battery authority

#81
Merged chris wants to merge codex/owned-vtol-electrical-energy into main
15 files +605 -28
app/Commands/VtolHover.tsmodified+2-1
Changes to app/Commands/VtolHover.ts
@@ -9,10 +9,11 @@ export default defineCommand({
99 options: {
1010 '--scenario <name>': { description: vtolHoverScenarios.join(', '), default: 'hover' },
1111 '--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 },
1213 },
1314 handle(options) {
1415 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) })
1617 const { trace, path, ...report } = result
1718 const expectedStatus = options.scenario === 'hover' ? 'completed' : options.scenario === 'host-loss' ? 'host-lost' : 'blocked'
1819 const observedFlight = path.some(row => row.truthPositionM[2] < -1 && row.actuators.slice(0, 4).some(n => n > 0))