@viamrobotics/sdk 0.0.24 → 0.0.26
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/components/arm/Arm.d.ts +14 -14
- package/dist/components/arm/Client.d.ts +16 -8
- package/dist/components/base/Base.d.ts +3 -4
- package/dist/components/base/Client.d.ts +3 -4
- package/dist/components/board/Board.d.ts +8 -4
- package/dist/components/board/Client.d.ts +12 -2
- package/dist/components/camera/Camera.d.ts +1 -7
- package/dist/components/camera/Client.d.ts +1 -1
- package/dist/components/motor/Client.d.ts +0 -2
- package/dist/components/movementsensor/Client.d.ts +3 -15
- package/dist/main.d.ts +4 -9
- package/dist/main.es.js +67 -57
- package/dist/main.umd.js +6 -6
- package/package.json +3 -2
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WorldState } from '../../gen/common/v1/common_pb.esm';
|
|
2
2
|
import type { JointPositions } from '../../gen/component/arm/v1/arm_pb.esm';
|
|
3
|
-
import type { Extra } from '../../types';
|
|
3
|
+
import type { Extra, Pose } from '../../types';
|
|
4
4
|
/** Represents a physical robot arm that exists in three-dimensional space. */
|
|
5
5
|
export interface Arm {
|
|
6
6
|
/** Get the position of the end of the arm expressed as a pose */
|
|
7
|
-
|
|
7
|
+
getEndPosition: (extra?: Extra) => Promise<Pose>;
|
|
8
8
|
/**
|
|
9
|
-
* Move the end of the arm to the pose, avoiding obstacles in the worldstate
|
|
9
|
+
* Move the end of the arm to the pose, avoiding obstacles in the worldstate.
|
|
10
10
|
*
|
|
11
11
|
* @param pose - The destination pose for the arm
|
|
12
12
|
* @param world - The obstacles for the arm to avoid
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
moveToPosition: (pose: Pose, world?: WorldState, extra?: Extra) => Promise<void>;
|
|
15
15
|
/**
|
|
16
|
-
* Move each joint of the arm based on the angles on the joint poisitons
|
|
16
|
+
* Move each joint of the arm based on the angles on the joint poisitons.
|
|
17
17
|
* parameter
|
|
18
18
|
*
|
|
19
|
-
* @param
|
|
19
|
+
* @param jointPositionsList - List of angles (0-360) to move each joint to.
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
/** Gets the current position of each joint */
|
|
23
|
-
|
|
24
|
-
/** Stops the motion of the arm */
|
|
25
|
-
|
|
26
|
-
/** Get if the arm is currently moving */
|
|
27
|
-
|
|
21
|
+
moveToJointPositions: (jointPositionsList: number[], extra?: Extra) => Promise<void>;
|
|
22
|
+
/** Gets the current position of each joint. */
|
|
23
|
+
getJointPositions: (extra: Extra) => Promise<JointPositions>;
|
|
24
|
+
/** Stops the motion of the arm. */
|
|
25
|
+
stop: (extra: Extra) => Promise<void>;
|
|
26
|
+
/** Get if the arm is currently moving. */
|
|
27
|
+
isMoving: () => Promise<boolean>;
|
|
28
28
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Pose, WorldState } from '../../gen/common/v1/common_pb.esm';
|
|
2
1
|
import type Client from '../../Client';
|
|
3
2
|
import pb from '../../gen/component/arm/v1/arm_pb.esm';
|
|
4
|
-
import type { Options } from '../../types';
|
|
3
|
+
import type { Options, Pose } from '../../types';
|
|
5
4
|
import type { Arm } from './Arm';
|
|
5
|
+
import commonPB from '../../gen/common/v1/common_pb.esm';
|
|
6
6
|
/** A gRPC-web client for the Arm component. */
|
|
7
7
|
export declare class ArmClient implements Arm {
|
|
8
8
|
private client;
|
|
@@ -10,10 +10,18 @@ export declare class ArmClient implements Arm {
|
|
|
10
10
|
private readonly options;
|
|
11
11
|
constructor(client: Client, name: string, options?: Options);
|
|
12
12
|
private get ArmService();
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
getEndPosition(extra?: {}): Promise<{
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
z: number;
|
|
17
|
+
ox: number;
|
|
18
|
+
oy: number;
|
|
19
|
+
oz: number;
|
|
20
|
+
theta: number;
|
|
21
|
+
}>;
|
|
22
|
+
moveToPosition(pose: Pose, world?: commonPB.WorldState, extra?: {}): Promise<void>;
|
|
23
|
+
moveToJointPositions(jointPositionsList: number[], extra?: {}): Promise<void>;
|
|
24
|
+
getJointPositions(extra?: {}): Promise<pb.JointPositions>;
|
|
25
|
+
stop(extra?: {}): Promise<void>;
|
|
26
|
+
isMoving(): Promise<boolean>;
|
|
19
27
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Extra } from '../../types';
|
|
2
|
-
import type { commonApi } from '../../main';
|
|
1
|
+
import type { Extra, Vector3D } from '../../types';
|
|
3
2
|
/** Represents a physical base of a robot. */
|
|
4
3
|
export interface Base {
|
|
5
4
|
/**
|
|
@@ -25,14 +24,14 @@ export interface Base {
|
|
|
25
24
|
* @param linear - Desired linear power percentage from -1 to 1.
|
|
26
25
|
* @param angular - Desired angular power percentage from -1 to 1.
|
|
27
26
|
*/
|
|
28
|
-
setPower(linear:
|
|
27
|
+
setPower(linear: Vector3D, angular: Vector3D, extra?: Extra): Promise<void>;
|
|
29
28
|
/**
|
|
30
29
|
* Set the linear and angular velocity of a base.
|
|
31
30
|
*
|
|
32
31
|
* @param linear - Desired linear velocity in millimeters per second.
|
|
33
32
|
* @param angular - Desired angular velocity in degrees per second.
|
|
34
33
|
*/
|
|
35
|
-
setVelocity(linear:
|
|
34
|
+
setVelocity(linear: Vector3D, angular: Vector3D, extra?: Extra): Promise<void>;
|
|
36
35
|
/** Stop a base */
|
|
37
36
|
stop(extra?: Extra): Promise<void>;
|
|
38
37
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type Client from '../../Client';
|
|
2
|
-
import type commonApi from '../../gen/common/v1/common_pb.esm';
|
|
3
2
|
import type { Base } from './Base';
|
|
4
|
-
import type { Options } from '../../types';
|
|
3
|
+
import type { Options, Vector3D } from '../../types';
|
|
5
4
|
/** A gRPC-web client for the Base component. */
|
|
6
5
|
export declare class BaseClient implements Base {
|
|
7
6
|
private client;
|
|
@@ -11,7 +10,7 @@ export declare class BaseClient implements Base {
|
|
|
11
10
|
private get baseService();
|
|
12
11
|
moveStraight(distanceMm: number, mmPerSec: number, extra?: {}): Promise<void>;
|
|
13
12
|
spin(angleDeg: number, degsPerSec: number, extra?: {}): Promise<void>;
|
|
14
|
-
setPower(linear:
|
|
15
|
-
setVelocity(linear:
|
|
13
|
+
setPower(linear: Vector3D, angular: Vector3D, extra?: {}): Promise<void>;
|
|
14
|
+
setVelocity(linear: Vector3D, angular: Vector3D, extra?: {}): Promise<void>;
|
|
16
15
|
stop(extra?: {}): Promise<void>;
|
|
17
16
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { Extra } from '../../types';
|
|
2
|
-
|
|
2
|
+
interface Status {
|
|
3
|
+
analogs: Record<string, number>;
|
|
4
|
+
digitalInterrupts: Record<string, number>;
|
|
5
|
+
}
|
|
3
6
|
/**
|
|
4
7
|
* Represents a physical general purpose compute board that contains various
|
|
5
8
|
* components such as analog readers, and digital interrupts.
|
|
6
9
|
*/
|
|
7
10
|
export interface Board {
|
|
8
11
|
/** Get the status of the board. */
|
|
9
|
-
|
|
12
|
+
getStatus(extra?: Extra): Promise<Status>;
|
|
10
13
|
/**
|
|
11
14
|
* Get the high/low state of the given pin of a board.
|
|
12
15
|
*
|
|
@@ -54,12 +57,13 @@ export interface Board {
|
|
|
54
57
|
*
|
|
55
58
|
* @param analogReader - The name of the analog reader.
|
|
56
59
|
*/
|
|
57
|
-
readAnalogReader(
|
|
60
|
+
readAnalogReader(analogReader: string, extra?: Extra): Promise<number>;
|
|
58
61
|
/**
|
|
59
62
|
* Return the current value of the interrupt which is based on the type of
|
|
60
63
|
* interrupt.
|
|
61
64
|
*
|
|
62
65
|
* @param digitalInterruptName - The name of the digital interrupt.
|
|
63
66
|
*/
|
|
64
|
-
getDigitalInterruptValue(
|
|
67
|
+
getDigitalInterruptValue(digitalInterruptName: string, extra?: Extra): Promise<number>;
|
|
65
68
|
}
|
|
69
|
+
export {};
|
|
@@ -9,13 +9,23 @@ export declare class BoardClient implements Board {
|
|
|
9
9
|
private readonly options;
|
|
10
10
|
constructor(client: Client, name: string, options?: Options);
|
|
11
11
|
private get boardService();
|
|
12
|
+
private getRawStatusResponse;
|
|
13
|
+
/**
|
|
14
|
+
* Get the status of the board as a raw protobuf response.
|
|
15
|
+
*
|
|
16
|
+
* @deprecated Use {@link BoardClient#getStatus} instead.
|
|
17
|
+
*/
|
|
12
18
|
status(extra?: {}): Promise<pb.StatusResponse>;
|
|
19
|
+
getStatus(extra?: {}): Promise<{
|
|
20
|
+
analogs: Record<string, number>;
|
|
21
|
+
digitalInterrupts: Record<string, number>;
|
|
22
|
+
}>;
|
|
13
23
|
setGPIO(pin: string, high: boolean, extra?: {}): Promise<void>;
|
|
14
24
|
getGPIO(pin: string, extra?: {}): Promise<boolean>;
|
|
15
25
|
getPWM(pin: string, extra?: {}): Promise<number>;
|
|
16
26
|
setPWM(pin: string, dutyCyle: number, extra?: {}): Promise<void>;
|
|
17
27
|
getPWMFrequency(pin: string, extra?: {}): Promise<number>;
|
|
18
28
|
setPWMFrequency(pin: string, frequencyHz: number, extra?: {}): Promise<void>;
|
|
19
|
-
readAnalogReader(
|
|
20
|
-
getDigitalInterruptValue(
|
|
29
|
+
readAnalogReader(analogReader: string, extra?: {}): Promise<number>;
|
|
30
|
+
getDigitalInterruptValue(digitalInteruptName: string, extra?: {}): Promise<number>;
|
|
21
31
|
}
|
|
@@ -7,13 +7,7 @@ export interface Properties {
|
|
|
7
7
|
/** Camera distortion parameters, if available. */
|
|
8
8
|
distortionParameters?: DistortionParameters.AsObject;
|
|
9
9
|
}
|
|
10
|
-
export declare
|
|
11
|
-
VIAM_RGBA = "image/vnd.viam.rgba",
|
|
12
|
-
JPEG = "image/jpeg",
|
|
13
|
-
PNG = "image/png",
|
|
14
|
-
PCD = "pointcloud/pcd",
|
|
15
|
-
UNSUPPORTED = "unsupported"
|
|
16
|
-
}
|
|
10
|
+
export declare type MimeType = 'image/vnd.viam.rgba' | 'image/jpeg' | 'image/png' | 'pointcloud/pcd' | 'unsupported';
|
|
17
11
|
/** Represents any physical hardware that can capture frames. */
|
|
18
12
|
export interface Camera {
|
|
19
13
|
/**
|
|
@@ -13,8 +13,6 @@ export declare class MotorClient implements Motor {
|
|
|
13
13
|
goTo(rpm: number, positionRevolutions: number, extra?: {}): Promise<void>;
|
|
14
14
|
resetZeroPosition(offset: number, extra?: {}): Promise<void>;
|
|
15
15
|
stop(extra?: {}): Promise<void>;
|
|
16
|
-
/** @deprecated Use {@link MotorClient#stop} instead. */
|
|
17
|
-
motorStop(extra?: {}): Promise<void>;
|
|
18
16
|
getProperties(extra?: {}): Promise<{
|
|
19
17
|
positionReporting: boolean;
|
|
20
18
|
}>;
|
|
@@ -9,16 +9,8 @@ export declare class MovementSensorClient implements MovementSensor {
|
|
|
9
9
|
private readonly options;
|
|
10
10
|
constructor(client: Client, name: string, options?: Options);
|
|
11
11
|
private get movementsensorService();
|
|
12
|
-
getLinearVelocity(extra?: {}): Promise<
|
|
13
|
-
|
|
14
|
-
y: number;
|
|
15
|
-
z: number;
|
|
16
|
-
}>;
|
|
17
|
-
getAngularVelocity(extra?: {}): Promise<{
|
|
18
|
-
x: number;
|
|
19
|
-
y: number;
|
|
20
|
-
z: number;
|
|
21
|
-
}>;
|
|
12
|
+
getLinearVelocity(extra?: {}): Promise<import("../../types").Vector3D>;
|
|
13
|
+
getAngularVelocity(extra?: {}): Promise<import("../../types").Vector3D>;
|
|
22
14
|
getCompassHeading(extra?: {}): Promise<number>;
|
|
23
15
|
getOrientation(extra?: {}): Promise<{
|
|
24
16
|
ox: number;
|
|
@@ -40,10 +32,6 @@ export declare class MovementSensorClient implements MovementSensor {
|
|
|
40
32
|
linearAccelerationSupported: boolean;
|
|
41
33
|
}>;
|
|
42
34
|
getAccuracy(extra?: {}): Promise<Record<string, number>>;
|
|
43
|
-
getLinearAcceleration(extra?: {}): Promise<
|
|
44
|
-
x: number;
|
|
45
|
-
y: number;
|
|
46
|
-
z: number;
|
|
47
|
-
}>;
|
|
35
|
+
getLinearAcceleration(extra?: {}): Promise<import("../../types").Vector3D>;
|
|
48
36
|
getReadings(extra?: {}): Promise<Record<string, unknown>>;
|
|
49
37
|
}
|
package/dist/main.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import Client from './Client';
|
|
2
|
-
import * as Base from './components/base/Base';
|
|
3
|
-
import * as Board from './components/board/Board';
|
|
4
|
-
import * as Camera from './components/camera/Camera';
|
|
5
|
-
import * as Motor from './components/motor/Motor';
|
|
6
|
-
export { Base, Board, Camera, Motor };
|
|
7
2
|
import armApi from './gen/component/arm/v1/arm_pb.esm';
|
|
8
3
|
import baseApi from './gen/component/base/v1/base_pb.esm';
|
|
9
4
|
import boardApi from './gen/component/board/v1/board_pb.esm';
|
|
@@ -26,10 +21,10 @@ import streamApi from './gen/proto/stream/v1/stream_pb.esm';
|
|
|
26
21
|
import visionApi from './gen/service/vision/v1/vision_pb.esm';
|
|
27
22
|
export { type Robot, RobotClient } from './components/robot';
|
|
28
23
|
export { type Arm, ArmClient } from './components/arm';
|
|
29
|
-
export { BaseClient } from './components/base';
|
|
30
|
-
export { BoardClient } from './components/board';
|
|
31
|
-
export { CameraClient } from './components/camera';
|
|
32
|
-
export { MotorClient } from './components/motor';
|
|
24
|
+
export { type Base, BaseClient } from './components/base';
|
|
25
|
+
export { type Board, BoardClient } from './components/board';
|
|
26
|
+
export { type Camera, CameraClient } from './components/camera';
|
|
27
|
+
export { type Motor, MotorClient } from './components/motor';
|
|
33
28
|
export { type MovementSensor, MovementSensorClient, } from './components/movementsensor';
|
|
34
29
|
export { type Sensor, SensorClient } from './components/sensor';
|
|
35
30
|
export { type Stream, StreamClient } from './extra/stream';
|
package/dist/main.es.js
CHANGED
|
@@ -215289,18 +215289,6 @@ class Client {
|
|
|
215289
215289
|
}
|
|
215290
215290
|
}
|
|
215291
215291
|
}
|
|
215292
|
-
const Base = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
215293
|
-
__proto__: null
|
|
215294
|
-
}, Symbol.toStringTag, { value: "Module" })), Board = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
215295
|
-
__proto__: null
|
|
215296
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
215297
|
-
var MimeType = /* @__PURE__ */ ((o) => (o.VIAM_RGBA = "image/vnd.viam.rgba", o.JPEG = "image/jpeg", o.PNG = "image/png", o.PCD = "pointcloud/pcd", o.UNSUPPORTED = "unsupported", o))(MimeType || {});
|
|
215298
|
-
const Camera = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
215299
|
-
__proto__: null,
|
|
215300
|
-
MimeType
|
|
215301
|
-
}, Symbol.toStringTag, { value: "Module" })), Motor = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
215302
|
-
__proto__: null
|
|
215303
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
215304
215292
|
var commonjsGlobal$l = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, arm_pb = {}, googleProtobuf$m = {};
|
|
215305
215293
|
(function(exports) {
|
|
215306
215294
|
var $jscomp = $jscomp || {};
|
|
@@ -414579,6 +414567,15 @@ const promisify = function(o, e) {
|
|
|
414579
414567
|
return new Promise((r, p) => {
|
|
414580
414568
|
o(e, new grpcWebClient_umdExports.grpc.Metadata(), (t, n) => t ? p(t) : n ? r(n) : p(new Error("no response")));
|
|
414581
414569
|
});
|
|
414570
|
+
}, encodeVector3D = function(o) {
|
|
414571
|
+
const e = new common_pb$e.Vector3();
|
|
414572
|
+
return e.setX(o.x), e.setY(o.y), e.setZ(o.z), e;
|
|
414573
|
+
}, decodeVector3D = function(o) {
|
|
414574
|
+
return {
|
|
414575
|
+
x: o.getX(),
|
|
414576
|
+
y: o.getY(),
|
|
414577
|
+
z: o.getZ()
|
|
414578
|
+
};
|
|
414582
414579
|
};
|
|
414583
414580
|
class RobotClient {
|
|
414584
414581
|
client;
|
|
@@ -419093,26 +419090,38 @@ class ArmClient {
|
|
|
419093
419090
|
get ArmService() {
|
|
419094
419091
|
return this.client;
|
|
419095
419092
|
}
|
|
419096
|
-
async
|
|
419093
|
+
async getEndPosition(e = {}) {
|
|
419097
419094
|
const r = this.ArmService, p = new arm_pb.GetEndPositionRequest();
|
|
419098
419095
|
p.setName(this.name), p.setExtra(struct_pb$2.Struct.fromJavaScript(e)), this.options.requestLogger?.(p);
|
|
419099
419096
|
const n = (await promisify(r.getEndPosition.bind(r), p)).getPose();
|
|
419100
419097
|
if (!n)
|
|
419101
419098
|
throw new Error("no pose");
|
|
419102
|
-
return
|
|
419099
|
+
return {
|
|
419100
|
+
x: n.getX(),
|
|
419101
|
+
y: n.getY(),
|
|
419102
|
+
z: n.getZ(),
|
|
419103
|
+
ox: n.getOX(),
|
|
419104
|
+
oy: n.getOY(),
|
|
419105
|
+
oz: n.getOZ(),
|
|
419106
|
+
theta: n.getTheta()
|
|
419107
|
+
};
|
|
419103
419108
|
}
|
|
419104
|
-
async
|
|
419105
|
-
const t = this.ArmService, n = new
|
|
419106
|
-
n.
|
|
419109
|
+
async moveToPosition(e, r, p = {}) {
|
|
419110
|
+
const t = this.ArmService, n = new common_pb$e.Pose();
|
|
419111
|
+
n.setX(e.x), n.setY(e.y), n.setZ(e.z), n.setOX(e.ox), n.setOY(e.oy), n.setOZ(e.oz), n.setTheta(e.theta);
|
|
419112
|
+
const i = new arm_pb.MoveToPositionRequest();
|
|
419113
|
+
i.setName(this.name), i.setTo(n), i.setWorldState(r), i.setExtra(struct_pb$2.Struct.fromJavaScript(p)), this.options.requestLogger?.(i), await promisify(
|
|
419107
419114
|
t.moveToPosition.bind(t),
|
|
419108
|
-
|
|
419115
|
+
i
|
|
419109
419116
|
);
|
|
419110
419117
|
}
|
|
419111
|
-
async
|
|
419112
|
-
const p = this.ArmService, t = new arm_pb.
|
|
419113
|
-
t.
|
|
419118
|
+
async moveToJointPositions(e, r = {}) {
|
|
419119
|
+
const p = this.ArmService, t = new arm_pb.JointPositions();
|
|
419120
|
+
t.setValuesList(e);
|
|
419121
|
+
const n = new arm_pb.MoveToJointPositionsRequest();
|
|
419122
|
+
n.setName(this.name), n.setPositions(t), n.setExtra(struct_pb$2.Struct.fromJavaScript(r)), this.options.requestLogger?.(n), await promisify(p.moveToJointPositions.bind(p), n);
|
|
419114
419123
|
}
|
|
419115
|
-
async
|
|
419124
|
+
async getJointPositions(e = {}) {
|
|
419116
419125
|
const r = this.ArmService, p = new arm_pb.GetJointPositionsRequest();
|
|
419117
419126
|
p.setName(this.name), p.setExtra(struct_pb$2.Struct.fromJavaScript(e)), this.options.requestLogger?.(p);
|
|
419118
419127
|
const n = (await promisify(r.getJointPositions.bind(r), p)).getPositions();
|
|
@@ -419120,14 +419129,14 @@ class ArmClient {
|
|
|
419120
419129
|
throw new Error("no pose");
|
|
419121
419130
|
return n;
|
|
419122
419131
|
}
|
|
419123
|
-
async
|
|
419132
|
+
async stop(e = {}) {
|
|
419124
419133
|
const r = this.ArmService, p = new arm_pb.StopRequest();
|
|
419125
419134
|
p.setName(this.name), p.setExtra(struct_pb$2.Struct.fromJavaScript(e)), this.options.requestLogger?.(p), await promisify(
|
|
419126
419135
|
r.getJointPositions.bind(r),
|
|
419127
419136
|
p
|
|
419128
419137
|
);
|
|
419129
419138
|
}
|
|
419130
|
-
async
|
|
419139
|
+
async isMoving() {
|
|
419131
419140
|
const e = this.ArmService, r = new arm_pb.IsMovingRequest();
|
|
419132
419141
|
return this.options.requestLogger?.(r), (await promisify(
|
|
419133
419142
|
e.isMoving.bind(e),
|
|
@@ -419161,14 +419170,14 @@ class BaseClient {
|
|
|
419161
419170
|
}
|
|
419162
419171
|
async setPower(e, r, p = {}) {
|
|
419163
419172
|
const t = this.baseService, n = new base_pb.SetPowerRequest();
|
|
419164
|
-
n.setName(this.name), n.setLinear(e), n.setAngular(r), n.setExtra(struct_pb$2.Struct.fromJavaScript(p)), this.options.requestLogger?.(n), await promisify(
|
|
419173
|
+
n.setName(this.name), n.setLinear(encodeVector3D(e)), n.setAngular(encodeVector3D(r)), n.setExtra(struct_pb$2.Struct.fromJavaScript(p)), this.options.requestLogger?.(n), await promisify(
|
|
419165
419174
|
t.setPower.bind(t),
|
|
419166
419175
|
n
|
|
419167
419176
|
);
|
|
419168
419177
|
}
|
|
419169
419178
|
async setVelocity(e, r, p = {}) {
|
|
419170
419179
|
const t = this.baseService, n = new base_pb.SetVelocityRequest();
|
|
419171
|
-
n.setName(this.name), n.setLinear(e), n.setAngular(r), n.setExtra(struct_pb$2.Struct.fromJavaScript(p)), this.options.requestLogger?.(n), await promisify(
|
|
419180
|
+
n.setName(this.name), n.setLinear(encodeVector3D(e)), n.setAngular(encodeVector3D(r)), n.setExtra(struct_pb$2.Struct.fromJavaScript(p)), this.options.requestLogger?.(n), await promisify(
|
|
419172
419181
|
t.setVelocity.bind(t),
|
|
419173
419182
|
n
|
|
419174
419183
|
);
|
|
@@ -419191,13 +419200,33 @@ class BoardClient {
|
|
|
419191
419200
|
get boardService() {
|
|
419192
419201
|
return this.client;
|
|
419193
419202
|
}
|
|
419194
|
-
async
|
|
419203
|
+
async getRawStatusResponse(e = {}) {
|
|
419195
419204
|
const r = this.boardService, p = new board_pb.StatusRequest();
|
|
419196
419205
|
return p.setName(this.name), p.setExtra(struct_pb$2.Struct.fromJavaScript(e)), this.options.requestLogger?.(p), await promisify(
|
|
419197
419206
|
r.status.bind(r),
|
|
419198
419207
|
p
|
|
419199
419208
|
);
|
|
419200
419209
|
}
|
|
419210
|
+
/**
|
|
419211
|
+
* Get the status of the board as a raw protobuf response.
|
|
419212
|
+
*
|
|
419213
|
+
* @deprecated Use {@link BoardClient#getStatus} instead.
|
|
419214
|
+
*/
|
|
419215
|
+
status(e = {}) {
|
|
419216
|
+
return this.getRawStatusResponse(e);
|
|
419217
|
+
}
|
|
419218
|
+
async getStatus(e = {}) {
|
|
419219
|
+
const p = (await this.getRawStatusResponse(e)).getStatus();
|
|
419220
|
+
if (!p)
|
|
419221
|
+
throw new Error("no status");
|
|
419222
|
+
const t = {};
|
|
419223
|
+
for (const [i, s] of p.getAnalogsMap().entries())
|
|
419224
|
+
t[i] = s.getValue();
|
|
419225
|
+
const n = {};
|
|
419226
|
+
for (const [i, s] of p.getDigitalInterruptsMap().entries())
|
|
419227
|
+
n[i] = s.getValue();
|
|
419228
|
+
return { analogs: t, digitalInterrupts: n };
|
|
419229
|
+
}
|
|
419201
419230
|
async setGPIO(e, r, p = {}) {
|
|
419202
419231
|
const t = this.boardService, n = new board_pb.SetGPIORequest();
|
|
419203
419232
|
n.setName(this.name), n.setPin(e), n.setHigh(r), n.setExtra(struct_pb$2.Struct.fromJavaScript(p)), this.options.requestLogger?.(n), await promisify(
|
|
@@ -419237,13 +419266,13 @@ class BoardClient {
|
|
|
419237
419266
|
n
|
|
419238
419267
|
);
|
|
419239
419268
|
}
|
|
419240
|
-
async readAnalogReader(e, r
|
|
419241
|
-
const
|
|
419242
|
-
return
|
|
419269
|
+
async readAnalogReader(e, r = {}) {
|
|
419270
|
+
const p = this.boardService, t = new board_pb.ReadAnalogReaderRequest();
|
|
419271
|
+
return t.setBoardName(this.name), t.setAnalogReaderName(e), t.setExtra(struct_pb$2.Struct.fromJavaScript(r)), this.options.requestLogger?.(t), (await promisify(p.readAnalogReader.bind(p), t)).getValue();
|
|
419243
419272
|
}
|
|
419244
|
-
async getDigitalInterruptValue(e, r
|
|
419245
|
-
const
|
|
419246
|
-
return
|
|
419273
|
+
async getDigitalInterruptValue(e, r = {}) {
|
|
419274
|
+
const p = this.boardService, t = new board_pb.GetDigitalInterruptValueRequest();
|
|
419275
|
+
return t.setBoardName(this.name), t.setDigitalInterruptName(e), t.setExtra(struct_pb$2.Struct.fromJavaScript(r)), this.options.requestLogger?.(t), (await promisify(p.getDigitalInterruptValue.bind(p), t)).getValue();
|
|
419247
419276
|
}
|
|
419248
419277
|
}
|
|
419249
419278
|
var commonjsGlobal$2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, camera_pb = {}, googleProtobuf$2 = {};
|
|
@@ -431443,6 +431472,7 @@ CameraServiceClient.prototype.doCommand = function o(e, r, p) {
|
|
|
431443
431472
|
};
|
|
431444
431473
|
};
|
|
431445
431474
|
var CameraServiceClient_1 = CameraServiceClient;
|
|
431475
|
+
const PointCloudPCD = "pointcloud/pcd";
|
|
431446
431476
|
class CameraClient {
|
|
431447
431477
|
client;
|
|
431448
431478
|
name;
|
|
@@ -431471,7 +431501,7 @@ class CameraClient {
|
|
|
431471
431501
|
}
|
|
431472
431502
|
async getPointCloud() {
|
|
431473
431503
|
const e = this.cameraService, r = new camera_pb$1.GetPointCloudRequest();
|
|
431474
|
-
return r.setName(this.name), r.setMimeType(
|
|
431504
|
+
return r.setName(this.name), r.setMimeType(PointCloudPCD), this.options.requestLogger?.(r), (await promisify(e.getPointCloud.bind(e), r)).getPointCloud_asU8();
|
|
431475
431505
|
}
|
|
431476
431506
|
async getProperties() {
|
|
431477
431507
|
const e = this.cameraService, r = new camera_pb$1.GetPropertiesRequest();
|
|
@@ -431520,10 +431550,6 @@ class MotorClient {
|
|
|
431520
431550
|
p
|
|
431521
431551
|
);
|
|
431522
431552
|
}
|
|
431523
|
-
/** @deprecated Use {@link MotorClient#stop} instead. */
|
|
431524
|
-
motorStop(e = {}) {
|
|
431525
|
-
return this.stop(e);
|
|
431526
|
-
}
|
|
431527
431553
|
async getProperties(e = {}) {
|
|
431528
431554
|
const r = this.motorService, p = new motor_pb.GetPropertiesRequest();
|
|
431529
431555
|
return p.setName(this.name), p.setExtra(struct_pb$2.Struct.fromJavaScript(e)), this.options.requestLogger?.(p), { positionReporting: (await promisify(r.getProperties.bind(r), p)).getPositionReporting() };
|
|
@@ -442702,11 +442728,7 @@ class MovementSensorClient {
|
|
|
442702
442728
|
)).getLinearVelocity();
|
|
442703
442729
|
if (!n)
|
|
442704
442730
|
throw new Error("no linear velocity");
|
|
442705
|
-
return
|
|
442706
|
-
x: n.getX(),
|
|
442707
|
-
y: n.getY(),
|
|
442708
|
-
z: n.getZ()
|
|
442709
|
-
};
|
|
442731
|
+
return decodeVector3D(n);
|
|
442710
442732
|
}
|
|
442711
442733
|
async getAngularVelocity(e = {}) {
|
|
442712
442734
|
const r = this.movementsensorService, p = new movementsensor_pb.GetAngularVelocityRequest();
|
|
@@ -442717,11 +442739,7 @@ class MovementSensorClient {
|
|
|
442717
442739
|
)).getAngularVelocity();
|
|
442718
442740
|
if (!n)
|
|
442719
442741
|
throw new Error("no angular velocity");
|
|
442720
|
-
return
|
|
442721
|
-
x: n.getX(),
|
|
442722
|
-
y: n.getY(),
|
|
442723
|
-
z: n.getZ()
|
|
442724
|
-
};
|
|
442742
|
+
return decodeVector3D(n);
|
|
442725
442743
|
}
|
|
442726
442744
|
async getCompassHeading(e = {}) {
|
|
442727
442745
|
const r = this.movementsensorService, p = new movementsensor_pb.GetCompassHeadingRequest();
|
|
@@ -442788,11 +442806,7 @@ class MovementSensorClient {
|
|
|
442788
442806
|
)).getLinearAcceleration();
|
|
442789
442807
|
if (!n)
|
|
442790
442808
|
throw new Error("no linear acceleration");
|
|
442791
|
-
return
|
|
442792
|
-
x: n.getX(),
|
|
442793
|
-
y: n.getY(),
|
|
442794
|
-
z: n.getZ()
|
|
442795
|
-
};
|
|
442809
|
+
return decodeVector3D(n);
|
|
442796
442810
|
}
|
|
442797
442811
|
getReadings(e = {}) {
|
|
442798
442812
|
return this.sensorclient.getReadings(e);
|
|
@@ -447976,14 +447990,10 @@ class StreamClient extends EventDispatcher {
|
|
|
447976
447990
|
}
|
|
447977
447991
|
export {
|
|
447978
447992
|
ArmClient,
|
|
447979
|
-
Base,
|
|
447980
447993
|
BaseClient,
|
|
447981
|
-
Board,
|
|
447982
447994
|
BoardClient,
|
|
447983
|
-
Camera,
|
|
447984
447995
|
CameraClient,
|
|
447985
447996
|
Client,
|
|
447986
|
-
Motor,
|
|
447987
447997
|
MotorClient,
|
|
447988
447998
|
MovementSensorClient,
|
|
447989
447999
|
RobotClient,
|