@rise-maritime/keelson-js 0.5.1-rc.6 → 0.5.2
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/dist/interfaces/MavlinkCommand.d.ts +83 -0
- package/dist/interfaces/MavlinkCommand.js +467 -0
- package/dist/interfaces/VehicleCommon.d.ts +65 -0
- package/dist/interfaces/VehicleCommon.js +181 -0
- package/dist/interfaces/VehicleControl.d.ts +148 -0
- package/dist/interfaces/VehicleControl.js +360 -0
- package/dist/interfaces/VehicleGeofence.d.ts +111 -0
- package/dist/interfaces/VehicleGeofence.js +612 -0
- package/dist/interfaces/VehicleLifecycle.d.ts +101 -0
- package/dist/interfaces/VehicleLifecycle.js +514 -0
- package/dist/interfaces/VehicleMission.d.ts +168 -0
- package/dist/interfaces/VehicleMission.js +1115 -0
- package/dist/interfaces/VehicleNavigation.d.ts +107 -0
- package/dist/interfaces/VehicleNavigation.js +426 -0
- package/dist/interfaces/VehicleParam.d.ts +107 -0
- package/dist/interfaces/VehicleParam.js +690 -0
- package/dist/payloads/EntityHealth.d.ts +61 -0
- package/dist/payloads/EntityHealth.js +467 -0
- package/dist/payloads/LocationFixQuality.d.ts +71 -9
- package/dist/payloads/LocationFixQuality.js +275 -21
- package/dist/payloads/index.keelson.d.ts +1 -0
- package/dist/payloads/index.keelson.js +1 -0
- package/dist/subjects.json +20 -2
- package/package.json +1 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { CommandResult } from "./VehicleCommon";
|
|
3
|
+
export declare const protobufPackage = "";
|
|
4
|
+
export interface SetMessageIntervalRequest {
|
|
5
|
+
/**
|
|
6
|
+
* Either the symbolic MAVLink message name (e.g. "ATTITUDE") OR the
|
|
7
|
+
* numeric MAVLink message id. If `message_id` is non-zero it wins.
|
|
8
|
+
*/
|
|
9
|
+
messageName: string;
|
|
10
|
+
messageId: number;
|
|
11
|
+
/** Desired publication rate in Hz. 0 = stop publishing the message. */
|
|
12
|
+
hz: number;
|
|
13
|
+
}
|
|
14
|
+
export interface SetMessageIntervalResponse {
|
|
15
|
+
result: CommandResult;
|
|
16
|
+
rawAutopilotResult: number;
|
|
17
|
+
detail: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Escape hatch: send an arbitrary MAVLink COMMAND_LONG. Use when a
|
|
21
|
+
* MAV_CMD_* operation doesn't have a typed subject yet.
|
|
22
|
+
*/
|
|
23
|
+
export interface CommandLongRequest {
|
|
24
|
+
/** MAV_CMD enum */
|
|
25
|
+
command: number;
|
|
26
|
+
param1: number;
|
|
27
|
+
param2: number;
|
|
28
|
+
param3: number;
|
|
29
|
+
param4: number;
|
|
30
|
+
param5: number;
|
|
31
|
+
param6: number;
|
|
32
|
+
param7: number;
|
|
33
|
+
/**
|
|
34
|
+
* Optional override of the target component (default = connector's
|
|
35
|
+
* configured --target-component).
|
|
36
|
+
*/
|
|
37
|
+
targetComponent?: number | undefined;
|
|
38
|
+
}
|
|
39
|
+
export interface CommandLongResponse {
|
|
40
|
+
result: CommandResult;
|
|
41
|
+
rawAutopilotResult: number;
|
|
42
|
+
detail: string;
|
|
43
|
+
}
|
|
44
|
+
export declare const SetMessageIntervalRequest: MessageFns<SetMessageIntervalRequest>;
|
|
45
|
+
export declare const SetMessageIntervalResponse: MessageFns<SetMessageIntervalResponse>;
|
|
46
|
+
export declare const CommandLongRequest: MessageFns<CommandLongRequest>;
|
|
47
|
+
export declare const CommandLongResponse: MessageFns<CommandLongResponse>;
|
|
48
|
+
export interface MavlinkCommand {
|
|
49
|
+
set_message_interval(request: SetMessageIntervalRequest): Promise<SetMessageIntervalResponse>;
|
|
50
|
+
send_command_long(request: CommandLongRequest): Promise<CommandLongResponse>;
|
|
51
|
+
}
|
|
52
|
+
export declare const MavlinkCommandServiceName = "MavlinkCommand";
|
|
53
|
+
export declare class MavlinkCommandClientImpl implements MavlinkCommand {
|
|
54
|
+
private readonly rpc;
|
|
55
|
+
private readonly service;
|
|
56
|
+
constructor(rpc: Rpc, opts?: {
|
|
57
|
+
service?: string;
|
|
58
|
+
});
|
|
59
|
+
set_message_interval(request: SetMessageIntervalRequest): Promise<SetMessageIntervalResponse>;
|
|
60
|
+
send_command_long(request: CommandLongRequest): Promise<CommandLongResponse>;
|
|
61
|
+
}
|
|
62
|
+
interface Rpc {
|
|
63
|
+
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
64
|
+
}
|
|
65
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
66
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
67
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
68
|
+
} : Partial<T>;
|
|
69
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
70
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
71
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
72
|
+
} & {
|
|
73
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
74
|
+
};
|
|
75
|
+
export interface MessageFns<T> {
|
|
76
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
77
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
78
|
+
fromJSON(object: any): T;
|
|
79
|
+
toJSON(message: T): unknown;
|
|
80
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
81
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.6.1
|
|
5
|
+
// protoc v6.30.2
|
|
6
|
+
// source: MavlinkCommand.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.MavlinkCommandClientImpl = exports.MavlinkCommandServiceName = exports.CommandLongResponse = exports.CommandLongRequest = exports.SetMessageIntervalResponse = exports.SetMessageIntervalRequest = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
+
const VehicleCommon_1 = require("./VehicleCommon");
|
|
12
|
+
exports.protobufPackage = "";
|
|
13
|
+
function createBaseSetMessageIntervalRequest() {
|
|
14
|
+
return { messageName: "", messageId: 0, hz: 0 };
|
|
15
|
+
}
|
|
16
|
+
exports.SetMessageIntervalRequest = {
|
|
17
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
18
|
+
if (message.messageName !== "") {
|
|
19
|
+
writer.uint32(10).string(message.messageName);
|
|
20
|
+
}
|
|
21
|
+
if (message.messageId !== 0) {
|
|
22
|
+
writer.uint32(16).uint32(message.messageId);
|
|
23
|
+
}
|
|
24
|
+
if (message.hz !== 0) {
|
|
25
|
+
writer.uint32(29).float(message.hz);
|
|
26
|
+
}
|
|
27
|
+
return writer;
|
|
28
|
+
},
|
|
29
|
+
decode(input, length) {
|
|
30
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
31
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
32
|
+
const message = createBaseSetMessageIntervalRequest();
|
|
33
|
+
while (reader.pos < end) {
|
|
34
|
+
const tag = reader.uint32();
|
|
35
|
+
switch (tag >>> 3) {
|
|
36
|
+
case 1: {
|
|
37
|
+
if (tag !== 10) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
message.messageName = reader.string();
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
case 2: {
|
|
44
|
+
if (tag !== 16) {
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
message.messageId = reader.uint32();
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
case 3: {
|
|
51
|
+
if (tag !== 29) {
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
message.hz = reader.float();
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
reader.skip(tag & 7);
|
|
62
|
+
}
|
|
63
|
+
return message;
|
|
64
|
+
},
|
|
65
|
+
fromJSON(object) {
|
|
66
|
+
return {
|
|
67
|
+
messageName: isSet(object.messageName) ? globalThis.String(object.messageName) : "",
|
|
68
|
+
messageId: isSet(object.messageId) ? globalThis.Number(object.messageId) : 0,
|
|
69
|
+
hz: isSet(object.hz) ? globalThis.Number(object.hz) : 0,
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
toJSON(message) {
|
|
73
|
+
const obj = {};
|
|
74
|
+
if (message.messageName !== "") {
|
|
75
|
+
obj.messageName = message.messageName;
|
|
76
|
+
}
|
|
77
|
+
if (message.messageId !== 0) {
|
|
78
|
+
obj.messageId = Math.round(message.messageId);
|
|
79
|
+
}
|
|
80
|
+
if (message.hz !== 0) {
|
|
81
|
+
obj.hz = message.hz;
|
|
82
|
+
}
|
|
83
|
+
return obj;
|
|
84
|
+
},
|
|
85
|
+
create(base) {
|
|
86
|
+
return exports.SetMessageIntervalRequest.fromPartial(base ?? {});
|
|
87
|
+
},
|
|
88
|
+
fromPartial(object) {
|
|
89
|
+
const message = createBaseSetMessageIntervalRequest();
|
|
90
|
+
message.messageName = object.messageName ?? "";
|
|
91
|
+
message.messageId = object.messageId ?? 0;
|
|
92
|
+
message.hz = object.hz ?? 0;
|
|
93
|
+
return message;
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
function createBaseSetMessageIntervalResponse() {
|
|
97
|
+
return { result: 0, rawAutopilotResult: 0, detail: "" };
|
|
98
|
+
}
|
|
99
|
+
exports.SetMessageIntervalResponse = {
|
|
100
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
101
|
+
if (message.result !== 0) {
|
|
102
|
+
writer.uint32(8).int32(message.result);
|
|
103
|
+
}
|
|
104
|
+
if (message.rawAutopilotResult !== 0) {
|
|
105
|
+
writer.uint32(16).int32(message.rawAutopilotResult);
|
|
106
|
+
}
|
|
107
|
+
if (message.detail !== "") {
|
|
108
|
+
writer.uint32(26).string(message.detail);
|
|
109
|
+
}
|
|
110
|
+
return writer;
|
|
111
|
+
},
|
|
112
|
+
decode(input, length) {
|
|
113
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
114
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
115
|
+
const message = createBaseSetMessageIntervalResponse();
|
|
116
|
+
while (reader.pos < end) {
|
|
117
|
+
const tag = reader.uint32();
|
|
118
|
+
switch (tag >>> 3) {
|
|
119
|
+
case 1: {
|
|
120
|
+
if (tag !== 8) {
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
message.result = reader.int32();
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
case 2: {
|
|
127
|
+
if (tag !== 16) {
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
message.rawAutopilotResult = reader.int32();
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
case 3: {
|
|
134
|
+
if (tag !== 26) {
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
message.detail = reader.string();
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
reader.skip(tag & 7);
|
|
145
|
+
}
|
|
146
|
+
return message;
|
|
147
|
+
},
|
|
148
|
+
fromJSON(object) {
|
|
149
|
+
return {
|
|
150
|
+
result: isSet(object.result) ? (0, VehicleCommon_1.commandResultFromJSON)(object.result) : 0,
|
|
151
|
+
rawAutopilotResult: isSet(object.rawAutopilotResult) ? globalThis.Number(object.rawAutopilotResult) : 0,
|
|
152
|
+
detail: isSet(object.detail) ? globalThis.String(object.detail) : "",
|
|
153
|
+
};
|
|
154
|
+
},
|
|
155
|
+
toJSON(message) {
|
|
156
|
+
const obj = {};
|
|
157
|
+
if (message.result !== 0) {
|
|
158
|
+
obj.result = (0, VehicleCommon_1.commandResultToJSON)(message.result);
|
|
159
|
+
}
|
|
160
|
+
if (message.rawAutopilotResult !== 0) {
|
|
161
|
+
obj.rawAutopilotResult = Math.round(message.rawAutopilotResult);
|
|
162
|
+
}
|
|
163
|
+
if (message.detail !== "") {
|
|
164
|
+
obj.detail = message.detail;
|
|
165
|
+
}
|
|
166
|
+
return obj;
|
|
167
|
+
},
|
|
168
|
+
create(base) {
|
|
169
|
+
return exports.SetMessageIntervalResponse.fromPartial(base ?? {});
|
|
170
|
+
},
|
|
171
|
+
fromPartial(object) {
|
|
172
|
+
const message = createBaseSetMessageIntervalResponse();
|
|
173
|
+
message.result = object.result ?? 0;
|
|
174
|
+
message.rawAutopilotResult = object.rawAutopilotResult ?? 0;
|
|
175
|
+
message.detail = object.detail ?? "";
|
|
176
|
+
return message;
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
function createBaseCommandLongRequest() {
|
|
180
|
+
return {
|
|
181
|
+
command: 0,
|
|
182
|
+
param1: 0,
|
|
183
|
+
param2: 0,
|
|
184
|
+
param3: 0,
|
|
185
|
+
param4: 0,
|
|
186
|
+
param5: 0,
|
|
187
|
+
param6: 0,
|
|
188
|
+
param7: 0,
|
|
189
|
+
targetComponent: undefined,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
exports.CommandLongRequest = {
|
|
193
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
194
|
+
if (message.command !== 0) {
|
|
195
|
+
writer.uint32(8).uint32(message.command);
|
|
196
|
+
}
|
|
197
|
+
if (message.param1 !== 0) {
|
|
198
|
+
writer.uint32(21).float(message.param1);
|
|
199
|
+
}
|
|
200
|
+
if (message.param2 !== 0) {
|
|
201
|
+
writer.uint32(29).float(message.param2);
|
|
202
|
+
}
|
|
203
|
+
if (message.param3 !== 0) {
|
|
204
|
+
writer.uint32(37).float(message.param3);
|
|
205
|
+
}
|
|
206
|
+
if (message.param4 !== 0) {
|
|
207
|
+
writer.uint32(45).float(message.param4);
|
|
208
|
+
}
|
|
209
|
+
if (message.param5 !== 0) {
|
|
210
|
+
writer.uint32(53).float(message.param5);
|
|
211
|
+
}
|
|
212
|
+
if (message.param6 !== 0) {
|
|
213
|
+
writer.uint32(61).float(message.param6);
|
|
214
|
+
}
|
|
215
|
+
if (message.param7 !== 0) {
|
|
216
|
+
writer.uint32(69).float(message.param7);
|
|
217
|
+
}
|
|
218
|
+
if (message.targetComponent !== undefined) {
|
|
219
|
+
writer.uint32(72).uint32(message.targetComponent);
|
|
220
|
+
}
|
|
221
|
+
return writer;
|
|
222
|
+
},
|
|
223
|
+
decode(input, length) {
|
|
224
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
225
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
226
|
+
const message = createBaseCommandLongRequest();
|
|
227
|
+
while (reader.pos < end) {
|
|
228
|
+
const tag = reader.uint32();
|
|
229
|
+
switch (tag >>> 3) {
|
|
230
|
+
case 1: {
|
|
231
|
+
if (tag !== 8) {
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
message.command = reader.uint32();
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
case 2: {
|
|
238
|
+
if (tag !== 21) {
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
message.param1 = reader.float();
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
case 3: {
|
|
245
|
+
if (tag !== 29) {
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
message.param2 = reader.float();
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
case 4: {
|
|
252
|
+
if (tag !== 37) {
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
message.param3 = reader.float();
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
case 5: {
|
|
259
|
+
if (tag !== 45) {
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
message.param4 = reader.float();
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
case 6: {
|
|
266
|
+
if (tag !== 53) {
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
message.param5 = reader.float();
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
case 7: {
|
|
273
|
+
if (tag !== 61) {
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
message.param6 = reader.float();
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
case 8: {
|
|
280
|
+
if (tag !== 69) {
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
message.param7 = reader.float();
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
case 9: {
|
|
287
|
+
if (tag !== 72) {
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
message.targetComponent = reader.uint32();
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
reader.skip(tag & 7);
|
|
298
|
+
}
|
|
299
|
+
return message;
|
|
300
|
+
},
|
|
301
|
+
fromJSON(object) {
|
|
302
|
+
return {
|
|
303
|
+
command: isSet(object.command) ? globalThis.Number(object.command) : 0,
|
|
304
|
+
param1: isSet(object.param1) ? globalThis.Number(object.param1) : 0,
|
|
305
|
+
param2: isSet(object.param2) ? globalThis.Number(object.param2) : 0,
|
|
306
|
+
param3: isSet(object.param3) ? globalThis.Number(object.param3) : 0,
|
|
307
|
+
param4: isSet(object.param4) ? globalThis.Number(object.param4) : 0,
|
|
308
|
+
param5: isSet(object.param5) ? globalThis.Number(object.param5) : 0,
|
|
309
|
+
param6: isSet(object.param6) ? globalThis.Number(object.param6) : 0,
|
|
310
|
+
param7: isSet(object.param7) ? globalThis.Number(object.param7) : 0,
|
|
311
|
+
targetComponent: isSet(object.targetComponent) ? globalThis.Number(object.targetComponent) : undefined,
|
|
312
|
+
};
|
|
313
|
+
},
|
|
314
|
+
toJSON(message) {
|
|
315
|
+
const obj = {};
|
|
316
|
+
if (message.command !== 0) {
|
|
317
|
+
obj.command = Math.round(message.command);
|
|
318
|
+
}
|
|
319
|
+
if (message.param1 !== 0) {
|
|
320
|
+
obj.param1 = message.param1;
|
|
321
|
+
}
|
|
322
|
+
if (message.param2 !== 0) {
|
|
323
|
+
obj.param2 = message.param2;
|
|
324
|
+
}
|
|
325
|
+
if (message.param3 !== 0) {
|
|
326
|
+
obj.param3 = message.param3;
|
|
327
|
+
}
|
|
328
|
+
if (message.param4 !== 0) {
|
|
329
|
+
obj.param4 = message.param4;
|
|
330
|
+
}
|
|
331
|
+
if (message.param5 !== 0) {
|
|
332
|
+
obj.param5 = message.param5;
|
|
333
|
+
}
|
|
334
|
+
if (message.param6 !== 0) {
|
|
335
|
+
obj.param6 = message.param6;
|
|
336
|
+
}
|
|
337
|
+
if (message.param7 !== 0) {
|
|
338
|
+
obj.param7 = message.param7;
|
|
339
|
+
}
|
|
340
|
+
if (message.targetComponent !== undefined) {
|
|
341
|
+
obj.targetComponent = Math.round(message.targetComponent);
|
|
342
|
+
}
|
|
343
|
+
return obj;
|
|
344
|
+
},
|
|
345
|
+
create(base) {
|
|
346
|
+
return exports.CommandLongRequest.fromPartial(base ?? {});
|
|
347
|
+
},
|
|
348
|
+
fromPartial(object) {
|
|
349
|
+
const message = createBaseCommandLongRequest();
|
|
350
|
+
message.command = object.command ?? 0;
|
|
351
|
+
message.param1 = object.param1 ?? 0;
|
|
352
|
+
message.param2 = object.param2 ?? 0;
|
|
353
|
+
message.param3 = object.param3 ?? 0;
|
|
354
|
+
message.param4 = object.param4 ?? 0;
|
|
355
|
+
message.param5 = object.param5 ?? 0;
|
|
356
|
+
message.param6 = object.param6 ?? 0;
|
|
357
|
+
message.param7 = object.param7 ?? 0;
|
|
358
|
+
message.targetComponent = object.targetComponent ?? undefined;
|
|
359
|
+
return message;
|
|
360
|
+
},
|
|
361
|
+
};
|
|
362
|
+
function createBaseCommandLongResponse() {
|
|
363
|
+
return { result: 0, rawAutopilotResult: 0, detail: "" };
|
|
364
|
+
}
|
|
365
|
+
exports.CommandLongResponse = {
|
|
366
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
367
|
+
if (message.result !== 0) {
|
|
368
|
+
writer.uint32(8).int32(message.result);
|
|
369
|
+
}
|
|
370
|
+
if (message.rawAutopilotResult !== 0) {
|
|
371
|
+
writer.uint32(16).int32(message.rawAutopilotResult);
|
|
372
|
+
}
|
|
373
|
+
if (message.detail !== "") {
|
|
374
|
+
writer.uint32(26).string(message.detail);
|
|
375
|
+
}
|
|
376
|
+
return writer;
|
|
377
|
+
},
|
|
378
|
+
decode(input, length) {
|
|
379
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
380
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
381
|
+
const message = createBaseCommandLongResponse();
|
|
382
|
+
while (reader.pos < end) {
|
|
383
|
+
const tag = reader.uint32();
|
|
384
|
+
switch (tag >>> 3) {
|
|
385
|
+
case 1: {
|
|
386
|
+
if (tag !== 8) {
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
message.result = reader.int32();
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
case 2: {
|
|
393
|
+
if (tag !== 16) {
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
396
|
+
message.rawAutopilotResult = reader.int32();
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
case 3: {
|
|
400
|
+
if (tag !== 26) {
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
message.detail = reader.string();
|
|
404
|
+
continue;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
408
|
+
break;
|
|
409
|
+
}
|
|
410
|
+
reader.skip(tag & 7);
|
|
411
|
+
}
|
|
412
|
+
return message;
|
|
413
|
+
},
|
|
414
|
+
fromJSON(object) {
|
|
415
|
+
return {
|
|
416
|
+
result: isSet(object.result) ? (0, VehicleCommon_1.commandResultFromJSON)(object.result) : 0,
|
|
417
|
+
rawAutopilotResult: isSet(object.rawAutopilotResult) ? globalThis.Number(object.rawAutopilotResult) : 0,
|
|
418
|
+
detail: isSet(object.detail) ? globalThis.String(object.detail) : "",
|
|
419
|
+
};
|
|
420
|
+
},
|
|
421
|
+
toJSON(message) {
|
|
422
|
+
const obj = {};
|
|
423
|
+
if (message.result !== 0) {
|
|
424
|
+
obj.result = (0, VehicleCommon_1.commandResultToJSON)(message.result);
|
|
425
|
+
}
|
|
426
|
+
if (message.rawAutopilotResult !== 0) {
|
|
427
|
+
obj.rawAutopilotResult = Math.round(message.rawAutopilotResult);
|
|
428
|
+
}
|
|
429
|
+
if (message.detail !== "") {
|
|
430
|
+
obj.detail = message.detail;
|
|
431
|
+
}
|
|
432
|
+
return obj;
|
|
433
|
+
},
|
|
434
|
+
create(base) {
|
|
435
|
+
return exports.CommandLongResponse.fromPartial(base ?? {});
|
|
436
|
+
},
|
|
437
|
+
fromPartial(object) {
|
|
438
|
+
const message = createBaseCommandLongResponse();
|
|
439
|
+
message.result = object.result ?? 0;
|
|
440
|
+
message.rawAutopilotResult = object.rawAutopilotResult ?? 0;
|
|
441
|
+
message.detail = object.detail ?? "";
|
|
442
|
+
return message;
|
|
443
|
+
},
|
|
444
|
+
};
|
|
445
|
+
exports.MavlinkCommandServiceName = "MavlinkCommand";
|
|
446
|
+
class MavlinkCommandClientImpl {
|
|
447
|
+
constructor(rpc, opts) {
|
|
448
|
+
this.service = opts?.service || exports.MavlinkCommandServiceName;
|
|
449
|
+
this.rpc = rpc;
|
|
450
|
+
this.set_message_interval = this.set_message_interval.bind(this);
|
|
451
|
+
this.send_command_long = this.send_command_long.bind(this);
|
|
452
|
+
}
|
|
453
|
+
set_message_interval(request) {
|
|
454
|
+
const data = exports.SetMessageIntervalRequest.encode(request).finish();
|
|
455
|
+
const promise = this.rpc.request(this.service, "set_message_interval", data);
|
|
456
|
+
return promise.then((data) => exports.SetMessageIntervalResponse.decode(new wire_1.BinaryReader(data)));
|
|
457
|
+
}
|
|
458
|
+
send_command_long(request) {
|
|
459
|
+
const data = exports.CommandLongRequest.encode(request).finish();
|
|
460
|
+
const promise = this.rpc.request(this.service, "send_command_long", data);
|
|
461
|
+
return promise.then((data) => exports.CommandLongResponse.decode(new wire_1.BinaryReader(data)));
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
exports.MavlinkCommandClientImpl = MavlinkCommandClientImpl;
|
|
465
|
+
function isSet(value) {
|
|
466
|
+
return value !== null && value !== undefined;
|
|
467
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "";
|
|
3
|
+
/**
|
|
4
|
+
* Outcome of a vehicle-side command. Values 1..7 mirror the MAVLink
|
|
5
|
+
* MAV_RESULT enum 1:1 by name (with renumbering so that the proto3
|
|
6
|
+
* default `UNSPECIFIED = 0` is a safe absent-field sentinel rather than
|
|
7
|
+
* an accidental ACCEPTED). Values 8 and 9 are connector-internal and
|
|
8
|
+
* have no MAVLink equivalent.
|
|
9
|
+
*
|
|
10
|
+
* For autopilots that expose richer or newer result codes than the ones
|
|
11
|
+
* modeled here, response messages should carry the raw integer
|
|
12
|
+
* alongside this enum so callers don't lose information.
|
|
13
|
+
*/
|
|
14
|
+
export declare enum CommandResult {
|
|
15
|
+
COMMAND_RESULT_UNSPECIFIED = 0,
|
|
16
|
+
COMMAND_RESULT_ACCEPTED = 1,
|
|
17
|
+
COMMAND_RESULT_TEMPORARILY_REJECTED = 2,
|
|
18
|
+
COMMAND_RESULT_DENIED = 3,
|
|
19
|
+
COMMAND_RESULT_UNSUPPORTED = 4,
|
|
20
|
+
COMMAND_RESULT_FAILED = 5,
|
|
21
|
+
COMMAND_RESULT_IN_PROGRESS = 6,
|
|
22
|
+
COMMAND_RESULT_CANCELLED = 7,
|
|
23
|
+
/** COMMAND_RESULT_TIMEOUT - The autopilot did not reply within the connector's wait window. */
|
|
24
|
+
COMMAND_RESULT_TIMEOUT = 8,
|
|
25
|
+
/**
|
|
26
|
+
* COMMAND_RESULT_NOT_OBSERVABLE - The MAVLink path used to deliver the command has no acknowledgement
|
|
27
|
+
* (e.g. SET_POSITION_TARGET_GLOBAL_INT). The command was sent on the
|
|
28
|
+
* wire but the autopilot's acceptance is not observable directly;
|
|
29
|
+
* callers must infer success from downstream telemetry.
|
|
30
|
+
*/
|
|
31
|
+
COMMAND_RESULT_NOT_OBSERVABLE = 9,
|
|
32
|
+
UNRECOGNIZED = -1
|
|
33
|
+
}
|
|
34
|
+
export declare function commandResultFromJSON(object: any): CommandResult;
|
|
35
|
+
export declare function commandResultToJSON(object: CommandResult): string;
|
|
36
|
+
/**
|
|
37
|
+
* WGS84 latitude/longitude in plain degrees. Shared by Vehicle*
|
|
38
|
+
* interfaces that carry geographic positions (missions, geofences,
|
|
39
|
+
* navigation targets) so consumers see a single coordinate shape
|
|
40
|
+
* rather than each interface picking its own scaling / units.
|
|
41
|
+
*/
|
|
42
|
+
export interface Coordinate {
|
|
43
|
+
latitudeDeg: number;
|
|
44
|
+
longitudeDeg: number;
|
|
45
|
+
}
|
|
46
|
+
export declare const Coordinate: MessageFns<Coordinate>;
|
|
47
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
48
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
49
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
50
|
+
} : Partial<T>;
|
|
51
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
52
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
53
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
54
|
+
} & {
|
|
55
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
56
|
+
};
|
|
57
|
+
export interface MessageFns<T> {
|
|
58
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
59
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
60
|
+
fromJSON(object: any): T;
|
|
61
|
+
toJSON(message: T): unknown;
|
|
62
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
63
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
64
|
+
}
|
|
65
|
+
export {};
|