@rise-maritime/keelson-js 0.5.1 → 0.5.3
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/ErrorResponse.d.ts +28 -0
- package/dist/interfaces/ErrorResponse.js +108 -3
- package/dist/interfaces/ReplayControl.d.ts +97 -0
- package/dist/interfaces/ReplayControl.js +616 -0
- package/dist/interfaces/VehicleControl.d.ts +48 -23
- package/dist/interfaces/VehicleControl.js +40 -40
- package/dist/interfaces/VehicleLifecycle.d.ts +0 -21
- package/dist/interfaces/VehicleLifecycle.js +1 -141
- package/dist/interfaces/VehicleParam.d.ts +22 -0
- package/dist/interfaces/VehicleParam.js +164 -1
- package/dist/payloads/Primitives.d.ts +11 -0
- package/dist/payloads/Primitives.js +89 -1
- package/dist/payloads/ReplayStatus.d.ts +76 -0
- package/dist/payloads/ReplayStatus.js +445 -0
- package/dist/payloads/Severity.d.ts +14 -0
- package/dist/payloads/Severity.js +59 -0
- package/dist/payloads/VehicleState.d.ts +56 -0
- package/dist/payloads/VehicleState.js +196 -0
- package/dist/payloads/Weather.d.ts +148 -0
- package/dist/payloads/Weather.js +906 -0
- package/dist/payloads/index.foxglove.d.ts +1 -1
- package/dist/payloads/index.foxglove.js +1 -1
- package/dist/payloads/index.keelson.d.ts +4 -0
- package/dist/payloads/index.keelson.js +4 -0
- package/dist/subjects.json +24 -1
- package/package.json +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
import { Empty } from "./google/protobuf/empty";
|
|
3
3
|
export declare const protobufPackage = "";
|
|
4
|
-
export interface
|
|
4
|
+
export interface ControlAxis {
|
|
5
5
|
/**
|
|
6
6
|
* Entity to subscribe under. Empty string => connector's own
|
|
7
7
|
* --entity-id (the typical case: a companion-board joystick driver
|
|
@@ -33,8 +33,26 @@ export interface ManualControlAxis {
|
|
|
33
33
|
*/
|
|
34
34
|
invert: boolean;
|
|
35
35
|
}
|
|
36
|
-
export interface
|
|
36
|
+
export interface ControlAxisMapping {
|
|
37
37
|
/**
|
|
38
|
+
* -------------------------------------------------------------------
|
|
39
|
+
* Contract for publishers feeding these axes
|
|
40
|
+
* -------------------------------------------------------------------
|
|
41
|
+
* Publishers MUST publish continuously (on a fixed cadence, NOT
|
|
42
|
+
* on-change-only) for the entire duration they are driving an axis
|
|
43
|
+
* — including when the value isn't changing. Recommended rate:
|
|
44
|
+
* 10-20 Hz.
|
|
45
|
+
*
|
|
46
|
+
* This is load-bearing: the connector is sample-driven (one MAVLink
|
|
47
|
+
* RC_CHANNELS_OVERRIDE per arriving Zenoh sample for mavlink2keelson;
|
|
48
|
+
* equivalent framing for other actuation transports), and ArduPilot
|
|
49
|
+
* times the override out after ~3 s of no frames. Silence on the
|
|
50
|
+
* Zenoh wire is the stop signal — so an on-change-only publisher
|
|
51
|
+
* looks identical to a publisher dropout once the value stops
|
|
52
|
+
* changing. Make sure your upstream emits whether or not the value
|
|
53
|
+
* changed.
|
|
54
|
+
* -------------------------------------------------------------------
|
|
55
|
+
*
|
|
38
56
|
* Per-axis subject mapping. v1 (ArduPilot Rover frame) recognizes
|
|
39
57
|
* only "steering" and "throttle" — they resolve to the autopilot's
|
|
40
58
|
* RCMAP_ROLL and RCMAP_THROTTLE RC channels respectively, via the
|
|
@@ -47,7 +65,7 @@ export interface ManualControlMapping {
|
|
|
47
65
|
* ("autonomy steers, joystick controls throttle").
|
|
48
66
|
*/
|
|
49
67
|
axes: {
|
|
50
|
-
[key: string]:
|
|
68
|
+
[key: string]: ControlAxis;
|
|
51
69
|
};
|
|
52
70
|
/**
|
|
53
71
|
* Minimum interval between RC_OVERRIDE emissions, in seconds.
|
|
@@ -57,37 +75,44 @@ export interface ManualControlMapping {
|
|
|
57
75
|
*/
|
|
58
76
|
minIntervalS: number;
|
|
59
77
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
78
|
+
* Dead-man: if any mapped axis's last sample is older than this
|
|
79
|
+
* (in seconds, wall clock) the connector stops emitting
|
|
80
|
+
* RC_CHANNELS_OVERRIDE, letting ArduPilot's own RC override timer
|
|
81
|
+
* expire and return control to the autopilot mode. This is what
|
|
82
|
+
* catches a Zenoh-side dropout — without it, the override would
|
|
83
|
+
* survive a network split indefinitely.
|
|
84
|
+
*
|
|
85
|
+
* 0 (unset) = use the connector default of 1.0 s, which assumes
|
|
86
|
+
* upstreams publish at >= 10 Hz (lots of headroom for jitter). Set
|
|
87
|
+
* explicitly to tighten or loosen; values above ArduPilot's
|
|
88
|
+
* RC_OVERRIDE_TIME (~3 s default) are pointless because ArduPilot
|
|
89
|
+
* would time out first. The dead-man cannot be disabled by design.
|
|
65
90
|
*/
|
|
66
91
|
maxAxisAgeS: number;
|
|
67
92
|
}
|
|
68
|
-
export interface
|
|
93
|
+
export interface ControlAxisMapping_AxesEntry {
|
|
69
94
|
key: string;
|
|
70
|
-
value:
|
|
95
|
+
value: ControlAxis | undefined;
|
|
71
96
|
}
|
|
72
|
-
export interface
|
|
97
|
+
export interface ControlAxisMappingAck {
|
|
73
98
|
}
|
|
74
|
-
export declare const
|
|
75
|
-
export declare const
|
|
76
|
-
export declare const
|
|
77
|
-
export declare const
|
|
99
|
+
export declare const ControlAxis: MessageFns<ControlAxis>;
|
|
100
|
+
export declare const ControlAxisMapping: MessageFns<ControlAxisMapping>;
|
|
101
|
+
export declare const ControlAxisMapping_AxesEntry: MessageFns<ControlAxisMapping_AxesEntry>;
|
|
102
|
+
export declare const ControlAxisMappingAck: MessageFns<ControlAxisMappingAck>;
|
|
78
103
|
export interface VehicleControl {
|
|
79
104
|
/**
|
|
80
|
-
* Replace the active
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
105
|
+
* Replace the active control-axis mapping atomically. An empty axes
|
|
106
|
+
* map = stop driving (undeclare every axis subscriber). Calling this
|
|
107
|
+
* RPC is the only way to make the vehicle drivable after a connector
|
|
108
|
+
* start.
|
|
84
109
|
*/
|
|
85
|
-
|
|
110
|
+
set_control_mapping(request: ControlAxisMapping): Promise<ControlAxisMappingAck>;
|
|
86
111
|
/**
|
|
87
112
|
* Return the currently-active mapping. Useful for operators
|
|
88
113
|
* inspecting state set by another client.
|
|
89
114
|
*/
|
|
90
|
-
|
|
115
|
+
get_control_mapping(request: Empty): Promise<ControlAxisMapping>;
|
|
91
116
|
}
|
|
92
117
|
export declare const VehicleControlServiceName = "VehicleControl";
|
|
93
118
|
export declare class VehicleControlClientImpl implements VehicleControl {
|
|
@@ -96,8 +121,8 @@ export declare class VehicleControlClientImpl implements VehicleControl {
|
|
|
96
121
|
constructor(rpc: Rpc, opts?: {
|
|
97
122
|
service?: string;
|
|
98
123
|
});
|
|
99
|
-
|
|
100
|
-
|
|
124
|
+
set_control_mapping(request: ControlAxisMapping): Promise<ControlAxisMappingAck>;
|
|
125
|
+
get_control_mapping(request: Empty): Promise<ControlAxisMapping>;
|
|
101
126
|
}
|
|
102
127
|
interface Rpc {
|
|
103
128
|
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
// protoc v6.30.2
|
|
6
6
|
// source: VehicleControl.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.VehicleControlClientImpl = exports.VehicleControlServiceName = exports.
|
|
8
|
+
exports.VehicleControlClientImpl = exports.VehicleControlServiceName = exports.ControlAxisMappingAck = exports.ControlAxisMapping_AxesEntry = exports.ControlAxisMapping = exports.ControlAxis = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
const empty_1 = require("./google/protobuf/empty");
|
|
12
12
|
exports.protobufPackage = "";
|
|
13
|
-
function
|
|
13
|
+
function createBaseControlAxis() {
|
|
14
14
|
return { entityId: "", subject: "", sourceId: "", unipolar: false, invert: false };
|
|
15
15
|
}
|
|
16
|
-
exports.
|
|
16
|
+
exports.ControlAxis = {
|
|
17
17
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
18
18
|
if (message.entityId !== "") {
|
|
19
19
|
writer.uint32(10).string(message.entityId);
|
|
@@ -35,7 +35,7 @@ exports.ManualControlAxis = {
|
|
|
35
35
|
decode(input, length) {
|
|
36
36
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
37
37
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
38
|
-
const message =
|
|
38
|
+
const message = createBaseControlAxis();
|
|
39
39
|
while (reader.pos < end) {
|
|
40
40
|
const tag = reader.uint32();
|
|
41
41
|
switch (tag >>> 3) {
|
|
@@ -111,10 +111,10 @@ exports.ManualControlAxis = {
|
|
|
111
111
|
return obj;
|
|
112
112
|
},
|
|
113
113
|
create(base) {
|
|
114
|
-
return exports.
|
|
114
|
+
return exports.ControlAxis.fromPartial(base ?? {});
|
|
115
115
|
},
|
|
116
116
|
fromPartial(object) {
|
|
117
|
-
const message =
|
|
117
|
+
const message = createBaseControlAxis();
|
|
118
118
|
message.entityId = object.entityId ?? "";
|
|
119
119
|
message.subject = object.subject ?? "";
|
|
120
120
|
message.sourceId = object.sourceId ?? "";
|
|
@@ -123,13 +123,13 @@ exports.ManualControlAxis = {
|
|
|
123
123
|
return message;
|
|
124
124
|
},
|
|
125
125
|
};
|
|
126
|
-
function
|
|
126
|
+
function createBaseControlAxisMapping() {
|
|
127
127
|
return { axes: {}, minIntervalS: 0, maxAxisAgeS: 0 };
|
|
128
128
|
}
|
|
129
|
-
exports.
|
|
129
|
+
exports.ControlAxisMapping = {
|
|
130
130
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
131
131
|
Object.entries(message.axes).forEach(([key, value]) => {
|
|
132
|
-
exports.
|
|
132
|
+
exports.ControlAxisMapping_AxesEntry.encode({ key: key, value }, writer.uint32(10).fork()).join();
|
|
133
133
|
});
|
|
134
134
|
if (message.minIntervalS !== 0) {
|
|
135
135
|
writer.uint32(21).float(message.minIntervalS);
|
|
@@ -142,7 +142,7 @@ exports.ManualControlMapping = {
|
|
|
142
142
|
decode(input, length) {
|
|
143
143
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
144
144
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
145
|
-
const message =
|
|
145
|
+
const message = createBaseControlAxisMapping();
|
|
146
146
|
while (reader.pos < end) {
|
|
147
147
|
const tag = reader.uint32();
|
|
148
148
|
switch (tag >>> 3) {
|
|
@@ -150,7 +150,7 @@ exports.ManualControlMapping = {
|
|
|
150
150
|
if (tag !== 10) {
|
|
151
151
|
break;
|
|
152
152
|
}
|
|
153
|
-
const entry1 = exports.
|
|
153
|
+
const entry1 = exports.ControlAxisMapping_AxesEntry.decode(reader, reader.uint32());
|
|
154
154
|
if (entry1.value !== undefined) {
|
|
155
155
|
message.axes[entry1.key] = entry1.value;
|
|
156
156
|
}
|
|
@@ -182,7 +182,7 @@ exports.ManualControlMapping = {
|
|
|
182
182
|
return {
|
|
183
183
|
axes: isObject(object.axes)
|
|
184
184
|
? Object.entries(object.axes).reduce((acc, [key, value]) => {
|
|
185
|
-
acc[key] = exports.
|
|
185
|
+
acc[key] = exports.ControlAxis.fromJSON(value);
|
|
186
186
|
return acc;
|
|
187
187
|
}, {})
|
|
188
188
|
: {},
|
|
@@ -197,7 +197,7 @@ exports.ManualControlMapping = {
|
|
|
197
197
|
if (entries.length > 0) {
|
|
198
198
|
obj.axes = {};
|
|
199
199
|
entries.forEach(([k, v]) => {
|
|
200
|
-
obj.axes[k] = exports.
|
|
200
|
+
obj.axes[k] = exports.ControlAxis.toJSON(v);
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
203
|
}
|
|
@@ -210,13 +210,13 @@ exports.ManualControlMapping = {
|
|
|
210
210
|
return obj;
|
|
211
211
|
},
|
|
212
212
|
create(base) {
|
|
213
|
-
return exports.
|
|
213
|
+
return exports.ControlAxisMapping.fromPartial(base ?? {});
|
|
214
214
|
},
|
|
215
215
|
fromPartial(object) {
|
|
216
|
-
const message =
|
|
216
|
+
const message = createBaseControlAxisMapping();
|
|
217
217
|
message.axes = Object.entries(object.axes ?? {}).reduce((acc, [key, value]) => {
|
|
218
218
|
if (value !== undefined) {
|
|
219
|
-
acc[key] = exports.
|
|
219
|
+
acc[key] = exports.ControlAxis.fromPartial(value);
|
|
220
220
|
}
|
|
221
221
|
return acc;
|
|
222
222
|
}, {});
|
|
@@ -225,23 +225,23 @@ exports.ManualControlMapping = {
|
|
|
225
225
|
return message;
|
|
226
226
|
},
|
|
227
227
|
};
|
|
228
|
-
function
|
|
228
|
+
function createBaseControlAxisMapping_AxesEntry() {
|
|
229
229
|
return { key: "", value: undefined };
|
|
230
230
|
}
|
|
231
|
-
exports.
|
|
231
|
+
exports.ControlAxisMapping_AxesEntry = {
|
|
232
232
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
233
233
|
if (message.key !== "") {
|
|
234
234
|
writer.uint32(10).string(message.key);
|
|
235
235
|
}
|
|
236
236
|
if (message.value !== undefined) {
|
|
237
|
-
exports.
|
|
237
|
+
exports.ControlAxis.encode(message.value, writer.uint32(18).fork()).join();
|
|
238
238
|
}
|
|
239
239
|
return writer;
|
|
240
240
|
},
|
|
241
241
|
decode(input, length) {
|
|
242
242
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
243
243
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
244
|
-
const message =
|
|
244
|
+
const message = createBaseControlAxisMapping_AxesEntry();
|
|
245
245
|
while (reader.pos < end) {
|
|
246
246
|
const tag = reader.uint32();
|
|
247
247
|
switch (tag >>> 3) {
|
|
@@ -256,7 +256,7 @@ exports.ManualControlMapping_AxesEntry = {
|
|
|
256
256
|
if (tag !== 18) {
|
|
257
257
|
break;
|
|
258
258
|
}
|
|
259
|
-
message.value = exports.
|
|
259
|
+
message.value = exports.ControlAxis.decode(reader, reader.uint32());
|
|
260
260
|
continue;
|
|
261
261
|
}
|
|
262
262
|
}
|
|
@@ -270,7 +270,7 @@ exports.ManualControlMapping_AxesEntry = {
|
|
|
270
270
|
fromJSON(object) {
|
|
271
271
|
return {
|
|
272
272
|
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
273
|
-
value: isSet(object.value) ? exports.
|
|
273
|
+
value: isSet(object.value) ? exports.ControlAxis.fromJSON(object.value) : undefined,
|
|
274
274
|
};
|
|
275
275
|
},
|
|
276
276
|
toJSON(message) {
|
|
@@ -279,33 +279,33 @@ exports.ManualControlMapping_AxesEntry = {
|
|
|
279
279
|
obj.key = message.key;
|
|
280
280
|
}
|
|
281
281
|
if (message.value !== undefined) {
|
|
282
|
-
obj.value = exports.
|
|
282
|
+
obj.value = exports.ControlAxis.toJSON(message.value);
|
|
283
283
|
}
|
|
284
284
|
return obj;
|
|
285
285
|
},
|
|
286
286
|
create(base) {
|
|
287
|
-
return exports.
|
|
287
|
+
return exports.ControlAxisMapping_AxesEntry.fromPartial(base ?? {});
|
|
288
288
|
},
|
|
289
289
|
fromPartial(object) {
|
|
290
|
-
const message =
|
|
290
|
+
const message = createBaseControlAxisMapping_AxesEntry();
|
|
291
291
|
message.key = object.key ?? "";
|
|
292
292
|
message.value = (object.value !== undefined && object.value !== null)
|
|
293
|
-
? exports.
|
|
293
|
+
? exports.ControlAxis.fromPartial(object.value)
|
|
294
294
|
: undefined;
|
|
295
295
|
return message;
|
|
296
296
|
},
|
|
297
297
|
};
|
|
298
|
-
function
|
|
298
|
+
function createBaseControlAxisMappingAck() {
|
|
299
299
|
return {};
|
|
300
300
|
}
|
|
301
|
-
exports.
|
|
301
|
+
exports.ControlAxisMappingAck = {
|
|
302
302
|
encode(_, writer = new wire_1.BinaryWriter()) {
|
|
303
303
|
return writer;
|
|
304
304
|
},
|
|
305
305
|
decode(input, length) {
|
|
306
306
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
307
307
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
308
|
-
const message =
|
|
308
|
+
const message = createBaseControlAxisMappingAck();
|
|
309
309
|
while (reader.pos < end) {
|
|
310
310
|
const tag = reader.uint32();
|
|
311
311
|
switch (tag >>> 3) {
|
|
@@ -325,10 +325,10 @@ exports.ManualControlMappingAck = {
|
|
|
325
325
|
return obj;
|
|
326
326
|
},
|
|
327
327
|
create(base) {
|
|
328
|
-
return exports.
|
|
328
|
+
return exports.ControlAxisMappingAck.fromPartial(base ?? {});
|
|
329
329
|
},
|
|
330
330
|
fromPartial(_) {
|
|
331
|
-
const message =
|
|
331
|
+
const message = createBaseControlAxisMappingAck();
|
|
332
332
|
return message;
|
|
333
333
|
},
|
|
334
334
|
};
|
|
@@ -337,18 +337,18 @@ class VehicleControlClientImpl {
|
|
|
337
337
|
constructor(rpc, opts) {
|
|
338
338
|
this.service = opts?.service || exports.VehicleControlServiceName;
|
|
339
339
|
this.rpc = rpc;
|
|
340
|
-
this.
|
|
341
|
-
this.
|
|
340
|
+
this.set_control_mapping = this.set_control_mapping.bind(this);
|
|
341
|
+
this.get_control_mapping = this.get_control_mapping.bind(this);
|
|
342
342
|
}
|
|
343
|
-
|
|
344
|
-
const data = exports.
|
|
345
|
-
const promise = this.rpc.request(this.service, "
|
|
346
|
-
return promise.then((data) => exports.
|
|
343
|
+
set_control_mapping(request) {
|
|
344
|
+
const data = exports.ControlAxisMapping.encode(request).finish();
|
|
345
|
+
const promise = this.rpc.request(this.service, "set_control_mapping", data);
|
|
346
|
+
return promise.then((data) => exports.ControlAxisMappingAck.decode(new wire_1.BinaryReader(data)));
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
get_control_mapping(request) {
|
|
349
349
|
const data = empty_1.Empty.encode(request).finish();
|
|
350
|
-
const promise = this.rpc.request(this.service, "
|
|
351
|
-
return promise.then((data) => exports.
|
|
350
|
+
const promise = this.rpc.request(this.service, "get_control_mapping", data);
|
|
351
|
+
return promise.then((data) => exports.ControlAxisMapping.decode(new wire_1.BinaryReader(data)));
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
exports.VehicleControlClientImpl = VehicleControlClientImpl;
|
|
@@ -55,36 +55,16 @@ export interface EmergencyStopResponse {
|
|
|
55
55
|
rawAutopilotResult: number;
|
|
56
56
|
detail: string;
|
|
57
57
|
}
|
|
58
|
-
/**
|
|
59
|
-
* Persist the current in-memory parameter set to non-volatile storage.
|
|
60
|
-
* Maps onto MAVLink MAV_CMD_PREFLIGHT_STORAGE.
|
|
61
|
-
*
|
|
62
|
-
* No-op on ArduPilot: ArduPilot persists every set_param write to
|
|
63
|
-
* storage immediately, so this bulk command is redundant and the
|
|
64
|
-
* autopilot returns DENIED -- an expected outcome, not a failure. The
|
|
65
|
-
* RPC is meaningful for PX4-class autopilots, which do not auto-persist.
|
|
66
|
-
*/
|
|
67
|
-
export interface SaveParamsRequest {
|
|
68
|
-
timestamp: Date | undefined;
|
|
69
|
-
}
|
|
70
|
-
export interface SaveParamsResponse {
|
|
71
|
-
result: CommandResult;
|
|
72
|
-
rawAutopilotResult: number;
|
|
73
|
-
detail: string;
|
|
74
|
-
}
|
|
75
58
|
export declare const ArmRequest: MessageFns<ArmRequest>;
|
|
76
59
|
export declare const ArmResponse: MessageFns<ArmResponse>;
|
|
77
60
|
export declare const SetModeRequest: MessageFns<SetModeRequest>;
|
|
78
61
|
export declare const SetModeResponse: MessageFns<SetModeResponse>;
|
|
79
62
|
export declare const EmergencyStopRequest: MessageFns<EmergencyStopRequest>;
|
|
80
63
|
export declare const EmergencyStopResponse: MessageFns<EmergencyStopResponse>;
|
|
81
|
-
export declare const SaveParamsRequest: MessageFns<SaveParamsRequest>;
|
|
82
|
-
export declare const SaveParamsResponse: MessageFns<SaveParamsResponse>;
|
|
83
64
|
export interface VehicleLifecycle {
|
|
84
65
|
arm(request: ArmRequest): Promise<ArmResponse>;
|
|
85
66
|
set_mode(request: SetModeRequest): Promise<SetModeResponse>;
|
|
86
67
|
emergency_stop(request: EmergencyStopRequest): Promise<EmergencyStopResponse>;
|
|
87
|
-
save_params(request: SaveParamsRequest): Promise<SaveParamsResponse>;
|
|
88
68
|
}
|
|
89
69
|
export declare const VehicleLifecycleServiceName = "VehicleLifecycle";
|
|
90
70
|
export declare class VehicleLifecycleClientImpl implements VehicleLifecycle {
|
|
@@ -96,7 +76,6 @@ export declare class VehicleLifecycleClientImpl implements VehicleLifecycle {
|
|
|
96
76
|
arm(request: ArmRequest): Promise<ArmResponse>;
|
|
97
77
|
set_mode(request: SetModeRequest): Promise<SetModeResponse>;
|
|
98
78
|
emergency_stop(request: EmergencyStopRequest): Promise<EmergencyStopResponse>;
|
|
99
|
-
save_params(request: SaveParamsRequest): Promise<SaveParamsResponse>;
|
|
100
79
|
}
|
|
101
80
|
interface Rpc {
|
|
102
81
|
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v6.30.2
|
|
6
6
|
// source: VehicleLifecycle.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.VehicleLifecycleClientImpl = exports.VehicleLifecycleServiceName = exports.
|
|
8
|
+
exports.VehicleLifecycleClientImpl = exports.VehicleLifecycleServiceName = exports.EmergencyStopResponse = exports.EmergencyStopRequest = exports.SetModeResponse = exports.SetModeRequest = exports.ArmResponse = exports.ArmRequest = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
const VehicleCommon_1 = require("./VehicleCommon");
|
|
@@ -462,140 +462,6 @@ exports.EmergencyStopResponse = {
|
|
|
462
462
|
return message;
|
|
463
463
|
},
|
|
464
464
|
};
|
|
465
|
-
function createBaseSaveParamsRequest() {
|
|
466
|
-
return { timestamp: undefined };
|
|
467
|
-
}
|
|
468
|
-
exports.SaveParamsRequest = {
|
|
469
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
470
|
-
if (message.timestamp !== undefined) {
|
|
471
|
-
timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).join();
|
|
472
|
-
}
|
|
473
|
-
return writer;
|
|
474
|
-
},
|
|
475
|
-
decode(input, length) {
|
|
476
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
477
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
478
|
-
const message = createBaseSaveParamsRequest();
|
|
479
|
-
while (reader.pos < end) {
|
|
480
|
-
const tag = reader.uint32();
|
|
481
|
-
switch (tag >>> 3) {
|
|
482
|
-
case 1: {
|
|
483
|
-
if (tag !== 10) {
|
|
484
|
-
break;
|
|
485
|
-
}
|
|
486
|
-
message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
487
|
-
continue;
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
491
|
-
break;
|
|
492
|
-
}
|
|
493
|
-
reader.skip(tag & 7);
|
|
494
|
-
}
|
|
495
|
-
return message;
|
|
496
|
-
},
|
|
497
|
-
fromJSON(object) {
|
|
498
|
-
return { timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined };
|
|
499
|
-
},
|
|
500
|
-
toJSON(message) {
|
|
501
|
-
const obj = {};
|
|
502
|
-
if (message.timestamp !== undefined) {
|
|
503
|
-
obj.timestamp = message.timestamp.toISOString();
|
|
504
|
-
}
|
|
505
|
-
return obj;
|
|
506
|
-
},
|
|
507
|
-
create(base) {
|
|
508
|
-
return exports.SaveParamsRequest.fromPartial(base ?? {});
|
|
509
|
-
},
|
|
510
|
-
fromPartial(object) {
|
|
511
|
-
const message = createBaseSaveParamsRequest();
|
|
512
|
-
message.timestamp = object.timestamp ?? undefined;
|
|
513
|
-
return message;
|
|
514
|
-
},
|
|
515
|
-
};
|
|
516
|
-
function createBaseSaveParamsResponse() {
|
|
517
|
-
return { result: 0, rawAutopilotResult: 0, detail: "" };
|
|
518
|
-
}
|
|
519
|
-
exports.SaveParamsResponse = {
|
|
520
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
521
|
-
if (message.result !== 0) {
|
|
522
|
-
writer.uint32(8).int32(message.result);
|
|
523
|
-
}
|
|
524
|
-
if (message.rawAutopilotResult !== 0) {
|
|
525
|
-
writer.uint32(16).int32(message.rawAutopilotResult);
|
|
526
|
-
}
|
|
527
|
-
if (message.detail !== "") {
|
|
528
|
-
writer.uint32(26).string(message.detail);
|
|
529
|
-
}
|
|
530
|
-
return writer;
|
|
531
|
-
},
|
|
532
|
-
decode(input, length) {
|
|
533
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
534
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
535
|
-
const message = createBaseSaveParamsResponse();
|
|
536
|
-
while (reader.pos < end) {
|
|
537
|
-
const tag = reader.uint32();
|
|
538
|
-
switch (tag >>> 3) {
|
|
539
|
-
case 1: {
|
|
540
|
-
if (tag !== 8) {
|
|
541
|
-
break;
|
|
542
|
-
}
|
|
543
|
-
message.result = reader.int32();
|
|
544
|
-
continue;
|
|
545
|
-
}
|
|
546
|
-
case 2: {
|
|
547
|
-
if (tag !== 16) {
|
|
548
|
-
break;
|
|
549
|
-
}
|
|
550
|
-
message.rawAutopilotResult = reader.int32();
|
|
551
|
-
continue;
|
|
552
|
-
}
|
|
553
|
-
case 3: {
|
|
554
|
-
if (tag !== 26) {
|
|
555
|
-
break;
|
|
556
|
-
}
|
|
557
|
-
message.detail = reader.string();
|
|
558
|
-
continue;
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
562
|
-
break;
|
|
563
|
-
}
|
|
564
|
-
reader.skip(tag & 7);
|
|
565
|
-
}
|
|
566
|
-
return message;
|
|
567
|
-
},
|
|
568
|
-
fromJSON(object) {
|
|
569
|
-
return {
|
|
570
|
-
result: isSet(object.result) ? (0, VehicleCommon_1.commandResultFromJSON)(object.result) : 0,
|
|
571
|
-
rawAutopilotResult: isSet(object.rawAutopilotResult) ? globalThis.Number(object.rawAutopilotResult) : 0,
|
|
572
|
-
detail: isSet(object.detail) ? globalThis.String(object.detail) : "",
|
|
573
|
-
};
|
|
574
|
-
},
|
|
575
|
-
toJSON(message) {
|
|
576
|
-
const obj = {};
|
|
577
|
-
if (message.result !== 0) {
|
|
578
|
-
obj.result = (0, VehicleCommon_1.commandResultToJSON)(message.result);
|
|
579
|
-
}
|
|
580
|
-
if (message.rawAutopilotResult !== 0) {
|
|
581
|
-
obj.rawAutopilotResult = Math.round(message.rawAutopilotResult);
|
|
582
|
-
}
|
|
583
|
-
if (message.detail !== "") {
|
|
584
|
-
obj.detail = message.detail;
|
|
585
|
-
}
|
|
586
|
-
return obj;
|
|
587
|
-
},
|
|
588
|
-
create(base) {
|
|
589
|
-
return exports.SaveParamsResponse.fromPartial(base ?? {});
|
|
590
|
-
},
|
|
591
|
-
fromPartial(object) {
|
|
592
|
-
const message = createBaseSaveParamsResponse();
|
|
593
|
-
message.result = object.result ?? 0;
|
|
594
|
-
message.rawAutopilotResult = object.rawAutopilotResult ?? 0;
|
|
595
|
-
message.detail = object.detail ?? "";
|
|
596
|
-
return message;
|
|
597
|
-
},
|
|
598
|
-
};
|
|
599
465
|
exports.VehicleLifecycleServiceName = "VehicleLifecycle";
|
|
600
466
|
class VehicleLifecycleClientImpl {
|
|
601
467
|
constructor(rpc, opts) {
|
|
@@ -604,7 +470,6 @@ class VehicleLifecycleClientImpl {
|
|
|
604
470
|
this.arm = this.arm.bind(this);
|
|
605
471
|
this.set_mode = this.set_mode.bind(this);
|
|
606
472
|
this.emergency_stop = this.emergency_stop.bind(this);
|
|
607
|
-
this.save_params = this.save_params.bind(this);
|
|
608
473
|
}
|
|
609
474
|
arm(request) {
|
|
610
475
|
const data = exports.ArmRequest.encode(request).finish();
|
|
@@ -621,11 +486,6 @@ class VehicleLifecycleClientImpl {
|
|
|
621
486
|
const promise = this.rpc.request(this.service, "emergency_stop", data);
|
|
622
487
|
return promise.then((data) => exports.EmergencyStopResponse.decode(new wire_1.BinaryReader(data)));
|
|
623
488
|
}
|
|
624
|
-
save_params(request) {
|
|
625
|
-
const data = exports.SaveParamsRequest.encode(request).finish();
|
|
626
|
-
const promise = this.rpc.request(this.service, "save_params", data);
|
|
627
|
-
return promise.then((data) => exports.SaveParamsResponse.decode(new wire_1.BinaryReader(data)));
|
|
628
|
-
}
|
|
629
489
|
}
|
|
630
490
|
exports.VehicleLifecycleClientImpl = VehicleLifecycleClientImpl;
|
|
631
491
|
function toTimestamp(date) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { CommandResult } from "./VehicleCommon";
|
|
2
3
|
import { Empty } from "./google/protobuf/empty";
|
|
3
4
|
export declare const protobufPackage = "";
|
|
4
5
|
export interface ParamGetRequest {
|
|
@@ -36,6 +37,23 @@ export interface ParamSetBulkResult {
|
|
|
36
37
|
export interface ParamSetBulkResponse {
|
|
37
38
|
results: ParamSetBulkResult[];
|
|
38
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Persist the current in-memory parameter set to non-volatile storage.
|
|
42
|
+
* Maps onto MAVLink MAV_CMD_PREFLIGHT_STORAGE.
|
|
43
|
+
*
|
|
44
|
+
* No-op on ArduPilot: ArduPilot persists every set_param write to
|
|
45
|
+
* storage immediately, so this bulk command is redundant and the
|
|
46
|
+
* autopilot returns DENIED -- an expected outcome, not a failure. The
|
|
47
|
+
* RPC is meaningful for PX4-class autopilots, which do not auto-persist.
|
|
48
|
+
*/
|
|
49
|
+
export interface SaveParamsRequest {
|
|
50
|
+
timestamp: Date | undefined;
|
|
51
|
+
}
|
|
52
|
+
export interface SaveParamsResponse {
|
|
53
|
+
result: CommandResult;
|
|
54
|
+
rawAutopilotResult: number;
|
|
55
|
+
detail: string;
|
|
56
|
+
}
|
|
39
57
|
export declare const ParamGetRequest: MessageFns<ParamGetRequest>;
|
|
40
58
|
export declare const ParamSetRequest: MessageFns<ParamSetRequest>;
|
|
41
59
|
export declare const ParamValueResponse: MessageFns<ParamValueResponse>;
|
|
@@ -43,11 +61,14 @@ export declare const ParamListResponse: MessageFns<ParamListResponse>;
|
|
|
43
61
|
export declare const ParamSetBulkRequest: MessageFns<ParamSetBulkRequest>;
|
|
44
62
|
export declare const ParamSetBulkResult: MessageFns<ParamSetBulkResult>;
|
|
45
63
|
export declare const ParamSetBulkResponse: MessageFns<ParamSetBulkResponse>;
|
|
64
|
+
export declare const SaveParamsRequest: MessageFns<SaveParamsRequest>;
|
|
65
|
+
export declare const SaveParamsResponse: MessageFns<SaveParamsResponse>;
|
|
46
66
|
export interface VehicleParam {
|
|
47
67
|
get_param(request: ParamGetRequest): Promise<ParamValueResponse>;
|
|
48
68
|
set_param(request: ParamSetRequest): Promise<ParamValueResponse>;
|
|
49
69
|
list_params(request: Empty): Promise<ParamListResponse>;
|
|
50
70
|
set_params(request: ParamSetBulkRequest): Promise<ParamSetBulkResponse>;
|
|
71
|
+
save_params(request: SaveParamsRequest): Promise<SaveParamsResponse>;
|
|
51
72
|
}
|
|
52
73
|
export declare const VehicleParamServiceName = "VehicleParam";
|
|
53
74
|
export declare class VehicleParamClientImpl implements VehicleParam {
|
|
@@ -60,6 +81,7 @@ export declare class VehicleParamClientImpl implements VehicleParam {
|
|
|
60
81
|
set_param(request: ParamSetRequest): Promise<ParamValueResponse>;
|
|
61
82
|
list_params(request: Empty): Promise<ParamListResponse>;
|
|
62
83
|
set_params(request: ParamSetBulkRequest): Promise<ParamSetBulkResponse>;
|
|
84
|
+
save_params(request: SaveParamsRequest): Promise<SaveParamsResponse>;
|
|
63
85
|
}
|
|
64
86
|
interface Rpc {
|
|
65
87
|
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|