@viamrobotics/sdk 0.39.0 → 0.40.1

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.
Files changed (36) hide show
  1. package/dist/api-version.d.ts +1 -1
  2. package/dist/app/app-client.d.ts +642 -11
  3. package/dist/app/data-client.d.ts +325 -0
  4. package/dist/components/arm/arm.d.ts +82 -7
  5. package/dist/components/base/base.d.ts +106 -4
  6. package/dist/components/board/board.d.ts +119 -2
  7. package/dist/components/button/button.d.ts +12 -1
  8. package/dist/components/encoder/encoder.d.ts +36 -2
  9. package/dist/components/gantry/gantry.d.ts +88 -6
  10. package/dist/components/generic/generic.d.ts +16 -1
  11. package/dist/components/gripper/gripper.d.ts +62 -5
  12. package/dist/components/input-controller/input-controller.d.ts +36 -2
  13. package/dist/components/motor/motor.d.ts +108 -4
  14. package/dist/components/servo/servo.d.ts +54 -4
  15. package/dist/components/switch/switch.d.ts +49 -3
  16. package/dist/gen/app/data/v1/data_pb.d.ts +98 -14
  17. package/dist/gen/app/datapipelines/v1/data_pipelines_connect.d.ts +34 -1
  18. package/dist/gen/app/datapipelines/v1/data_pipelines_pb.d.ts +259 -7
  19. package/dist/gen/app/datasync/v1/data_sync_pb.d.ts +4 -2
  20. package/dist/gen/app/v1/app_connect.d.ts +21 -1
  21. package/dist/gen/app/v1/app_pb.d.ts +156 -0
  22. package/dist/gen/app/v1/billing_connect.d.ts +23 -1
  23. package/dist/gen/app/v1/billing_pb.d.ts +91 -0
  24. package/dist/gen/google/rpc/error_details_pb.d.ts +89 -0
  25. package/dist/main.d.ts +1 -0
  26. package/dist/main.es.js +6174 -4823
  27. package/dist/main.umd.js +7 -7
  28. package/dist/robot/client.d.ts +28 -2
  29. package/dist/robot/robot.d.ts +80 -8
  30. package/dist/services/ml-model/client.d.ts +13 -0
  31. package/dist/services/ml-model/index.d.ts +2 -0
  32. package/dist/services/ml-model/ml-model.d.ts +7 -0
  33. package/dist/services/motion/motion.d.ts +161 -2
  34. package/dist/services/slam/slam.d.ts +47 -2
  35. package/dist/services/vision/vision.d.ts +77 -0
  36. package/package.json +1 -1
@@ -53,6 +53,7 @@ export declare class RobotClient extends EventDispatcher implements Robot {
53
53
  private gantryServiceClient;
54
54
  private genericServiceClient;
55
55
  private gripperServiceClient;
56
+ private mlModelServiceClient;
56
57
  private movementSensorServiceClient;
57
58
  private powerSensorServiceClient;
58
59
  private inputControllerServiceClient;
@@ -566,6 +567,23 @@ export declare class RobotClient extends EventDispatcher implements Robot {
566
567
  };
567
568
  };
568
569
  }>;
