-
Notifications
You must be signed in to change notification settings - Fork 1
/
drone.d.ts
90 lines (90 loc) · 3.38 KB
/
drone.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
/// <reference types="web-bluetooth" />
import { Observable } from 'rxjs';
export declare class Drone {
private device;
private flightCommandInstructions;
private flightParamsInstructions;
private flightStatus;
roll: number;
pitch: number;
yaw: number;
altitude: number;
private flightLoopHandle;
private loopHandle;
private ready;
private connectionSubject;
readonly connection$: Observable<boolean>;
constructor(device: BluetoothDevice);
connect(): Promise<any>;
initialise(server: BluetoothRemoteGATTServer): Promise<void>;
private prepareCharacteristics(server);
private initialiseFlightDefaults();
private listenToOnDisconnected();
private onDisconnected();
/**
* Convenience method for setting the drone's altitude limitation
* @param {Integer} altitude the altitude in meters (2m-10m for Airborne Cargo / 2m - 25m for Mambo)
*/
setMaxAltitude(maxAltitude: number): Promise<any>;
/**
* Convenience method for setting the drone's max tilt limitation
* @param {integer} tilt The max tilt from 0-100 (0 = 5° - 100 = 20°)
*/
setMaxTilt(maxTilt: number): Promise<any>;
/**
* Convenience method for setting the drone's max vertical speed limitation
* @param {integer} verticalSpeed The max vertical speed from 0.5m/s - 2m/s
*/
setMaxVerticalSpeed(maxVerticalSpeed: number): Promise<any>;
/**
* Convenience method for setting the drone's max rotation speed limitation
* @param {integer} tilt The max rotation speed from (50°-360° for Airborne Cargo / 50° - 180° for Mambo)
*/
setMaxRotationSpeed(maxRotationSpeed: number): Promise<any>;
private startFlightLoop();
private stopFlightLoop();
/**
* Instructs the drone to take off
*/
takeOff(): void;
/**
* Instructs the drone to land
*/
land(): void;
/**
* Instructs the drone to fire the cannon
*/
fire(): void;
/**
* Sets the roll, pitch, yaw and altitude of drone's flight params in one call
* @param roll turn speed, expected value from -1 (move left) to 1 (move right)
* @param pitch turn speed, expected value from -1 (move back) to 1 (move forward)
* @param yaw turn speed, expected value from -1 (turn counter-clocwise) to 1 (turn clocwise)
* @param altitude turn speed, expected value from -1 (move down) to 1 (move up)
*/
private sendFlightParams();
updateFlightParams(roll: number, pitch: number, yaw: number, altitude: number): void;
/**
* Sets the roll speed of drone's flight params
* @param roll turn speed, expected value from -1 (move left) to 1 (move right)
*/
setRoll(roll: any): void;
/**
* Sets the pitch of drone's flight params
* @param pitch turn speed, expected value from -1 (move back) to 1 (move forward)
*/
setPitch(pitch: any): void;
/**
* Sets the turn speed of drone's flight params
* @param yaw turn speed, expected value from -1 (turn counter-clocwise) to 1 (turn clocwise)
*/
setYaw(yaw: number): void;
/**
* Sets the altitude of drone's flight params
* @param altitude turn speed, expected value from -1 (move down) to 1 (move up)
*/
setAltitude(altitude: any): void;
private convertToInputValue(value);
private ensureBoundaries(val, min, max);
private ensureBoundariesRound(val, min, max);
}