@@ -360,6 +360,26 @@ MavMission.prototype.DroneToMission = async function(filename) {
360
360
data2 += "[" ;
361
361
data2 += l . toString ( ) ;
362
362
data2 += "],\n" ;
363
+
364
+ var wp_type = MWNP . WPTYPE . WAYPOINT ;
365
+ //if ( e.command == 16 ) wp_type = MWNP.WPTYPE.WAYPOINT; // The scheduled action for the waypoint.
366
+
367
+ // skip 'home' = 'zero' wp from drone
368
+ if ( e . seq != 0 ) {
369
+ //number, action, lat, lon, alt=0, p1=0, p2=0, p3=0, endMission=0, isUsed=true, isAttached=false, attachedId=""
370
+ MISSION_PLANER . put ( new Waypoint (
371
+ e . seq , //data.getUint8(0),//number
372
+ wp_type , //data.getUint8(1), //action like MWNP.WPTYPE.JUMP or MWNP.WPTYPE.WAYPOINT
373
+ e . x * 10000000 , //data.getInt32(2, true), //lat
374
+ e . y * 10000000 , //data.getInt32(6, true), //lon
375
+ e . z , //data.getInt32(10, true), //alt
376
+ e . param1 , //data.getInt16(14, true), //p1
377
+ e . param2 , //data.getInt16(16, true), //p2
378
+ e . param3 , //data.getInt16(18, true) //p3
379
+ // eep buzz todo, fit e.param4
380
+ ) ) ;
381
+ }
382
+ //
363
383
} ) ;
364
384
data2 += '];\n//module.exports = missionItems;\n' ;
365
385
await fs . writeFile ( filename , data2 ) ;
0 commit comments