@deeptrekker/api-domain 1.0.43-x4-localization.0 → 1.0.43-x4-localization.1
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/constants/schema/schema.json +52 -1
- package/dist/constants/versions/index.d.ts +1 -1
- package/dist/constants/versions/index.js +1 -1
- package/dist/types/devices/vehicles/x4/deviceAllocation/index.d.ts +130 -0
- package/dist/types/devices/vehicles/x4/deviceAllocation/index.js +89 -0
- package/dist/types/devices/vehicles/x4/index.d.ts +12 -0
- package/dist/types/devices/vehicles/x4/index.js +15 -0
- package/package.json +1 -1
|
@@ -766,6 +766,25 @@
|
|
|
766
766
|
},
|
|
767
767
|
"type": "object"
|
|
768
768
|
},
|
|
769
|
+
"ControllerPosition": {
|
|
770
|
+
"additionalProperties": false,
|
|
771
|
+
"description": "Controller position",
|
|
772
|
+
"properties": {
|
|
773
|
+
"lat": {
|
|
774
|
+
"description": "Latitude of the controller, in degrees.",
|
|
775
|
+
"maximum": 90,
|
|
776
|
+
"minimum": -90,
|
|
777
|
+
"type": "number"
|
|
778
|
+
},
|
|
779
|
+
"lng": {
|
|
780
|
+
"description": "Longitude of the controller, in degrees.",
|
|
781
|
+
"maximum": 180,
|
|
782
|
+
"minimum": -180,
|
|
783
|
+
"type": "number"
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
"type": "object"
|
|
787
|
+
},
|
|
769
788
|
"CrawlerDrive": {
|
|
770
789
|
"additionalProperties": false,
|
|
771
790
|
"description": "Crawler drive",
|
|
@@ -2393,6 +2412,10 @@
|
|
|
2393
2412
|
"description": "Dead Reckoning availability flag",
|
|
2394
2413
|
"type": "boolean"
|
|
2395
2414
|
},
|
|
2415
|
+
"resetFilter": {
|
|
2416
|
+
"description": "Re-zeroes the position filter.",
|
|
2417
|
+
"type": "boolean"
|
|
2418
|
+
},
|
|
2396
2419
|
"rovGpsStatus": {
|
|
2397
2420
|
"$ref": "#/definitions/GpsStatus"
|
|
2398
2421
|
},
|
|
@@ -2405,6 +2428,14 @@
|
|
|
2405
2428
|
},
|
|
2406
2429
|
"topsideGpsStatus": {
|
|
2407
2430
|
"$ref": "#/definitions/GpsStatus"
|
|
2431
|
+
},
|
|
2432
|
+
"topsidePosition": {
|
|
2433
|
+
"$ref": "#/definitions/ControllerPosition",
|
|
2434
|
+
"description": "Position of the controller, which is the surface end of the tether and the reference the USBL head is offset from."
|
|
2435
|
+
},
|
|
2436
|
+
"usblOffset": {
|
|
2437
|
+
"$ref": "#/definitions/UsblOffset",
|
|
2438
|
+
"description": "Fixed offset from the controller to the USBL head."
|
|
2408
2439
|
}
|
|
2409
2440
|
},
|
|
2410
2441
|
"type": "object"
|
|
@@ -2415,7 +2446,12 @@
|
|
|
2415
2446
|
"NONE",
|
|
2416
2447
|
"SEATRAC_USBL",
|
|
2417
2448
|
"EXTERNAL_GPS",
|
|
2418
|
-
"STATIC"
|
|
2449
|
+
"STATIC",
|
|
2450
|
+
"ROV_GPS",
|
|
2451
|
+
"USBL",
|
|
2452
|
+
"EXTERNAL",
|
|
2453
|
+
"MANUAL",
|
|
2454
|
+
"AUTOMATIC"
|
|
2419
2455
|
],
|
|
2420
2456
|
"type": "string"
|
|
2421
2457
|
},
|
|
@@ -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 controller to the USBL head (in meters). Negative is west.",
|
|
3731
|
+
"type": "number"
|
|
3732
|
+
},
|
|
3733
|
+
"y": {
|
|
3734
|
+
"description": "Distance north from the controller 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.
|
|
1
|
+
export declare const API_VERSION = "1.0.43-x4-localization.1";
|
|
@@ -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.
|
|
@@ -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.
|
|
3
|
+
"version": "1.0.43-x4-localization.1",
|
|
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": {
|