-
Notifications
You must be signed in to change notification settings - Fork 0
/
flightplan.d.ts
110 lines (110 loc) · 3.76 KB
/
flightplan.d.ts
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
/// <reference types="node" />
import { EventEmitter } from 'events';
/**
* Waypoint.
*/
export declare class Waypoint {
latitude: number;
longitude: number;
altitude: number;
orientation: number;
radius: number;
constructor(latitude: number, longitude: number, altitude: number, orientation: number, radius: number);
readonly isValid: boolean;
clone(): Waypoint;
}
/**
* Flight plan.
* The flightplan implementation must ensure that it can be completely constructed from its mavlink representation.
*/
export declare class Flightplan extends EventEmitter {
private _name;
private _mavlink;
private _takeOffPosition;
private _touchDownPosition;
private _waypoints;
/**
* Construct a flight plan instance. Can throw an error if parsing mavlink fails
* @param mavlink If present, parseMavlink is called by the constructor, otherwise an
* empty (equal to a cleared) and invalid flight plan is created.
*/
constructor(mavlink?: string);
/**
* Clear previously added data.
* Invalidates this flight plan.
*/
clear(): void;
/**
* Check if this is a valid flight plan.
* A cleared flight plan (this.clear()) is not valid.
*/
readonly isValid: boolean;
/**
* (Re)generate the mavlink code from internal waypoint data.
* @param holdTimeAtWaypoint The time to wait at each waypoint in seconds.
* @param velocity The velocity in [m/s].
*/
updateMavlink(velocity?: number, holdTimeAtWaypoint?: number): void;
/**
* Return the name of this flight plan.
*/
readonly name: string;
/**
* Return the flight plan in mavlink format.
*/
readonly mavlink: string;
/**
* Number of waypoints. Without take-off and touch-down positions.
*/
readonly numWaypoints: number;
/**
* Get take-off waypoint.
*/
readonly takeOffPosition: Waypoint;
/**
* Get touch-down waypoint.
*/
readonly touchDownPosition: Waypoint;
/**
* Get waypoints. Does not include take-off and touch-down waypoints.
*/
readonly waypoints: Waypoint[];
/**
* Set an accuracy radius for each waypoint.
* @param radius Radius set for each waypoint.
*/
setWaypointRadius(radius: number): void;
/**
* Set the altitude of the flight path.
* @param altitude Altitude for all waypoints.
*/
setAltitude(altitude: number): void;
/**
* Set a single bearing for all waypoints.
* @param bearing Bearing for all waypoints.
*/
setBearing(bearing: number): void;
/**
* Set bearings for each waypoint such that the vehicle
* is facing the center of the bounding box of the flight path.
*/
setBearingToCenter(): void;
/**
* Add waypoints every stepSize meters to the waypoints of this flight path. Latitude, longitude and altitude is interpolated.
* Waypoint radius and bearing are taken from the previous waypoint of the respective leg.
*/
addWaypoints(stepSize: number): void;
/**
* Parse a flightplan in Bebop mavlink format.
* @param flightplan A string in Bebop mavlink format and containing a line with '// (name):{<flightplan-name}.
* Throws and error in case a problem is encountered.
*/
parseMavlink(flightplan: string): void;
/**
* Load a kmz (Google Earth path) file and parse its coordinate section.
* Sets first point as take-off location and last point as touch-down location.
* @param kmz The content of a kmz file.
* @param name The name to set to the flight plan.
*/
parseKmz(kmz: string, name: string, bearing?: number, waypointRadius?: number): void;
}