@lumikmz/kmz 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -66
- package/dist/index.d.mts +215 -76
- package/dist/index.mjs +634 -157
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/plan/geometry.test.ts +96 -0
- package/src/plan/geometry.ts +161 -25
- package/src/plan/index.ts +23 -3
- package/src/plan/plan-mapping-strip.ts +3 -3
- package/src/plan/plan-mapping2d.ts +512 -89
- package/src/plan/plan-mapping3d.ts +157 -98
- package/src/plan/plan.test.ts +263 -9
- package/src/types/action.ts +65 -1
- package/src/types/drone-payload.ts +18 -12
- package/src/types/enums.ts +17 -3
- package/src/types/mission-config.ts +5 -0
- package/src/types/placemark.ts +92 -15
- package/src/types/template.ts +12 -76
- package/src/types/waylines.ts +12 -3
- package/src/types/waypoint-params.ts +18 -0
package/dist/index.d.mts
CHANGED
|
@@ -59,8 +59,8 @@ type LidarReturnMode = "singleReturnStrongest" | "dualReturn" | "tripleReturn";
|
|
|
59
59
|
type LidarScanningMode = "repetitive" | "nonRepetitive";
|
|
60
60
|
type ActionGroupMode = "sequence";
|
|
61
61
|
type ActionTriggerType = "reachPoint" | "betweenAdjacentPoints" | "multipleTiming" | "multipleDistance";
|
|
62
|
-
type ActionActuatorFunc = "takePhoto" | "startRecord" | "stopRecord" | "focus" | "zoom" | "customDirName" | "gimbalRotate" | "rotateYaw" | "hover" | "gimbalEvenlyRotate" | "accurateShoot" | "orientedShoot" | "panoShot" | "recordPointCloud" | "megaphone" | "searchlight";
|
|
63
|
-
type GimbalHeadingYawBase = "north";
|
|
62
|
+
type ActionActuatorFunc = "takePhoto" | "startRecord" | "stopRecord" | "focus" | "zoom" | "customDirName" | "gimbalRotate" | "rotateYaw" | "hover" | "gimbalEvenlyRotate" | "accurateShoot" | "orientedShoot" | "panoShot" | "recordPointCloud" | "megaphone" | "searchlight" /** ⚠️ NON-SPEC — observed in real DJI KMZ exports, absent from WPML 1.15 docs. */ | "startSmartOblique" /** ⚠️ NON-SPEC — observed in real DJI KMZ exports, absent from WPML 1.15 docs. */ | "stopSmartOblique" /** Starts time-lapse (interval) shooting for a mapping strip. */ | "startTimeLapse" /** Stops time-lapse shooting. */ | "stopTimeLapse" /** Locks gimbal angle during a mapping strip. */ | "gimbalAngleLock" /** Unlocks gimbal angle (no params in XML). */ | "gimbalAngleUnlock" /** Sets camera focus mode (manual / auto). */ | "setFocusType";
|
|
63
|
+
type GimbalHeadingYawBase = "north" | "aircraft";
|
|
64
64
|
type GimbalRotateMode = "absoluteAngle";
|
|
65
65
|
type AircraftPathMode = "clockwise" | "counterClockwise";
|
|
66
66
|
type RecordPointCloudOperate = "startRecord" | "pauseRecord" | "resumeRecord" | "stopRecord";
|
|
@@ -74,6 +74,12 @@ interface DroneInfo {
|
|
|
74
74
|
}
|
|
75
75
|
interface PayloadInfo {
|
|
76
76
|
payloadEnumValue: number;
|
|
77
|
+
/**
|
|
78
|
+
* Payload sub-type (`type-subtype-gimbalindex`, the middle field). Non-standard
|
|
79
|
+
* WPML extension that DJI tooling emits; written when present. Main-gimbal
|
|
80
|
+
* cameras are subtype 0 (e.g. M4TD Camera = 99-0-0).
|
|
81
|
+
*/
|
|
82
|
+
payloadSubEnumValue?: number;
|
|
77
83
|
payloadPositionIndex: number;
|
|
78
84
|
}
|
|
79
85
|
/** Aircraft `{ droneEnumValue, droneSubEnumValue }` tuples. */
|
|
@@ -139,46 +145,57 @@ declare const DroneEnum: {
|
|
|
139
145
|
declare const PayloadEnum: {
|
|
140
146
|
readonly M30Camera: {
|
|
141
147
|
readonly payloadEnumValue: 52;
|
|
148
|
+
readonly payloadSubEnumValue: 0;
|
|
142
149
|
readonly payloadPositionIndex: 0;
|
|
143
150
|
};
|
|
144
151
|
readonly M30TCamera: {
|
|
145
152
|
readonly payloadEnumValue: 53;
|
|
153
|
+
readonly payloadSubEnumValue: 0;
|
|
146
154
|
readonly payloadPositionIndex: 0;
|
|
147
155
|
};
|
|
148
156
|
readonly M3ECamera: {
|
|
149
157
|
readonly payloadEnumValue: 66;
|
|
158
|
+
readonly payloadSubEnumValue: 0;
|
|
150
159
|
readonly payloadPositionIndex: 0;
|
|
151
160
|
};
|
|
152
161
|
readonly M3TCamera: {
|
|
153
162
|
readonly payloadEnumValue: 67;
|
|
163
|
+
readonly payloadSubEnumValue: 0;
|
|
154
164
|
readonly payloadPositionIndex: 0;
|
|
155
165
|
};
|
|
156
166
|
readonly M3TACamera: {
|
|
157
167
|
readonly payloadEnumValue: 129;
|
|
168
|
+
readonly payloadSubEnumValue: 0;
|
|
158
169
|
readonly payloadPositionIndex: 0;
|
|
159
170
|
};
|
|
160
171
|
readonly M3DCamera: {
|
|
161
172
|
readonly payloadEnumValue: 80;
|
|
173
|
+
readonly payloadSubEnumValue: 0;
|
|
162
174
|
readonly payloadPositionIndex: 0;
|
|
163
175
|
};
|
|
164
176
|
readonly M3TDCamera: {
|
|
165
177
|
readonly payloadEnumValue: 81;
|
|
178
|
+
readonly payloadSubEnumValue: 0;
|
|
166
179
|
readonly payloadPositionIndex: 0;
|
|
167
180
|
};
|
|
168
181
|
readonly M4DCamera: {
|
|
169
182
|
readonly payloadEnumValue: 98;
|
|
183
|
+
readonly payloadSubEnumValue: 0;
|
|
170
184
|
readonly payloadPositionIndex: 0;
|
|
171
185
|
};
|
|
172
186
|
readonly M4TDCamera: {
|
|
173
187
|
readonly payloadEnumValue: 99;
|
|
188
|
+
readonly payloadSubEnumValue: 0;
|
|
174
189
|
readonly payloadPositionIndex: 0;
|
|
175
190
|
};
|
|
176
191
|
readonly M4ECamera: {
|
|
177
192
|
readonly payloadEnumValue: 88;
|
|
193
|
+
readonly payloadSubEnumValue: 0;
|
|
178
194
|
readonly payloadPositionIndex: 0;
|
|
179
195
|
};
|
|
180
196
|
readonly M4TCamera: {
|
|
181
197
|
readonly payloadEnumValue: 89;
|
|
198
|
+
readonly payloadSubEnumValue: 0;
|
|
182
199
|
readonly payloadPositionIndex: 0;
|
|
183
200
|
};
|
|
184
201
|
readonly ZenmuseZ30: {
|
|
@@ -269,6 +286,11 @@ interface PayloadParam {
|
|
|
269
286
|
modelColoringEnable?: boolean;
|
|
270
287
|
/** Comma-joined `LensType` tokens, e.g. `["wide","ir"]`. */
|
|
271
288
|
imageFormat: LensType[];
|
|
289
|
+
/**
|
|
290
|
+
* ⚠️ NON-SPEC — observed in 司空2 (FlightHub 2) KMZ exports, absent from WPML 1.15.
|
|
291
|
+
* Photo size/ratio token, e.g. `"default_l"`. Pass-through for compatibility.
|
|
292
|
+
*/
|
|
293
|
+
photoSize?: string;
|
|
272
294
|
}
|
|
273
295
|
//#endregion
|
|
274
296
|
//#region src/types/waypoint-params.d.ts
|
|
@@ -282,7 +304,14 @@ interface WaypointHeadingParam {
|
|
|
282
304
|
waypointHeadingAngle?: Degrees;
|
|
283
305
|
/** Required iff `waypointHeadingMode === "towardPOI"`. Z aim unsupported; set height to 0. */
|
|
284
306
|
waypointPoiPoint?: LngLatHeight;
|
|
307
|
+
/**
|
|
308
|
+
* Whether `waypointHeadingAngle` is in effect at this waypoint.
|
|
309
|
+
* Observed in mapping waylines exports; `false` on the terminal waypoint.
|
|
310
|
+
*/
|
|
311
|
+
waypointHeadingAngleEnable?: boolean;
|
|
285
312
|
waypointHeadingPathMode: WaypointHeadingPathMode;
|
|
313
|
+
/** POI index when `waypointHeadingMode === "towardPOI"`. Default 0. */
|
|
314
|
+
waypointHeadingPoiIndex?: number;
|
|
286
315
|
}
|
|
287
316
|
/**
|
|
288
317
|
* `wpml:waypointTurnParam`.
|
|
@@ -311,6 +340,17 @@ interface WaylineCoordinateSysParam {
|
|
|
311
340
|
surfaceFollowModeEnable?: boolean;
|
|
312
341
|
/** Required iff `surfaceFollowModeEnable === true`. */
|
|
313
342
|
surfaceRelativeHeight?: Meters;
|
|
343
|
+
/**
|
|
344
|
+
* ⚠️ NON-SPEC — observed in real DJI KMZ exports, absent from WPML 1.15 docs.
|
|
345
|
+
* When true, surface-follow uses live onboard sensor height (no DSM file).
|
|
346
|
+
*/
|
|
347
|
+
isRealtimeSurfaceFollow?: boolean;
|
|
348
|
+
/**
|
|
349
|
+
* ⚠️ NON-SPEC — observed in real DJI KMZ exports, absent from WPML 1.15 docs.
|
|
350
|
+
* Path inside the KMZ to the DSM `.tif` used for surface-follow,
|
|
351
|
+
* e.g. `"wpmz/res/dsm/foo.tif"`. Only set when `isRealtimeSurfaceFollow` is false.
|
|
352
|
+
*/
|
|
353
|
+
dsmFile?: string;
|
|
314
354
|
}
|
|
315
355
|
/**
|
|
316
356
|
* `wpml:mappingHeadingParam` — only on `mapping2d` Folder
|
|
@@ -357,7 +397,7 @@ interface ActionTrigger {
|
|
|
357
397
|
actionTriggerParam?: number;
|
|
358
398
|
}
|
|
359
399
|
/** Discriminated by `actionActuatorFunc`. */
|
|
360
|
-
type Action = TakePhotoAction | StartRecordAction | StopRecordAction | FocusAction | ZoomAction | CustomDirNameAction | GimbalRotateAction | RotateYawAction | HoverAction | GimbalEvenlyRotateAction | AccurateShootAction | OrientedShootAction | PanoShotAction | RecordPointCloudAction | MegaphoneAction | SearchlightAction;
|
|
400
|
+
type Action = TakePhotoAction | StartRecordAction | StopRecordAction | FocusAction | ZoomAction | CustomDirNameAction | GimbalRotateAction | RotateYawAction | HoverAction | GimbalEvenlyRotateAction | AccurateShootAction | OrientedShootAction | PanoShotAction | RecordPointCloudAction | MegaphoneAction | SearchlightAction | StartSmartObliqueAction | StopSmartObliqueAction | StartTimeLapseAction | StopTimeLapseAction | GimbalAngleLockAction | GimbalAngleUnlockAction | SetFocusTypeAction;
|
|
361
401
|
interface ActionBase<F extends string, P> {
|
|
362
402
|
actionId: number;
|
|
363
403
|
actionActuatorFunc: F;
|
|
@@ -393,6 +433,8 @@ interface FocusParam {
|
|
|
393
433
|
focusRegionHeight?: number;
|
|
394
434
|
/** Required on M3E/M3T/M3M, M3D/M3TD, M4D/M4TD, M4E/M4T. */
|
|
395
435
|
isInfiniteFocus?: boolean;
|
|
436
|
+
/** Calibration focus flag, observed in mapping WPML exports. */
|
|
437
|
+
isCalibrationFocus?: boolean;
|
|
396
438
|
}
|
|
397
439
|
type FocusAction = ActionBase<"focus", FocusParam>;
|
|
398
440
|
interface ZoomParam {
|
|
@@ -504,6 +546,8 @@ interface PanoShotParam {
|
|
|
504
546
|
payloadPositionIndex?: number;
|
|
505
547
|
payloadLensIndex?: LensType[];
|
|
506
548
|
useGlobalPayloadLensIndex?: boolean;
|
|
549
|
+
/** Photo meta tag written alongside the panorama; UUID string. */
|
|
550
|
+
actionUUID?: string;
|
|
507
551
|
panoShotSubMode: PanoShotSubMode;
|
|
508
552
|
}
|
|
509
553
|
type PanoShotAction = ActionBase<"panoShot", PanoShotParam>;
|
|
@@ -530,6 +574,52 @@ interface MegaphoneParam {
|
|
|
530
574
|
megaphoneFileBitrate: 1 | 2 | 3 | 4 | 5 | 6;
|
|
531
575
|
}
|
|
532
576
|
type MegaphoneAction = ActionBase<"megaphone", MegaphoneParam>;
|
|
577
|
+
/** M4D/M4TD only — starts gimbal swing in smart-oblique mode. */
|
|
578
|
+
interface StartSmartObliqueParam {
|
|
579
|
+
payloadPositionIndex: number;
|
|
580
|
+
}
|
|
581
|
+
type StartSmartObliqueAction = ActionBase<"startSmartOblique", StartSmartObliqueParam>;
|
|
582
|
+
/** M4D/M4TD only — stops gimbal swing in smart-oblique mode. */
|
|
583
|
+
interface StopSmartObliqueParam {
|
|
584
|
+
payloadPositionIndex: number;
|
|
585
|
+
}
|
|
586
|
+
type StopSmartObliqueAction = ActionBase<"stopSmartOblique", StopSmartObliqueParam>;
|
|
587
|
+
/** Starts interval (time-lapse) shooting for a mapping strip. */
|
|
588
|
+
interface StartTimeLapseParam {
|
|
589
|
+
payloadPositionIndex: number;
|
|
590
|
+
useGlobalPayloadLensIndex: boolean;
|
|
591
|
+
/** Single lens token (not a list — mapping strips use one lens). */
|
|
592
|
+
payloadLensIndex: LensType;
|
|
593
|
+
/** Minimum shoot interval in seconds. Derived from `forwardGroundSpacing / speed`. */
|
|
594
|
+
minShootInterval: number;
|
|
595
|
+
}
|
|
596
|
+
type StartTimeLapseAction = ActionBase<"startTimeLapse", StartTimeLapseParam>;
|
|
597
|
+
/** Stops interval shooting for a mapping strip. */
|
|
598
|
+
interface StopTimeLapseParam {
|
|
599
|
+
payloadPositionIndex: number;
|
|
600
|
+
payloadLensIndex: LensType;
|
|
601
|
+
}
|
|
602
|
+
type StopTimeLapseAction = ActionBase<"stopTimeLapse", StopTimeLapseParam>;
|
|
603
|
+
/** Locks gimbal pitch angle during a mapping strip. */
|
|
604
|
+
interface GimbalAngleLockParam {
|
|
605
|
+
payloadPositionIndex: number;
|
|
606
|
+
}
|
|
607
|
+
type GimbalAngleLockAction = ActionBase<"gimbalAngleLock", GimbalAngleLockParam>;
|
|
608
|
+
/**
|
|
609
|
+
* Unlocks gimbal angle after a mapping strip ends.
|
|
610
|
+
* ⚠️ No `actionActuatorFuncParam` element is emitted in XML — this action has no params.
|
|
611
|
+
*/
|
|
612
|
+
interface GimbalAngleUnlockAction {
|
|
613
|
+
actionId: number;
|
|
614
|
+
actionActuatorFunc: "gimbalAngleUnlock";
|
|
615
|
+
}
|
|
616
|
+
/** Sets camera focus mode (e.g. "manual") before a mapping run. */
|
|
617
|
+
interface SetFocusTypeParam {
|
|
618
|
+
payloadPositionIndex: number;
|
|
619
|
+
/** e.g. `"manual"`, `"auto"`. */
|
|
620
|
+
cameraFocusType: string;
|
|
621
|
+
}
|
|
622
|
+
type SetFocusTypeAction = ActionBase<"setFocusType", SetFocusTypeParam>;
|
|
533
623
|
/** M4D/M4TD only. */
|
|
534
624
|
interface SearchlightParam {
|
|
535
625
|
payloadPositionIndex: number;
|
|
@@ -577,24 +667,87 @@ interface TemplateWaypointPlacemark {
|
|
|
577
667
|
isRisky?: boolean;
|
|
578
668
|
actionGroup?: ActionGroup[];
|
|
579
669
|
}
|
|
580
|
-
/**
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
Polygon: {
|
|
586
|
-
outerBoundaryIs: {
|
|
587
|
-
LinearRing: {
|
|
588
|
-
/** Space-separated `lon,lat,alt` triples. */coordinates: string;
|
|
589
|
-
};
|
|
670
|
+
/** Survey-area boundary polygon, shared by mapping2d / mapping3d Placemarks. */
|
|
671
|
+
interface TemplatePolygon {
|
|
672
|
+
outerBoundaryIs: {
|
|
673
|
+
LinearRing: {
|
|
674
|
+
/** Space-separated `lon,lat,alt` triples. */coordinates: string;
|
|
590
675
|
};
|
|
591
676
|
};
|
|
592
677
|
}
|
|
593
|
-
/**
|
|
594
|
-
|
|
678
|
+
/**
|
|
679
|
+
* `Placemark` inside a `mapping2d` Folder. Per the WPML spec the shooting/mapping
|
|
680
|
+
* params live HERE alongside the polygon — NOT on the Folder.
|
|
681
|
+
*/
|
|
682
|
+
interface Mapping2dPlacemark {
|
|
683
|
+
/** M300/M350 only. */
|
|
684
|
+
caliFlightEnable?: boolean;
|
|
685
|
+
elevationOptimizeEnable: boolean;
|
|
686
|
+
/** M300/M350+P1, M3E/M3T/M3M, M3D. */
|
|
687
|
+
smartObliqueEnable?: boolean;
|
|
688
|
+
smartObliqueGimbalPitch?: Degrees;
|
|
689
|
+
/** M4E only. */
|
|
690
|
+
quickOrthoMappingEnable?: boolean;
|
|
691
|
+
/** Required iff `quickOrthoMappingEnable === true`. `[10, 30]`. */
|
|
692
|
+
quickOrthoMappingPitch?: Degrees;
|
|
693
|
+
/** M3E/M3T/M3M. */
|
|
694
|
+
facadeWaylineEnable?: boolean;
|
|
695
|
+
shootType: ShootType;
|
|
696
|
+
/** `[0, 360]`. */
|
|
697
|
+
direction: Degrees;
|
|
698
|
+
/** Outward survey-area margin, meters. */
|
|
699
|
+
margin: number;
|
|
700
|
+
/** M3E/M3T/M3M, M3D/M3TD, M4D/M4TD, M4E/M4T. */
|
|
701
|
+
mappingHeadingParam?: MappingHeadingParam;
|
|
702
|
+
/** M3E/M3T/M3M, M3D/M3TD, M4D/M4TD, M4E/M4T. */
|
|
703
|
+
gimbalPitchMode?: "manual" | "fixed";
|
|
704
|
+
/** Required iff `gimbalPitchMode === "fixed"`. `[-90, -30]`. */
|
|
705
|
+
gimbalPitchAngle?: Degrees;
|
|
706
|
+
/** Overlap ratios as percentages `[0, 100]` (e.g. `80`, not `0.8`). */
|
|
707
|
+
overlap: Overlap;
|
|
708
|
+
Polygon: TemplatePolygon;
|
|
709
|
+
/** WGS84 ellipsoid. */
|
|
710
|
+
ellipsoidHeight: Meters;
|
|
711
|
+
/** Per Folder `heightMode`. */
|
|
712
|
+
height: Meters;
|
|
713
|
+
}
|
|
714
|
+
/** `Placemark` inside a `mapping3d` (oblique) Folder. Params live here, not on the Folder. */
|
|
715
|
+
interface Mapping3dPlacemark {
|
|
716
|
+
caliFlightEnable?: boolean;
|
|
717
|
+
inclinedGimbalPitch: Degrees;
|
|
718
|
+
/** Range `[1, 15]`. */
|
|
719
|
+
inclinedFlightSpeed: MetersPerSecond;
|
|
720
|
+
shootType: ShootType;
|
|
721
|
+
direction: Degrees;
|
|
722
|
+
margin: number;
|
|
723
|
+
/** Overlap ratios as percentages `[0, 100]`. */
|
|
724
|
+
overlap: Overlap;
|
|
725
|
+
Polygon: TemplatePolygon;
|
|
726
|
+
ellipsoidHeight: Meters;
|
|
727
|
+
height: Meters;
|
|
728
|
+
}
|
|
729
|
+
/** `Placemark` inside a `mappingStrip` Folder — uses a LineString; params live here. */
|
|
730
|
+
interface MappingStripPlacemark {
|
|
731
|
+
caliFlightEnable: boolean;
|
|
732
|
+
shootType: ShootType;
|
|
733
|
+
direction: Degrees;
|
|
734
|
+
/** Float meters (vs integer in mapping2d/3d). */
|
|
735
|
+
margin: number;
|
|
736
|
+
singleLineEnable: boolean;
|
|
737
|
+
cuttingDistance: number;
|
|
738
|
+
boundaryOptimEnable: boolean;
|
|
739
|
+
leftExtend: number;
|
|
740
|
+
rightExtend: number;
|
|
741
|
+
includeCenterEnable: boolean;
|
|
742
|
+
/** Overlap ratios as percentages `[0, 100]`. */
|
|
743
|
+
overlap: Overlap;
|
|
595
744
|
LineString: {
|
|
596
745
|
/** Space-separated `lon,lat,alt` triples. Alt consumed only when `stripUseTemplateAltitude === true`. */coordinates: string;
|
|
597
746
|
};
|
|
747
|
+
ellipsoidHeight: Meters;
|
|
748
|
+
height: Meters;
|
|
749
|
+
/** When true, altitudes are read from LineString triples. */
|
|
750
|
+
stripUseTemplateAltitude: boolean;
|
|
598
751
|
}
|
|
599
752
|
/**
|
|
600
753
|
* `Placemark` inside a Folder of waylines.wpml.
|
|
@@ -616,6 +769,13 @@ interface WaylinesPlacemark {
|
|
|
616
769
|
useStraightLine?: boolean;
|
|
617
770
|
isRisky?: boolean;
|
|
618
771
|
actionGroup?: ActionGroup[];
|
|
772
|
+
/** Per-waypoint gimbal orientation hint observed in mapping waylines exports. */
|
|
773
|
+
waypointGimbalHeadingParam?: {
|
|
774
|
+
waypointGimbalPitchAngle: Degrees;
|
|
775
|
+
waypointGimbalYawAngle: Degrees;
|
|
776
|
+
};
|
|
777
|
+
/** Waypoint work type; 0 = normal. Observed in mapping waylines exports. */
|
|
778
|
+
waypointWorkType?: number;
|
|
619
779
|
}
|
|
620
780
|
//#endregion
|
|
621
781
|
//#region src/types/template.d.ts
|
|
@@ -664,35 +824,8 @@ interface Mapping2dFolder {
|
|
|
664
824
|
waylineCoordinateSysParam: WaylineCoordinateSysParam;
|
|
665
825
|
autoFlightSpeed: MetersPerSecond;
|
|
666
826
|
payloadParam?: PayloadParam;
|
|
667
|
-
/**
|
|
668
|
-
|
|
669
|
-
elevationOptimizeEnable: boolean;
|
|
670
|
-
/** M300/M350+P1, M3E/M3T/M3M, M3D. */
|
|
671
|
-
smartObliqueEnable?: boolean;
|
|
672
|
-
smartObliqueGimbalPitch?: Degrees;
|
|
673
|
-
shootType: ShootType;
|
|
674
|
-
/** `[0, 360]`. */
|
|
675
|
-
direction: Degrees;
|
|
676
|
-
/** Outward survey-area margin, meters. */
|
|
677
|
-
margin: number;
|
|
678
|
-
overlap: Overlap;
|
|
679
|
-
/** WGS84 ellipsoid. */
|
|
680
|
-
ellipsoidHeight: Meters;
|
|
681
|
-
/** Per Folder `heightMode`. */
|
|
682
|
-
height: Meters;
|
|
683
|
-
/** M3E/M3T/M3M. */
|
|
684
|
-
facadeWaylineEnable?: boolean;
|
|
685
|
-
/** M3E/M3T/M3M, M3D/M3TD, M4D/M4TD, M4E/M4T. */
|
|
686
|
-
mappingHeadingParam?: MappingHeadingParam;
|
|
687
|
-
/** M3E/M3T/M3M, M3D/M3TD, M4D/M4TD, M4E/M4T. */
|
|
688
|
-
gimbalPitchMode?: "manual" | "fixed";
|
|
689
|
-
/** Required iff `gimbalPitchMode === "fixed"`. `[-90, -30]`. */
|
|
690
|
-
gimbalPitchAngle?: Degrees;
|
|
691
|
-
/** M4E only. */
|
|
692
|
-
quickOrthoMappingEnable?: boolean;
|
|
693
|
-
/** Required iff `quickOrthoMappingEnable === true`. `[10, 30]`. */
|
|
694
|
-
quickOrthoMappingPitch?: Degrees;
|
|
695
|
-
Placemark: TemplatePolygonPlacemark;
|
|
827
|
+
/** Holds the survey polygon AND all shooting/mapping params (per WPML nesting). */
|
|
828
|
+
Placemark: Mapping2dPlacemark;
|
|
696
829
|
}
|
|
697
830
|
interface Mapping3dTemplate extends TemplateDocumentBase {
|
|
698
831
|
Folder: Mapping3dFolder;
|
|
@@ -703,17 +836,8 @@ interface Mapping3dFolder {
|
|
|
703
836
|
waylineCoordinateSysParam: WaylineCoordinateSysParam;
|
|
704
837
|
autoFlightSpeed: MetersPerSecond;
|
|
705
838
|
payloadParam?: PayloadParam;
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
/** Range `[1, 15]`. */
|
|
709
|
-
inclinedFlightSpeed: MetersPerSecond;
|
|
710
|
-
shootType: ShootType;
|
|
711
|
-
direction: Degrees;
|
|
712
|
-
margin: number;
|
|
713
|
-
overlap: Overlap;
|
|
714
|
-
ellipsoidHeight: Meters;
|
|
715
|
-
height: Meters;
|
|
716
|
-
Placemark: TemplatePolygonPlacemark;
|
|
839
|
+
/** Holds the survey polygon AND all shooting/mapping params. */
|
|
840
|
+
Placemark: Mapping3dPlacemark;
|
|
717
841
|
}
|
|
718
842
|
interface MappingStripTemplate extends TemplateDocumentBase {
|
|
719
843
|
Folder: MappingStripFolder;
|
|
@@ -724,26 +848,19 @@ interface MappingStripFolder {
|
|
|
724
848
|
waylineCoordinateSysParam: WaylineCoordinateSysParam;
|
|
725
849
|
autoFlightSpeed: MetersPerSecond;
|
|
726
850
|
payloadParam?: PayloadParam;
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
direction: Degrees;
|
|
730
|
-
/** Float meters (vs integer in mapping2d/3d). */
|
|
731
|
-
margin: number;
|
|
732
|
-
singleLineEnable: boolean;
|
|
733
|
-
cuttingDistance: number;
|
|
734
|
-
boundaryOptimEnable: boolean;
|
|
735
|
-
leftExtend: number;
|
|
736
|
-
rightExtend: number;
|
|
737
|
-
includeCenterEnable: boolean;
|
|
738
|
-
overlap: Overlap;
|
|
739
|
-
ellipsoidHeight: Meters;
|
|
740
|
-
height: Meters;
|
|
741
|
-
/** When true, altitudes are read from LineString triples. */
|
|
742
|
-
stripUseTemplateAltitude: boolean;
|
|
743
|
-
Placemark: TemplateLineStringPlacemark;
|
|
851
|
+
/** Holds the LineString AND all strip params. */
|
|
852
|
+
Placemark: MappingStripPlacemark;
|
|
744
853
|
}
|
|
745
854
|
//#endregion
|
|
746
855
|
//#region src/types/waylines.d.ts
|
|
856
|
+
/**
|
|
857
|
+
* Pre-flight action list executed before the wayline starts.
|
|
858
|
+
* The XML `<wpml:startActionGroup>` element only wraps raw `<wpml:action>` items —
|
|
859
|
+
* it has no `actionGroupId`, `actionGroupMode`, or `actionTrigger` elements.
|
|
860
|
+
*/
|
|
861
|
+
interface StartActionGroup {
|
|
862
|
+
action: Action[];
|
|
863
|
+
}
|
|
747
864
|
/**
|
|
748
865
|
* `waylines.wpml` document. Mirrors `<kml><Document>` structure.
|
|
749
866
|
* See `docs/kmz/waylines-wpml.html`.
|
|
@@ -763,19 +880,37 @@ interface WaylinesFolder {
|
|
|
763
880
|
/** Range `[1, 15]`. */
|
|
764
881
|
autoFlightSpeed: MetersPerSecond;
|
|
765
882
|
/**
|
|
766
|
-
* Optional pre-wayline action
|
|
883
|
+
* Optional pre-wayline action list executed before the wayline starts.
|
|
767
884
|
* Available on M30/M30T, M3E/M3T/M3M, M3D/M3TD, M4D/M4TD, M4E/M4T.
|
|
768
885
|
*/
|
|
769
|
-
startActionGroup?:
|
|
886
|
+
startActionGroup?: StartActionGroup;
|
|
770
887
|
Placemark: WaylinesPlacemark[];
|
|
771
888
|
}
|
|
772
889
|
//#endregion
|
|
773
890
|
//#region src/plan/index.d.ts
|
|
891
|
+
/**
|
|
892
|
+
* Options for `plan()`.
|
|
893
|
+
*
|
|
894
|
+
* Mapping templates (`mapping2d`, `mapping3d`) require `lineSpacing` — the perpendicular
|
|
895
|
+
* distance between adjacent flight lines in meters. The formula is:
|
|
896
|
+
* `2 · height · tan(HFOV / 2) · (1 − sideOverlap)`.
|
|
897
|
+
*
|
|
898
|
+
* `shootInterval` — time-lapse interval in seconds for `startTimeLapse` actions.
|
|
899
|
+
* Formula: `forwardGroundSpacing / speed`,
|
|
900
|
+
* where `forwardGroundSpacing = 2 · height · tan(VFOV / 2) · (1 − forwardOverlap)`.
|
|
901
|
+
* Camera FOV and sensor data live in the demo layer, not in this package.
|
|
902
|
+
*/
|
|
903
|
+
interface PlanOptions {
|
|
904
|
+
lineSpacing?: Meters;
|
|
905
|
+
shootInterval?: number;
|
|
906
|
+
}
|
|
774
907
|
/**
|
|
775
908
|
* Compile a high-level `Template` into executable `Waylines`.
|
|
776
909
|
* Dispatch is by `template.Folder.templateType` per the DJI WPML spec.
|
|
910
|
+
*
|
|
911
|
+
* Mapping templates require `options.lineSpacing` (meters between flight lines).
|
|
777
912
|
*/
|
|
778
|
-
declare function plan(template: Template): Waylines;
|
|
913
|
+
declare function plan(template: Template, options?: PlanOptions): Waylines;
|
|
779
914
|
//#endregion
|
|
780
915
|
//#region src/validate/index.d.ts
|
|
781
916
|
/**
|
|
@@ -786,4 +921,8 @@ declare function plan(template: Template): Waylines;
|
|
|
786
921
|
*/
|
|
787
922
|
declare function validate(doc: Template | Waylines): Issue[];
|
|
788
923
|
//#endregion
|
|
789
|
-
|
|
924
|
+
//#region src/plan/geometry.d.ts
|
|
925
|
+
/** Great-circle distance between two WGS-84 coordinates, in meters. */
|
|
926
|
+
declare function haversineMeters(a: LngLat, b: LngLat): number;
|
|
927
|
+
//#endregion
|
|
928
|
+
export { AccurateShootAction, AccurateShootParam, Action, ActionActuatorFunc, ActionGroup, ActionGroupMode, ActionTrigger, ActionTriggerType, AircraftPathMode, AutoRerouteInfo, CoordinateMode, CustomDirNameAction, CustomDirNameParam, Degrees, DroneEnum, DroneInfo, ExecuteHeightMode, ExecuteRCLostAction, ExitOnRCLost, FinishAction, FlyToWaylineMode, FocusAction, FocusMode, FocusParam, GimbalAngleLockAction, GimbalAngleLockParam, GimbalAngleUnlockAction, GimbalEvenlyRotateAction, GimbalEvenlyRotateParam, GimbalHeadingYawBase, GimbalPitchMode, GimbalRotateAction, GimbalRotateMode, GimbalRotateParam, HoverAction, HoverParam, Issue, KmzError, LensType, LidarReturnMode, LidarScanningMode, LngLat, LngLatHeight, Mapping2dFolder, Mapping2dPlacemark, Mapping2dTemplate, Mapping3dFolder, Mapping3dPlacemark, Mapping3dTemplate, MappingHeadingMode, MappingHeadingParam, MappingStripFolder, MappingStripPlacemark, MappingStripTemplate, MegaphoneAction, MegaphoneParam, MeteringMode, Meters, MetersPerSecond, MissionConfig, OrientedPhotoMode, OrientedShootAction, OrientedShootParam, Overlap, PanoShotAction, PanoShotParam, PanoShotSubMode, PayloadEnum, PayloadInfo, PayloadParam, type PlanOptions, PlannerError, PositioningType, RecordPointCloudAction, RecordPointCloudOperate, RecordPointCloudParam, RotateYawAction, RotateYawParam, SearchlightAction, SearchlightParam, SetFocusTypeAction, SetFocusTypeParam, ShootType, StartActionGroup, StartRecordAction, StartRecordParam, StartSmartObliqueAction, StartSmartObliqueParam, StartTimeLapseAction, StartTimeLapseParam, StopRecordAction, StopRecordParam, StopSmartObliqueAction, StopSmartObliqueParam, StopTimeLapseAction, StopTimeLapseParam, TakePhotoAction, TakePhotoParam, Template, TemplateHeightMode, TemplatePolygon, TemplateType, TemplateWaypointPlacemark, WaylineCoordinateSysParam, Waylines, WaylinesFolder, WaylinesPlacemark, WaypointFolder, WaypointHeadingMode, WaypointHeadingParam, WaypointHeadingPathMode, WaypointTemplate, WaypointTurnMode, WaypointTurnParam, ZoomAction, ZoomParam, degrees, haversineMeters, meters, metersPerSecond, plan, validate };
|