@dronedeploy/rocos-js-sdk 4.4.3 → 4.4.4
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.
|
@@ -31,6 +31,18 @@ export declare enum GamepadButtonType {
|
|
|
31
31
|
}
|
|
32
32
|
/** Per-axis tuning keyed by GamepadButtonType. Absent entirely on configs saved before axis tuning existed. */
|
|
33
33
|
export type GamepadAxisValueMap = Partial<Record<GamepadButtonType, number>>;
|
|
34
|
+
/** Same shape as GamepadAxisValueMap, keyed by any input — a modifier is usually a bumper or trigger, not an axis. */
|
|
35
|
+
export type GamepadInputValueMap = Partial<Record<GamepadButtonType, number>>;
|
|
36
|
+
/**
|
|
37
|
+
* Engage point for an input with no GamepadConfig.modifierThresholds entry. Exported so editor and
|
|
38
|
+
* interpreter agree: a modifier held at 0.5 in one and 0.75 in the other works on screen, not on the robot.
|
|
39
|
+
*/
|
|
40
|
+
export declare const DEFAULT_MODIFIER_THRESHOLD = 0.5;
|
|
41
|
+
/**
|
|
42
|
+
* Release point as a fraction of the engage threshold. Releasing at the engage value flaps the layer at
|
|
43
|
+
* frame rate while a trigger rests on the threshold. Exported for the same reason as the threshold.
|
|
44
|
+
*/
|
|
45
|
+
export declare const MODIFIER_RELEASE_FRACTION = 0.7;
|
|
34
46
|
export declare enum GamepadTriggerType {
|
|
35
47
|
ONCE = "once",
|
|
36
48
|
CONTINUOUSLY = "continuously"
|
|
@@ -54,6 +66,15 @@ export interface GamepadAction {
|
|
|
54
66
|
triggerType: GamepadTriggerType;
|
|
55
67
|
/** Milliseconds between repeats. Only meaningful for `continuously`. */
|
|
56
68
|
frequency: number;
|
|
69
|
+
/**
|
|
70
|
+
* Inputs that must be held for this action to fire. A set: unordered, and absent or empty is the base
|
|
71
|
+
* layer, eligible whatever is held — which is what leaves pre-modifier configs unaffected.
|
|
72
|
+
*
|
|
73
|
+
* Matched on `type` alone, since `text` is a display label and the same input reaches us as "LB" from
|
|
74
|
+
* one author and "L1" from another. Must not contain the action's own `source`, which the triggering
|
|
75
|
+
* press would satisfy on its own.
|
|
76
|
+
*/
|
|
77
|
+
modifiers?: GamepadButtonRef[];
|
|
57
78
|
}
|
|
58
79
|
export interface GamepadVariable {
|
|
59
80
|
name: string;
|
|
@@ -80,6 +101,11 @@ export interface GamepadConfig {
|
|
|
80
101
|
variables: GamepadVariable[];
|
|
81
102
|
axisDeadzones?: GamepadAxisValueMap;
|
|
82
103
|
axisExpos?: GamepadAxisValueMap;
|
|
104
|
+
/**
|
|
105
|
+
* Engage point per modifier input. Profile-level rather than per-action so one trigger cannot engage at
|
|
106
|
+
* two values. Absent entries use DEFAULT_MODIFIER_THRESHOLD.
|
|
107
|
+
*/
|
|
108
|
+
modifierThresholds?: GamepadInputValueMap;
|
|
83
109
|
}
|
|
84
110
|
/** One stored gamepad config, scoped to a specific physical controller model (GamepadConfig.gamepad). */
|
|
85
111
|
export type GamepadConfigItem = ConfigGroupItem<GamepadConfig>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GamepadCommandVersion = exports.GamepadTriggerType = exports.GamepadButtonType = void 0;
|
|
3
|
+
exports.GamepadCommandVersion = exports.GamepadTriggerType = exports.MODIFIER_RELEASE_FRACTION = exports.DEFAULT_MODIFIER_THRESHOLD = exports.GamepadButtonType = void 0;
|
|
4
4
|
// Ref: https://github.com/alaingilbert/GamepadJs
|
|
5
5
|
var GamepadButtonType;
|
|
6
6
|
(function (GamepadButtonType) {
|
|
@@ -33,6 +33,16 @@ var GamepadButtonType;
|
|
|
33
33
|
GamepadButtonType[GamepadButtonType["SQUARE"] = 26] = "SQUARE";
|
|
34
34
|
GamepadButtonType[GamepadButtonType["TRIANGLE"] = 27] = "TRIANGLE";
|
|
35
35
|
})(GamepadButtonType || (exports.GamepadButtonType = GamepadButtonType = {}));
|
|
36
|
+
/**
|
|
37
|
+
* Engage point for an input with no GamepadConfig.modifierThresholds entry. Exported so editor and
|
|
38
|
+
* interpreter agree: a modifier held at 0.5 in one and 0.75 in the other works on screen, not on the robot.
|
|
39
|
+
*/
|
|
40
|
+
exports.DEFAULT_MODIFIER_THRESHOLD = 0.5;
|
|
41
|
+
/**
|
|
42
|
+
* Release point as a fraction of the engage threshold. Releasing at the engage value flaps the layer at
|
|
43
|
+
* frame rate while a trigger rests on the threshold. Exported for the same reason as the threshold.
|
|
44
|
+
*/
|
|
45
|
+
exports.MODIFIER_RELEASE_FRACTION = 0.7;
|
|
36
46
|
var GamepadTriggerType;
|
|
37
47
|
(function (GamepadTriggerType) {
|
|
38
48
|
GamepadTriggerType["ONCE"] = "once";
|
|
@@ -31,6 +31,18 @@ export declare enum GamepadButtonType {
|
|
|
31
31
|
}
|
|
32
32
|
/** Per-axis tuning keyed by GamepadButtonType. Absent entirely on configs saved before axis tuning existed. */
|
|
33
33
|
export type GamepadAxisValueMap = Partial<Record<GamepadButtonType, number>>;
|
|
34
|
+
/** Same shape as GamepadAxisValueMap, keyed by any input — a modifier is usually a bumper or trigger, not an axis. */
|
|
35
|
+
export type GamepadInputValueMap = Partial<Record<GamepadButtonType, number>>;
|
|
36
|
+
/**
|
|
37
|
+
* Engage point for an input with no GamepadConfig.modifierThresholds entry. Exported so editor and
|
|
38
|
+
* interpreter agree: a modifier held at 0.5 in one and 0.75 in the other works on screen, not on the robot.
|
|
39
|
+
*/
|
|
40
|
+
export declare const DEFAULT_MODIFIER_THRESHOLD = 0.5;
|
|
41
|
+
/**
|
|
42
|
+
* Release point as a fraction of the engage threshold. Releasing at the engage value flaps the layer at
|
|
43
|
+
* frame rate while a trigger rests on the threshold. Exported for the same reason as the threshold.
|
|
44
|
+
*/
|
|
45
|
+
export declare const MODIFIER_RELEASE_FRACTION = 0.7;
|
|
34
46
|
export declare enum GamepadTriggerType {
|
|
35
47
|
ONCE = "once",
|
|
36
48
|
CONTINUOUSLY = "continuously"
|
|
@@ -54,6 +66,15 @@ export interface GamepadAction {
|
|
|
54
66
|
triggerType: GamepadTriggerType;
|
|
55
67
|
/** Milliseconds between repeats. Only meaningful for `continuously`. */
|
|
56
68
|
frequency: number;
|
|
69
|
+
/**
|
|
70
|
+
* Inputs that must be held for this action to fire. A set: unordered, and absent or empty is the base
|
|
71
|
+
* layer, eligible whatever is held — which is what leaves pre-modifier configs unaffected.
|
|
72
|
+
*
|
|
73
|
+
* Matched on `type` alone, since `text` is a display label and the same input reaches us as "LB" from
|
|
74
|
+
* one author and "L1" from another. Must not contain the action's own `source`, which the triggering
|
|
75
|
+
* press would satisfy on its own.
|
|
76
|
+
*/
|
|
77
|
+
modifiers?: GamepadButtonRef[];
|
|
57
78
|
}
|
|
58
79
|
export interface GamepadVariable {
|
|
59
80
|
name: string;
|
|
@@ -80,6 +101,11 @@ export interface GamepadConfig {
|
|
|
80
101
|
variables: GamepadVariable[];
|
|
81
102
|
axisDeadzones?: GamepadAxisValueMap;
|
|
82
103
|
axisExpos?: GamepadAxisValueMap;
|
|
104
|
+
/**
|
|
105
|
+
* Engage point per modifier input. Profile-level rather than per-action so one trigger cannot engage at
|
|
106
|
+
* two values. Absent entries use DEFAULT_MODIFIER_THRESHOLD.
|
|
107
|
+
*/
|
|
108
|
+
modifierThresholds?: GamepadInputValueMap;
|
|
83
109
|
}
|
|
84
110
|
/** One stored gamepad config, scoped to a specific physical controller model (GamepadConfig.gamepad). */
|
|
85
111
|
export type GamepadConfigItem = ConfigGroupItem<GamepadConfig>;
|
|
@@ -30,6 +30,16 @@ export var GamepadButtonType;
|
|
|
30
30
|
GamepadButtonType[GamepadButtonType["SQUARE"] = 26] = "SQUARE";
|
|
31
31
|
GamepadButtonType[GamepadButtonType["TRIANGLE"] = 27] = "TRIANGLE";
|
|
32
32
|
})(GamepadButtonType || (GamepadButtonType = {}));
|
|
33
|
+
/**
|
|
34
|
+
* Engage point for an input with no GamepadConfig.modifierThresholds entry. Exported so editor and
|
|
35
|
+
* interpreter agree: a modifier held at 0.5 in one and 0.75 in the other works on screen, not on the robot.
|
|
36
|
+
*/
|
|
37
|
+
export const DEFAULT_MODIFIER_THRESHOLD = 0.5;
|
|
38
|
+
/**
|
|
39
|
+
* Release point as a fraction of the engage threshold. Releasing at the engage value flaps the layer at
|
|
40
|
+
* frame rate while a trigger rests on the threshold. Exported for the same reason as the threshold.
|
|
41
|
+
*/
|
|
42
|
+
export const MODIFIER_RELEASE_FRACTION = 0.7;
|
|
33
43
|
export var GamepadTriggerType;
|
|
34
44
|
(function (GamepadTriggerType) {
|
|
35
45
|
GamepadTriggerType["ONCE"] = "once";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dronedeploy/rocos-js-sdk",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.4",
|
|
4
4
|
"description": "Javascript SDK for rocos",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -28,12 +28,19 @@
|
|
|
28
28
|
"@grpc/grpc-js": "^1.7.1",
|
|
29
29
|
"@protobuf-ts/grpcweb-transport": "^2.9.1",
|
|
30
30
|
"@protobuf-ts/runtime": "^2.9.1",
|
|
31
|
+
"@protobuf-ts/runtime-rpc": "^2.9.1",
|
|
31
32
|
"acorn": "^8.11.3",
|
|
32
33
|
"loglevel": "^1.7.1"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
|
36
|
+
"@types/node": "*",
|
|
35
37
|
"rxjs": "^6.6.6 || ^7.0.0"
|
|
36
38
|
},
|
|
39
|
+
"peerDependenciesMeta": {
|
|
40
|
+
"@types/node": {
|
|
41
|
+
"optional": true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
37
44
|
"repository": {},
|
|
38
45
|
"private": false
|
|
39
46
|
}
|