@viamrobotics/sdk 0.59.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/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/main.es.js +4226 -4234
- package/dist/main.umd.js +7 -7
- package/dist/services/vision/vision.d.ts +6 -8
- package/dist/utils.d.ts +23 -2
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { PlainMessage, Struct } from '@bufbuild/protobuf';
|
|
2
|
-
import type { Pose, Resource
|
|
2
|
+
import type { Pose, Resource } from '../../types';
|
|
3
3
|
import * as armApi from '../../gen/component/arm/v1/arm_pb';
|
|
4
4
|
import type { Geometry, Mesh } from '../../gen/common/v1/common_pb';
|
|
5
|
-
import type {
|
|
5
|
+
import type { KinematicsData } from '../../utils';
|
|
6
6
|
export type ArmJointPositions = PlainMessage<armApi.JointPositions>;
|
|
7
7
|
export declare const ArmJointPositions: typeof armApi.JointPositions;
|
|
8
8
|
/** Represents a physical robot arm that exists in three-dimensional space. */
|
|
@@ -62,19 +62,7 @@ export interface Arm extends Resource {
|
|
|
62
62
|
* API](https://docs.viam.com/dev/reference/apis/components/arm/#getkinematics).
|
|
63
63
|
* ```
|
|
64
64
|
*/
|
|
65
|
-
getKinematics: (extra?: Struct) => Promise<
|
|
66
|
-
name: string;
|
|
67
|
-
kinematic_param_type: 'SVA' | 'URDF' | 'UNSPECIFIED';
|
|
68
|
-
joints: {
|
|
69
|
-
id: string;
|
|
70
|
-
type: string;
|
|
71
|
-
parent: string;
|
|
72
|
-
axis: Vector3;
|
|
73
|
-
max: number;
|
|
74
|
-
min: number;
|
|
75
|
-
}[];
|
|
76
|
-
links: Frame[];
|
|
77
|
-
}>;
|
|
65
|
+
getKinematics: (extra?: Struct) => Promise<KinematicsData>;
|
|
78
66
|
/**
|
|
79
67
|
* Move the end of the arm to the pose.
|
|
80
68
|
*
|
|
@@ -18,20 +18,8 @@ export declare class ArmClient implements Arm {
|
|
|
18
18
|
constructor(client: RobotClient, name: string, options?: Options);
|
|
19
19
|
getEndPosition(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/common/v1/common_pb").Pose>;
|
|
20
20
|
getGeometries(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/common/v1/common_pb").Geometry[]>;
|
|
21
|
+
getKinematics(extra?: {}, callOptions?: CallOptions): Promise<import("../../utils").KinematicsData>;
|
|
21
22
|
get3DModels(extra?: {}, callOptions?: CallOptions): Promise<Record<string, Mesh>>;
|
|
22
|
-
getKinematics(extra?: {}, callOptions?: CallOptions): Promise<{
|
|
23
|
-
name: string;
|
|
24
|
-
kinematic_param_type: "SVA" | "URDF" | "UNSPECIFIED";
|
|
25
|
-
joints: {
|
|
26
|
-
id: string;
|
|
27
|
-
type: string;
|
|
28
|
-
parent: string;
|
|
29
|
-
axis: import("@bufbuild/protobuf").PlainMessage<import("../../gen/common/v1/common_pb").Vector3>;
|
|
30
|
-
max: number;
|
|
31
|
-
min: number;
|
|
32
|
-
}[];
|
|
33
|
-
links: import("../../gen/app/v1/robot_pb").Frame[];
|
|
34
|
-
}>;
|
|
35
23
|
moveToPosition(pose: Pose, extra?: {}, callOptions?: CallOptions): Promise<void>;
|
|
36
24
|
moveToJointPositions(jointPositionsList: number[], extra?: {}, callOptions?: CallOptions): Promise<void>;
|
|
37
25
|
getJointPositions(extra?: {}, callOptions?: CallOptions): Promise<JointPositions>;
|
|
@@ -26,39 +26,6 @@ export type MimeType = '' | 'image/vnd.viam.rgba' | 'image/vnd.viam.depth' | 'im
|
|
|
26
26
|
export interface Camera extends Resource {
|
|
27
27
|
/** Get the geometries of the component in their current configuration */
|
|
28
28
|
getGeometries: (extra?: Struct) => Promise<Geometry[]>;
|
|
29
|
-
/**
|
|
30
|
-
* Return a frame from a camera.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
*
|
|
34
|
-
* ```ts
|
|
35
|
-
* const camera = new VIAM.CameraClient(machine, 'my_camera');
|
|
36
|
-
* const image = await camera.getImage();
|
|
37
|
-
*
|
|
38
|
-
* // Convert Uint8Array to base64
|
|
39
|
-
* const base64Image = btoa(
|
|
40
|
-
* Array.from(image)
|
|
41
|
-
* .map((byte) => String.fromCharCode(byte))
|
|
42
|
-
* .join('')
|
|
43
|
-
* );
|
|
44
|
-
*
|
|
45
|
-
* // Convert image to base64 and display it
|
|
46
|
-
* const imageElement = document.createElement('img');
|
|
47
|
-
* imageElement.src = `data:image/jpeg;base64,${base64Image}`;
|
|
48
|
-
* const imageContainer = document.getElementById('#imageContainer');
|
|
49
|
-
* if (imageContainer) {
|
|
50
|
-
* imageContainer.innerHTML = '';
|
|
51
|
-
* imageContainer.appendChild(imageElement);
|
|
52
|
-
* }
|
|
53
|
-
* ```
|
|
54
|
-
*
|
|
55
|
-
* For more information, see [Camera
|
|
56
|
-
* API](https://docs.viam.com/dev/reference/apis/components/camera/#getimage).
|
|
57
|
-
*
|
|
58
|
-
* @param mimeType - A specific MIME type to request. This is not necessarily
|
|
59
|
-
* the same type that will be returned.
|
|
60
|
-
*/
|
|
61
|
-
getImage: (mimeType?: MimeType, extra?: Struct) => Promise<Uint8Array>;
|
|
62
29
|
/**
|
|
63
30
|
* Return a frame from a camera.
|
|
64
31
|
*
|
|
@@ -79,24 +46,6 @@ export interface Camera extends Resource {
|
|
|
79
46
|
images: NamedImage[];
|
|
80
47
|
metadata: ResponseMetadata;
|
|
81
48
|
}>;
|
|
82
|
-
/**
|
|
83
|
-
* Render a frame from a camera to an HTTP response.
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
*
|
|
87
|
-
* ```ts
|
|
88
|
-
* const camera = new VIAM.CameraClient(machine, 'my_camera');
|
|
89
|
-
* const mimeType = 'image/jpeg';
|
|
90
|
-
* const image = await camera.renderFrame(mimeType);
|
|
91
|
-
* ```
|
|
92
|
-
*
|
|
93
|
-
* For more information, see [Camera
|
|
94
|
-
* API](https://docs.viam.com/dev/reference/apis/components/camera/#renderframe).
|
|
95
|
-
*
|
|
96
|
-
* @param mimeType - A specific MIME type to request. This is not necessarily
|
|
97
|
-
* the same type that will be returned.
|
|
98
|
-
*/
|
|
99
|
-
renderFrame: (mimeType?: MimeType, extra?: Struct) => Promise<Blob>;
|
|
100
49
|
/**
|
|
101
50
|
* Return a point cloud from a camera.
|
|
102
51
|
*
|
|
@@ -2,7 +2,7 @@ import { type JsonValue, Struct } from '@bufbuild/protobuf';
|
|
|
2
2
|
import type { CallOptions } from '@connectrpc/connect';
|
|
3
3
|
import type { RobotClient } from '../../robot';
|
|
4
4
|
import type { Options } from '../../types';
|
|
5
|
-
import type { Camera,
|
|
5
|
+
import type { Camera, ResponseMetadata } from './camera';
|
|
6
6
|
/**
|
|
7
7
|
* A gRPC-web client for the Camera component.
|
|
8
8
|
*
|
|
@@ -15,7 +15,6 @@ export declare class CameraClient implements Camera {
|
|
|
15
15
|
callOptions: CallOptions;
|
|
16
16
|
constructor(client: RobotClient, name: string, options?: Options);
|
|
17
17
|
getGeometries(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/common/v1/common_pb").Geometry[]>;
|
|
18
|
-
getImage(mimeType?: MimeType, extra?: {}, callOptions?: CallOptions): Promise<Uint8Array>;
|
|
19
18
|
getImages(filterSourceNames?: string[], extra?: {}, callOptions?: CallOptions): Promise<{
|
|
20
19
|
images: {
|
|
21
20
|
sourceName: string;
|
|
@@ -24,7 +23,6 @@ export declare class CameraClient implements Camera {
|
|
|
24
23
|
}[];
|
|
25
24
|
metadata: ResponseMetadata;
|
|
26
25
|
}>;
|
|
27
|
-
renderFrame(mimeType?: MimeType, extra?: {}, callOptions?: CallOptions): Promise<Blob>;
|
|
28
26
|
getPointCloud(extra?: {}, callOptions?: CallOptions): Promise<Uint8Array>;
|
|
29
27
|
getProperties(callOptions?: CallOptions): Promise<import("../../gen/component/camera/v1/camera_pb").GetPropertiesResponse>;
|
|
30
28
|
doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
|
|
@@ -15,6 +15,7 @@ export declare class GantryClient implements Gantry {
|
|
|
15
15
|
callOptions: CallOptions;
|
|
16
16
|
constructor(client: RobotClient, name: string, options?: Options);
|
|
17
17
|
getGeometries(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/common/v1/common_pb").Geometry[]>;
|
|
18
|
+
getKinematics(extra?: {}, callOptions?: CallOptions): Promise<import("../../utils").KinematicsData>;
|
|
18
19
|
getPosition(extra?: {}, callOptions?: CallOptions): Promise<number[]>;
|
|
19
20
|
moveToPosition(positionsMm: number[], speedsMmPerSec: number[], extra?: {}, callOptions?: CallOptions): Promise<void>;
|
|
20
21
|
home(extra?: {}, callOptions?: CallOptions): Promise<boolean>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Struct } from '@bufbuild/protobuf';
|
|
2
2
|
import type { Resource } from '../../types';
|
|
3
3
|
import type { Geometry } from '../../gen/common/v1/common_pb';
|
|
4
|
+
import type { KinematicsData } from '../../utils';
|
|
4
5
|
/** Represents a physical gantry that exists in three-dimensional space. */
|
|
5
6
|
export interface Gantry extends Resource {
|
|
6
7
|
/**
|
|
@@ -19,6 +20,22 @@ export interface Gantry extends Resource {
|
|
|
19
20
|
* API](https://docs.viam.com/dev/reference/apis/components/gantry/#getgeometries).
|
|
20
21
|
*/
|
|
21
22
|
getGeometries: (extra?: Struct) => Promise<Geometry[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Get the kinematics information associated with the gantry.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* const gantry = new VIAM.GantryClient(machine, 'my_gantry');
|
|
30
|
+
*
|
|
31
|
+
* // Get the kinematics information associated with the gantry
|
|
32
|
+
* const kinematics = await gantry.getKinematics();
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* For more information, see [Gantry
|
|
36
|
+
* API](https://docs.viam.com/dev/reference/apis/components/gantry/#getkinematics).
|
|
37
|
+
*/
|
|
38
|
+
getKinematics: (extra?: Struct) => Promise<KinematicsData>;
|
|
22
39
|
/**
|
|
23
40
|
* Move each axis of the gantry to the positionsMm at the speeds in
|
|
24
41
|
* speedsMmPerSec.
|