@deeptrekker/api-domain 1.0.43-x4-localization.0 → 1.0.43-x4-localization.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.
@@ -2393,6 +2393,10 @@
2393
2393
  "description": "Dead Reckoning availability flag",
2394
2394
  "type": "boolean"
2395
2395
  },
2396
+ "resetFilter": {
2397
+ "description": "Re-zeroes the position filter.",
2398
+ "type": "boolean"
2399
+ },
2396
2400
  "rovGpsStatus": {
2397
2401
  "$ref": "#/definitions/GpsStatus"
2398
2402
  },
@@ -2405,6 +2409,14 @@
2405
2409
  },
2406
2410
  "topsideGpsStatus": {
2407
2411
  "$ref": "#/definitions/GpsStatus"
2412
+ },
2413
+ "topsidePosition": {
2414
+ "$ref": "#/definitions/TopsidePosition",
2415
+ "description": "Position of the topside, which is the surface end of the tether and the reference the USBL head is offset from."
2416
+ },
2417
+ "usblOffset": {
2418
+ "$ref": "#/definitions/UsblOffset",
2419
+ "description": "Fixed offset from the topside to the USBL head."
2408
2420
  }
2409
2421
  },
2410
2422
  "type": "object"
@@ -2415,7 +2427,12 @@
2415
2427
  "NONE",
2416
2428
  "SEATRAC_USBL",
2417
2429
  "EXTERNAL_GPS",
2418
- "STATIC"
2430
+ "STATIC",
2431
+ "ROV_GPS",
2432
+ "USBL",
2433
+ "EXTERNAL",
2434
+ "MANUAL",
2435
+ "AUTOMATIC"
2419
2436
  ],
2420
2437
  "type": "string"
2421
2438
  },
@@ -3576,6 +3593,25 @@
3576
3593
  ],
3577
3594
  "type": "string"
3578
3595
  },
3596
+ "TopsidePosition": {
3597
+ "additionalProperties": false,
3598
+ "description": "Topside position",
3599
+ "properties": {
3600
+ "lat": {
3601
+ "description": "Latitude of the topside, in degrees.",
3602
+ "maximum": 90,
3603
+ "minimum": -90,
3604
+ "type": "number"
3605
+ },
3606
+ "lng": {
3607
+ "description": "Longitude of the topside, in degrees.",
3608
+ "maximum": 180,
3609
+ "minimum": -180,
3610
+ "type": "number"
3611
+ }
3612
+ },
3613
+ "type": "object"
3614
+ },
3579
3615
  "TransferError": {
3580
3616
  "additionalProperties": false,
3581
3617
  "description": "Error message from the Bridge Box",
@@ -3686,6 +3722,21 @@
3686
3722
  },
3687
3723
  "type": "object"
3688
3724
  },
