@viamrobotics/sdk 0.0.52 → 0.0.53
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 +7 -7
- package/dist/components/arm/client.d.ts +2 -1
- package/dist/components/base/base.d.ts +8 -8
- package/dist/components/base/client.d.ts +2 -1
- package/dist/components/board/board.d.ts +11 -11
- package/dist/components/board/client.d.ts +2 -1
- package/dist/components/camera/camera.d.ts +2 -1
- package/dist/components/camera/client.d.ts +2 -1
- package/dist/components/encoder/client.d.ts +2 -1
- package/dist/components/encoder/encoder.d.ts +5 -5
- package/dist/components/gripper/client.d.ts +2 -1
- package/dist/components/gripper/gripper.d.ts +5 -5
- package/dist/components/motor/client.d.ts +2 -1
- package/dist/components/motor/motor.d.ts +10 -10
- package/dist/components/movement-sensor/client.d.ts +2 -1
- package/dist/components/movement-sensor/movement-sensor.d.ts +9 -9
- package/dist/components/sensor/client.d.ts +2 -1
- package/dist/components/sensor/sensor.d.ts +3 -3
- package/dist/main.d.ts +1 -1
- package/dist/main.es.js +67 -3
- package/dist/main.umd.js +2 -2
- package/dist/robot/robot.d.ts +2 -2
- package/dist/services/data-manager/client.d.ts +2 -1
- package/dist/services/data-manager/data-manager.d.ts +3 -3
- package/dist/services/motion/client.d.ts +2 -1
- package/dist/services/motion/motion.d.ts +6 -6
- package/dist/types.d.ts +10 -1
- package/dist/utils.d.ts +6 -1
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import type { JointPositions } from '../../gen/component/arm/v1/arm_pb';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Pose, Resource, StructType } from '../../types';
|
|
3
3
|
/** Represents a physical robot arm that exists in three-dimensional space. */
|
|
4
|
-
export interface Arm {
|
|
4
|
+
export interface Arm extends Resource {
|
|
5
5
|
/** Get the position of the end of the arm expressed as a pose */
|
|
6
|
-
getEndPosition: (extra?:
|
|
6
|
+
getEndPosition: (extra?: StructType) => Promise<Pose>;
|
|
7
7
|
/**
|
|
8
8
|
* Move the end of the arm to the pose.
|
|
9
9
|
*
|
|
10
10
|
* @param pose - The destination pose for the arm.
|
|
11
11
|
*/
|
|
12
|
-
moveToPosition: (pose: Pose, extra?:
|
|
12
|
+
moveToPosition: (pose: Pose, extra?: StructType) => Promise<void>;
|
|
13
13
|
/**
|
|
14
14
|
* Move each joint of the arm based on the angles on the joint poisitons.
|
|
15
15
|
* parameter
|
|
16
16
|
*
|
|
17
17
|
* @param jointPositionsList - List of angles (0-360) to move each joint to.
|
|
18
18
|
*/
|
|
19
|
-
moveToJointPositions: (jointPositionsList: number[], extra?:
|
|
19
|
+
moveToJointPositions: (jointPositionsList: number[], extra?: StructType) => Promise<void>;
|
|
20
20
|
/** Gets the current position of each joint. */
|
|
21
|
-
getJointPositions: (extra
|
|
21
|
+
getJointPositions: (extra?: StructType) => Promise<JointPositions>;
|
|
22
22
|
/** Stops the motion of the arm. */
|
|
23
|
-
stop: (extra
|
|
23
|
+
stop: (extra?: StructType) => Promise<void>;
|
|
24
24
|
/** Get if the arm is currently moving. */
|
|
25
25
|
isMoving: () => Promise<boolean>;
|
|
26
26
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RobotClient } from '../../robot';
|
|
2
2
|
import pb from '../../gen/component/arm/v1/arm_pb';
|
|
3
|
-
import type { Options, Pose } from '../../types';
|
|
3
|
+
import type { Options, Pose, StructType } from '../../types';
|
|
4
4
|
import type { Arm } from './arm';
|
|
5
5
|
/**
|
|
6
6
|
* A gRPC-web client for the Arm component.
|
|
@@ -19,4 +19,5 @@ export declare class ArmClient implements Arm {
|
|
|
19
19
|
getJointPositions(extra?: {}): Promise<pb.JointPositions>;
|
|
20
20
|
stop(extra?: {}): Promise<void>;
|
|
21
21
|
isMoving(): Promise<boolean>;
|
|
22
|
+
doCommand(command: StructType): Promise<StructType>;
|
|
22
23
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Resource, StructType, Vector3 } from '../../types';
|
|
2
2
|
/** Represents a physical base of a robot. */
|
|
3
|
-
export interface Base {
|
|
3
|
+
export interface Base extends Resource {
|
|
4
4
|
/**
|
|
5
5
|
* Move a base in a straight line by a given distance at a given speed. This
|
|
6
6
|
* method blocks until completed or cancelled.
|
|
@@ -8,7 +8,7 @@ export interface Base {
|
|
|
8
8
|
* @param distanceMm - Distance to move, in millimeters.
|
|
9
9
|
* @param mmPerSec - Movement speed, in millimeters per second.
|
|
10
10
|
*/
|
|
11
|
-
moveStraight(distanceMm: number, mmPerSec: number, extra?:
|
|
11
|
+
moveStraight(distanceMm: number, mmPerSec: number, extra?: StructType): Promise<void>;
|
|
12
12
|
/**
|
|
13
13
|
* Spin a base by a given angle at a given angular speed. This method blocks
|
|
14
14
|
* until completed or cancelled.
|
|
@@ -16,7 +16,7 @@ export interface Base {
|
|
|
16
16
|
* @param angleDeg - Degrees to spin.
|
|
17
17
|
* @param degsPerSec - Angular speed, in degrees per second.
|
|
18
18
|
*/
|
|
19
|
-
spin(angleDeg: number, degsPerSec: number, extra?:
|
|
19
|
+
spin(angleDeg: number, degsPerSec: number, extra?: StructType): Promise<void>;
|
|
20
20
|
/**
|
|
21
21
|
* Set the linear and angular power of a base from -1 to 1 in terms of power
|
|
22
22
|
* for each direction.
|
|
@@ -24,16 +24,16 @@ export interface Base {
|
|
|
24
24
|
* @param linear - Desired linear power percentage from -1 to 1.
|
|
25
25
|
* @param angular - Desired angular power percentage from -1 to 1.
|
|
26
26
|
*/
|
|
27
|
-
setPower(linear: Vector3, angular: Vector3, extra?:
|
|
27
|
+
setPower(linear: Vector3, angular: Vector3, extra?: StructType): Promise<void>;
|
|
28
28
|
/**
|
|
29
29
|
* Set the linear and angular velocity of a base.
|
|
30
30
|
*
|
|
31
31
|
* @param linear - Desired linear velocity in millimeters per second.
|
|
32
32
|
* @param angular - Desired angular velocity in degrees per second.
|
|
33
33
|
*/
|
|
34
|
-
setVelocity(linear: Vector3, angular: Vector3, extra?:
|
|
34
|
+
setVelocity(linear: Vector3, angular: Vector3, extra?: StructType): Promise<void>;
|
|
35
35
|
/** Stop a base */
|
|
36
|
-
stop(extra?:
|
|
36
|
+
stop(extra?: StructType): Promise<void>;
|
|
37
37
|
/** Return true if the base is in motion. */
|
|
38
|
-
isMoving(extra?:
|
|
38
|
+
isMoving(extra?: StructType): Promise<boolean>;
|
|
39
39
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RobotClient } from '../../robot';
|
|
2
|
-
import type { Options, Vector3 } from '../../types';
|
|
2
|
+
import type { Options, StructType, Vector3 } from '../../types';
|
|
3
3
|
import type { Base } from './base';
|
|
4
4
|
/**
|
|
5
5
|
* A gRPC-web client for the Base component.
|
|
@@ -18,4 +18,5 @@ export declare class BaseClient implements Base {
|
|
|
18
18
|
setVelocity(linear: Vector3, angular: Vector3, extra?: {}): Promise<void>;
|
|
19
19
|
stop(extra?: {}): Promise<void>;
|
|
20
20
|
isMoving(): Promise<boolean>;
|
|
21
|
+
doCommand(command: StructType): Promise<StructType>;
|
|
21
22
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Resource, StructType } from '../../types';
|
|
2
2
|
interface Status {
|
|
3
3
|
analogs: Record<string, number>;
|
|
4
4
|
digitalInterrupts: Record<string, number>;
|
|
@@ -7,15 +7,15 @@ interface Status {
|
|
|
7
7
|
* Represents a physical general purpose compute board that contains various
|
|
8
8
|
* components such as analog readers, and digital interrupts.
|
|
9
9
|
*/
|
|
10
|
-
export interface Board {
|
|
10
|
+
export interface Board extends Resource {
|
|
11
11
|
/** Get the status of the board. */
|
|
12
|
-
getStatus(extra?:
|
|
12
|
+
getStatus(extra?: StructType): Promise<Status>;
|
|
13
13
|
/**
|
|
14
14
|
* Get the high/low state of the given pin of a board.
|
|
15
15
|
*
|
|
16
16
|
* @param pin - The pin.
|
|
17
17
|
*/
|
|
18
|
-
getGPIO(pin: string, extra?:
|
|
18
|
+
getGPIO(pin: string, extra?: StructType): Promise<boolean>;
|
|
19
19
|
/**
|
|
20
20
|
* Set the high/low state of the given pin of a board.
|
|
21
21
|
*
|
|
@@ -23,27 +23,27 @@ export interface Board {
|
|
|
23
23
|
* @param high - When true, set the given pin to high. When false, set the
|
|
24
24
|
* given pin to low.
|
|
25
25
|
*/
|
|
26
|
-
setGPIO(pin: string, high: boolean, extra?:
|
|
26
|
+
setGPIO(pin: string, high: boolean, extra?: StructType): Promise<void>;
|
|
27
27
|
/**
|
|
28
28
|
* Get the duty cycle of the given pin of a board.
|
|
29
29
|
*
|
|
30
30
|
* @param pin - The pin.
|
|
31
31
|
* @returns The duty cycle, which is a value from 0 to 1.
|
|
32
32
|
*/
|
|
33
|
-
getPWM(pin: string, extra?:
|
|
33
|
+
getPWM(pin: string, extra?: StructType): Promise<number>;
|
|
34
34
|
/**
|
|
35
35
|
* Set the duty cycle of the given pin of a board.
|
|
36
36
|
*
|
|
37
37
|
* @param pin - The pin.
|
|
38
38
|
* @param dutyCyclePct - A value from 0 to 1.
|
|
39
39
|
*/
|
|
40
|
-
setPWM(pin: string, dutyCyclePct: number, extra?:
|
|
40
|
+
setPWM(pin: string, dutyCyclePct: number, extra?: StructType): Promise<void>;
|
|
41
41
|
/**
|
|
42
42
|
* Get the PWM frequency of the given pin of a board.
|
|
43
43
|
*
|
|
44
44
|
* @param pin - The pin.
|
|
45
45
|
*/
|
|
46
|
-
getPWMFrequency(pin: string, extra?:
|
|
46
|
+
getPWMFrequency(pin: string, extra?: StructType): Promise<number>;
|
|
47
47
|
/**
|
|
48
48
|
* Set the PWM frequency of the given pin of a board.
|
|
49
49
|
*
|
|
@@ -51,19 +51,19 @@ export interface Board {
|
|
|
51
51
|
* @param frequencyHz - The PWN frequency, in hertz. 0 will use the board's
|
|
52
52
|
* default PWM frequency.
|
|
53
53
|
*/
|
|
54
|
-
setPWMFrequency(pin: string, frequencyHz: number, extra?:
|
|
54
|
+
setPWMFrequency(pin: string, frequencyHz: number, extra?: StructType): Promise<void>;
|
|
55
55
|
/**
|
|
56
56
|
* Read the current value of an analog reader of a board.
|
|
57
57
|
*
|
|
58
58
|
* @param analogReader - The name of the analog reader.
|
|
59
59
|
*/
|
|
60
|
-
readAnalogReader(analogReader: string, extra?:
|
|
60
|
+
readAnalogReader(analogReader: string, extra?: StructType): Promise<number>;
|
|
61
61
|
/**
|
|
62
62
|
* Return the current value of the interrupt which is based on the type of
|
|
63
63
|
* interrupt.
|
|
64
64
|
*
|
|
65
65
|
* @param digitalInterruptName - The name of the digital interrupt.
|
|
66
66
|
*/
|
|
67
|
-
getDigitalInterruptValue(digitalInterruptName: string, extra?:
|
|
67
|
+
getDigitalInterruptValue(digitalInterruptName: string, extra?: StructType): Promise<number>;
|
|
68
68
|
}
|
|
69
69
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RobotClient } from '../../robot';
|
|
2
|
-
import type { Options } from '../../types';
|
|
2
|
+
import type { Options, StructType } from '../../types';
|
|
3
3
|
import pb from '../../gen/component/board/v1/board_pb';
|
|
4
4
|
import type { Board } from './board';
|
|
5
5
|
/**
|
|
@@ -32,4 +32,5 @@ export declare class BoardClient implements Board {
|
|
|
32
32
|
setPWMFrequency(pin: string, frequencyHz: number, extra?: {}): Promise<void>;
|
|
33
33
|
readAnalogReader(analogReader: string, extra?: {}): Promise<number>;
|
|
34
34
|
getDigitalInterruptValue(digitalInteruptName: string, extra?: {}): Promise<number>;
|
|
35
|
+
doCommand(command: StructType): Promise<StructType>;
|
|
35
36
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DistortionParameters, IntrinsicParameters } from '../../gen/component/camera/v1/camera_pb';
|
|
2
|
+
import type { Resource } from '../../types';
|
|
2
3
|
export interface Properties {
|
|
3
4
|
/** Whether the camera supports the return of point cloud data. */
|
|
4
5
|
supportsPcd: boolean;
|
|
@@ -9,7 +10,7 @@ export interface Properties {
|
|
|
9
10
|
}
|
|
10
11
|
export type MimeType = '' | 'image/vnd.viam.rgba' | 'image/jpeg' | 'image/png' | 'pointcloud/pcd' | 'unsupported';
|
|
11
12
|
/** Represents any physical hardware that can capture frames. */
|
|
12
|
-
export interface Camera {
|
|
13
|
+
export interface Camera extends Resource {
|
|
13
14
|
/**
|
|
14
15
|
* Return a frame from a camera.
|
|
15
16
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RobotClient } from '../../robot';
|
|
2
|
-
import type { Options } from '../../types';
|
|
2
|
+
import type { Options, StructType } from '../../types';
|
|
3
3
|
import pb from '../../gen/component/camera/v1/camera_pb';
|
|
4
4
|
import type { Camera, MimeType } from './camera';
|
|
5
5
|
/**
|
|
@@ -17,4 +17,5 @@ export declare class CameraClient implements Camera {
|
|
|
17
17
|
renderFrame(mimeType?: MimeType): Promise<Blob>;
|
|
18
18
|
getPointCloud(): Promise<Uint8Array>;
|
|
19
19
|
getProperties(): Promise<pb.GetPropertiesResponse.AsObject>;
|
|
20
|
+
doCommand(command: StructType): Promise<StructType>;
|
|
20
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RobotClient } from '../../robot';
|
|
2
2
|
import encoderApi from '../../gen/component/encoder/v1/encoder_pb';
|
|
3
|
-
import {
|
|
3
|
+
import type { Options, StructType } from '../../types';
|
|
4
4
|
import { type Encoder, EncoderPositionType } from './encoder';
|
|
5
5
|
/**
|
|
6
6
|
* A gRPC-web client for the Encoder component.
|
|
@@ -16,4 +16,5 @@ export declare class EncoderClient implements Encoder {
|
|
|
16
16
|
resetPosition(extra?: {}): Promise<void>;
|
|
17
17
|
getProperties(extra?: {}): Promise<encoderApi.GetPropertiesResponse.AsObject>;
|
|
18
18
|
getPosition(positionType?: EncoderPositionType, extra?: {}): Promise<readonly [number, 0 | 2 | 1]>;
|
|
19
|
+
doCommand(command: StructType): Promise<StructType>;
|
|
19
20
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Resource, StructType } from '../../types';
|
|
2
2
|
import pb from '../../gen/component/encoder/v1/encoder_pb';
|
|
3
3
|
export type EncoderProperties = pb.GetPropertiesResponse.AsObject;
|
|
4
4
|
type ValueOf<T> = T[keyof T];
|
|
5
5
|
export declare const EncoderPositionType: pb.PositionTypeMap;
|
|
6
6
|
export type EncoderPositionType = ValueOf<typeof pb.PositionType>;
|
|
7
7
|
/** Represents a physical encoder. */
|
|
8
|
-
export interface Encoder {
|
|
8
|
+
export interface Encoder extends Resource {
|
|
9
9
|
/** Set the current position of the encoder as the new zero position. */
|
|
10
|
-
resetPosition(extra?:
|
|
10
|
+
resetPosition(extra?: StructType): Promise<void>;
|
|
11
11
|
/** Return the encoder's properties. */
|
|
12
|
-
getProperties(extra?:
|
|
12
|
+
getProperties(extra?: StructType): Promise<EncoderProperties>;
|
|
13
13
|
/**
|
|
14
14
|
* Return the current position either in relative units (ticks away from a
|
|
15
15
|
* zero position) or absolute units (degrees along a circle).
|
|
@@ -17,6 +17,6 @@ export interface Encoder {
|
|
|
17
17
|
* @param positionType - The type of position the encoder returns (ticks or
|
|
18
18
|
* degrees)
|
|
19
19
|
*/
|
|
20
|
-
getPosition(positionType?: EncoderPositionType, extra?:
|
|
20
|
+
getPosition(positionType?: EncoderPositionType, extra?: StructType): Promise<readonly [number, EncoderPositionType]>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RobotClient } from '../../robot';
|
|
2
|
-
import type { Options } from '../../types';
|
|
2
|
+
import type { Options, StructType } from '../../types';
|
|
3
3
|
import type { Gripper } from './gripper';
|
|
4
4
|
/**
|
|
5
5
|
* A gRPC-web client for the Gripper component.
|
|
@@ -16,4 +16,5 @@ export declare class GripperClient implements Gripper {
|
|
|
16
16
|
grab(extra?: {}): Promise<void>;
|
|
17
17
|
stop(extra?: {}): Promise<void>;
|
|
18
18
|
isMoving(): Promise<boolean>;
|
|
19
|
+
doCommand(command: StructType): Promise<StructType>;
|
|
19
20
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Resource, StructType } from '../../types';
|
|
2
2
|
/** Represents a physical robotic gripper. */
|
|
3
|
-
export interface Gripper {
|
|
3
|
+
export interface Gripper extends Resource {
|
|
4
4
|
/** Open a gripper of the underlying robot. */
|
|
5
|
-
open: (extra?:
|
|
5
|
+
open: (extra?: StructType) => Promise<void>;
|
|
6
6
|
/** Request a gripper of the underlying robot to grab. */
|
|
7
|
-
grab: (extra?:
|
|
7
|
+
grab: (extra?: StructType) => Promise<void>;
|
|
8
8
|
/** Stop a robot's gripper. */
|
|
9
|
-
stop: (extra?:
|
|
9
|
+
stop: (extra?: StructType) => Promise<void>;
|
|
10
10
|
/** Report if the gripper is in motion. */
|
|
11
11
|
isMoving: () => Promise<boolean>;
|
|
12
12
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RobotClient } from '../../robot';
|
|
2
|
-
import type { Options } from '../../types';
|
|
2
|
+
import type { Options, StructType } from '../../types';
|
|
3
3
|
import type { Motor } from './motor';
|
|
4
4
|
/**
|
|
5
5
|
* A gRPC-web client for the Motor component.
|
|
@@ -23,4 +23,5 @@ export declare class MotorClient implements Motor {
|
|
|
23
23
|
getPosition(extra?: {}): Promise<number>;
|
|
24
24
|
isPowered(extra?: {}): Promise<readonly [boolean, number]>;
|
|
25
25
|
isMoving(): Promise<boolean>;
|
|
26
|
+
doCommand(command: StructType): Promise<StructType>;
|
|
26
27
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Resource, StructType } from '../../types';
|
|
2
2
|
export interface Properties {
|
|
3
3
|
/** Whether a motor supports position reporting. */
|
|
4
4
|
positionReporting: boolean;
|
|
5
5
|
}
|
|
6
6
|
/** Represents a physical motor. */
|
|
7
|
-
export interface Motor {
|
|
7
|
+
export interface Motor extends Resource {
|
|
8
8
|
/**
|
|
9
9
|
* Set the percentage of the motor's total power that should be employed.
|
|
10
10
|
*
|
|
11
11
|
* @param power - A value between -1 and 1 where negative values indicate a
|
|
12
12
|
* backwards direction and positive values a forward direction.
|
|
13
13
|
*/
|
|
14
|
-
setPower(power: number, extra?:
|
|
14
|
+
setPower(power: number, extra?: StructType): Promise<void>;
|
|
15
15
|
/**
|
|
16
16
|
* Turn the motor at a specified speed for either a specified number of
|
|
17
17
|
* revolutions or indefinitely. Raise an error if position reporting is not
|
|
@@ -23,7 +23,7 @@ export interface Motor {
|
|
|
23
23
|
* indefinitely. If this value is nonzero, this will block until the number
|
|
24
24
|
* of revolutions has been completed or another operation comes in.
|
|
25
25
|
*/
|
|
26
|
-
goFor(rpm: number, revolutions: number, extra?:
|
|
26
|
+
goFor(rpm: number, revolutions: number, extra?: StructType): Promise<void>;
|
|
27
27
|
/**
|
|
28
28
|
* Move the motor to a specific position relative to its home position at a
|
|
29
29
|
* specified speed. Raise an error if position reporting is not supported.
|
|
@@ -32,25 +32,25 @@ export interface Motor {
|
|
|
32
32
|
* @param positionRevolutions - Number of revolutions relative to the motor's
|
|
33
33
|
* home position.
|
|
34
34
|
*/
|
|
35
|
-
goTo(rpm: number, positionRevolutions: number, extra?:
|
|
35
|
+
goTo(rpm: number, positionRevolutions: number, extra?: StructType): Promise<void>;
|
|
36
36
|
/**
|
|
37
37
|
* Set the current position of the motor as the new zero position, offset by a
|
|
38
38
|
* given position. Raise an error if position reporting is not supported.
|
|
39
39
|
*
|
|
40
40
|
* @param offset - Position from which to offset the current position.
|
|
41
41
|
*/
|
|
42
|
-
resetZeroPosition(offset: number, extra?:
|
|
42
|
+
resetZeroPosition(offset: number, extra?: StructType): Promise<void>;
|
|
43
43
|
/** Turn the motor off. */
|
|
44
|
-
stop(extra?:
|
|
44
|
+
stop(extra?: StructType): Promise<void>;
|
|
45
45
|
/** Return the motor's properties. */
|
|
46
|
-
getProperties(extra?:
|
|
46
|
+
getProperties(extra?: StructType): Promise<Properties>;
|
|
47
47
|
/**
|
|
48
48
|
* Return the position of the motor relative to its zero position. Raise an
|
|
49
49
|
* error if position reporting is not supported.
|
|
50
50
|
*/
|
|
51
|
-
getPosition(extra?:
|
|
51
|
+
getPosition(extra?: StructType): Promise<number>;
|
|
52
52
|
/** Return true if the motor is on. */
|
|
53
|
-
isPowered(extra?:
|
|
53
|
+
isPowered(extra?: StructType): Promise<readonly [boolean, number]>;
|
|
54
54
|
/** Return true if the motor is in motion. */
|
|
55
55
|
isMoving(): Promise<boolean>;
|
|
56
56
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RobotClient } from '../../robot';
|
|
2
|
-
import type { Options } from '../../types';
|
|
2
|
+
import type { Options, StructType } from '../../types';
|
|
3
3
|
import pb from '../../gen/component/movementsensor/v1/movementsensor_pb';
|
|
4
4
|
import type { MovementSensor } from './movement-sensor';
|
|
5
5
|
/**
|
|
@@ -23,4 +23,5 @@ export declare class MovementSensorClient implements MovementSensor {
|
|
|
23
23
|
getAccuracy(extra?: {}): Promise<Record<string, number>>;
|
|
24
24
|
getLinearAcceleration(extra?: {}): Promise<import("../../gen/common/v1/common_pb").Vector3.AsObject>;
|
|
25
25
|
getReadings(extra?: {}): Promise<Record<string, unknown>>;
|
|
26
|
+
doCommand(command: StructType): Promise<StructType>;
|
|
26
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Orientation, StructType, Vector3 } from '../../types';
|
|
2
2
|
import type { Sensor } from '../sensor';
|
|
3
3
|
import pb from '../../gen/component/movementsensor/v1/movementsensor_pb';
|
|
4
4
|
export type MovementSensorPosition = pb.GetPositionResponse.AsObject;
|
|
@@ -9,25 +9,25 @@ export type MovementSensorProperties = pb.GetPropertiesResponse.AsObject;
|
|
|
9
9
|
*/
|
|
10
10
|
export interface MovementSensor extends Sensor {
|
|
11
11
|
/** Get linear velocity across x/y/z axes */
|
|
12
|
-
getLinearVelocity(extra?:
|
|
12
|
+
getLinearVelocity(extra?: StructType): Promise<Vector3>;
|
|
13
13
|
/** Get the angular velocity across x/y/z axes */
|
|
14
|
-
getAngularVelocity(extra?:
|
|
14
|
+
getAngularVelocity(extra?: StructType): Promise<Vector3>;
|
|
15
15
|
/**
|
|
16
16
|
* Get the compass heading, which is a number from 0-359 where 0 is North, 90
|
|
17
17
|
* is East, 180 is South, and 270 is West
|
|
18
18
|
*/
|
|
19
|
-
getCompassHeading(extra?:
|
|
19
|
+
getCompassHeading(extra?: StructType): Promise<number>;
|
|
20
20
|
/**
|
|
21
21
|
* Get the compass heading, which is a number from 0-359 where 0 is North, 90
|
|
22
22
|
* is East, 180 is South, and 270 is West
|
|
23
23
|
*/
|
|
24
|
-
getOrientation(extra?:
|
|
24
|
+
getOrientation(extra?: StructType): Promise<Orientation>;
|
|
25
25
|
/** Get the current position latitude, longitude, and altitude */
|
|
26
|
-
getPosition(extra?:
|
|
26
|
+
getPosition(extra?: StructType): Promise<MovementSensorPosition>;
|
|
27
27
|
/** Get the properties of this movement sensor */
|
|
28
|
-
getProperties(extra?:
|
|
28
|
+
getProperties(extra?: StructType): Promise<MovementSensorProperties>;
|
|
29
29
|
/** Get the accuracy of various sensors */
|
|
30
|
-
getAccuracy(extra?:
|
|
30
|
+
getAccuracy(extra?: StructType): Promise<Record<string, number>>;
|
|
31
31
|
/** Get linear acceleration across x/y/z axes */
|
|
32
|
-
getLinearAcceleration(extra?:
|
|
32
|
+
getLinearAcceleration(extra?: StructType): Promise<Vector3>;
|
|
33
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RobotClient } from '../../robot';
|
|
2
|
-
import type { Options } from '../../types';
|
|
2
|
+
import type { Options, StructType } from '../../types';
|
|
3
3
|
import type { Sensor } from './sensor';
|
|
4
4
|
/**
|
|
5
5
|
* A gRPC-web client for the Sensor component.
|
|
@@ -13,4 +13,5 @@ export declare class SensorClient implements Sensor {
|
|
|
13
13
|
constructor(client: RobotClient, name: string, options?: Options);
|
|
14
14
|
private get sensorService();
|
|
15
15
|
getReadings(extra?: {}): Promise<Record<string, unknown>>;
|
|
16
|
+
doCommand(command: StructType): Promise<StructType>;
|
|
16
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Resource, StructType } from '../../types';
|
|
2
2
|
/** Represents a physical sensing device that can provide measurement readings. */
|
|
3
|
-
export interface Sensor {
|
|
3
|
+
export interface Sensor extends Resource {
|
|
4
4
|
/** Return the readings of a sensor. */
|
|
5
|
-
getReadings(extra?:
|
|
5
|
+
getReadings(extra?: StructType): Promise<Record<string, unknown>>;
|
|
6
6
|
}
|
package/dist/main.d.ts
CHANGED
|
@@ -181,7 +181,7 @@ export { default as gantryApi } from './gen/component/gantry/v1/gantry_pb';
|
|
|
181
181
|
*
|
|
182
182
|
* const client = {}; // replace with a connected robot client
|
|
183
183
|
*
|
|
184
|
-
* const request = new
|
|
184
|
+
* const request = new commonApi.DoCommandRequest();
|
|
185
185
|
* request.setName('mygeneric');
|
|
186
186
|
* request.setCommand(Struct.fromJavaScript({ foo: 'bar' }));
|
|
187
187
|
*
|
package/dist/main.es.js
CHANGED
|
@@ -22950,7 +22950,12 @@ var __webpack_exports__dialDirect = __webpack_exports__.ry, __webpack_exports__d
|
|
|
22950
22950
|
})(grpcWebClient_umd);
|
|
22951
22951
|
const promisify = (t, e) => new Promise((s, i) => {
|
|
22952
22952
|
t(e, new grpcWebClient_umdExports.grpc.Metadata(), (u, g) => u ? i(u) : g ? s(g) : i(new Error("no response")));
|
|
22953
|
-
}),
|
|
22953
|
+
}), doCommandFromClient = async function t(e, s, i, u = {}) {
|
|
22954
|
+
const g = new common_pb.DoCommandRequest();
|
|
22955
|
+
g.setName(s), g.setCommand(struct_pb.Struct.fromJavaScript(i)), u.requestLogger?.(g);
|
|
22956
|
+
const o = (await promisify(e.doCommand.bind(e), g)).getResult()?.toJavaScript();
|
|
22957
|
+
return o || {};
|
|
22958
|
+
}, encodeVector3 = (t) => {
|
|
22954
22959
|
const e = new common_pb.Vector3();
|
|
22955
22960
|
return e.setX(t.x), e.setY(t.y), e.setZ(t.z), e;
|
|
22956
22961
|
}, encodePose = (t) => {
|
|
@@ -38160,11 +38165,15 @@ class ArmClient {
|
|
|
38160
38165
|
}
|
|
38161
38166
|
async isMoving() {
|
|
38162
38167
|
const e = this.ArmService, s = new arm_pb.IsMovingRequest();
|
|
38163
|
-
return this.options.requestLogger?.(s), (await promisify(
|
|
38168
|
+
return s.setName(this.name), this.options.requestLogger?.(s), (await promisify(
|
|
38164
38169
|
e.isMoving.bind(e),
|
|
38165
38170
|
s
|
|
38166
38171
|
)).getIsMoving();
|
|
38167
38172
|
}
|
|
38173
|
+
async doCommand(e) {
|
|
38174
|
+
const s = this.ArmService;
|
|
38175
|
+
return doCommandFromClient(s, this.name, e, this.options);
|
|
38176
|
+
}
|
|
38168
38177
|
}
|
|
38169
38178
|
class BaseClient {
|
|
38170
38179
|
client;
|
|
@@ -38218,6 +38227,10 @@ class BaseClient {
|
|
|
38218
38227
|
s
|
|
38219
38228
|
)).getIsMoving();
|
|
38220
38229
|
}
|
|
38230
|
+
async doCommand(e) {
|
|
38231
|
+
const { baseService: s } = this;
|
|
38232
|
+
return doCommandFromClient(s, this.name, e, this.options);
|
|
38233
|
+
}
|
|
38221
38234
|
}
|
|
38222
38235
|
class BoardClient {
|
|
38223
38236
|
client;
|
|
@@ -38303,6 +38316,10 @@ class BoardClient {
|
|
|
38303
38316
|
const { boardService: i } = this, u = new board_pb.GetDigitalInterruptValueRequest();
|
|
38304
38317
|
return u.setBoardName(this.name), u.setDigitalInterruptName(e), u.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(u), (await promisify(i.getDigitalInterruptValue.bind(i), u)).getValue();
|
|
38305
38318
|
}
|
|
38319
|
+
async doCommand(e) {
|
|
38320
|
+
const { boardService: s } = this;
|
|
38321
|
+
return doCommandFromClient(s, this.name, e, this.options);
|
|
38322
|
+
}
|
|
38306
38323
|
}
|
|
38307
38324
|
var camera_pb = {}, httpbody_pb = {}, any_pb = {};
|
|
38308
38325
|
(function(t) {
|
|
@@ -39640,6 +39657,10 @@ class CameraClient {
|
|
|
39640
39657
|
const { cameraService: e } = this, s = new camera_pb.GetPropertiesRequest();
|
|
39641
39658
|
return s.setName(this.name), this.options.requestLogger?.(s), (await promisify(e.getProperties.bind(e), s)).toObject();
|
|
39642
39659
|
}
|
|
39660
|
+
async doCommand(e) {
|
|
39661
|
+
const { cameraService: s } = this;
|
|
39662
|
+
return doCommandFromClient(s, this.name, e, this.options);
|
|
39663
|
+
}
|
|
39643
39664
|
}
|
|
39644
39665
|
const EncoderPositionType = encoder_pb.PositionType;
|
|
39645
39666
|
class EncoderClient {
|
|
@@ -39666,6 +39687,15 @@ class EncoderClient {
|
|
|
39666
39687
|
const g = await promisify(i.getPosition.bind(i), u);
|
|
39667
39688
|
return [g.getValue(), g.getPositionType()];
|
|
39668
39689
|
}
|
|
39690
|
+
async doCommand(e) {
|
|
39691
|
+
const { encoderService: s } = this;
|
|
39692
|
+
return doCommandFromClient(
|
|
39693
|
+
s,
|
|
39694
|
+
this.name,
|
|
39695
|
+
e,
|
|
39696
|
+
this.options
|
|
39697
|
+
);
|
|
39698
|
+
}
|
|
39669
39699
|
}
|
|
39670
39700
|
class MotorClient {
|
|
39671
39701
|
client;
|
|
@@ -39727,6 +39757,10 @@ class MotorClient {
|
|
|
39727
39757
|
const { motorService: e } = this, s = new motor_pb.IsMovingRequest();
|
|
39728
39758
|
return s.setName(this.name), this.options.requestLogger?.(s), (await promisify(e.isMoving.bind(e), s)).getIsMoving();
|
|
39729
39759
|
}
|
|
39760
|
+
async doCommand(e) {
|
|
39761
|
+
const { motorService: s } = this;
|
|
39762
|
+
return doCommandFromClient(s, this.name, e, this.options);
|
|
39763
|
+
}
|
|
39730
39764
|
}
|
|
39731
39765
|
var sensor_pb = {};
|
|
39732
39766
|
(function(t) {
|
|
@@ -39939,6 +39973,10 @@ class SensorClient {
|
|
|
39939
39973
|
g[p] = o.toJavaScript();
|
|
39940
39974
|
return g;
|
|
39941
39975
|
}
|
|
39976
|
+
async doCommand(e) {
|
|
39977
|
+
const { sensorService: s } = this;
|
|
39978
|
+
return doCommandFromClient(s, this.name, e, this.options);
|
|
39979
|
+
}
|
|
39942
39980
|
}
|
|
39943
39981
|
class MovementSensorClient {
|
|
39944
39982
|
client;
|
|
@@ -40021,6 +40059,15 @@ class MovementSensorClient {
|
|
|
40021
40059
|
getReadings(e = {}) {
|
|
40022
40060
|
return this.sensorclient.getReadings(e);
|
|
40023
40061
|
}
|
|
40062
|
+
async doCommand(e) {
|
|
40063
|
+
const { movementsensorService: s } = this;
|
|
40064
|
+
return doCommandFromClient(
|
|
40065
|
+
s,
|
|
40066
|
+
this.name,
|
|
40067
|
+
e,
|
|
40068
|
+
this.options
|
|
40069
|
+
);
|
|
40070
|
+
}
|
|
40024
40071
|
}
|
|
40025
40072
|
var stream_pb = {};
|
|
40026
40073
|
(function(t) {
|
|
@@ -40421,6 +40468,10 @@ class GripperClient {
|
|
|
40421
40468
|
s
|
|
40422
40469
|
)).getIsMoving();
|
|
40423
40470
|
}
|
|
40471
|
+
async doCommand(e) {
|
|
40472
|
+
const s = this.gripperService;
|
|
40473
|
+
return doCommandFromClient(s, this.name, e, this.options);
|
|
40474
|
+
}
|
|
40424
40475
|
}
|
|
40425
40476
|
const encodeLinearConstraint = (t) => {
|
|
40426
40477
|
const e = new motion_pb.LinearConstraint();
|
|
@@ -40487,6 +40538,10 @@ class MotionClient {
|
|
|
40487
40538
|
throw new Error("no pose");
|
|
40488
40539
|
return r.toObject();
|
|
40489
40540
|
}
|
|
40541
|
+
async doCommand(e) {
|
|
40542
|
+
const { service: s } = this;
|
|
40543
|
+
return doCommandFromClient(s, this.name, e, this.options);
|
|
40544
|
+
}
|
|
40490
40545
|
}
|
|
40491
40546
|
var data_manager_pb = {};
|
|
40492
40547
|
(function(t) {
|
|
@@ -40676,8 +40731,17 @@ class DataManagerClient {
|
|
|
40676
40731
|
i
|
|
40677
40732
|
);
|
|
40678
40733
|
}
|
|
40734
|
+
async doCommand(e) {
|
|
40735
|
+
const { datamanagerService: s } = this;
|
|
40736
|
+
return doCommandFromClient(
|
|
40737
|
+
s,
|
|
40738
|
+
this.name,
|
|
40739
|
+
e,
|
|
40740
|
+
this.options
|
|
40741
|
+
);
|
|
40742
|
+
}
|
|
40679
40743
|
}
|
|
40680
|
-
const version = "0.0.
|
|
40744
|
+
const version = "0.0.53";
|
|
40681
40745
|
export {
|
|
40682
40746
|
ArmClient,
|
|
40683
40747
|
BaseClient,
|