@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
@@ -39,6 +39,19 @@ export declare class DataClient {
39
39
  /**
40
40
  * Obtain unified tabular data and metadata from the specified data source.
41
41
  *
42
+ * @example
43
+ *
44
+ * ```ts
45
+ * const data = await dataClient.exportTabularData(
46
+ * '123abc45-1234-5678-90ab-cdef12345678',
47
+ * 'my-sensor',
48
+ * 'rdk:component:sensor',
49
+ * 'Readings',
50
+ * new Date('2025-03-25'),
51
+ * new Date('2024-03-27')
52
+ * );
53
+ * ```
54
+ *
42
55
  * @param partId The ID of the part that owns the data
43
56
  * @param resourceName The name of the requested resource that captured the
44
57
  * data
@@ -55,6 +68,15 @@ export declare class DataClient {
55
68
  /**
56
69
  * Obtain unified tabular data and metadata, queried with SQL.
57
70
  *
71
+ * @example
72
+ *
73
+ * ```ts
74
+ * const data = await dataClient.tabularDataBySQL(
75
+ * '123abc45-1234-5678-90ab-cdef12345678',
76
+ * 'SELECT * FROM readings LIMIT 5'
77
+ * );
78
+ * ```
79
+ *
58
80
  * @param organizationId The ID of the organization that owns the data
59
81
  * @param query The SQL query to run
60
82
  * @returns An array of data objects
@@ -63,6 +85,33 @@ export declare class DataClient {
63
85
  /**
64
86
  * Obtain unified tabular data and metadata, queried with MQL.
65
87
  *
88
+ * @example
89
+ *
90
+ * ```ts
91
+ * type JsonValue =
92
+ * | string
93
+ * | number
94
+ * | boolean
95
+ * | null
96
+ * | JsonValue[]
97
+ * | { [key: string]: JsonValue };
98
+ * const mqlQuery: Record<string, JsonValue>[] = [
99
+ * {
100
+ * $match: {
101
+ * component_name: 'sensor-1',
102
+ * },
103
+ * },
104
+ * {
105
+ * $limit: 5,
106
+ * },
107
+ * ];
108
+ *
109
+ * const data = await dataClient.tabularDataByMQL(
110
+ * '123abc45-1234-5678-90ab-cdef12345678',
111
+ * mqlQuery
112
+ * );
113
+ * ```
114
+ *
66
115
  * @param organizationId The ID of the organization that owns the data
67
116
  * @param query The MQL query to run as a list of BSON documents
68
117
  * @param useRecentData Whether to query blob storage or your recent data
@@ -76,6 +125,18 @@ export declare class DataClient {
76
125
  * metadata list. The data will be paginated into pages of `limit` items, and
77
126
  * the pagination ID will be included in the returned tuple.
78
127
  *
128
+ * @example
129
+ *
130
+ * ```ts
131
+ * const data = await dataClient.tabularDataByFilter(
132
+ * {
133
+ * componentName: 'sensor-1',
134
+ * componentType: 'rdk:component:sensor',
135
+ * } as Filter,
136
+ * 5
137
+ * );
138
+ * ```
139
+ *
79
140
  * @param filter Optional `pb.Filter` specifying tabular data to retrieve. No
80
141
  * `filter` implies all tabular data.
81
142
  * @param limit The maximum number of entries to include in a page. Defaults
@@ -102,6 +163,18 @@ export declare class DataClient {
102
163
  * metadata list. The data will be paginated into pages of `limit` items, and
103
164
  * the pagination ID will be included in the returned tuple.
104
165
  *
166
+ * @example
167
+ *
168
+ * ```ts
169
+ * const data = await dataClient.binaryDataByFilter(
170
+ * {
171
+ * componentName: 'camera-1',
172
+ * componentType: 'rdk:component:camera',
173
+ * } as Filter,
174
+ * 1
175
+ * );
176
+ * ```
177
+ *
105
178
  * @param filter Optional `pb.Filter` specifying binary data to retrieve. No
106
179
  * `filter` implies all binary data.
107
180
  * @param limit The maximum number of entries to include in a page. Defaults
@@ -127,6 +200,14 @@ export declare class DataClient {
127
200
  /**
128
201
  * Get binary data using the binary data ID.
129
202
  *
203
+ * @example
204
+ *
205
+ * ```ts
206
+ * const data = await dataClient.binaryDataByIds([
207
+ * 'ccb74b53-1235-4328-a4b9-91dff1915a50/x5vur1fmps/YAEzj5I1kTwtYsDdf4a7ctaJpGgKRHmnM9bJNVyblk52UpqmrnMVTITaBKZctKEh',
208
+ * ]);
209
+ * ```
210
+ *
130
211
  * @param ids The IDs of the requested binary data
131
212
  * @returns An array of data objects
132
213
  */
@@ -134,6 +215,15 @@ export declare class DataClient {
134
215
  /**
135
216
  * Delete tabular data older than a specified number of days.
136
217
  *
218
+ * @example
219
+ *
220
+ * ```ts
221
+ * const data = await dataClient.deleteTabularData(
222
+ * '123abc45-1234-5678-90ab-cdef12345678',
223
+ * 10
224
+ * );
225
+ * ```
226
+ *
137
227
  * @param organizationId The ID of organization to delete data from
138
228
  * @param deleteOlderThanDays Delete data that was captured more than this
139
229
  * many days ago. For example if `deleteOlderThanDays` is 10, this deletes
@@ -145,6 +235,18 @@ export declare class DataClient {
145
235
  /**
146
236
  * Filter and delete binary data.
147
237
  *
238
+ * @example
239
+ *
240
+ * ```ts
241
+ * const data = await dataClient.deleteBinaryDataByFilter({
242
+ * componentName: 'camera-1',
243
+ * componentType: 'rdk:component:camera',
244
+ * organizationIds: ['123abc45-1234-5678-90ab-cdef12345678'],
245
+ * startTime: new Date('2025-03-19'),
246
+ * endTime: new Date('2025-03-20'),
247
+ * } as Filter);
248
+ * ```
249
+ *
148
250
  * @param filter Optional `pb.Filter` specifying binary data to delete. No
149
251
  * `filter` implies all binary data.
150
252
  * @param includeInternalData Whether or not to delete internal data. Default
@@ -155,6 +257,14 @@ export declare class DataClient {
155
257
  /**
156
258
  * Delete binary data, specified by ID.
157
259
  *
260
+ * @example
261
+ *
262
+ * ```ts
263
+ * const data = await dataClient.deleteBinaryDataByIds([
264
+ * 'ccb74b53-1235-4328-a4b9-91dff1915a50/x5vur1fmps/YAEzj5I1kTwtYsDdf4a7ctaJpGgKRHmnM9bJNVyblk52UpqmrnMVTITaBKZctKEh',
265
+ * ]);
266
+ * ```
267
+ *
158
268
  * @param ids The IDs of the data to be deleted. Must be non-empty.
159
269
  * @returns The number of items deleted
160
270
  */
@@ -162,6 +272,17 @@ export declare class DataClient {
162
272
  /**
163
273
  * Add tags to binary data, specified by ID.
164
274
  *
275
+ * @example
276
+ *
277
+ * ```ts
278
+ * const data = await dataClient.addTagsToBinaryDataByIds(
279
+ * ['tag1', 'tag2'],
280
+ * [
281
+ * 'ccb74b53-1235-4328-a4b9-91dff1915a50/x5vur1fmps/YAEzj5I1kTwtYsDdf4a7ctaJpGgKRHmnM9bJNVyblk52UpqmrnMVTITaBKZctKEh',
282
+ * ]
283
+ * );
284
+ * ```
285
+ *
165
286
  * @param tags The list of tags to add to specified binary data. Must be
166
287
  * non-empty.
167
288
  * @param ids The IDs of the data to be tagged. Must be non-empty.
@@ -170,6 +291,19 @@ export declare class DataClient {
170
291
  /**
171
292
  * Add tags to binary data, specified by filter.
172
293
  *
294
+ * @example
295
+ *
296
+ * ```ts
297
+ * const data = await dataClient.addTagsToBinaryDataByFilter(
298
+ * ['tag1', 'tag2'],
299
+ * [
300
+ * {
301
+ * componentName: 'camera-1',
302
+ * } as Filter,
303
+ * ]
304
+ * );
305
+ * ```
306
+ *
173
307
  * @param tags The tags to add to the data
174
308
  * @param filter Optional `pb.Filter` specifying binary data to add tags to.
175
309
  * No `filter` implies all binary data.
@@ -178,6 +312,17 @@ export declare class DataClient {
178
312
  /**
179
313
  * Remove tags from binary data, specified by ID.
180
314
  *
315
+ * @example
316
+ *
317
+ * ```ts
318
+ * const data = await dataClient.removeTagsFromBinaryDataByIds(
319
+ * ['tag1', 'tag2'],
320
+ * [
321
+ * 'ccb74b53-1235-4328-a4b9-91dff1915a50/x5vur1fmps/YAEzj5I1kTwtYsDdf4a7ctaJpGgKRHmnM9bJNVyblk52UpqmrnMVTITaBKZctKEh',
322
+ * ]
323
+ * );
324
+ * ```
325
+ *
181
326
  * @param tags List of tags to remove from specified binary data. Must be
182
327
  * non-empty.
183
328
  * @param ids The IDs of the data to be edited. Must be non-empty.
@@ -187,6 +332,21 @@ export declare class DataClient {
187
332
  /**
188
333
  * Remove tags from binary data, specified by filter.
189
334
  *
335
+ * @example
336
+ *
337
+ * ```ts
338
+ * const data = await dataClient.removeTagsFromBinaryDataByFilter(
339
+ * ['tag1', 'tag2'],
340
+ * {
341
+ * componentName: 'camera-1',
342
+ * componentType: 'rdk:component:camera',
343
+ * organizationIds: ['123abc45-1234-5678-90ab-cdef12345678'],
344
+ * startTime: new Date('2025-03-19'),
345
+ * endTime: new Date('2025-03-20'),
346
+ * } as Filter
347
+ * );
348
+ * ```
349
+ *
190
350
  * @param tags List of tags to remove from specified binary data. Must be
191
351
  * non-empty.
192
352
  * @param filter Optional `pb.Filter` specifying binary data to add tags to.
@@ -197,6 +357,14 @@ export declare class DataClient {
197
357
  /**
198
358
  * Get a list of tags using a filter.
199
359
  *
360
+ * @example
361
+ *
362
+ * ```ts
363
+ * const data = await dataClient.tagsByFilter({
364
+ * componentName: 'camera-1',
365
+ * } as Filter);
366
+ * ```
367
+ *
200
368
  * @param filter Optional `pb.Filter` specifying what data to get tags from.
201
369
  * No `filter` implies all data.
202
370
  * @returns The list of tags
@@ -205,6 +373,19 @@ export declare class DataClient {
205
373
  /**
206
374
  * Add bounding box to an image.
207
375
  *
376
+ * @example
377
+ *
378
+ * ```ts
379
+ * const bboxId = await dataClient.addBoundingBoxToImageById(
380
+ * 'ccb74b53-1235-4328-a4b9-91dff1915a50/x5vur1fmps/YAEzj5I1kTwtYsDdf4a7ctaJpGgKRHmnM9bJNVyblk52UpqmrnMVTITaBKZctKEh',
381
+ * 'label1',
382
+ * 0.3,
383
+ * 0.3,
384
+ * 0.6,
385
+ * 0.6
386
+ * );
387
+ * ```
388
+ *
208
389
  * @param binaryId The ID of the image to add the bounding box to
209
390
  * @param label A label for the bounding box
210
391
  * @param xMinNormalized The min X value of the bounding box normalized from 0
@@ -221,6 +402,15 @@ export declare class DataClient {
221
402
  /**
222
403
  * Remove a bounding box from an image.
223
404
  *
405
+ * @example
406
+ *
407
+ * ```ts
408
+ * await dataClient.removeBoundingBoxFromImageById(
409
+ * 'ccb74b53-1235-4328-a4b9-91dff1915a50/x5vur1fmps/YAEzj5I1kTwtYsDdf4a7ctaJpGgKRHmnM9bJNVyblk52UpqmrnMVTITaBKZctKEh',
410
+ * '5Z9ryhkW7ULaXROjJO6ghPYulNllnH20QImda1iZFroZpQbjahK6igQ1WbYigXED'
411
+ * );
412
+ * ```
413
+ *
224
414
  * @param binId The ID of the image to remove the bounding box from
225
415
  * @param bboxId The ID of the bounding box to remove
226
416
  */
@@ -228,6 +418,14 @@ export declare class DataClient {
228
418
  /**
229
419
  * Get a list of bounding box labels using a Filter.
230
420
  *
421
+ * @example
422
+ *
423
+ * ```ts
424
+ * const data = await dataClient.boundingBoxLabelsByFilter({
425
+ * componentName: 'camera-1',
426
+ * } as Filter);
427
+ * ```
428
+ *
231
429
  * @param filter Optional `pb.Filter` specifying what data to get tags from.
232
430
  * No `filter` implies all labels.
233
431
  * @returns The list of bounding box labels
@@ -238,6 +436,15 @@ export declare class DataClient {
238
436
  * Federation instance. It can also be used to reset the password of the
239
437
  * existing database user.
240
438
  *
439
+ * @example
440
+ *
441
+ * ```ts
442
+ * await dataClient.configureDatabaseUser(
443
+ * '123abc45-1234-5678-90ab-cdef12345678',
444
+ * 'Password01!'
445
+ * );
446
+ * ```
447
+ *
241
448
  * @param organizationId The ID of the organization
242
449
  * @param password The password of the user
243
450
  */
@@ -245,6 +452,14 @@ export declare class DataClient {
245
452
  /**
246
453
  * Get a connection to access a MongoDB Atlas Data federation instance.
247
454
  *
455
+ * @example
456
+ *
457
+ * ```ts
458
+ * const hostname = await dataClient.getDatabaseConnection(
459
+ * '123abc45-1234-5678-90ab-cdef12345678'
460
+ * );
461
+ * ```
462
+ *
248
463
  * @param organizationId Organization to retrieve connection for
249
464
  * @returns Hostname of the federated database
250
465
  */
@@ -252,6 +467,17 @@ export declare class DataClient {
252
467
  /**
253
468
  * Add BinaryData to the provided dataset.
254
469
  *
470
+ * @example
471
+ *
472
+ * ```ts
473
+ * await dataClient.addBinaryDataToDatasetByIds(
474
+ * [
475
+ * 'ccb74b53-1235-4328-a4b9-91dff1915a50/x5vur1fmps/YAEzj5I1kTwtYsDdf4a7ctaJpGgKRHmnM9bJNVyblk52UpqmrnMVTITaBKZctKEh',
476
+ * ],
477
+ * '12ab3de4f56a7bcd89ef0ab1'
478
+ * );
479
+ * ```
480
+ *
255
481
  * @param ids The IDs of binary data to add to dataset
256
482
  * @param datasetId The ID of the dataset to be added to
257
483
  */
@@ -259,6 +485,17 @@ export declare class DataClient {
259
485
  /**
260
486
  * Remove BinaryData from the provided dataset.
261
487
  *
488
+ * @example
489
+ *
490
+ * ```ts
491
+ * await dataClient.removeBinaryDataFromDatasetByIds(
492
+ * [
493
+ * 'ccb74b53-1235-4328-a4b9-91dff1915a50/x5vur1fmps/YAEzj5I1kTwtYsDdf4a7ctaJpGgKRHmnM9bJNVyblk52UpqmrnMVTITaBKZctKEh',
494
+ * ],
495
+ * '12ab3de4f56a7bcd89ef0ab1'
496
+ * );
497
+ * ```
498
+ *
262
499
  * @param ids The IDs of the binary data to remove from dataset
263
500
  * @param datasetId The ID of the dataset to be removed from
264
501
  */
@@ -266,6 +503,15 @@ export declare class DataClient {
266
503
  /**
267
504
  * Create a new dataset.
268
505
  *
506
+ * @example
507
+ *
508
+ * ```ts
509
+ * const datasetId = await dataClient.createDataset(
510
+ * 'my-new-dataset',
511
+ * '123abc45-1234-5678-90ab-cdef12345678'
512
+ * );
513
+ * ```
514
+ *
269
515
  * @param name The name of the new dataset
270
516
  * @param organizationId The ID of the organization the dataset is being
271
517
  * created in
@@ -275,12 +521,27 @@ export declare class DataClient {
275
521
  /**
276
522
  * Delete a dataset.
277
523
  *
524
+ * @example
525
+ *
526
+ * ```ts
527
+ * await dataClient.deleteDataset('12ab3de4f56a7bcd89ef0ab1');
528
+ * ```
529
+ *
278
530
  * @param id The ID of the dataset.
279
531
  */
280
532
  deleteDataset(id: string): Promise<void>;
281
533
  /**
282
534
  * Rename a dataset.
283
535
  *
536
+ * @example
537
+ *
538
+ * ```ts
539
+ * await dataClient.renameDataset(
540
+ * '12ab3de4f56a7bcd89ef0ab1',
541
+ * 'my-new-dataset'
542
+ * );
543
+ * ```
544
+ *
284
545
  * @param id The ID of the dataset
285
546
  * @param name The new name of the dataset
286
547
  */
@@ -288,6 +549,14 @@ export declare class DataClient {
288
549
  /**
289
550
  * List all of the datasets for an organization.
290
551
  *
552
+ * @example
553
+ *
554
+ * ```ts
555
+ * const datasets = await dataClient.listDatasetsByOrganizationID(
556
+ * '123abc45-1234-5678-90ab-cdef12345678'
557
+ * );
558
+ * ```
559
+ *
291
560
  * @param organizationId The ID of the organization
292
561
  * @returns The list of datasets in the organization
293
562
  */
@@ -295,6 +564,14 @@ export declare class DataClient {
295
564
  /**
296
565
  * List all of the datasets specified by the given dataset IDs.
297
566
  *
567
+ * @example
568
+ *
569
+ * ```ts
570
+ * const datasets = await dataClient.listDatasetsByIds([
571
+ * '12ab3de4f56a7bcd89ef0ab1',
572
+ * ]);
573
+ * ```
574
+ *
298
575
  * @param ids The list of IDs of the datasets
299
576
  * @returns The list of datasets
300
577
  */
@@ -307,6 +584,29 @@ export declare class DataClient {
307
584
  * data can be found under the "Sensors" subtab of the Data tab on
308
585
  * app.viam.com.
309
586
  *
587
+ * @example
588
+ *
589
+ * ```ts
590
+ * const fileId = await dataClient.tabularDataCaptureUpload(
591
+ * [
592
+ * {
593
+ * timestamp: '2025-03-26T10:00:00Z',
594
+ * value: 10,
595
+ * },
596
+ * ],
597
+ * '123abc45-1234-5678-90ab-cdef12345678',
598
+ * 'rdk:component:sensor',
599
+ * 'my-sensor',
600
+ * 'Readings',
601
+ * [
602
+ * [
603
+ * new Date('2025-03-26T10:00:00Z'),
604
+ * new Date('2025-03-26T10:00:00Z'),
605
+ * ],
606
+ * ]
607
+ * );
608
+ * ```
609
+ *
310
610
  * @param tabularData The list of data to be uploaded, represented tabularly
311
611
  * as an array.
312
612
  * @param partId The part ID of the component used to capture the data
@@ -331,6 +631,20 @@ export declare class DataClient {
331
631
  * a motor) along with the relevant metadata to app.viam.com. binary data can
332
632
  * be found under the "Sensors" subtab of the Data tab on app.viam.com.
333
633
  *
634
+ * @example
635
+ *
636
+ * ```ts
637
+ * const binaryDataId = await dataClient.binaryDataCaptureUpload(
638
+ * binaryData,
639
+ * '123abc45-1234-5678-90ab-cdef12345678',
640
+ * 'rdk:component:camera',
641
+ * 'my-camera',
642
+ * 'ReadImage',
643
+ * '.jpg',
644
+ * [new Date('2025-03-19'), new Date('2025-03-19')]
645
+ * );
646
+ * ```
647
+ *
334
648
  * @param binaryData The data to be uploaded, represented in bytes
335
649
  * @param partId The part ID of the component used to capture the data
336
650
  * @param componentType The type of the component used to capture the data
@@ -354,6 +668,17 @@ export declare class DataClient {
354
668
  * Gets the most recent tabular data captured from the specified data source,
355
669
  * as long as it was synced within the last year.
356
670
  *
671
+ * @example
672
+ *
673
+ * ```ts
674
+ * const data = await dataClient.getLatestTabularData(
675
+ * '123abc45-1234-5678-90ab-cdef12345678',
676
+ * 'my-sensor',
677
+ * 'rdk:component:sensor',
678
+ * 'Readings'
679
+ * );
680
+ * ```
681
+ *
357
682
  * @param partId The ID of the part that owns the data
358
683
  * @param resourceName The name of the requested resource that captured the
359
684
  * data. Ex: "my-sensor"
@@ -6,27 +6,102 @@ export type ArmJointPositions = PlainMessage<armApi.JointPositions>;
6
6
  export declare const ArmJointPositions: typeof armApi.JointPositions;
7
7
  /** Represents a physical robot arm that exists in three-dimensional space. */
8
8
  export interface Arm extends Resource {
9
- /** Get the position of the end of the arm expressed as a pose */
9
+ /**
10
+ * Get the position of the end of the arm expressed as a pose
11
+ *
12
+ * @example
13
+ *
14
+ * ```ts
15
+ * const arm = new VIAM.ArmClient(machine, 'my_arm');
16
+ * const pose = await arm.getEndPosition();
17
+ * ```
18
+ */
10
19
  getEndPosition: (extra?: Struct) => Promise<Pose>;
11
- /** Get the geometries of the component in their current configuration */
20
+ /**
21
+ * Get the geometries of the component in their current configuration
22
+ *
23
+ * @example
24
+ *
25
+ * ```ts
26
+ * const arm = new VIAM.ArmClient(machine, 'my_arm');
27
+ * const geometries = await arm.getGeometries();
28
+ * console.log(geometries);
29
+ * ```
30
+ */
12
31
  getGeometries: (extra?: Struct) => Promise<Geometry[]>;
13
32
  /**
14
33
  * Move the end of the arm to the pose.
15
34
  *
35
+ * @example
36
+ *
37
+ * ```ts
38
+ * const arm = new VIAM.ArmClient(machine, 'my_arm');
39
+ *
40
+ * // Create a pose for the arm to move to
41
+ * const pose: Pose = {
42
+ * x: -500,
43
+ * y: -200,
44
+ * z: 62,
45
+ * oX: 1,
46
+ * oY: 0,
47
+ * oZ: 1,
48
+ * theta: 90,
49
+ * };
50
+ *
51
+ * // Move the arm to the pose
52
+ * await arm.moveToPosition(pose);
53
+ * ```
54
+ *
16
55
  * @param pose - The destination pose for the arm.
17
56
  */
18
57
  moveToPosition: (pose: Pose, extra?: Struct) => Promise<void>;
19
58
  /**
20
- * Move each joint of the arm based on the angles on the joint poisitons.
21
- * parameter
59
+ * Move each joint of the arm based on the angles on the joint positions.
60
+ *
61
+ * @example
62
+ *
63
+ * ```ts
64
+ * const arm = new VIAM.ArmClient(machine, 'my_arm');
65
+ *
66
+ * // Move an arm with 6 joints (6 DoF)
67
+ * await arm.moveToJointPositions([90, 0, 0, 0, 15, 0]);
68
+ * ```
22
69
  *
23
70
  * @param jointPositionsList - List of angles (0-360) to move each joint to.
24
71
  */
25
72
  moveToJointPositions: (jointPositionsList: number[], extra?: Struct) => Promise<void>;
26
- /** Gets the current position of each joint. */
73
+ /**
74
+ * Gets the current position of each joint.
75
+ *
76
+ * @example
77
+ *
78
+ * ```ts
79
+ * const arm = new VIAM.ArmClient(machine, 'my_arm');
80
+ * const jointPositions = await arm.getJointPositions();
81
+ * ```
82
+ */
27
83
  getJointPositions: (extra?: Struct) => Promise<ArmJointPositions>;
28
- /** Stops the motion of the arm. */
84
+ /**
85
+ * Stop the motion of the arm.
86
+ *
87
+ * @example
88
+ *
89
+ * ```ts
90
+ * const arm = new VIAM.ArmClient(machine, 'my_arm');
91
+ * await arm.stop();
92
+ * ```
93
+ */
29
94
  stop: (extra?: Struct) => Promise<void>;
30
- /** Get if the arm is currently moving. */
95
+ /**
96
+ * Get if the arm is currently moving.
97
+ *
98
+ * @example
99
+ *
100
+ * ```ts
101
+ * const arm = new VIAM.ArmClient(machine, 'my_arm');
102
+ * const isMoving = await arm.isMoving();
103
+ * console.log(isMoving);
104
+ * ```
105
+ */
31
106
  isMoving: () => Promise<boolean>;
32
107
  }