3725
+ "UsblOffset": {
3726
+ "additionalProperties": false,
3727
+ "description": "USBL head offset",
3728
+ "properties": {
3729
+ "x": {
3730
+ "description": "Distance east from the topside to the USBL head (in meters). Negative is west.",
3731
+ "type": "number"
3732
+ },
3733
+ "y": {
3734
+ "description": "Distance north from the topside to the USBL head (in meters). Negative is south.",
3735
+ "type": "number"
3736
+ }
3737
+ },
3738
+ "type": "object"
3739
+ },
3689
3740
  "VehicleHpDiagnostics": {
3690
3741
  "additionalProperties": false,
3691
3742
  "properties": {
@@ -1 +1 @@
1
- export declare const API_VERSION = "1.0.43-x4-localization.0";
1
+ export declare const API_VERSION = "1.0.43-x4-localization.2";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.API_VERSION = void 0;
4
4
  /* AUTO GENERATED FILE */
5
- exports.API_VERSION = "1.0.43-x4-localization.0";
5
+ exports.API_VERSION = "1.0.43-x4-localization.2";
@@ -247,19 +247,19 @@ export type PositionNavigationOption = {
247
247
  */
248
248
  rovGpsStatus?: GpsStatus;
249
249
  /**
250
- * Position of the controller, which is the surface end of the tether and the
250
+ * Position of the topside, which is the surface end of the tether and the
251
251
  * reference the USBL head is offset from.
252
252
  *
253
253
  * @remarks Reported by the vehicle whatever the source, so a client that did not
254
254
  * issue the write still renders it. Settable only when {@link PositionNavigationOption.topSource}
255
255
  * is `STATIC`. X4 only.
256
- * @see {@link ControllerPosition | ControllerPosition}
256
+ * @see {@link TopsidePosition | TopsidePosition}
257
257
  */
258
- topsidePosition?: ControllerPosition;
258
+ topsidePosition?: TopsidePosition;
259
259
  /**
260
- * Fixed offset from the controller to the USBL head.
260
+ * Fixed offset from the topside to the USBL head.
261
261
  *
262
- * @remarks Applies when the head is not co-located with the controller. X4 only.
262
+ * @remarks Applies when the head is not co-located with the topside. X4 only.
263
263
  * @see {@link UsblOffset | UsblOffset}
264
264
  */
265
265
  usblOffset?: UsblOffset;
@@ -273,22 +273,23 @@ export type PositionNavigationOption = {
273
273
  resetFilter?: boolean;
274
274
  };
275
275
  /**
276
- * Controller position
276
+ * Topside position
277
277
  *
278
- * @remarks Latitude and longitude of the controller, in degrees.
278
+ * @remarks Latitude and longitude of the topside controller at the surface end of the
279
+ * tether, in degrees.
279
280
  * @group Devices
280
281
  * @category Navigation
281
282
  */
282
- export type ControllerPosition = {
283
+ export type TopsidePosition = {
283
284
  /**
284
- * Latitude of the controller, in degrees.
285
+ * Latitude of the topside, in degrees.
285
286
  *
286
287
  * @minimum -90
287
288
  * @maximum 90
288
289
  */
289
290
  lat?: number;
290
291
  /**
291
- * Longitude of the controller, in degrees.
292
+ * Longitude of the topside, in degrees.
292
293
  *
293
294
  * @minimum -180
294
295
  * @maximum 180
@@ -298,18 +299,18 @@ export type ControllerPosition = {
298
299
  /**
299
300
  * USBL head offset
300
301
  *
301
- * @remarks Offset from the controller to the USBL head, in metres. Note these are
302
+ * @remarks Offset from the topside to the USBL head, in metres. Note these are
302
303
  * compass-aligned rather than vehicle-relative: `x` is east and `y` is north.
303
304
  * @group Devices
304
305
  * @category Navigation
305
306
  */
306
307
  export type UsblOffset = {
307
308
  /**
308
- * Distance east from the controller to the USBL head (in meters). Negative is west.
309
+ * Distance east from the topside to the USBL head (in meters). Negative is west.
309
310
  */
310
311
  x?: number;
311
312
  /**
312
- * Distance north from the controller to the USBL head (in meters). Negative is south.
313
+ * Distance north from the topside to the USBL head (in meters). Negative is south.
313
314
  */
314
315
  y?: number;
315
316
  };
@@ -0,0 +1,130 @@
1
+ /**
2
+ * The physical mounting position of a thruster on the X4 chassis.
3
+ * @group X4
4
+ * @category Device Allocation
5
+ */
6
+ export declare enum ThrusterPosition {
7
+ FRONT_LEFT = "FRONT_LEFT",
8
+ FRONT_RIGHT = "FRONT_RIGHT",
9
+ VERTICAL_LEFT = "VERTICAL_LEFT",
10
+ VERTICAL_RIGHT = "VERTICAL_RIGHT",
11
+ REAR_LEFT = "REAR_LEFT",
12
+ REAR_RIGHT = "REAR_RIGHT",
13
+ VERTICAL_REAR = "VERTICAL_REAR"
14
+ }
15
+ /**
16
+ * The physical mounting position of a light node on the X4 chassis.
17
+ * @group X4
18
+ * @category Device Allocation
19
+ */
20
+ export declare enum LightPosition {
21
+ LIGHT_0 = "LIGHT_0",
22
+ LIGHT_1 = "LIGHT_1"
23
+ }
24
+ /**
25
+ * Commands the frontend can issue to drive device allocation (thruster/light configuration).
26
+ * @group X4
27
+ * @category Device Allocation
28
+ */
29
+ export declare enum DeviceConfigCmd {
30
+ ENTER_CONFIG_MODE = "ENTER_CONFIG_MODE",
31
+ EXIT_CONFIG_MODE = "EXIT_CONFIG_MODE",
32
+ ACTIVATE_NEXT_UNKNOWN = "ACTIVATE_NEXT_UNKNOWN",
33
+ STOP = "STOP",
34
+ /** Requires `deviceId`. */
35
+ ASSIGN = "ASSIGN",
36
+ SAVE = "SAVE",
37
+ CLEAR_SELECTION = "CLEAR_SELECTION",
38
+ CLEAR_CONFIG = "CLEAR_CONFIG",
39
+ /** Thruster only. Requires `deviceId`. */
40
+ INVERT_DIRECTION = "INVERT_DIRECTION"
41
+ }
42
+ /**
43
+ * Backend-reported progress of the device allocation state machine.
44
+ * @group X4
45
+ * @category Device Allocation
46
+ */
47
+ export declare enum DeviceConfigState {
48
+ IDLE = "IDLE",
49
+ READY = "READY",
50
+ ACTIVATING = "ACTIVATING",
51
+ AWAITING_ASSIGN = "AWAITING_ASSIGN",
52
+ ASSIGNING = "ASSIGNING",
53
+ SAVING = "SAVING",
54
+ FULL_CONFIG_COMPLETE = "FULL_CONFIG_COMPLETE",
55
+ CONFIG_WRITTEN = "CONFIG_WRITTEN"
56
+ }
57
+ /**
58
+ * Error codes the backend can report when rejecting a device allocation command.
59
+ * @group X4
60
+ * @category Device Allocation
61
+ */
62
+ export declare enum DeviceConfigError {
63
+ NONE = "NONE",
64
+ UNKNOWN_ERROR = "UNKNOWN_ERROR",
65
+ MISSING_ASSIGN_ID = "MISSING_ASSIGN_ID",
66
+ INVALID_ASSIGN_ID = "INVALID_ASSIGN_ID",
67
+ DUPLICATE_ID = "DUPLICATE_ID",
68
+ NOT_IN_CORRECT_STATE = "NOT_IN_CORRECT_STATE",
69
+ NOT_IN_CONFIG_MODE = "NOT_IN_CONFIG_MODE",
70
+ SAVE_FAILED = "SAVE_FAILED"
71
+ }
72
+ /**
73
+ * Whether a thruster spins in its default or inverted direction.
74
+ * @group X4
75
+ * @category Device Allocation
76
+ */
77
+ export declare enum DeviceDirection {
78
+ DEFAULT = "DEFAULT",
79
+ INVERTED = "INVERTED"
80
+ }
81
+ /**
82
+ * Shared shape for the device allocation payload. The frontend sets `cmd` (and `deviceId`
83
+ * where required); the backend reports progress back through `state`/`errorCode`/`knownDevices`/`unknownCount`.
84
+ * @typeParam TDevicePosition - The position enum for the device type being allocated (e.g. {@link ThrusterPosition}, {@link LightPosition}).
85
+ * @group X4
86
+ * @category Device Allocation
87
+ */
88
+ export type DeviceConfigPayload<TDevicePosition extends string> = {
89
+ /**
90
+ * Frontend-issued command. See {@link DeviceConfigCmd | DeviceConfigCmd}.
91
+ */
92
+ cmd?: DeviceConfigCmd;
93
+ /**
94
+ * The device position targeted by `cmd`. Required for `ASSIGN` and `INVERT_DIRECTION`.
95
+ */
96
+ deviceId?: TDevicePosition;
97
+ /**
98
+ * Backend-reported state of the allocation state machine. See {@link DeviceConfigState | DeviceConfigState}.
99
+ */
100
+ state?: DeviceConfigState;
101
+ /**
102
+ * Backend-reported error from the most recently rejected command. See {@link DeviceConfigError | DeviceConfigError}.
103
+ */
104
+ errorCode?: DeviceConfigError;
105
+ /**
106
+ * The set of device positions that have already been assigned to a physical device.
107
+ */
108
+ knownDevices?: TDevicePosition[];
109
+ /**
110
+ * The number of physical devices detected that have not yet been assigned a position.
111
+ */
112
+ unknownCount?: number;
113
+ };
114
+ /**
115
+ * Device allocation payload for X4 thrusters.
116
+ * @group X4
117
+ * @category Device Allocation
118
+ */
119
+ export type ThrusterConfig = DeviceConfigPayload<ThrusterPosition> & {
120
+ /**
121
+ * The current prop spin direction for each assigned thruster position.
122
+ */
123
+ directions?: Partial<Record<ThrusterPosition, DeviceDirection>>;
124
+ };
125
+ /**
126
+ * Device allocation payload for X4 lights.
127
+ * @group X4
128
+ * @category Device Allocation
129
+ */
130
+ export type LightConfig = DeviceConfigPayload<LightPosition>;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeviceDirection = exports.DeviceConfigError = exports.DeviceConfigState = exports.DeviceConfigCmd = exports.LightPosition = exports.ThrusterPosition = void 0;
4
+ /**
5
+ * The physical mounting position of a thruster on the X4 chassis.
6
+ * @group X4
7
+ * @category Device Allocation
8
+ */
9
+ var ThrusterPosition;
10
+ (function (ThrusterPosition) {
11
+ ThrusterPosition["FRONT_LEFT"] = "FRONT_LEFT";
12
+ ThrusterPosition["FRONT_RIGHT"] = "FRONT_RIGHT";
13
+ ThrusterPosition["VERTICAL_LEFT"] = "VERTICAL_LEFT";
14
+ ThrusterPosition["VERTICAL_RIGHT"] = "VERTICAL_RIGHT";
15
+ ThrusterPosition["REAR_LEFT"] = "REAR_LEFT";
16
+ ThrusterPosition["REAR_RIGHT"] = "REAR_RIGHT";
17
+ ThrusterPosition["VERTICAL_REAR"] = "VERTICAL_REAR";
18
+ })(ThrusterPosition || (exports.ThrusterPosition = ThrusterPosition = {}));
19
+ /**
20
+ * The physical mounting position of a light node on the X4 chassis.
21
+ * @group X4
22
+ * @category Device Allocation
23
+ */
24
+ var LightPosition;
25
+ (function (LightPosition) {
26
+ LightPosition["LIGHT_0"] = "LIGHT_0";
27
+ LightPosition["LIGHT_1"] = "LIGHT_1";
28
+ })(LightPosition || (exports.LightPosition = LightPosition = {}));
29
+ /**
30
+ * Commands the frontend can issue to drive device allocation (thruster/light configuration).
31
+ * @group X4
32
+ * @category Device Allocation
33
+ */
34
+ var DeviceConfigCmd;
35
+ (function (DeviceConfigCmd) {
36
+ DeviceConfigCmd["ENTER_CONFIG_MODE"] = "ENTER_CONFIG_MODE";
37
+ DeviceConfigCmd["EXIT_CONFIG_MODE"] = "EXIT_CONFIG_MODE";
38
+ DeviceConfigCmd["ACTIVATE_NEXT_UNKNOWN"] = "ACTIVATE_NEXT_UNKNOWN";
39
+ DeviceConfigCmd["STOP"] = "STOP";
40
+ /** Requires `deviceId`. */
41
+ DeviceConfigCmd["ASSIGN"] = "ASSIGN";
42
+ DeviceConfigCmd["SAVE"] = "SAVE";
43
+ DeviceConfigCmd["CLEAR_SELECTION"] = "CLEAR_SELECTION";
44
+ DeviceConfigCmd["CLEAR_CONFIG"] = "CLEAR_CONFIG";
45
+ /** Thruster only. Requires `deviceId`. */
46
+ DeviceConfigCmd["INVERT_DIRECTION"] = "INVERT_DIRECTION";
47
+ })(DeviceConfigCmd || (exports.DeviceConfigCmd = DeviceConfigCmd = {}));
48
+ /**
49
+ * Backend-reported progress of the device allocation state machine.
50
+ * @group X4
51
+ * @category Device Allocation
52
+ */
53
+ var DeviceConfigState;
54
+ (function (DeviceConfigState) {
55
+ DeviceConfigState["IDLE"] = "IDLE";
56
+ DeviceConfigState["READY"] = "READY";
57
+ DeviceConfigState["ACTIVATING"] = "ACTIVATING";
58
+ DeviceConfigState["AWAITING_ASSIGN"] = "AWAITING_ASSIGN";
59
+ DeviceConfigState["ASSIGNING"] = "ASSIGNING";
60
+ DeviceConfigState["SAVING"] = "SAVING";
61
+ DeviceConfigState["FULL_CONFIG_COMPLETE"] = "FULL_CONFIG_COMPLETE";
62
+ DeviceConfigState["CONFIG_WRITTEN"] = "CONFIG_WRITTEN";
63
+ })(DeviceConfigState || (exports.DeviceConfigState = DeviceConfigState = {}));
64
+ /**
65
+ * Error codes the backend can report when rejecting a device allocation command.
66
+ * @group X4
67
+ * @category Device Allocation
68
+ */
69
+ var DeviceConfigError;
70
+ (function (DeviceConfigError) {
71
+ DeviceConfigError["NONE"] = "NONE";
72
+ DeviceConfigError["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
73
+ DeviceConfigError["MISSING_ASSIGN_ID"] = "MISSING_ASSIGN_ID";
74
+ DeviceConfigError["INVALID_ASSIGN_ID"] = "INVALID_ASSIGN_ID";
75
+ DeviceConfigError["DUPLICATE_ID"] = "DUPLICATE_ID";
76
+ DeviceConfigError["NOT_IN_CORRECT_STATE"] = "NOT_IN_CORRECT_STATE";
77
+ DeviceConfigError["NOT_IN_CONFIG_MODE"] = "NOT_IN_CONFIG_MODE";
78
+ DeviceConfigError["SAVE_FAILED"] = "SAVE_FAILED";
79
+ })(DeviceConfigError || (exports.DeviceConfigError = DeviceConfigError = {}));
80
+ /**
81
+ * Whether a thruster spins in its default or inverted direction.
82
+ * @group X4
83
+ * @category Device Allocation
84
+ */
85
+ var DeviceDirection;
86
+ (function (DeviceDirection) {
87
+ DeviceDirection["DEFAULT"] = "DEFAULT";
88
+ DeviceDirection["INVERTED"] = "INVERTED";
89
+ })(DeviceDirection || (exports.DeviceDirection = DeviceDirection = {}));
@@ -1,6 +1,8 @@
1
1
  import { Movement } from "../../../core";
2
2
  import { DeviceModel, MotorDiagnostics, Sonar, StereoCamera, X4CameraHead } from "../../cameraHeads";
3
3
  import { ImpaqDriver, SensorPod, X4Light } from "../../peripherals";
4
+ import { LightConfig, ThrusterConfig } from "./deviceAllocation";
5
+ export * from "./deviceAllocation";
4
6
  import { CygnusType } from "../..";
5
7
  import { NavigationOptions } from "../navigation";
6
8
  /**
@@ -730,6 +732,16 @@ export type X4 = {
730
732
  * @readonly
731
733
  */
732
734
  thrusters?: Record<string, X4Thruster>;
735
+ /**
736
+ * The current state of in-app thruster device allocation (mapping physical thrusters to
737
+ * their logical vehicle position). See {@link ThrusterConfig | ThrusterConfig}.
738
+ */
739
+ thrusterConfig?: ThrusterConfig;
740
+ /**
741
+ * The current state of in-app light device allocation (mapping physical light nodes to
742
+ * their logical vehicle position). See {@link LightConfig | LightConfig}.
743
+ */
744
+ lightConfig?: LightConfig;
733
745
  /**
734
746
  * A record of camera heads associated with the X4 vehicle.
735
747
  * Each camera head is identified by its unique MAC address and contains properties such as tilt, motor diagnostics, and temperatures.
@@ -784,7 +796,7 @@ export type X4 = {
784
796
  vehiclePosition?: X4Position;
785
797
  /**
786
798
  * Navigation settings and options for the X4: which source supplies the global position,
787
- * where the controller is, and the heading corrections.
799
+ * where the topside is, and the heading corrections.
788
800
  *
789
801
  * Only `navigationOptions` is taken from {@link Navigation | Navigation}, rather than
790
802
  * intersecting the whole type as {@link RovVehicle | RovVehicle} does. The X4 reports
@@ -1,6 +1,21 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  exports.ControlMode = exports.CoordinateType = void 0;
18
+ __exportStar(require("./deviceAllocation"), exports);
4
19
  /**
5
20
  * The coordinate system used for navigation and positioning.
6
21
  * @internal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeptrekker/api-domain",
3
- "version": "1.0.43-x4-localization.0",
3
+ "version": "1.0.43-x4-localization.2",
4
4
  "description": "A business domain of types and schemas that the Deep Trekker topside communicates with via an API.",
5
5
  "main": "dist/index.js",
6
6
  "engines": {