@flightpath/flightpath 0.0.9 → 0.0.11
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
CHANGED
|
@@ -80,10 +80,7 @@ go run examples/monitor_heartbeat_flightpath/main.go
|
|
|
80
80
|
# 1. Turn on the drone
|
|
81
81
|
|
|
82
82
|
# 2. Run the server with a serial port configuration
|
|
83
|
-
|
|
84
|
-
export FLIGHTPATH_MAVLINK_SERIAL_DEVICE=/dev/cu.usbserial-D30JAXGS
|
|
85
|
-
export FLIGHTPATH_MAVLINK_SERIAL_BAUD=57600
|
|
86
|
-
go run cmd/server/main.go
|
|
83
|
+
./scripts/run-serial.sh
|
|
87
84
|
|
|
88
85
|
# 3. Monitor messages from the drone
|
|
89
86
|
go run examples/monitor_heartbeat_flightpath/main.go
|
|
@@ -95,9 +92,7 @@ go run examples/monitor_heartbeat_flightpath/main.go
|
|
|
95
92
|
# 1. Turn on the drone
|
|
96
93
|
|
|
97
94
|
# 2. Run the server with a UDP configuration
|
|
98
|
-
|
|
99
|
-
export FLIGHTPATH_MAVLINK_UDP_ADDRESS=0.0.0.0:14550
|
|
100
|
-
go run cmd/server/main.go
|
|
95
|
+
./scripts/run-udp.sh
|
|
101
96
|
|
|
102
97
|
# 3. Monitor messages from the drone
|
|
103
98
|
go run examples/monitor_heartbeat_flightpath/main.go
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.10.2 with parameter "target=ts,import_extension=.js"
|
|
2
|
+
// @generated from file flightpath/mavlink_commands.proto (package flightpath, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import type { GenEnum, GenFile } from "@bufbuild/protobuf/codegenv2";
|
|
6
|
+
import { enumDesc, fileDesc } from "@bufbuild/protobuf/codegenv2";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Describes the file flightpath/mavlink_commands.proto.
|
|
10
|
+
*/
|
|
11
|
+
export const file_flightpath_mavlink_commands: GenFile = /*@__PURE__*/
|
|
12
|
+
fileDesc("CiFmbGlnaHRwYXRoL21hdmxpbmtfY29tbWFuZHMucHJvdG8SCmZsaWdodHBhdGgqmQEKBk1hdkNtZBIXChNNQVZfQ01EX1VOU1BFQ0lGSUVEEAASIAocTUFWX0NNRF9OQVZfUkVUVVJOX1RPX0xBVU5DSBAUEhcKE01BVl9DTURfTkFWX1RBS0VPRkYQFhIYChNNQVZfQ01EX0RPX1NFVF9NT0RFELABEiEKHE1BVl9DTURfQ09NUE9ORU5UX0FSTV9ESVNBUk0QkAMqwgIKC01hdk1vZGVGbGFnEh0KGU1BVl9NT0RFX0ZMQUdfVU5TUEVDSUZJRUQQABIlCiFNQVZfTU9ERV9GTEFHX0NVU1RPTV9NT0RFX0VOQUJMRUQQARIeChpNQVZfTU9ERV9GTEFHX1RFU1RfRU5BQkxFRBACEh4KGk1BVl9NT0RFX0ZMQUdfQVVUT19FTkFCTEVEEAQSIAocTUFWX01PREVfRkxBR19HVUlERURfRU5BQkxFRBAIEiMKH01BVl9NT0RFX0ZMQUdfU1RBQklMSVpFX0VOQUJMRUQQEBIdChlNQVZfTU9ERV9GTEFHX0hJTF9FTkFCTEVEECASJgoiTUFWX01PREVfRkxBR19NQU5VQUxfSU5QVVRfRU5BQkxFRBBAEh8KGk1BVl9NT0RFX0ZMQUdfU0FGRVRZX0FSTUVEEIABQm4KDmNvbS5mbGlnaHRwYXRoQhRNYXZsaW5rQ29tbWFuZHNQcm90b1ABogIDRlhYqgIKRmxpZ2h0cGF0aMoCCkZsaWdodHBhdGjiAhZGbGlnaHRwYXRoXEdQQk1ldGFkYXRh6gIKRmxpZ2h0cGF0aGIGcHJvdG8z");
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* MavCmd represents MAVLink command IDs from the MAV_CMD enum.
|
|
16
|
+
* Reference: https://mavlink.io/en/messages/common.html#MAV_CMD
|
|
17
|
+
*
|
|
18
|
+
* @generated from enum flightpath.MavCmd
|
|
19
|
+
*/
|
|
20
|
+
export enum MavCmd {
|
|
21
|
+
/**
|
|
22
|
+
* @generated from enum value: MAV_CMD_UNSPECIFIED = 0;
|
|
23
|
+
*/
|
|
24
|
+
UNSPECIFIED = 0,
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Navigation commands
|
|
28
|
+
*
|
|
29
|
+
* @generated from enum value: MAV_CMD_NAV_RETURN_TO_LAUNCH = 20;
|
|
30
|
+
*/
|
|
31
|
+
NAV_RETURN_TO_LAUNCH = 20,
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @generated from enum value: MAV_CMD_NAV_TAKEOFF = 22;
|
|
35
|
+
*/
|
|
36
|
+
NAV_TAKEOFF = 22,
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Mode commands
|
|
40
|
+
*
|
|
41
|
+
* @generated from enum value: MAV_CMD_DO_SET_MODE = 176;
|
|
42
|
+
*/
|
|
43
|
+
DO_SET_MODE = 176,
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Component commands
|
|
47
|
+
*
|
|
48
|
+
* @generated from enum value: MAV_CMD_COMPONENT_ARM_DISARM = 400;
|
|
49
|
+
*/
|
|
50
|
+
COMPONENT_ARM_DISARM = 400,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Describes the enum flightpath.MavCmd.
|
|
55
|
+
*/
|
|
56
|
+
export const MavCmdSchema: GenEnum<MavCmd> = /*@__PURE__*/
|
|
57
|
+
enumDesc(file_flightpath_mavlink_commands, 0);
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* MavModeFlag represents MAV_MODE_FLAG bitfield values.
|
|
61
|
+
* These flags can be combined using bitwise OR operations.
|
|
62
|
+
* Reference: https://mavlink.io/en/messages/common.html#MAV_MODE_FLAG
|
|
63
|
+
*
|
|
64
|
+
* @generated from enum flightpath.MavModeFlag
|
|
65
|
+
*/
|
|
66
|
+
export enum MavModeFlag {
|
|
67
|
+
/**
|
|
68
|
+
* @generated from enum value: MAV_MODE_FLAG_UNSPECIFIED = 0;
|
|
69
|
+
*/
|
|
70
|
+
UNSPECIFIED = 0,
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Bit 0 (1): Custom mode is enabled
|
|
74
|
+
*
|
|
75
|
+
* @generated from enum value: MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1;
|
|
76
|
+
*/
|
|
77
|
+
CUSTOM_MODE_ENABLED = 1,
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Bit 1 (2): Test mode enabled
|
|
81
|
+
*
|
|
82
|
+
* @generated from enum value: MAV_MODE_FLAG_TEST_ENABLED = 2;
|
|
83
|
+
*/
|
|
84
|
+
TEST_ENABLED = 2,
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Bit 2 (4): Autonomous mode enabled
|
|
88
|
+
*
|
|
89
|
+
* @generated from enum value: MAV_MODE_FLAG_AUTO_ENABLED = 4;
|
|
90
|
+
*/
|
|
91
|
+
AUTO_ENABLED = 4,
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Bit 3 (8): Guided mode enabled
|
|
95
|
+
*
|
|
96
|
+
* @generated from enum value: MAV_MODE_FLAG_GUIDED_ENABLED = 8;
|
|
97
|
+
*/
|
|
98
|
+
GUIDED_ENABLED = 8,
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Bit 4 (16): Stabilize mode enabled
|
|
102
|
+
*
|
|
103
|
+
* @generated from enum value: MAV_MODE_FLAG_STABILIZE_ENABLED = 16;
|
|
104
|
+
*/
|
|
105
|
+
STABILIZE_ENABLED = 16,
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Bit 5 (32): Hardware in the loop simulation enabled
|
|
109
|
+
*
|
|
110
|
+
* @generated from enum value: MAV_MODE_FLAG_HIL_ENABLED = 32;
|
|
111
|
+
*/
|
|
112
|
+
HIL_ENABLED = 32,
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Bit 6 (64): Manual input is enabled
|
|
116
|
+
*
|
|
117
|
+
* @generated from enum value: MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64;
|
|
118
|
+
*/
|
|
119
|
+
MANUAL_INPUT_ENABLED = 64,
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Bit 7 (128): Safety switch is currently engaged (armed)
|
|
123
|
+
*
|
|
124
|
+
* @generated from enum value: MAV_MODE_FLAG_SAFETY_ARMED = 128;
|
|
125
|
+
*/
|
|
126
|
+
SAFETY_ARMED = 128,
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Describes the enum flightpath.MavModeFlag.
|
|
131
|
+
*/
|
|
132
|
+
export const MavModeFlagSchema: GenEnum<MavModeFlag> = /*@__PURE__*/
|
|
133
|
+
enumDesc(file_flightpath_mavlink_commands, 1);
|
|
134
|
+
|
|
@@ -26,7 +26,7 @@ import type { Message } from "@bufbuild/protobuf";
|
|
|
26
26
|
* Describes the file flightpath/mavlink_service.proto.
|
|
27
27
|
*/
|
|
28
28
|
export const file_flightpath_mavlink_service: GenFile = /*@__PURE__*/
|
|
29
|
-
fileDesc("
|
|
29
|
+
fileDesc("CiBmbGlnaHRwYXRoL21hdmxpbmtfc2VydmljZS5wcm90bxIKZmxpZ2h0cGF0aCJRChhTdWJzY3JpYmVNZXNzYWdlc1JlcXVlc3QSNQoNbWVzc2FnZV90eXBlcxgBIAMoDjIeLmZsaWdodHBhdGguTWF2bGlua01lc3NhZ2VUeXBlIqMEChlTdWJzY3JpYmVNZXNzYWdlc1Jlc3BvbnNlEhQKDHRpbWVzdGFtcF9tcxgBIAEoAxIRCglzeXN0ZW1faWQYAiABKA0SFAoMY29tcG9uZW50X2lkGAMgASgNEjQKDG1lc3NhZ2VfdHlwZRgEIAEoDjIeLmZsaWdodHBhdGguTWF2bGlua01lc3NhZ2VUeXBlEioKCWhlYXJ0YmVhdBgFI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VkxJTktfTUVTU0FHRV9UWVBFX0dQU19SQVdfSU5UEAMSLAooTUFWTElOS19NRVNTQUdFX1RZUEVfR0xPQkFMX1BPU0lUSU9OX0lOVBAEEiAKHE1BVkxJTktfTUVTU0FHRV9UWVBFX1ZGUl9IVUQQBRIlCiFNQVZMSU5LX01FU1NBR0VfVFlQRV9SQURJT19TVEFUVVMQBhIrCidNQVZMSU5LX01FU1NBR0VfVFlQRV9FWFRFTkRFRF9TWVNfU1RBVEUQBxIjCh9NQVZMSU5LX01FU1NBR0VfVFlQRV9TVEFUVVNURVhUEAgyxAEKDk1BVkxpbmtTZXJ2aWNlEmIKEVN1YnNjcmliZU1lc3NhZ2VzEiQuZmxpZ2h0cGF0aC5TdWJzY3JpYmVNZXNzYWdlc1JlcXVlc3QaJS5mbGlnaHRwYXRoLlN1YnNjcmliZU1lc3NhZ2VzUmVzcG9uc2UwARJOCgtTZW5kQ29tbWFuZBIeLmZsaWdodHBhdGguU2VuZENvbW1hbmRSZXF1ZXN0Gh8uZmxpZ2h0cGF0aC5TZW5kQ29tbWFuZFJlc3BvbnNlQm0KDmNvbS5mbGlnaHRwYXRoQhNNYXZsaW5rU2VydmljZVByb3RvUAGiAgNGWFiqAgpGbGlnaHRwYXRoygIKRmxpZ2h0cGF0aOICFkZsaWdodHBhdGhcR1BCTWV0YWRhdGHqAgpGbGlnaHRwYXRoYgZwcm90bzM", [file_flightpath_extended_sys_state, file_flightpath_global_position_int, file_flightpath_gps_raw_int, file_flightpath_heartbeat, file_flightpath_radio_status, file_flightpath_statustext, file_flightpath_sys_status, file_flightpath_vfr_hud]);
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Subscribe to all messages or a filtered subset
|
|
@@ -147,6 +147,106 @@ export type SubscribeMessagesResponse = Message<"flightpath.SubscribeMessagesRes
|
|
|
147
147
|
export const SubscribeMessagesResponseSchema: GenMessage<SubscribeMessagesResponse> = /*@__PURE__*/
|
|
148
148
|
messageDesc(file_flightpath_mavlink_service, 1);
|
|
149
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Send a MAVLink command to the drone
|
|
152
|
+
*
|
|
153
|
+
* @generated from message flightpath.SendCommandRequest
|
|
154
|
+
*/
|
|
155
|
+
export type SendCommandRequest = Message<"flightpath.SendCommandRequest"> & {
|
|
156
|
+
/**
|
|
157
|
+
* Target system ID (typically 1 for autopilot)
|
|
158
|
+
*
|
|
159
|
+
* @generated from field: uint32 target_system_id = 1;
|
|
160
|
+
*/
|
|
161
|
+
targetSystemId: number;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Target component ID (typically 1 for autopilot)
|
|
165
|
+
*
|
|
166
|
+
* @generated from field: uint32 target_component_id = 2;
|
|
167
|
+
*/
|
|
168
|
+
targetComponentId: number;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* MAV_CMD enum value (e.g., 22 for MAV_CMD_NAV_TAKEOFF, 20 for MAV_CMD_NAV_RETURN_TO_LAUNCH)
|
|
172
|
+
*
|
|
173
|
+
* @generated from field: uint32 command = 3;
|
|
174
|
+
*/
|
|
175
|
+
command: number;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Command parameters (param1 through param7)
|
|
179
|
+
*
|
|
180
|
+
* @generated from field: float param1 = 4;
|
|
181
|
+
*/
|
|
182
|
+
param1: number;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @generated from field: float param2 = 5;
|
|
186
|
+
*/
|
|
187
|
+
param2: number;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* @generated from field: float param3 = 6;
|
|
191
|
+
*/
|
|
192
|
+
param3: number;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @generated from field: float param4 = 7;
|
|
196
|
+
*/
|
|
197
|
+
param4: number;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @generated from field: float param5 = 8;
|
|
201
|
+
*/
|
|
202
|
+
param5: number;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* @generated from field: float param6 = 9;
|
|
206
|
+
*/
|
|
207
|
+
param6: number;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @generated from field: float param7 = 10;
|
|
211
|
+
*/
|
|
212
|
+
param7: number;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Describes the message flightpath.SendCommandRequest.
|
|
217
|
+
* Use `create(SendCommandRequestSchema)` to create a new message.
|
|
218
|
+
*/
|
|
219
|
+
export const SendCommandRequestSchema: GenMessage<SendCommandRequest> = /*@__PURE__*/
|
|
220
|
+
messageDesc(file_flightpath_mavlink_service, 2);
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Response to a SendCommand request
|
|
224
|
+
*
|
|
225
|
+
* @generated from message flightpath.SendCommandResponse
|
|
226
|
+
*/
|
|
227
|
+
export type SendCommandResponse = Message<"flightpath.SendCommandResponse"> & {
|
|
228
|
+
/**
|
|
229
|
+
* Whether the command was sent successfully
|
|
230
|
+
*
|
|
231
|
+
* @generated from field: bool success = 1;
|
|
232
|
+
*/
|
|
233
|
+
success: boolean;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Error message if the command failed (optional)
|
|
237
|
+
*
|
|
238
|
+
* @generated from field: string error_message = 2;
|
|
239
|
+
*/
|
|
240
|
+
errorMessage: string;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Describes the message flightpath.SendCommandResponse.
|
|
245
|
+
* Use `create(SendCommandResponseSchema)` to create a new message.
|
|
246
|
+
*/
|
|
247
|
+
export const SendCommandResponseSchema: GenMessage<SendCommandResponse> = /*@__PURE__*/
|
|
248
|
+
messageDesc(file_flightpath_mavlink_service, 3);
|
|
249
|
+
|
|
150
250
|
/**
|
|
151
251
|
* MavlinkMessageType identifies the type of MAVLink message
|
|
152
252
|
*
|
|
@@ -221,6 +321,16 @@ export const MAVLinkService: GenService<{
|
|
|
221
321
|
input: typeof SubscribeMessagesRequestSchema;
|
|
222
322
|
output: typeof SubscribeMessagesResponseSchema;
|
|
223
323
|
},
|
|
324
|
+
/**
|
|
325
|
+
* Send a MAVLink command to the drone
|
|
326
|
+
*
|
|
327
|
+
* @generated from rpc flightpath.MAVLinkService.SendCommand
|
|
328
|
+
*/
|
|
329
|
+
sendCommand: {
|
|
330
|
+
methodKind: "unary";
|
|
331
|
+
input: typeof SendCommandRequestSchema;
|
|
332
|
+
output: typeof SendCommandResponseSchema;
|
|
333
|
+
},
|
|
224
334
|
}> = /*@__PURE__*/
|
|
225
335
|
serviceDesc(file_flightpath_mavlink_service, 0);
|
|
226
336
|
|