@viamrobotics/sdk 0.72.0 → 0.73.0-b.0
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/api-version.d.ts +1 -1
- package/dist/app/app-client.d.ts +130 -254
- package/dist/app/billing-client.d.ts +6 -15
- package/dist/app/data-client.d.ts +253 -250
- package/dist/app/ml-training-client.d.ts +5 -5
- package/dist/app/provisioning-client.d.ts +2 -4
- package/dist/app/viam-client.d.ts +1 -1
- package/dist/app/viam-transport.d.ts +1 -4
- package/dist/assert.d.ts +2 -3
- package/dist/components/arm/arm.d.ts +2 -2
- package/dist/components/arm/client.d.ts +1 -1
- package/dist/components/audio-out/audio-out.d.ts +30 -2
- package/dist/components/audio-out/client.d.ts +1 -0
- package/dist/components/audioin.d.ts +1 -1
- package/dist/components/audioout.d.ts +1 -1
- package/dist/components/base/base.d.ts +10 -11
- package/dist/components/board/board.d.ts +8 -15
- package/dist/components/board/client.d.ts +1 -1
- package/dist/components/camera/camera.d.ts +2 -4
- package/dist/components/camera/client.d.ts +2 -2
- package/dist/components/encoder/encoder.d.ts +4 -5
- package/dist/components/encoder.d.ts +1 -1
- package/dist/components/gantry/gantry.d.ts +7 -10
- package/dist/components/generic/generic.d.ts +1 -4
- package/dist/components/gripper/gripper.d.ts +1 -2
- package/dist/components/input-controller/input-controller.d.ts +5 -15
- package/dist/components/inputcontroller.d.ts +1 -1
- package/dist/components/motor/motor.d.ts +17 -19
- package/dist/components/movement-sensor/movement-sensor.d.ts +14 -42
- package/dist/components/pose-tracker/pose-tracker.d.ts +1 -4
- package/dist/components/power-sensor/power-sensor.d.ts +6 -20
- package/dist/components/switch/switch.d.ts +2 -3
- package/dist/debug.d.ts +7 -15
- package/dist/events.d.ts +12 -10
- package/dist/extra/stream/client.d.ts +12 -11
- package/dist/extra/stream/stream.d.ts +1 -1
- package/dist/gen/app/agent/v1/agent_connect.d.ts +1 -1
- package/dist/gen/app/build/v1/build_connect.d.ts +1 -1
- package/dist/gen/app/build/v1/build_pb.d.ts +15 -0
- package/dist/gen/app/cloudslam/v1/cloud_slam_connect.d.ts +1 -1
- package/dist/gen/app/data/v1/data_connect.d.ts +35 -2
- package/dist/gen/app/data/v1/data_pb.d.ts +175 -9
- package/dist/gen/app/datapipelines/v1/data_pipelines_connect.d.ts +1 -1
- package/dist/gen/app/dataset/v1/dataset_connect.d.ts +25 -3
- package/dist/gen/app/dataset/v1/dataset_pb.d.ts +227 -1
- package/dist/gen/app/datasync/v1/data_sync_connect.d.ts +1 -1
- package/dist/gen/app/mlinference/v1/ml_inference_connect.d.ts +1 -1
- package/dist/gen/app/mltraining/v1/ml_training_connect.d.ts +1 -1
- package/dist/gen/app/packages/v1/packages_connect.d.ts +1 -1
- package/dist/gen/app/v1/app_connect.d.ts +1 -1
- package/dist/gen/app/v1/billing_connect.d.ts +1 -1
- package/dist/gen/app/v1/end_user_connect.d.ts +1 -1
- package/dist/gen/app/v1/robot_connect.d.ts +1 -1
- package/dist/gen/component/arm/v1/arm_connect.d.ts +1 -1
- package/dist/gen/component/audioin/v1/audioin_connect.d.ts +1 -1
- package/dist/gen/component/audioout/v1/audioout_connect.d.ts +16 -2
- package/dist/gen/component/audioout/v1/audioout_pb.d.ts +115 -0
- package/dist/gen/component/base/v1/base_connect.d.ts +1 -1
- package/dist/gen/component/board/v1/board_connect.d.ts +1 -1
- package/dist/gen/component/button/v1/button_connect.d.ts +1 -1
- package/dist/gen/component/camera/v1/camera_connect.d.ts +1 -1
- package/dist/gen/component/encoder/v1/encoder_connect.d.ts +1 -1
- package/dist/gen/component/gantry/v1/gantry_connect.d.ts +1 -1
- package/dist/gen/component/generic/v1/generic_connect.d.ts +1 -1
- package/dist/gen/component/gripper/v1/gripper_connect.d.ts +1 -1
- package/dist/gen/component/inputcontroller/v1/input_controller_connect.d.ts +1 -1
- package/dist/gen/component/motor/v1/motor_connect.d.ts +1 -1
- package/dist/gen/component/movementsensor/v1/movementsensor_connect.d.ts +1 -1
- package/dist/gen/component/posetracker/v1/pose_tracker_connect.d.ts +1 -1
- package/dist/gen/component/powersensor/v1/powersensor_connect.d.ts +1 -1
- package/dist/gen/component/sensor/v1/sensor_connect.d.ts +1 -1
- package/dist/gen/component/servo/v1/servo_connect.d.ts +1 -1
- package/dist/gen/component/switch/v1/switch_connect.d.ts +1 -1
- package/dist/gen/component/testecho/v1/testecho_connect.d.ts +1 -1
- package/dist/gen/google/bytestream/bytestream_connect.d.ts +1 -1
- package/dist/gen/google/iam/v1/iam_policy_connect.d.ts +1 -1
- package/dist/gen/google/longrunning/operations_connect.d.ts +1 -1
- package/dist/gen/grpc/reflection/v1/reflection_connect.d.ts +1 -1
- package/dist/gen/opentelemetry/proto/collector/logs/v1/logs_service_connect.d.ts +1 -1
- package/dist/gen/opentelemetry/proto/collector/metrics/v1/metrics_service_connect.d.ts +1 -1
- package/dist/gen/opentelemetry/proto/collector/profiles/v1development/profiles_service_connect.d.ts +1 -1
- package/dist/gen/opentelemetry/proto/collector/trace/v1/trace_service_connect.d.ts +1 -1
- package/dist/gen/proto/rpc/examples/echo/v1/echo_connect.d.ts +1 -1
- package/dist/gen/proto/rpc/examples/echoresource/v1/echoresource_connect.d.ts +1 -1
- package/dist/gen/proto/rpc/v1/auth_connect.d.ts +1 -1
- package/dist/gen/proto/rpc/webrtc/v1/signaling_connect.d.ts +1 -1
- package/dist/gen/provisioning/v1/provisioning_connect.d.ts +1 -1
- package/dist/gen/robot/v1/robot_connect.d.ts +1 -1
- package/dist/gen/service/datamanager/v1/data_manager_connect.d.ts +1 -1
- package/dist/gen/service/discovery/v1/discovery_connect.d.ts +1 -1
- package/dist/gen/service/generic/v1/generic_connect.d.ts +1 -1
- package/dist/gen/service/mlmodel/v1/mlmodel_connect.d.ts +1 -1
- package/dist/gen/service/motion/v1/motion_connect.d.ts +1 -1
- package/dist/gen/service/navigation/v1/navigation_connect.d.ts +1 -1
- package/dist/gen/service/sensors/v1/sensors_connect.d.ts +1 -1
- package/dist/gen/service/shell/v1/shell_connect.d.ts +1 -1
- package/dist/gen/service/slam/v1/slam_connect.d.ts +1 -1
- package/dist/gen/service/video/v1/video_connect.d.ts +1 -1
- package/dist/gen/service/vision/v1/vision_connect.d.ts +1 -1
- package/dist/gen/service/worldstatestore/v1/world_state_store_connect.d.ts +1 -1
- package/dist/gen/stream/v1/stream_connect.d.ts +1 -1
- package/dist/main.d.ts +11 -12
- package/dist/main.es.js +28872 -32841
- package/dist/main.umd.js +6 -7
- package/dist/robot/client.d.ts +59 -86
- package/dist/robot/dial.d.ts +7 -10
- package/dist/robot/robot.d.ts +27 -29
- package/dist/rpc/client-channel.d.ts +1 -1
- package/dist/rpc/client-stream.d.ts +4 -5
- package/dist/rpc/connection-closed-error.d.ts +1 -1
- package/dist/rpc/dial.d.ts +34 -41
- package/dist/rpc/signaling-exchange.d.ts +1 -1
- package/dist/rpc/stream-client-stream.d.ts +1 -1
- package/dist/rpc/unary-client-stream.d.ts +1 -1
- package/dist/services/data-manager/client.d.ts +5 -14
- package/dist/services/data-manager/data-manager.d.ts +1 -1
- package/dist/services/generic/client.d.ts +1 -1
- package/dist/services/generic/generic.d.ts +1 -2
- package/dist/services/motion/motion.d.ts +53 -78
- package/dist/services/navigation/client.d.ts +1 -1
- package/dist/services/navigation/navigation.d.ts +2 -4
- package/dist/services/slam/client.d.ts +1 -1
- package/dist/services/slam/slam.d.ts +4 -6
- package/dist/services/video/video.d.ts +2 -6
- package/dist/services/vision/vision.d.ts +13 -19
- package/dist/services/world-state-store/world-state-store.d.ts +6 -19
- package/dist/types.d.ts +5 -7
- package/dist/utils.d.ts +5 -5
- package/package.json +29 -29
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Transport } from '@connectrpc/connect';
|
|
2
|
-
import { ModelType, TrainingStatus } from '../gen/app/mltraining/v1/ml_training_pb';
|
|
2
|
+
import { type ModelType, type TrainingStatus } from '../gen/app/mltraining/v1/ml_training_pb';
|
|
3
3
|
export declare class MlTrainingClient {
|
|
4
4
|
private client;
|
|
5
5
|
constructor(transport: Transport);
|
|
@@ -15,7 +15,7 @@ export declare class MlTrainingClient {
|
|
|
15
15
|
* '<your-model-name>',
|
|
16
16
|
* '1.0.0',
|
|
17
17
|
* ModelType.SINGLE_LABEL_CLASSIFICATION,
|
|
18
|
-
* ['tag1', 'tag2']
|
|
18
|
+
* ['tag1', 'tag2'],
|
|
19
19
|
* );
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
@@ -42,7 +42,7 @@ export declare class MlTrainingClient {
|
|
|
42
42
|
* 'viam:classification-tflite',
|
|
43
43
|
* '1.0.0',
|
|
44
44
|
* '<your-model-name>',
|
|
45
|
-
* '1.0.0'
|
|
45
|
+
* '1.0.0',
|
|
46
46
|
* );
|
|
47
47
|
* ```
|
|
48
48
|
*
|
|
@@ -80,7 +80,7 @@ export declare class MlTrainingClient {
|
|
|
80
80
|
* ```ts
|
|
81
81
|
* const jobs = await mlTrainingClient.listTrainingJobs(
|
|
82
82
|
* '<organization-id>',
|
|
83
|
-
* TrainingStatus.RUNNING
|
|
83
|
+
* TrainingStatus.RUNNING,
|
|
84
84
|
* );
|
|
85
85
|
* ```
|
|
86
86
|
*
|
|
@@ -122,4 +122,4 @@ export declare class MlTrainingClient {
|
|
|
122
122
|
*/
|
|
123
123
|
deleteCompletedTrainingJob(id: string): Promise<null>;
|
|
124
124
|
}
|
|
125
|
-
export { ModelType, TrainingStatus
|
|
125
|
+
export { ModelType, TrainingStatus } from '../gen/app/mltraining/v1/ml_training_pb';
|
|
@@ -10,8 +10,7 @@ export declare class ProvisioningClient {
|
|
|
10
10
|
*/
|
|
11
11
|
getSmartMachineStatus(): Promise<import("../gen/provisioning/v1/provisioning_pb").GetSmartMachineStatusResponse>;
|
|
12
12
|
/**
|
|
13
|
-
* Set the network credentials of the Smart Machine, so it can connect to the
|
|
14
|
-
* internet.
|
|
13
|
+
* Set the network credentials of the Smart Machine, so it can connect to the internet.
|
|
15
14
|
*
|
|
16
15
|
* @param type - The type of network
|
|
17
16
|
* @param ssid - The SSID of the network
|
|
@@ -19,8 +18,7 @@ export declare class ProvisioningClient {
|
|
|
19
18
|
*/
|
|
20
19
|
setNetworkCredentials(type: string, ssid: string, psk: string): Promise<void>;
|
|
21
20
|
/**
|
|
22
|
-
* Set the Viam credentials of the smart machine credentials, so it connect to
|
|
23
|
-
* the Cloud.
|
|
21
|
+
* Set the Viam credentials of the smart machine credentials, so it connect to the Cloud.
|
|
24
22
|
*
|
|
25
23
|
* @param cloud - The configuration of the Cloud
|
|
26
24
|
*/
|
|
@@ -26,6 +26,6 @@ export declare class ViamClient {
|
|
|
26
26
|
readonly billingClient: BillingClient;
|
|
27
27
|
constructor(transport: Transport, credentials: Credentials);
|
|
28
28
|
getRobotSecretFromHost(host: string): Promise<string | undefined>;
|
|
29
|
-
connectToMachine({ host, id
|
|
29
|
+
connectToMachine({ host, id }: ViamClientMachineConnectionOpts): Promise<import("../robot").RobotClient>;
|
|
30
30
|
}
|
|
31
31
|
export {};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { Transport } from '@connectrpc/connect';
|
|
2
|
-
/**
|
|
3
|
-
* Credentials are either used to obtain an access token or provide an existing
|
|
4
|
-
* one
|
|
5
|
-
*/
|
|
2
|
+
/** Credentials are either used to obtain an access token or provide an existing one */
|
|
6
3
|
export type Credentials = Credential | AccessToken;
|
|
7
4
|
/** A credential that can be exchanged to obtain an access token */
|
|
8
5
|
export interface Credential {
|
package/dist/assert.d.ts
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Assert that a value is defined.
|
|
4
4
|
*
|
|
5
|
-
* @example Const stringify = (value: number | undefined): number => {
|
|
6
|
-
*
|
|
7
|
-
* `number` }
|
|
5
|
+
* @example Const stringify = (value: number | undefined): number => { assertExists(value) return
|
|
6
|
+
* `${value}` // TS now knows that value is of type `number` }
|
|
8
7
|
*/
|
|
9
8
|
export declare const assertExists: <T>(value: T, message: string) => asserts value is NonNullable<T>;
|
|
@@ -62,8 +62,8 @@ export interface Arm extends Resource {
|
|
|
62
62
|
* API](https://docs.viam.com/dev/reference/apis/components/arm/#getkinematics).
|
|
63
63
|
* ```
|
|
64
64
|
*
|
|
65
|
-
* @returns The legacy kinematics data shape or the newer object containing
|
|
66
|
-
*
|
|
65
|
+
* @returns The legacy kinematics data shape or the newer object containing kinematics data plus a
|
|
66
|
+
* map of URDF mesh file paths to mesh data.
|
|
67
67
|
*/
|
|
68
68
|
getKinematics: (extra?: Struct) => Promise<GetKinematicsResult>;
|
|
69
69
|
/**
|
|
@@ -4,7 +4,7 @@ import { JointPositions } from '../../gen/component/arm/v1/arm_pb';
|
|
|
4
4
|
import type { RobotClient } from '../../robot';
|
|
5
5
|
import type { Options, Pose } from '../../types';
|
|
6
6
|
import type { Arm } from './arm';
|
|
7
|
-
import { Mesh } from '../../gen/common/v1/common_pb';
|
|
7
|
+
import { type Mesh } from '../../gen/common/v1/common_pb';
|
|
8
8
|
import type { GetKinematicsResult } from '../../utils';
|
|
9
9
|
/**
|
|
10
10
|
* A gRPC-web client for the Arm component.
|
|
@@ -16,10 +16,38 @@ export interface AudioOut extends Resource {
|
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
18
|
* @param audioData - The audio data to play
|
|
19
|
-
* @param audioInfo - Information about the audio format (optional, required
|
|
20
|
-
* for raw pcm data)
|
|
19
|
+
* @param audioInfo - Information about the audio format (optional, required for raw pcm data)
|
|
21
20
|
*/
|
|
22
21
|
play: (audioData: Uint8Array, audioInfo?: AudioInfo, extra?: Struct) => Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Stream audio chunks to the device for playback.
|
|
24
|
+
*
|
|
25
|
+
* The caller provides an async iterable of raw audio bytes. Each chunk must match the codec and
|
|
26
|
+
* format described by `audioInfo`. Playback starts as chunks arrive on the server, before the
|
|
27
|
+
* iterable is exhausted.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
*
|
|
31
|
+
* ```ts
|
|
32
|
+
* const audioOut = new VIAM.AudioOutClient(machine, 'my_audio_out');
|
|
33
|
+
* const audioInfo = {
|
|
34
|
+
* codec: 'pcm16',
|
|
35
|
+
* sampleRateHz: 22050,
|
|
36
|
+
* numChannels: 1,
|
|
37
|
+
* };
|
|
38
|
+
*
|
|
39
|
+
* async function* chunks() {
|
|
40
|
+
* for (const chunk of pcmChunks) yield chunk;
|
|
41
|
+
* }
|
|
42
|
+
*
|
|
43
|
+
* await audioOut.playStream(audioInfo, chunks());
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @param audioInfo - Information about the audio format (codec, sample rate, channels) that
|
|
47
|
+
* applies to every chunk
|
|
48
|
+
* @param chunks - Async iterable of audio byte chunks to play in order
|
|
49
|
+
*/
|
|
50
|
+
playStream: (audioInfo: AudioInfo, chunks: AsyncIterable<Uint8Array>, extra?: Struct) => Promise<void>;
|
|
23
51
|
/**
|
|
24
52
|
* Return the audio output properties.
|
|
25
53
|
*
|
|
@@ -16,6 +16,7 @@ export declare class AudioOutClient implements AudioOut {
|
|
|
16
16
|
callOptions: CallOptions;
|
|
17
17
|
constructor(client: RobotClient, name: string, options?: Options);
|
|
18
18
|
play(audioData: Uint8Array, audioInfo?: AudioInfo, extra?: {}, callOptions?: CallOptions): Promise<void>;
|
|
19
|
+
playStream(audioInfo: AudioInfo, chunks: AsyncIterable<Uint8Array>, extra?: {}, callOptions?: CallOptions): Promise<void>;
|
|
19
20
|
getProperties(extra?: {}, callOptions?: CallOptions): Promise<{
|
|
20
21
|
supportedCodecs: string[];
|
|
21
22
|
sampleRateHz: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { type AudioIn, type AudioChunk } from './audio-in/audio-in';
|
|
2
2
|
export { AudioInClient } from './audio-in/client';
|
|
3
|
-
export { type AudioProperties, AudioCodec, type AudioCodecType
|
|
3
|
+
export { type AudioProperties, AudioCodec, type AudioCodecType } from '../audio-common';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { type AudioOut } from './audio-out/audio-out';
|
|
2
2
|
export { AudioOutClient } from './audio-out/client';
|
|
3
|
-
export { type AudioProperties, AudioCodec, type AudioCodecType
|
|
3
|
+
export { type AudioProperties, AudioCodec, type AudioCodecType } from '../audio-common';
|
|
@@ -20,8 +20,8 @@ export interface Base extends Resource {
|
|
|
20
20
|
*/
|
|
21
21
|
getGeometries: (extra?: Struct) => Promise<Geometry[]>;
|
|
22
22
|
/**
|
|
23
|
-
* Move a base in a straight line by a given distance at a given speed. This
|
|
24
|
-
*
|
|
23
|
+
* Move a base in a straight line by a given distance at a given speed. This method blocks until
|
|
24
|
+
* completed or cancelled.
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
*
|
|
@@ -43,8 +43,8 @@ export interface Base extends Resource {
|
|
|
43
43
|
*/
|
|
44
44
|
moveStraight(distanceMm: number, mmPerSec: number, extra?: Struct): Promise<void>;
|
|
45
45
|
/**
|
|
46
|
-
* Spin a base by a given angle at a given angular speed. This method blocks
|
|
47
|
-
*
|
|
46
|
+
* Spin a base by a given angle at a given angular speed. This method blocks until completed or
|
|
47
|
+
* cancelled.
|
|
48
48
|
*
|
|
49
49
|
* @example
|
|
50
50
|
*
|
|
@@ -66,8 +66,7 @@ export interface Base extends Resource {
|
|
|
66
66
|
*/
|
|
67
67
|
spin(angleDeg: number, degsPerSec: number, extra?: Struct): Promise<void>;
|
|
68
68
|
/**
|
|
69
|
-
* Set the linear and angular power of a base from -1 to 1 in terms of power
|
|
70
|
-
* for each direction.
|
|
69
|
+
* Set the linear and angular power of a base from -1 to 1 in terms of power for each direction.
|
|
71
70
|
*
|
|
72
71
|
* @example
|
|
73
72
|
*
|
|
@@ -77,25 +76,25 @@ export interface Base extends Resource {
|
|
|
77
76
|
* // Move forward at 75% power
|
|
78
77
|
* await base.setPower(
|
|
79
78
|
* { x: 0, y: 0.75, z: 0 }, // linear power
|
|
80
|
-
* { x: 0, y: 0, z: 0 } // no rotation
|
|
79
|
+
* { x: 0, y: 0, z: 0 }, // no rotation
|
|
81
80
|
* );
|
|
82
81
|
*
|
|
83
82
|
* // Move straight back at 100% power
|
|
84
83
|
* await base.setPower(
|
|
85
84
|
* { x: 0, y: -1, z: 0 }, // linear power
|
|
86
|
-
* { x: 0, y: 0, z: 0 } // no rotation
|
|
85
|
+
* { x: 0, y: 0, z: 0 }, // no rotation
|
|
87
86
|
* );
|
|
88
87
|
*
|
|
89
88
|
* // Turn counter-clockwise at 50% power
|
|
90
89
|
* await base.setPower(
|
|
91
90
|
* { x: 0, y: 0, z: 0 }, // no linear movement
|
|
92
|
-
* { x: 0, y: 0, z: 0.5 } // rotate around z-axis
|
|
91
|
+
* { x: 0, y: 0, z: 0.5 }, // rotate around z-axis
|
|
93
92
|
* );
|
|
94
93
|
*
|
|
95
94
|
* // Turn clockwise at 60% power
|
|
96
95
|
* await base.setPower(
|
|
97
96
|
* { x: 0, y: 0, z: 0 }, // no linear movement
|
|
98
|
-
* { x: 0, y: 0, z: -0.6 } // rotate around z-axis
|
|
97
|
+
* { x: 0, y: 0, z: -0.6 }, // rotate around z-axis
|
|
99
98
|
* );
|
|
100
99
|
* ```
|
|
101
100
|
*
|
|
@@ -117,7 +116,7 @@ export interface Base extends Resource {
|
|
|
117
116
|
* // Move forward at 50mm/s while spinning 15 degrees per second to the left
|
|
118
117
|
* await base.setVelocity(
|
|
119
118
|
* { x: 0, y: 50, z: 0 }, // linear velocity in mm/s
|
|
120
|
-
* { x: 0, y: 0, z: 15 } // 15 degrees per second counter-clockwise
|
|
119
|
+
* { x: 0, y: 0, z: 15 }, // 15 degrees per second counter-clockwise
|
|
121
120
|
* );
|
|
122
121
|
* ```
|
|
123
122
|
*
|
|
@@ -10,8 +10,8 @@ export interface Tick {
|
|
|
10
10
|
time: number;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Represents a physical general purpose compute board that contains various
|
|
14
|
-
*
|
|
13
|
+
* Represents a physical general purpose compute board that contains various components such as
|
|
14
|
+
* analog readers, and digital interrupts.
|
|
15
15
|
*/
|
|
16
16
|
export interface Board extends Resource {
|
|
17
17
|
/**
|
|
@@ -48,8 +48,7 @@ export interface Board extends Resource {
|
|
|
48
48
|
* API](https://docs.viam.com/dev/reference/apis/components/board/#setgpio).
|
|
49
49
|
*
|
|
50
50
|
* @param pin - The pin number.
|
|
51
|
-
* @param high - When true, set the given pin to high. When false, set the
|
|
52
|
-
* given pin to low.
|
|
51
|
+
* @param high - When true, set the given pin to high. When false, set the given pin to low.
|
|
53
52
|
*/
|
|
54
53
|
setGPIO(pin: string, high: boolean, extra?: Struct): Promise<void>;
|
|
55
54
|
/**
|
|
@@ -125,8 +124,7 @@ export interface Board extends Resource {
|
|
|
125
124
|
* API](https://docs.viam.com/dev/reference/apis/components/board/#setpwmfrequency).
|
|
126
125
|
*
|
|
127
126
|
* @param pin - The pin.
|
|
128
|
-
* @param frequencyHz - The PWM frequency, in hertz. 0 will use the board's
|
|
129
|
-
* default PWM frequency.
|
|
127
|
+
* @param frequencyHz - The PWM frequency, in hertz. 0 will use the board's default PWM frequency.
|
|
130
128
|
*/
|
|
131
129
|
setPWMFrequency(pin: string, frequencyHz: number, extra?: Struct): Promise<void>;
|
|
132
130
|
/**
|
|
@@ -139,9 +137,7 @@ export interface Board extends Resource {
|
|
|
139
137
|
*
|
|
140
138
|
* // Get the value of the analog signal "my_example_analog_reader" has most
|
|
141
139
|
* // recently measured.
|
|
142
|
-
* const reading = await board.readAnalogReader(
|
|
143
|
-
* 'my_example_analog_reader'
|
|
144
|
-
* );
|
|
140
|
+
* const reading = await board.readAnalogReader('my_example_analog_reader');
|
|
145
141
|
* ```
|
|
146
142
|
*
|
|
147
143
|
* For more information, see [Board
|
|
@@ -170,8 +166,7 @@ export interface Board extends Resource {
|
|
|
170
166
|
*/
|
|
171
167
|
writeAnalog(pin: string, value: number, extra?: Struct): Promise<void>;
|
|
172
168
|
/**
|
|
173
|
-
* Return the current value of the interrupt which is based on the type of
|
|
174
|
-
* interrupt.
|
|
169
|
+
* Return the current value of the interrupt which is based on the type of interrupt.
|
|
175
170
|
*
|
|
176
171
|
* @example
|
|
177
172
|
*
|
|
@@ -179,9 +174,7 @@ export interface Board extends Resource {
|
|
|
179
174
|
* const board = new VIAM.BoardClient(machine, 'my_board');
|
|
180
175
|
*
|
|
181
176
|
* // Get the number of times this DigitalInterrupt has been interrupted with a tick.
|
|
182
|
-
* const count = await board.getDigitalInterruptValue(
|
|
183
|
-
* 'my_example_digital_interrupt'
|
|
184
|
-
* );
|
|
177
|
+
* const count = await board.getDigitalInterruptValue('my_example_digital_interrupt');
|
|
185
178
|
* ```
|
|
186
179
|
*
|
|
187
180
|
* For more information, see [Board
|
|
@@ -203,7 +196,7 @@ export interface Board extends Resource {
|
|
|
203
196
|
*
|
|
204
197
|
* for await (const tick of ticks) {
|
|
205
198
|
* console.log(
|
|
206
|
-
* `Pin ${tick.pinName} changed to ${tick.high ? 'high' : 'low'} at ${tick.time}
|
|
199
|
+
* `Pin ${tick.pinName} changed to ${tick.high ? 'high' : 'low'} at ${tick.time}`,
|
|
207
200
|
* );
|
|
208
201
|
* }
|
|
209
202
|
* ```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RobotClient } from '../../robot';
|
|
2
2
|
import type { Options } from '../../types';
|
|
3
|
-
import { Duration, Struct, type JsonValue } from '@bufbuild/protobuf';
|
|
3
|
+
import { type Duration, Struct, type JsonValue } from '@bufbuild/protobuf';
|
|
4
4
|
import type { CallOptions } from '@connectrpc/connect';
|
|
5
5
|
import { type Board, type PowerMode, type Tick } from './board';
|
|
6
6
|
/**
|
|
@@ -36,10 +36,8 @@ export interface Camera extends Resource {
|
|
|
36
36
|
* const images = await camera.getImages();
|
|
37
37
|
* ```
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* @param filterSourceNames - A list of source names to filter the images by.
|
|
42
|
-
* If empty or undefined, all images will be returned.
|
|
39
|
+
* @param filterSourceNames - A list of source names to filter the images by. If empty or
|
|
40
|
+
* undefined, all images will be returned.
|
|
43
41
|
* @param extra - Extra parameters to pass to the camera.
|
|
44
42
|
*/
|
|
45
43
|
getImages: (filterSourceNames?: string[], extra?: Struct) => Promise<{
|
|
@@ -18,12 +18,12 @@ export declare class CameraClient implements Camera {
|
|
|
18
18
|
getImages(filterSourceNames?: string[], extra?: {}, callOptions?: CallOptions): Promise<{
|
|
19
19
|
images: {
|
|
20
20
|
sourceName: string;
|
|
21
|
-
image: Uint8Array
|
|
21
|
+
image: Uint8Array<ArrayBufferLike>;
|
|
22
22
|
mimeType: string;
|
|
23
23
|
}[];
|
|
24
24
|
metadata: ResponseMetadata;
|
|
25
25
|
}>;
|
|
26
|
-
getPointCloud(extra?: {}, callOptions?: CallOptions): Promise<Uint8Array
|
|
26
|
+
getPointCloud(extra?: {}, callOptions?: CallOptions): Promise<Uint8Array<ArrayBufferLike>>;
|
|
27
27
|
getProperties(callOptions?: CallOptions): Promise<import("../../gen/component/camera/v1/camera_pb").GetPropertiesResponse>;
|
|
28
28
|
getStatus(callOptions?: CallOptions): Promise<JsonValue>;
|
|
29
29
|
doCommand(command: Struct | Record<string, JsonValue>, callOptions?: CallOptions): Promise<JsonValue>;
|
|
@@ -39,8 +39,8 @@ export interface Encoder extends Resource {
|
|
|
39
39
|
*/
|
|
40
40
|
getProperties(extra?: Struct): Promise<EncoderProperties>;
|
|
41
41
|
/**
|
|
42
|
-
* Return the current position either in relative units (ticks away from a
|
|
43
|
-
*
|
|
42
|
+
* Return the current position either in relative units (ticks away from a zero position) or
|
|
43
|
+
* absolute units (degrees along a circle).
|
|
44
44
|
*
|
|
45
45
|
* @example
|
|
46
46
|
*
|
|
@@ -49,7 +49,7 @@ export interface Encoder extends Resource {
|
|
|
49
49
|
*
|
|
50
50
|
* // Get the position of the encoder in ticks
|
|
51
51
|
* const [position, posType] = await encoder.getPosition(
|
|
52
|
-
* EncoderPositionType.POSITION_TYPE_TICKS_COUNT
|
|
52
|
+
* EncoderPositionType.POSITION_TYPE_TICKS_COUNT,
|
|
53
53
|
* );
|
|
54
54
|
* console.log('The encoder position is currently', position, posType);
|
|
55
55
|
* ```
|
|
@@ -57,8 +57,7 @@ export interface Encoder extends Resource {
|
|
|
57
57
|
* For more information, see [Encoder
|
|
58
58
|
* API](https://docs.viam.com/dev/reference/apis/components/encoder/#getposition).
|
|
59
59
|
*
|
|
60
|
-
* @param positionType - The type of position the encoder returns (ticks or
|
|
61
|
-
* degrees)
|
|
60
|
+
* @param positionType - The type of position the encoder returns (ticks or degrees)
|
|
62
61
|
*/
|
|
63
62
|
getPosition(positionType?: EncoderPositionType, extra?: Struct): Promise<readonly [number, EncoderPositionType]>;
|
|
64
63
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { EncoderClient } from './encoder/client';
|
|
2
|
-
export { EncoderPositionType, EncoderProperties, type Encoder
|
|
2
|
+
export { EncoderPositionType, EncoderProperties, type Encoder } from './encoder/encoder';
|
|
@@ -35,13 +35,12 @@ export interface Gantry extends Resource {
|
|
|
35
35
|
* For more information, see [Gantry
|
|
36
36
|
* API](https://docs.viam.com/dev/reference/apis/components/gantry/#getkinematics).
|
|
37
37
|
*
|
|
38
|
-
* @returns The legacy kinematics data shape or the newer object containing
|
|
39
|
-
*
|
|
38
|
+
* @returns The legacy kinematics data shape or the newer object containing kinematics data plus a
|
|
39
|
+
* map of URDF mesh file paths to mesh data.
|
|
40
40
|
*/
|
|
41
41
|
getKinematics: (extra?: Struct) => Promise<GetKinematicsResult>;
|
|
42
42
|
/**
|
|
43
|
-
* Move each axis of the gantry to the positionsMm at the speeds in
|
|
44
|
-
* speedsMmPerSec.
|
|
43
|
+
* Move each axis of the gantry to the positionsMm at the speeds in speedsMmPerSec.
|
|
45
44
|
*
|
|
46
45
|
* @example
|
|
47
46
|
*
|
|
@@ -60,8 +59,8 @@ export interface Gantry extends Resource {
|
|
|
60
59
|
* API](https://docs.viam.com/dev/reference/apis/components/gantry/#movetoposition).
|
|
61
60
|
*
|
|
62
61
|
* @param positionsMm - The goal positions for each axis of the gantry.
|
|
63
|
-
* @param speedsMmPerSec - The desired speed for each axis to move to the
|
|
64
|
-
*
|
|
62
|
+
* @param speedsMmPerSec - The desired speed for each axis to move to the respective position in
|
|
63
|
+
* positionsMm.
|
|
65
64
|
*/
|
|
66
65
|
moveToPosition: (positionsMm: number[], speedsMmPerSec: number[], extra?: Struct) => Promise<void>;
|
|
67
66
|
/**
|
|
@@ -83,8 +82,7 @@ export interface Gantry extends Resource {
|
|
|
83
82
|
*/
|
|
84
83
|
getPosition: (extra?: Struct) => Promise<number[]>;
|
|
85
84
|
/**
|
|
86
|
-
* Runs the homing sequence to find the start and end positions of the gantry
|
|
87
|
-
* axis.
|
|
85
|
+
* Runs the homing sequence to find the start and end positions of the gantry axis.
|
|
88
86
|
*
|
|
89
87
|
* @example
|
|
90
88
|
*
|
|
@@ -98,8 +96,7 @@ export interface Gantry extends Resource {
|
|
|
98
96
|
* For more information, see [Gantry
|
|
99
97
|
* API](https://docs.viam.com/dev/reference/apis/components/gantry/#home).
|
|
100
98
|
*
|
|
101
|
-
* @returns A bool representing whether the gantry has run the homing sequence
|
|
102
|
-
* successfully.
|
|
99
|
+
* @returns A bool representing whether the gantry has run the homing sequence successfully.
|
|
103
100
|
*/
|
|
104
101
|
home: (extra?: Struct) => Promise<boolean>;
|
|
105
102
|
/**
|
|
@@ -8,10 +8,7 @@ export interface Generic extends Resource {
|
|
|
8
8
|
* @example
|
|
9
9
|
*
|
|
10
10
|
* ```ts
|
|
11
|
-
* const generic = new VIAM.GenericComponentClient(
|
|
12
|
-
* machine,
|
|
13
|
-
* 'my_generic_component'
|
|
14
|
-
* );
|
|
11
|
+
* const generic = new VIAM.GenericComponentClient(machine, 'my_generic_component');
|
|
15
12
|
*
|
|
16
13
|
* // Get the geometries of this component
|
|
17
14
|
* const geometries = await generic.getGeometries();
|
|
@@ -86,8 +86,7 @@ export interface Gripper extends Resource {
|
|
|
86
86
|
*/
|
|
87
87
|
isMoving: () => Promise<boolean>;
|
|
88
88
|
/**
|
|
89
|
-
* Get information about whether the gripper is currently holding onto an
|
|
90
|
-
* object.
|
|
89
|
+
* Get information about whether the gripper is currently holding onto an object.
|
|
91
90
|
*
|
|
92
91
|
* @example
|
|
93
92
|
*
|
|
@@ -3,10 +3,7 @@ import * as pb from '../../gen/component/inputcontroller/v1/input_controller_pb'
|
|
|
3
3
|
import type { Resource } from '../../types';
|
|
4
4
|
export type InputControllerEvent = PlainMessage<pb.Event>;
|
|
5
5
|
export declare const InputControllerEvent: typeof pb.Event;
|
|
6
|
-
/**
|
|
7
|
-
* Represents a human interface device like a mouse or keyboard that emits
|
|
8
|
-
* events for controls.
|
|
9
|
-
*/
|
|
6
|
+
/** Represents a human interface device like a mouse or keyboard that emits events for controls. */
|
|
10
7
|
export interface InputController extends Resource {
|
|
11
8
|
/**
|
|
12
9
|
* Returns a list of events representing the last event on each control.
|
|
@@ -14,10 +11,7 @@ export interface InputController extends Resource {
|
|
|
14
11
|
* @example
|
|
15
12
|
*
|
|
16
13
|
* ```ts
|
|
17
|
-
* const controller = new VIAM.InputControllerClient(
|
|
18
|
-
* machine,
|
|
19
|
-
* 'my_controller'
|
|
20
|
-
* );
|
|
14
|
+
* const controller = new VIAM.InputControllerClient(machine, 'my_controller');
|
|
21
15
|
*
|
|
22
16
|
* // Get the most recent Event for each Control
|
|
23
17
|
* const recentEvents = await controller.getEvents();
|
|
@@ -29,17 +23,13 @@ export interface InputController extends Resource {
|
|
|
29
23
|
*/
|
|
30
24
|
getEvents(extra?: Struct): Promise<InputControllerEvent[]>;
|
|
31
25
|
/**
|
|
32
|
-
* TriggerEvent, where supported, injects an InputControllerEvent into an
|
|
33
|
-
*
|
|
34
|
-
* movements.
|
|
26
|
+
* TriggerEvent, where supported, injects an InputControllerEvent into an input controller to
|
|
27
|
+
* (virtually) generate events like button presses or axis movements.
|
|
35
28
|
*
|
|
36
29
|
* @example
|
|
37
30
|
*
|
|
38
31
|
* ```ts
|
|
39
|
-
* const controller = new VIAM.InputControllerClient(
|
|
40
|
-
* machine,
|
|
41
|
-
* 'my_controller'
|
|
42
|
-
* );
|
|
32
|
+
* const controller = new VIAM.InputControllerClient(machine, 'my_controller');
|
|
43
33
|
*
|
|
44
34
|
* // Create a "Button is Pressed" event for the control BUTTON_START
|
|
45
35
|
* const buttonPressEvent = new VIAM.InputControllerEvent({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { InputControllerClient } from './input-controller/client';
|
|
2
|
-
export { InputControllerEvent, type InputController
|
|
2
|
+
export { InputControllerEvent, type InputController } from './input-controller/input-controller';
|
|
@@ -21,14 +21,13 @@ export interface Motor extends Resource {
|
|
|
21
21
|
* For more information, see [Motor
|
|
22
22
|
* API](https://docs.viam.com/dev/reference/apis/components/motor/#setpower).
|
|
23
23
|
*
|
|
24
|
-
* @param power - A value between -1 and 1 where negative values indicate a
|
|
25
|
-
*
|
|
24
|
+
* @param power - A value between -1 and 1 where negative values indicate a backwards direction
|
|
25
|
+
* and positive values a forward direction.
|
|
26
26
|
*/
|
|
27
27
|
setPower(power: number, extra?: Struct): Promise<void>;
|
|
28
28
|
/**
|
|
29
|
-
* Turn the motor at a specified speed for either a specified number of
|
|
30
|
-
*
|
|
31
|
-
* supported.
|
|
29
|
+
* Turn the motor at a specified speed for either a specified number of revolutions or
|
|
30
|
+
* indefinitely. Raise an error if position reporting is not supported.
|
|
32
31
|
*
|
|
33
32
|
* @example
|
|
34
33
|
*
|
|
@@ -43,15 +42,15 @@ export interface Motor extends Resource {
|
|
|
43
42
|
* API](https://docs.viam.com/dev/reference/apis/components/motor/#gofor).
|
|
44
43
|
*
|
|
45
44
|
* @param rpm - Speed in revolutions per minute.
|
|
46
|
-
* @param revolutions - Number of revolutions relative to the motor's starting
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
45
|
+
* @param revolutions - Number of revolutions relative to the motor's starting position. If this
|
|
46
|
+
* value is 0, this will run the motor at the given rpm indefinitely. If this value is nonzero,
|
|
47
|
+
* this will block until the number of revolutions has been completed or another operation comes
|
|
48
|
+
* in.
|
|
50
49
|
*/
|
|
51
50
|
goFor(rpm: number, revolutions: number, extra?: Struct): Promise<void>;
|
|
52
51
|
/**
|
|
53
|
-
* Move the motor to a specific position relative to its home position at a
|
|
54
|
-
*
|
|
52
|
+
* Move the motor to a specific position relative to its home position at a specified speed. Raise
|
|
53
|
+
* an error if position reporting is not supported.
|
|
55
54
|
*
|
|
56
55
|
* @example
|
|
57
56
|
*
|
|
@@ -66,13 +65,12 @@ export interface Motor extends Resource {
|
|
|
66
65
|
* API](https://docs.viam.com/dev/reference/apis/components/motor/#goto).
|
|
67
66
|
*
|
|
68
67
|
* @param rpm - Speed in revolutions per minute.
|
|
69
|
-
* @param positionRevolutions - Number of revolutions relative to the motor's
|
|
70
|
-
* home position.
|
|
68
|
+
* @param positionRevolutions - Number of revolutions relative to the motor's home position.
|
|
71
69
|
*/
|
|
72
70
|
goTo(rpm: number, positionRevolutions: number, extra?: Struct): Promise<void>;
|
|
73
71
|
/**
|
|
74
|
-
* Move the motor indefinitely at a specified speed. Raise an error if
|
|
75
|
-
*
|
|
72
|
+
* Move the motor indefinitely at a specified speed. Raise an error if position reporting is not
|
|
73
|
+
* supported.
|
|
76
74
|
*
|
|
77
75
|
* @example
|
|
78
76
|
*
|
|
@@ -90,8 +88,8 @@ export interface Motor extends Resource {
|
|
|
90
88
|
*/
|
|
91
89
|
setRPM(rpm: number, extra?: Struct): Promise<void>;
|
|
92
90
|
/**
|
|
93
|
-
* Set the current position of the motor as the new zero position, offset by a
|
|
94
|
-
*
|
|
91
|
+
* Set the current position of the motor as the new zero position, offset by a given position.
|
|
92
|
+
* Raise an error if position reporting is not supported.
|
|
95
93
|
*
|
|
96
94
|
* @example
|
|
97
95
|
*
|
|
@@ -143,8 +141,8 @@ export interface Motor extends Resource {
|
|
|
143
141
|
*/
|
|
144
142
|
getProperties(extra?: Struct): Promise<Properties>;
|
|
145
143
|
/**
|
|
146
|
-
* Return the position of the motor relative to its zero position. Raise an
|
|
147
|
-
*
|
|
144
|
+
* Return the position of the motor relative to its zero position. Raise an error if position
|
|
145
|
+
* reporting is not supported.
|
|
148
146
|
*
|
|
149
147
|
* @example
|
|
150
148
|
*
|