570
+ get mlModelService(): PromiseClient<{
571
+ readonly typeName: "viam.service.mlmodel.v1.MLModelService";
572
+ readonly methods: {
573
+ readonly infer: {
574
+ readonly name: "Infer";
575
+ readonly I: typeof import("../gen/service/mlmodel/v1/mlmodel_pb").InferRequest;
576
+ readonly O: typeof import("../gen/service/mlmodel/v1/mlmodel_pb").InferResponse;
577
+ readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
578
+ };
579
+ readonly metadata: {
580
+ readonly name: "Metadata";
581
+ readonly I: typeof import("../gen/service/mlmodel/v1/mlmodel_pb").MetadataRequest;
582
+ readonly O: typeof import("../gen/service/mlmodel/v1/mlmodel_pb").MetadataResponse;
583
+ readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
584
+ };
585
+ };
586
+ }>;
569
587
  get movementSensorService(): PromiseClient<{
570
588
  readonly typeName: "viam.component.movementsensor.v1.MovementSensorService";
571
589
  readonly methods: {
@@ -702,7 +720,11 @@ export declare class RobotClient extends EventDispatcher implements Robot {
702
720
  readonly doCommand: {
703
721
  readonly name: "DoCommand";
704
722
  readonly I: typeof import("../gen/common/v1/common_pb").DoCommandRequest;
705
- readonly O: typeof import("../gen/common/v1/common_pb").DoCommandResponse;
723
+ readonly O: typeof import("../gen/common/v1/common_pb").DoCommandResponse; /**
724
+ * A gRPC-web client for a Robot.
725
+ *
726
+ * @group Clients
727
+ */
706
728
  readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
707
729
  };
708
730
  readonly getGeometries: {
@@ -736,7 +758,11 @@ export declare class RobotClient extends EventDispatcher implements Robot {
736
758
  };
737
759
  readonly setRPM: {
738
760
  readonly name: "SetRPM";
739
- readonly I: typeof import("../gen/component/motor/v1/motor_pb").SetRPMRequest;
761
+ readonly I: typeof import("../gen/component/motor/v1/motor_pb").SetRPMRequest; /**
762
+ * A gRPC-web client for a Robot.
763
+ *
764
+ * @group Clients
765
+ */
740
766
  readonly O: typeof import("../gen/component/motor/v1/motor_pb").SetRPMResponse;
741
767
  readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
742
768
  };
@@ -8,21 +8,39 @@ export type CloudMetadata = proto.GetCloudMetadataResponse;
8
8
  type Callback = (args: unknown) => void;
9
9
  export interface Robot {
10
10
  /**
11
- * Get the list of sessions currently connected to the robot.
11
+ * Get the list of sessions currently connected to the machine.
12
+ *
13
+ * @example
14
+ *
15
+ * ```ts
16
+ * const sessions = await machine.getSessions();
17
+ * ```
12
18
  *
13
19
  * @group Sessions
14
20
  * @alpha
15
21
  */
16
22
  getSessions(): Promise<proto.Session[]>;
17
23
  /**
18
- * Get the list of operations currently running on the robot.
24
+ * Get the list of operations currently running on the machine.
25
+ *
26
+ * @example
27
+ *
28
+ * ```ts
29
+ * const operations = await machine.getOperations();
30
+ * ```
19
31
  *
20
32
  * @group Operations
21
33
  * @alpha
22
34
  */
23
35
  getOperations(): Promise<proto.Operation[]>;
24
36
  /**
25
- * Cancels the specified operation on the robot.
37
+ * Cancels the specified operation on the machine.
38
+ *
39
+ * @example
40
+ *
41
+ * ```ts
42
+ * await machine.cancelOperation('INSERT OPERATION ID');
43
+ * ```
26
44
  *
27
45
  * @param id - ID of operation to kill.
28
46
  * @group Operations
@@ -30,9 +48,15 @@ export interface Robot {
30
48
  */
31
49
  cancelOperation(id: string): Promise<void>;
32
50
  /**
33
- * Blocks on the specified operation on the robot. This function will only
51
+ * Blocks on the specified operation on the machine. This function will only
34
52
  * return when the specific operation has finished or has been cancelled.
35
53
  *
54
+ * @example
55
+ *
56
+ * ```ts
57
+ * await machine.blockForOperation('INSERT OPERATION ID');
58
+ * ```
59
+ *
36
60
  * @param id - ID of operation to block on.
37
61
  * @group Operations
38
62
  * @alpha
@@ -42,6 +66,12 @@ export interface Robot {
42
66
  * Cancel all current and outstanding operations for the robot and stop all
43
67
  * actuators and movement.
44
68
  *
69
+ * @example
70
+ *
71
+ * ```ts
72
+ * await machine.stopAll();
73
+ * ```
74
+ *
45
75
  * @param extra - Any extra parameters to pass to the components' `stop`
46
76
  * methods, keyed on the component's resource name.
47
77
  * @group Operations
@@ -49,7 +79,13 @@ export interface Robot {
49
79
  */
50
80
  stopAll(extra?: Map<string, Struct>): Promise<void>;
51
81
  /**
52
- * Get the configuration of the frame system of a given robot.
82
+ * Get the configuration of the frame system of a given machine.
83
+ *
84
+ * @example
85
+ *
86
+ * ```ts
87
+ * const frameSystemConfig = await machine.frameSystemConfig();
88
+ * ```
53
89
  *
54
90
  * @group Frame System
55
91
  * @alpha
@@ -87,12 +123,24 @@ export interface Robot {
87
123
  /**
88
124
  * Get the list of models provided by modules on the machine.
89
125
  *
126
+ * @example
127
+ *
128
+ * ```ts
129
+ * const models = await machine.getModelsFromModules();
130
+ * ```
131
+ *
90
132
  * @group Resources
91
133
  * @alpha
92
134
  */
93
135
  getModelsFromModules(): Promise<ModuleModel[]>;
94
136
  /**
95
- * Get a list of all resources on the robot.
137
+ * Get a list of all resources on the machine.
138
+ *
139
+ * @example
140
+ *
141
+ * ```ts
142
+ * const resourceNames = await machine.resourceNames();
143
+ * ```
96
144
  *
97
145
  * @group Resources
98
146
  * @alpha
@@ -101,6 +149,12 @@ export interface Robot {
101
149
  /**
102
150
  * Get a list of all resource types.
103
151
  *
152
+ * @example
153
+ *
154
+ * ```ts
155
+ * const resourceRPCSubtypes = await machine.resourceRPCSubtypes();
156
+ * ```
157
+ *
104
158
  * @group Resources
105
159
  * @alpha
106
160
  */
@@ -120,14 +174,26 @@ export interface Robot {
120
174
  */
121
175
  on: (type: MachineConnectionEvent | 'connectionstatechange', listener: Callback) => void;
122
176
  /**
123
- * Get app-related information about the robot.
177
+ * Get app-related information about the machine.
178
+ *
179
+ * @example
180
+ *
181
+ * ```ts
182
+ * const cloudMetadata = await machine.getCloudMetadata();
183
+ * ```
124
184
  *
125
185
  * @group App/Cloud
126
186
  * @alpha
127
187
  */
128
188
  getCloudMetadata(): Promise<CloudMetadata>;
129
189
  /**
130
- * Get the current status of the robot.
190
+ * Get the current status of the machine.
191
+ *
192
+ * @example
193
+ *
194
+ * ```ts
195
+ * const machineStatus = await machine.getMachineStatus();
196
+ * ```
131
197
  *
132
198
  * @alpha
133
199
  */
@@ -135,6 +201,12 @@ export interface Robot {
135
201
  /**
136
202
  * Restarts a module running on the machine with the given id or name.
137
203
  *
204
+ * @example
205
+ *
206
+ * ```ts
207
+ * await machine.restartModule('namespace:module:model', 'my_model_name');
208
+ * ```
209
+ *
138
210
  * @param moduleId - The id matching the module_id field of the registry
139
211
  * module in your part configuration
140
212
  * @param moduleName - The name matching the name field of the local/registry
@@ -0,0 +1,13 @@
1
+ import type { CallOptions } from '@connectrpc/connect';
2
+ import type { FlatTensors, MLModel } from './ml-model';
3
+ import { type Options } from '../../types';
4
+ import type { RobotClient } from '../../robot';
5
+ export declare class MLModelClient implements MLModel {
6
+ private client;
7
+ private readonly name;
8
+ private readonly options;
9
+ callOptions: CallOptions;
10
+ constructor(client: RobotClient, name: string, options?: Options);
11
+ metadata(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/service/mlmodel/v1/mlmodel_pb").MetadataResponse>;
12
+ infer(inputTensors: FlatTensors, extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/service/mlmodel/v1/mlmodel_pb").InferResponse>;
13
+ }
@@ -0,0 +1,2 @@
1
+ export type { MLModel, FlatTensors } from './ml-model';
2
+ export { MLModelClient } from './client';
@@ -0,0 +1,7 @@
1
+ import type { Struct } from '@bufbuild/protobuf';
2
+ import type * as mlModelAPI from '../../gen/service/mlmodel/v1/mlmodel_pb';
3
+ export type FlatTensors = mlModelAPI.FlatTensors;
4
+ export interface MLModel {
5
+ metadata: (extra?: Struct) => Promise<mlModelAPI.MetadataResponse>;
6
+ infer: (inputTensors: FlatTensors, extra?: Struct) => Promise<mlModelAPI.InferResponse>;
7
+ }
@@ -10,6 +10,37 @@ export interface Motion extends Resource {
10
10
  * Move any component on the robot to a specified destination which can be
11
11
  * from the reference frame of any other component on the robot.
12
12
  *
13
+ * @example
14
+ *
15
+ * ```ts
16
+ * const motion = new VIAM.MotionClient(machine, 'builtin');
17
+ *
18
+ * // Assumes a gripper configured with name "my_gripper"
19
+ * const gripperName = new VIAM.ResourceName({
20
+ * name: 'my_gripper',
21
+ * namespace: 'rdk',
22
+ * type: 'component',
23
+ * subtype: 'gripper',
24
+ * });
25
+ *
26
+ * const goalPose: VIAM.Pose = {
27
+ * x: -817,
28
+ * y: -230,
29
+ * z: 62,
30
+ * oX: -1,
31
+ * oY: 0,
32
+ * oZ: 0,
33
+ * theta: 90,
34
+ * };
35
+ * const goalPoseInFrame = new VIAM.PoseInFrame({
36
+ * referenceFrame: 'world',
37
+ * pose: goalPose,
38
+ * });
39
+ *
40
+ * // Move the gripper
41
+ * const moved = await motion.move(goalPoseInFrame, gripperName);
42
+ * ```
43
+ *
13
44
  * @param destination - Destination to move to, which can a pose in the
14
45
  * reference frame of any frame in the robot's frame system.
15
46
  * @param componentName - Component on the robot to move to the specified
@@ -29,6 +60,43 @@ export interface Motion extends Resource {
29
60
  * the`moveOnMap()`call. You can monitor the progress of the`moveOnMap()`call
30
61
  * by querying`getPlan()`and`listPlanStatuses()`.
31
62
  *
63
+ * @example
64
+ *
65
+ * ```ts
66
+ * const motion = new VIAM.MotionClient(machine, 'builtin');
67
+ *
68
+ * // Define destination pose with respect to map origin
69
+ * const myPose: VIAM.Pose = {
70
+ * x: 0,
71
+ * y: 10,
72
+ * z: 0,
73
+ * oX: 0,
74
+ * oY: 0,
75
+ * oZ: 0,
76
+ * theta: 0,
77
+ * };
78
+ *
79
+ * const baseName = new VIAM.ResourceName({
80
+ * name: 'my_base',
81
+ * namespace: 'rdk',
82
+ * type: 'component',
83
+ * subtype: 'base',
84
+ * });
85
+ * const slamServiceName = new VIAM.ResourceName({
86
+ * name: 'my_slam_service',
87
+ * namespace: 'rdk',
88
+ * type: 'service',
89
+ * subtype: 'slam',
90
+ * });
91
+ *
92
+ * // Move the base to Y=10 (location of 0,10,0) relative to map origin
93
+ * const executionId = await motion.moveOnMap(
94
+ * myPose,
95
+ * baseName,
96
+ * slamServiceName
97
+ * );
98
+ * ```
99
+ *
32
100
  * @param destination - Specify a destination to, which can be any `Pose` with
33
101
  * respect to the SLAM map's origin.
34
102
  * @param componentName - Component on the robot to move to the specified
@@ -48,6 +116,38 @@ export interface Motion extends Resource {
48
116
  * generated durring the `moveOnGlobe()` call. You can monitor the progress of
49
117
  * the `moveOnGlobe()` call by querying `getPlan()` and `listPlanStatuses()`.
50
118
  *
119
+ * @example
120
+ *
121
+ * ```ts
122
+ * const motion = new VIAM.MotionClient(machine, 'builtin');
123
+ *
124
+ * // Define destination at GPS coordinates [0,0]
125
+ * const destination: VIAM.GeoPoint = {
126
+ * latitude: 40.7,
127
+ * longitude: -73.98,
128
+ * };
129
+ *
130
+ * const baseName = new VIAM.ResourceName({
131
+ * name: 'my_base',
132
+ * namespace: 'rdk',
133
+ * type: 'component',
134
+ * subtype: 'base',
135
+ * });
136
+ * const movementSensorName = new VIAM.ResourceName({
137
+ * name: 'my_movement_sensor',
138
+ * namespace: 'rdk',
139
+ * type: 'component',
140
+ * subtype: 'movement_sensor',
141
+ * });
142
+ *
143
+ * // Move the base to the geographic location
144
+ * const globeExecutionId = await motion.moveOnGlobe(
145
+ * destination,
146
+ * baseName,
147
+ * movementSensorName
148
+ * );
149
+ * ```
150
+ *
51
151
  * @param destination - Destination for the component to move to, represented
52
152
  * as a `GeoPoint`.
53
153
  * @param componentName - The name of the component to move.
@@ -65,6 +165,21 @@ export interface Motion extends Resource {
65
165
  * Stop a component being moved by an in progress `moveOnGlobe()` or
66
166
  * `moveOnMap()` call.
67
167
  *
168
+ * @example
169
+ *
170
+ * ```ts
171
+ * const motion = new VIAM.MotionClient(machine, 'builtin');
172
+ * const baseName = new VIAM.ResourceName({
173
+ * name: 'my_base',
174
+ * namespace: 'rdk',
175
+ * type: 'component',
176
+ * subtype: 'base',
177
+ * });
178
+ *
179
+ * // Stop the base component which was instructed to move
180
+ * await motion.stopPlan(baseName);
181
+ * ```
182
+ *
68
183
  * @param componentName - The component to stop
69
184
  */
70
185
  stopPlan: (componentName: ResourceName, extra?: Struct) => Promise<null>;
@@ -82,6 +197,21 @@ export interface Motion extends Resource {
82
197
  * ExecutionID of the previously executing plan. All repeated fields are in
83
198
  * chronological order.
84
199
  *
200
+ * @example
201
+ *
202
+ * ```ts
203
+ * const motion = new VIAM.MotionClient(machine, 'builtin');
204
+ * const baseName = new VIAM.ResourceName({
205
+ * name: 'my_base',
206
+ * namespace: 'rdk',
207
+ * type: 'component',
208
+ * subtype: 'base',
209
+ * });
210
+ *
211
+ * // Get the plan(s) of the base component
212
+ * const response = await motion.getPlan(baseName);
213
+ * ```
214
+ *
85
215
  * @param componentName - The component to query
86
216
  * @param destinationFrame - The reference frame in which the component's
87
217
  * `Pose` should be provided, if unset this defaults to the "world"
@@ -95,11 +225,20 @@ export interface Motion extends Resource {
95
225
  * least one of the following conditions since the motion service
96
226
  * initialized:
97
227
  *
98
- * - The plan’s status is in progress
99
- * - The plan’s status changed state within the last 24 hours
228
+ * - The plan's status is in progress
229
+ * - The plan's status changed state within the last 24 hours
100
230
  *
101
231
  * All repeated fields are in chronological order.
102
232
  *
233
+ * @example
234
+ *
235
+ * ```ts
236
+ * const motion = new VIAM.MotionClient(machine, 'builtin');
237
+ *
238
+ * // List plan statuses within the TTL
239
+ * const response = await motion.listPlanStatuses();
240
+ * ```
241
+ *
103
242
  * @param onlyActivePlans - If true, the response will only return plans which
104
243
  * are executing.
105
244
  */
@@ -107,6 +246,26 @@ export interface Motion extends Resource {
107
246
  /**
108
247
  * Get the current location and orientation of a component.
109
248
  *
249
+ * @example
250
+ *
251
+ * ```ts
252
+ * const motion = new VIAM.MotionClient(machine, 'builtin');
253
+ *
254
+ * const gripperName = new VIAM.ResourceName({
255
+ * name: 'my_gripper',
256
+ * namespace: 'rdk',
257
+ * type: 'component',
258
+ * subtype: 'gripper',
259
+ * });
260
+ *
261
+ * // Get the gripper's pose in world coordinates
262
+ * const gripperPoseInWorld = await motion.getPose(
263
+ * gripperName,
264
+ * 'world',
265
+ * []
266
+ * );
267
+ * ```
268
+ *
110
269
  * @param componentName - The component whose `Pose` is being requested.
111
270
  * @param destinationFrame - The reference frame in which the component's
112
271
  * `Pose` should be provided, if unset this defaults to the "world"
@@ -8,15 +8,60 @@ export interface Slam extends Resource {
8
8
  /**
9
9
  * Get the current position of the specified source component in the point
10
10
  * cloud SLAM map.
11
+ *
12
+ * @example
13
+ *
14
+ * ```ts
15
+ * const slam = new VIAM.SlamClient(machine, 'my_slam');
16
+ *
17
+ * // Get the current position of the robot in the SLAM map
18
+ * const position = await slam.getPosition();
19
+ * console.log('Current position:', position);
20
+ * ```
11
21
  */
12
22
  getPosition: () => Promise<SlamPosition>;
13
- /** Get the point cloud SLAM map. */
23
+ /**
24
+ * Get the point cloud SLAM map.
25
+ *
26
+ * @example
27
+ *
28
+ * ```ts
29
+ * const slam = new VIAM.SlamClient(machine, 'my_slam');
30
+ *
31
+ * // Get the point cloud map
32
+ * const pointCloudMap = await slam.getPointCloudMap();
33
+ *
34
+ * // Get the edited point cloud map
35
+ * const editedMap = await slam.getPointCloudMap(true);
36
+ * ```
37
+ */
14
38
  getPointCloudMap: (returnEditedMap?: boolean) => Promise<Uint8Array>;
15
39
  /**
16
40
  * Get the internal state of the SLAM algorithm required to continue
17
41
  * mapping/localization.
42
+ *
43
+ * @example
44
+ *
45
+ * ```ts
46
+ * const slam = new VIAM.SlamClient(machine, 'my_slam');
47
+ *
48
+ * // Get the internal state of the SLAM algorithm
49
+ * const internalState = await slam.getInternalState();
50
+ * ```
18
51
  */
19
52
  getInternalState: () => Promise<Uint8Array>;
20
- /** Gets information on the properties of the current SLAM service. */
53
+ /**
54
+ * Get information on the properties of the current SLAM service.
55
+ *
56
+ * @example
57
+ *
58
+ * ```ts
59
+ * const slam = new VIAM.SlamClient(machine, 'my_slam');
60
+ *
61
+ * // Get the properties of the SLAM service
62
+ * const properties = await slam.getProperties();
63
+ * console.log('SLAM properties:', properties);
64
+ * ```
65
+ */
21
66
  getProperties: () => Promise<SlamProperties>;
22
67
  }
@@ -7,6 +7,13 @@ export interface Vision extends Resource {
7
7
  /**
8
8
  * Get a list of detections in the next image given a camera.
9
9
  *
10
+ * @example
11
+ *
12
+ * ```ts
13
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
14
+ * const detections = await vision.getDetectionsFromCamera('my_camera');
15
+ * ```
16
+ *
10
17
  * @param cameraName - The name of the camera to use for detection.
11
18
  * @returns - The list of Detections.
12
19
  */
@@ -14,6 +21,22 @@ export interface Vision extends Resource {
14
21
  /**
15
22
  * Get a list of detections in the given image.
16
23
  *
24
+ * @example
25
+ *
26
+ * ```ts
27
+ * const camera = new VIAM.CameraClient(machine, 'my_camera');
28
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
29
+ *
30
+ * const mimeType = 'image/jpeg';
31
+ * const image = await camera.getImage(mimeType);
32
+ * const detections = await vision.getDetections(
33
+ * image,
34
+ * 600,
35
+ * 600,
36
+ * mimeType
37
+ * );
38
+ * ```
39
+ *
17
40
  * @param image - The image from which to get detections.
18
41
  * @param width - The width of the image.
19
42
  * @param height - The height of the image.
@@ -24,6 +47,16 @@ export interface Vision extends Resource {
24
47
  /**
25
48
  * Get a list of classifications in the next image given a camera.
26
49
  *
50
+ * @example
51
+ *
52
+ * ```ts
53
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
54
+ * const classifications = await vision.getClassificationsFromCamera(
55
+ * 'my_camera',
56
+ * 10
57
+ * );
58
+ * ```
59
+ *
27
60
  * @param cameraName - The name of the camera to use for classification.
28
61
  * @param count - The number of Classifications requested.
29
62
  * @returns - The list of Classifications.
@@ -32,6 +65,23 @@ export interface Vision extends Resource {
32
65
  /**
33
66
  * Get a list of classifications in the given image.
34
67
  *
68
+ * @example
69
+ *
70
+ * ```ts
71
+ * const camera = new VIAM.CameraClient(machine, 'my_camera');
72
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
73
+ *
74
+ * const mimeType = 'image/jpeg';
75
+ * const image = await camera.getImage(mimeType);
76
+ * const classifications = await vision.getClassifications(
77
+ * image,
78
+ * 600,
79
+ * 600,
80
+ * mimeType,
81
+ * 10
82
+ * );
83
+ * ```
84
+ *
35
85
  * @param image - The image from which to get classifications.
36
86
  * @param width - The width of the image.
37
87
  * @param height - The height of the image.
@@ -44,6 +94,14 @@ export interface Vision extends Resource {
44
94
  * Returns a list of the 3D point cloud objects and associated metadata in the
45
95
  * latest picture obtained from the specified 3D camera.
46
96
  *
97
+ * @example
98
+ *
99
+ * ```ts
100
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
101
+ * const pointCloudObjects =
102
+ * await vision.getObjectPointClouds('my_camera');
103
+ * ```
104
+ *
47
105
  * @param cameraName - The name of the camera.
48
106
  * @returns - The list of PointCloudObjects
49
107
  */
@@ -53,6 +111,13 @@ export interface Vision extends Resource {
53
111
  * booleans indicating whether classifications, detections, and 3d
54
112
  * segmentation are supported.
55
113
  *
114
+ * @example
115
+ *
116
+ * ```ts
117
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
118
+ * const properties = await vision.getProperties();
119
+ * ```
120
+ *
56
121
  * @returns - The properties of the vision service
57
122
  */
58
123
  getProperties: (extra?: Struct) => Promise<Properties>;
@@ -60,6 +125,18 @@ export interface Vision extends Resource {
60
125
  * Returns the requested image, classifications, detections, and 3d point
61
126
  * cloud objects in the next image given a camera.
62
127
  *
128
+ * @example
129
+ *
130
+ * ```ts
131
+ * const vision = new VIAM.VisionClient(machine, 'my_vision');
132
+ * const captureAll = await vision.captureAllFromCamera('my_camera', {
133
+ * returnImage: true,
134
+ * returnClassifications: true,
135
+ * returnDetections: true,
136
+ * returnObjectPointClouds: true,
137
+ * });
138
+ * ```
139
+ *
63
140
  * @param cameraName - The name of the camera to use for classification,
64
141
  * detection, and segmentation.
65
142
  * @param opts - The fields desired in the response.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamrobotics/sdk",
3
- "version": "0.39.0",
3
+ "version": "0.40.1",
4
4
  "description": "",
5
5
  "main": "./dist/main.umd.js",
6
6
  "module": "./dist/main.es.js",