-
Notifications
You must be signed in to change notification settings - Fork 98
/
Copy pathgeofence.proto
85 lines (71 loc) · 2.5 KB
/
geofence.proto
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
syntax = "proto3";
package mavsdk.rpc.geofence;
import "mavsdk_options.proto";
option java_package = "io.mavsdk.geofence";
option java_outer_classname = "GeofenceProto";
// Enable setting a geofence.
service GeofenceService {
/*
* Upload geofences.
*
* Polygon and Circular geofences are uploaded to a drone. Once uploaded, the geofence will remain
* on the drone even if a connection is lost.
*/
rpc UploadGeofence(UploadGeofenceRequest) returns(UploadGeofenceResponse) {}
/*
* Clear all geofences saved on the vehicle.
*/
rpc ClearGeofence(ClearGeofenceRequest) returns(ClearGeofenceResponse) {}
}
// Point type.
message Point {
double latitude_deg = 1; // Latitude in degrees (range: -90 to +90)
double longitude_deg = 2; // Longitude in degrees (range: -180 to +180)
}
// Geofence types.
enum FenceType {
FENCE_TYPE_INCLUSION = 0; // Type representing an inclusion fence
FENCE_TYPE_EXCLUSION = 1; // Type representing an exclusion fence
}
// Polygon type.
message Polygon {
repeated Point points = 1; // Points defining the polygon
FenceType fence_type = 2; // Fence type
}
// Circular type.
message Circle {
Point point = 1; // Point defining the center
float radius = 2 [(mavsdk.options.default_value)="NaN"]; // Radius of the circular fence
FenceType fence_type = 3; // Fence type
}
// Geofence data type.
message GeofenceData {
repeated Polygon polygons = 1; // Polygon(s) representing the geofence(s)
repeated Circle circles = 2; // Circle(s) representing the geofence(s)
}
message UploadGeofenceRequest {
GeofenceData geofence_data = 1; // Circle(s) and/or Polygon(s) representing the geofence(s)
}
message UploadGeofenceResponse {
GeofenceResult geofence_result = 1;
}
message ClearGeofenceRequest {}
message ClearGeofenceResponse {
GeofenceResult geofence_result = 1;
}
// Result type.
message GeofenceResult {
// Possible results returned for geofence requests.
enum Result {
RESULT_UNKNOWN = 0; // Unknown result
RESULT_SUCCESS = 1; // Request succeeded
RESULT_ERROR = 2; // Error
RESULT_TOO_MANY_GEOFENCE_ITEMS = 3; // Too many objects in the geofence
RESULT_BUSY = 4; // Vehicle is busy
RESULT_TIMEOUT = 5; // Request timed out
RESULT_INVALID_ARGUMENT = 6; // Invalid argument
RESULT_NO_SYSTEM = 7; // No system connected
}
Result result = 1; // Result enum value
string result_str = 2; // Human-readable English string describing the result
}