@viamrobotics/sdk 0.58.0 → 0.60.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/components/arm/arm.d.ts +3 -15
- package/dist/components/arm/client.d.ts +1 -13
- package/dist/components/camera/camera.d.ts +0 -51
- package/dist/components/camera/client.d.ts +1 -3
- package/dist/components/gantry/client.d.ts +1 -0
- package/dist/components/gantry/gantry.d.ts +17 -0
- package/dist/gen/app/datasync/v1/data_sync_pb.d.ts +5 -0
- package/dist/gen/app/v1/app_pb.d.ts +74 -0
- package/dist/gen/app/v1/robot_pb.d.ts +55 -0
- package/dist/main.es.js +3886 -3827
- package/dist/main.umd.js +7 -7
- package/dist/services/video/client.d.ts +20 -0
- package/dist/services/video/index.d.ts +3 -0
- package/dist/services/video/types.d.ts +9 -0
- package/dist/services/video/video.d.ts +44 -0
- package/dist/services/video.d.ts +3 -0
- package/dist/services/vision/vision.d.ts +6 -8
- package/dist/utils.d.ts +23 -2
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Struct, type JsonValue } from '@bufbuild/protobuf';
|
|
2
|
+
import type { CallOptions } from '@connectrpc/connect';
|
|
3
|
+
import type { RobotClient } from '../../robot';
|
|
4
|
+
import type { Options } from '../../types';
|
|
5
|
+
import type { VideoChunk } from './types';
|
|
6
|
+
import type { Video } from './video';
|
|
7
|
+
/**
|
|
8
|
+
* A gRPC-web client for a Video service.
|
|
9
|
+
*
|
|
10
|
+
* @group Clients
|
|
11
|
+
*/
|
|
12
|
+
export declare class VideoClient implements Video {
|
|
13
|
+
private client;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
private readonly options;
|
|
16
|
+
callOptions: CallOptions;
|
|
17
|
+
constructor(client: RobotClient, name: string, options?: Options);
|
|
18
|
+
getVideo(startTimestamp?: Date, endTimestamp?: Date, videoCodec?: string, videoContainer?: string, extra?: {}, callOptions?: CallOptions): AsyncIterable<VideoChunk>;
|
|
19
|
+
doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** A chunk of video data returned from the video service */
|
|
2
|
+
export interface VideoChunk {
|
|
3
|
+
/** Video data chunk */
|
|
4
|
+
videoData: Uint8Array;
|
|
5
|
+
/** Container format (e.g., "mp4", "fmp4") */
|
|
6
|
+
videoContainer: string;
|
|
7
|
+
/** Request ID to match this response to its request */
|
|
8
|
+
requestId: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { JsonValue, Struct } from '@bufbuild/protobuf';
|
|
2
|
+
import type { Resource } from '../../types';
|
|
3
|
+
import type { VideoChunk } from './types';
|
|
4
|
+
/** A service that enables video streaming and retrieval for a given time range. */
|
|
5
|
+
export interface Video extends Resource {
|
|
6
|
+
/**
|
|
7
|
+
* Retrieve video data for a given time range.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* const video = new VIAM.VideoClient(machine, 'my_video');
|
|
13
|
+
* const videoStream = video.getVideo(
|
|
14
|
+
* new Date('2025-01-01T00:00:00Z'),
|
|
15
|
+
* new Date('2025-01-01T00:10:00Z'),
|
|
16
|
+
* 'h264',
|
|
17
|
+
* 'mp4'
|
|
18
|
+
* );
|
|
19
|
+
*
|
|
20
|
+
* for await (const chunk of videoStream) {
|
|
21
|
+
* console.log(
|
|
22
|
+
* 'Received video chunk:',
|
|
23
|
+
* chunk.videoData.length,
|
|
24
|
+
* 'bytes'
|
|
25
|
+
* );
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @param startTimestamp - Start time for the video retrieval.
|
|
30
|
+
* @param endTimestamp - End time for the video retrieval.
|
|
31
|
+
* @param videoCodec - Codec for the video (e.g., "h264", "h265").
|
|
32
|
+
* @param videoContainer - Container format (e.g., "mp4", "fmp4").
|
|
33
|
+
* @param extra - Additional arguments.
|
|
34
|
+
* @returns An async iterable of video chunks.
|
|
35
|
+
*/
|
|
36
|
+
getVideo: (startTimestamp?: Date, endTimestamp?: Date, videoCodec?: string, videoContainer?: string, extra?: Struct) => AsyncIterable<VideoChunk>;
|
|
37
|
+
/**
|
|
38
|
+
* Send/receive arbitrary commands to the resource.
|
|
39
|
+
*
|
|
40
|
+
* @param command - The command to execute.
|
|
41
|
+
* @returns The result of the command.
|
|
42
|
+
*/
|
|
43
|
+
doCommand: (command: Struct) => Promise<JsonValue>;
|
|
44
|
+
}
|
|
@@ -30,13 +30,12 @@ export interface Vision extends Resource {
|
|
|
30
30
|
* const camera = new VIAM.CameraClient(machine, 'my_camera');
|
|
31
31
|
* const vision = new VIAM.VisionClient(machine, 'my_vision');
|
|
32
32
|
*
|
|
33
|
-
* const
|
|
34
|
-
* const image = await camera.getImage(mimeType);
|
|
33
|
+
* const { images } = await camera.getImages();
|
|
35
34
|
* const detections = await vision.getDetections(
|
|
36
|
-
* image,
|
|
35
|
+
* images[0].image,
|
|
37
36
|
* 600,
|
|
38
37
|
* 600,
|
|
39
|
-
* mimeType
|
|
38
|
+
* images[0].mimeType
|
|
40
39
|
* );
|
|
41
40
|
* ```
|
|
42
41
|
*
|
|
@@ -80,13 +79,12 @@ export interface Vision extends Resource {
|
|
|
80
79
|
* const camera = new VIAM.CameraClient(machine, 'my_camera');
|
|
81
80
|
* const vision = new VIAM.VisionClient(machine, 'my_vision');
|
|
82
81
|
*
|
|
83
|
-
* const
|
|
84
|
-
* const image = await camera.getImage(mimeType);
|
|
82
|
+
* const { images } = await camera.getImages();
|
|
85
83
|
* const classifications = await vision.getClassifications(
|
|
86
|
-
* image,
|
|
84
|
+
* images[0].image,
|
|
87
85
|
* 600,
|
|
88
86
|
* 600,
|
|
89
|
-
* mimeType,
|
|
87
|
+
* images[0].mimeType,
|
|
90
88
|
* 10
|
|
91
89
|
* );
|
|
92
90
|
* ```
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Struct, type JsonValue, type PartialMessage } from '@bufbuild/protobuf';
|
|
2
2
|
import type { CallOptions } from '@connectrpc/connect';
|
|
3
|
-
import { DoCommandRequest, DoCommandResponse } from './gen/common/v1/common_pb';
|
|
4
|
-
import type { Options } from './types';
|
|
3
|
+
import { DoCommandRequest, DoCommandResponse, GetKinematicsRequest, GetKinematicsResponse, GetGeometriesRequest, GetGeometriesResponse, Geometry } from './gen/common/v1/common_pb';
|
|
4
|
+
import type { Options, Vector3 } from './types';
|
|
5
|
+
import type { Frame } from './gen/app/v1/robot_pb';
|
|
5
6
|
export declare const clientHeaders: Headers;
|
|
6
7
|
type doCommand = (request: PartialMessage<DoCommandRequest>, options?: CallOptions) => Promise<DoCommandResponse>;
|
|
7
8
|
/** Send/Receive an arbitrary command using a resource client */
|
|
@@ -10,4 +11,24 @@ export declare const enableDebugLogging: (key?: string, opts?: CallOptions) => C
|
|
|
10
11
|
export declare const disableDebugLogging: (opts: CallOptions) => void;
|
|
11
12
|
export declare const addMetadata: (key: string, value: string, opts?: CallOptions) => CallOptions;
|
|
12
13
|
export declare const deleteMetadata: (opts: CallOptions, key: string) => void;
|
|
14
|
+
/** Shared type for kinematics return value */
|
|
15
|
+
export interface KinematicsData {
|
|
16
|
+
name: string;
|
|
17
|
+
kinematic_param_type: 'SVA' | 'URDF' | 'UNSPECIFIED';
|
|
18
|
+
joints: {
|
|
19
|
+
id: string;
|
|
20
|
+
type: string;
|
|
21
|
+
parent: string;
|
|
22
|
+
axis: Vector3;
|
|
23
|
+
max: number;
|
|
24
|
+
min: number;
|
|
25
|
+
}[];
|
|
26
|
+
links: Frame[];
|
|
27
|
+
}
|
|
28
|
+
type getKinematics = (request: PartialMessage<GetKinematicsRequest>, options?: CallOptions) => Promise<GetKinematicsResponse>;
|
|
29
|
+
/** Get kinematics information using a resource client */
|
|
30
|
+
export declare const getKinematicsFromClient: (getKinematicsMethod: getKinematics, name: string, extra?: Struct, callOptions?: CallOptions) => Promise<KinematicsData>;
|
|
31
|
+
type getGeometries = (request: PartialMessage<GetGeometriesRequest>, options?: CallOptions) => Promise<GetGeometriesResponse>;
|
|
32
|
+
/** Get geometries information using a resource client */
|
|
33
|
+
export declare const getGeometriesFromClient: (getGeometriesMethod: getGeometries, name: string, extra?: Struct, callOptions?: CallOptions) => Promise<Geometry[]>;
|
|
13
34
|
export {};
|