@viamrobotics/sdk 0.0.39 → 0.0.40-alpha.2

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.
@@ -1,15 +1,16 @@
1
1
  import type { JointPositions } from '../../gen/component/arm/v1/arm_pb';
2
- import type { Extra, Pose } from '../../types';
2
+ import type { Extra } from '../../types';
3
+ import { Pose } from '../../gen/common/v1/common_pb';
3
4
  /** Represents a physical robot arm that exists in three-dimensional space. */
4
5
  export interface Arm {
5
6
  /** Get the position of the end of the arm expressed as a pose */
6
- getEndPosition: (extra?: Extra) => Promise<Pose>;
7
+ getEndPosition: (extra?: Extra) => Promise<Pose.AsObject>;
7
8
  /**
8
9
  * Move the end of the arm to the pose.
9
10
  *
10
11
  * @param pose - The destination pose for the arm.
11
12
  */
12
- moveToPosition: (pose: Pose, extra?: Extra) => Promise<void>;
13
+ moveToPosition: (pose: Pose.AsObject, extra?: Extra) => Promise<void>;
13
14
  /**
14
15
  * Move each joint of the arm based on the angles on the joint poisitons.
15
16
  * parameter
@@ -1,24 +1,21 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import pb from '../../gen/component/arm/v1/arm_pb';
3
- import type { Options, Pose } from '../../types';
3
+ import type { Options } from '../../types';
4
4
  import type { Arm } from './Arm';
5
- /** A gRPC-web client for the Arm component. */
5
+ import { Pose } from '../../gen/common/v1/common_pb';
6
+ /**
7
+ * A gRPC-web client for the Arm component.
8
+ *
9
+ * @group Clients
10
+ */
6
11
  export declare class ArmClient implements Arm {
7
12
  private client;
8
13
  private readonly name;
9
14
  private readonly options;
10
15
  constructor(client: RobotClient, name: string, options?: Options);
11
16
  private get ArmService();
12
- getEndPosition(extra?: {}): Promise<{
13
- x: number;
14
- y: number;
15
- z: number;
16
- ox: number;
17
- oy: number;
18
- oz: number;
19
- theta: number;
20
- }>;
21
- moveToPosition(pose: Pose, extra?: {}): Promise<void>;
17
+ getEndPosition(extra?: {}): Promise<Pose.AsObject>;
18
+ moveToPosition(pose: Pose.AsObject, extra?: {}): Promise<void>;
22
19
  moveToJointPositions(jointPositionsList: number[], extra?: {}): Promise<void>;
23
20
  getJointPositions(extra?: {}): Promise<pb.JointPositions>;
24
21
  stop(extra?: {}): Promise<void>;
@@ -1,7 +1,11 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import type { Base } from './Base';
3
3
  import type { Options, Vector3D } from '../../types';
4
- /** A gRPC-web client for the Base component. */
4
+ /**
5
+ * A gRPC-web client for the Base component.
6
+ *
7
+ * @group Clients
8
+ */
5
9
  export declare class BaseClient implements Base {
6
10
  private client;
7
11
  private readonly name;
@@ -2,7 +2,11 @@ import type { Board } from './Board';
2
2
  import type { RobotClient } from '../../robot';
3
3
  import type { Options } from '../../types';
4
4
  import pb from '../../gen/component/board/v1/board_pb';
5
- /** A gRPC-web client for the Board component. */
5
+ /**
6
+ * A gRPC-web client for the Board component.
7
+ *
8
+ * @group Clients
9
+ */
6
10
  export declare class BoardClient implements Board {
7
11
  private client;
8
12
  private readonly name;
@@ -2,7 +2,11 @@ import type { Camera, MimeType } from './Camera';
2
2
  import type { RobotClient } from '../../robot';
3
3
  import type { Options } from '../../types';
4
4
  import pb from '../../gen/component/camera/v1/camera_pb';
5
- /** A gRPC-web client for the Camera component. */
5
+ /**
6
+ * A gRPC-web client for the Camera component.
7
+ *
8
+ * @group Clients
9
+ */
6
10
  export declare class CameraClient implements Camera {
7
11
  private client;
8
12
  private readonly name;
@@ -1,7 +1,11 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import type { Motor } from './Motor';
3
3
  import type { Options } from '../../types';
4
- /** A gRPC-web client for the Motor component. */
4
+ /**
5
+ * A gRPC-web client for the Motor component.
6
+ *
7
+ * @group Clients
8
+ */
5
9
  export declare class MotorClient implements Motor {
6
10
  private client;
7
11
  private readonly name;
@@ -1,7 +1,11 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import type { MovementSensor } from './MovementSensor';
3
3
  import type { Options } from '../../types';
4
- /** A gRPC-web client for the MovementSensor component. */
4
+ /**
5
+ * A gRPC-web client for the MovementSensor component.
6
+ *
7
+ * @group Clients
8
+ */
5
9
  export declare class MovementSensorClient implements MovementSensor {
6
10
  private client;
7
11
  private sensorclient;
@@ -1,7 +1,11 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import type { Options } from '../../types';
3
3
  import type { Sensor } from './Sensor';
4
- /** A gRPC-web client for the Sensor component. */
4
+ /**
5
+ * A gRPC-web client for the Sensor component.
6
+ *
7
+ * @group Clients
8
+ */
5
9
  export declare class SensorClient implements Sensor {
6
10
  private client;
7
11
  private readonly name;
@@ -2,6 +2,11 @@ import { EventDispatcher } from '../../events';
2
2
  import type { RobotClient } from '../../robot';
3
3
  import type { Options } from '../../types';
4
4
  import type { Stream } from './Stream';
5
+ /**
6
+ * A gRPC-web client for a Stream.
7
+ *
8
+ * @group Clients
9
+ */
5
10
  export declare class StreamClient extends EventDispatcher implements Stream {
6
11
  private client;
7
12
  private readonly options;
package/dist/main.d.ts CHANGED
@@ -1,33 +1,389 @@
1
- import { RobotClient as Client } from './robot';
2
- import { version } from '../package.json';
3
- import armApi from './gen/component/arm/v1/arm_pb';
4
- import baseApi from './gen/component/base/v1/base_pb';
5
- import boardApi from './gen/component/board/v1/board_pb';
6
- import cameraApi from './gen/component/camera/v1/camera_pb';
7
- import commonApi from './gen/common/v1/common_pb';
8
- import gantryApi from './gen/component/gantry/v1/gantry_pb';
9
- import genericApi from './gen/component/generic/v1/generic_pb';
10
- import gripperApi from './gen/component/gripper/v1/gripper_pb';
11
- import inputControllerApi from './gen/component/inputcontroller/v1/input_controller_pb';
12
- import motionApi from './gen/service/motion/v1/motion_pb';
13
- import motorApi from './gen/component/motor/v1/motor_pb';
14
- import movementSensorApi from './gen/component/movementsensor/v1/movementsensor_pb';
15
- import navigationApi from './gen/service/navigation/v1/navigation_pb';
16
- import robotApi from './gen/robot/v1/robot_pb';
17
- import sensorApi from './gen/component/sensor/v1/sensor_pb';
18
- import sensorsApi from './gen/service/sensors/v1/sensors_pb';
19
- import servoApi from './gen/component/servo/v1/servo_pb';
20
- import slamApi from './gen/service/slam/v1/slam_pb';
21
- import streamApi from './gen/proto/stream/v1/stream_pb';
22
- import visionApi from './gen/service/vision/v1/vision_pb';
1
+ export { version } from '../package.json';
2
+ /**
3
+ * Raw Protobuf interfaces for a Robot component.
4
+ *
5
+ * Generated with https://github.com/improbable-eng/grpc-web
6
+ *
7
+ * @deprecated Use {@link RobotClient} instead.
8
+ * @alpha
9
+ * @group Raw Protobufs
10
+ */
11
+ export { default as robotApi } from './gen/robot/v1/robot_pb';
23
12
  export { type Robot, type DialDirectConf, type DialWebRTCConf, RobotClient, createRobotClient, } from './robot';
13
+ /**
14
+ * @deprecated Use {@link RobotClient} instead.
15
+ * @group Clients
16
+ */
17
+ export { RobotClient as Client } from './robot';
18
+ /**
19
+ * Raw Protobuf interfaces for an Arm component.
20
+ *
21
+ * Generated with https://github.com/improbable-eng/grpc-web
22
+ *
23
+ * @deprecated Use {@link ArmClient} instead.
24
+ * @alpha
25
+ * @group Raw Protobufs
26
+ */
27
+ export { default as armApi } from './gen/component/arm/v1/arm_pb';
24
28
  export { type Arm, ArmClient } from './components/arm';
29
+ /**
30
+ * Raw Protobuf interfaces for a Base component.
31
+ *
32
+ * Generated with https://github.com/improbable-eng/grpc-web
33
+ *
34
+ * @deprecated Use {@link BaseClient} instead.
35
+ * @alpha
36
+ * @group Raw Protobufs
37
+ */
38
+ export { default as baseApi } from './gen/component/base/v1/base_pb';
25
39
  export { type Base, BaseClient } from './components/base';
40
+ /**
41
+ * Raw Protobuf interfaces for a Board component.
42
+ *
43
+ * Generated with https://github.com/improbable-eng/grpc-web
44
+ *
45
+ * @deprecated Use {@link BoardClient} instead.
46
+ * @alpha
47
+ * @group Raw Protobufs
48
+ */
49
+ export { default as boardApi } from './gen/component/board/v1/board_pb';
26
50
  export { type Board, BoardClient } from './components/board';
51
+ /**
52
+ * Raw Protobuf interfaces for a Camera component.
53
+ *
54
+ * Generated with https://github.com/improbable-eng/grpc-web
55
+ *
56
+ * @deprecated Use {@link CameraClient} instead.
57
+ * @alpha
58
+ * @group Raw Protobufs
59
+ */
60
+ export { default as cameraApi } from './gen/component/camera/v1/camera_pb';
27
61
  export { type Camera, CameraClient } from './components/camera';
62
+ /**
63
+ * Raw Protobuf interfaces for a Motor component.
64
+ *
65
+ * Generated with https://github.com/improbable-eng/grpc-web
66
+ *
67
+ * @deprecated Use {@link MotorClient} instead.
68
+ * @alpha
69
+ * @group Raw Protobufs
70
+ */
71
+ export { default as motorApi } from './gen/component/motor/v1/motor_pb';
28
72
  export { type Motor, MotorClient } from './components/motor';
73
+ /**
74
+ * Raw Protobuf interfaces for a MovementSensor component.
75
+ *
76
+ * Generated with https://github.com/improbable-eng/grpc-web
77
+ *
78
+ * @deprecated Use {@link MovementSensorClient} instead.
79
+ * @alpha
80
+ * @group Raw Protobufs
81
+ */
82
+ export { default as movementSensorApi } from './gen/component/movementsensor/v1/movementsensor_pb';
29
83
  export { type MovementSensor, MovementSensorClient, } from './components/movementsensor';
84
+ /**
85
+ * Raw Protobuf interfaces generated with
86
+ * https://github.com/improbable-eng/grpc-web for a Sensor component.
87
+ *
88
+ * @deprecated Use {@link SensorClient} instead.
89
+ * @alpha
90
+ * @group Raw Protobufs
91
+ */
92
+ export { default as sensorApi } from './gen/component/sensor/v1/sensor_pb';
30
93
  export { type Sensor, SensorClient } from './components/sensor';
94
+ /**
95
+ * Raw Protobuf interfaces for a Sensors service.
96
+ *
97
+ * Generated with https://github.com/improbable-eng/grpc-web
98
+ *
99
+ * @example
100
+ *
101
+ * ```ts
102
+ * import { grpc } from '@improbable-eng/grpc-web';
103
+ *
104
+ * const client = {}; // replace with a connected robot client
105
+ *
106
+ * const request = new sensorsApi.GetSensorsRequest();
107
+ * request.setName('mysensors');
108
+ *
109
+ * client.sensorsService.getSensors(
110
+ * request,
111
+ * new grpc.Metadata(),
112
+ * (error, response) => {
113
+ * // do something with error or response
114
+ * }
115
+ * );
116
+ * ```
117
+ *
118
+ * @alpha
119
+ * @group Raw Protobufs
120
+ */
121
+ export { default as sensorsApi } from './gen/service/sensors/v1/sensors_pb';
122
+ /**
123
+ * Raw Protobuf interfaces for a Stream.
124
+ *
125
+ * Generated with https://github.com/improbable-eng/grpc-web
126
+ *
127
+ * @deprecated Use {@link StreamClient} instead.
128
+ * @group Raw Protobufs
129
+ */
130
+ export { default as streamApi } from './gen/proto/stream/v1/stream_pb';
31
131
  export { type Stream, StreamClient } from './extra/stream';
32
- export { commonApi, armApi, baseApi, boardApi, cameraApi, gantryApi, genericApi, gripperApi, inputControllerApi, motorApi, motionApi, movementSensorApi, servoApi, navigationApi, robotApi, sensorApi, sensorsApi, slamApi, visionApi, streamApi, Client, version, };
132
+ /**
133
+ * Raw Protobuf interfaces for a Gantry component.
134
+ *
135
+ * Generated with https://github.com/improbable-eng/grpc-web
136
+ *
137
+ * @example
138
+ *
139
+ * ```ts
140
+ * import { grpc } from '@improbable-eng/grpc-web';
141
+ *
142
+ * const client = {}; // replace with a connected robot client
143
+ *
144
+ * const request = new gantryApi.GetLengthsRequest();
145
+ * request.setName('mygantry');
146
+ *
147
+ * client.gantryService.getLengths(
148
+ * request,
149
+ * new grpc.Metadata(),
150
+ * (error, response) => {
151
+ * // do something with error or response
152
+ * }
153
+ * );
154
+ * ```
155
+ *
156
+ * @alpha
157
+ * @group Raw Protobufs
158
+ */
159
+ export { default as gantryApi } from './gen/component/gantry/v1/gantry_pb';
160
+ /**
161
+ * Raw Protobuf interfaces for a Generic component.
162
+ *
163
+ * Generated with https://github.com/improbable-eng/grpc-web
164
+ *
165
+ * @example
166
+ *
167
+ * ```ts
168
+ * import { grpc } from '@improbable-eng/grpc-web';
169
+ * import { Struct } from 'google-protobuf/google/protobuf/struct_pb';
170
+ *
171
+ * const client = {}; // replace with a connected robot client
172
+ *
173
+ * const request = new genericApi.DoCommandRequest();
174
+ * request.setName('mygeneric');
175
+ * request.setCommand(Struct.fromJavaScript({ foo: 'bar' }));
176
+ *
177
+ * client.genericService.doCommand(
178
+ * request,
179
+ * new grpc.Metadata(),
180
+ * (error, response) => {
181
+ * // do something with error or response
182
+ * }
183
+ * );
184
+ * ```
185
+ *
186
+ * @alpha
187
+ * @group Raw Protobufs
188
+ */
189
+ export { default as genericApi } from './gen/component/generic/v1/generic_pb';
190
+ /**
191
+ * Raw Protobuf interfaces for a Gripper component.
192
+ *
193
+ * Generated with https://github.com/improbable-eng/grpc-web
194
+ *
195
+ * @example
196
+ *
197
+ * ```ts
198
+ * import { grpc } from '@improbable-eng/grpc-web';
199
+ *
200
+ * const client = {}; // replace with a connected robot client
201
+ *
202
+ * const request = new gripperApi.IsMovingRequest();
203
+ * request.setName('mygripper');
204
+ *
205
+ * client.gripperService.isMoving(
206
+ * request,
207
+ * new grpc.Metadata(),
208
+ * (error, response) => {
209
+ * // do something with error or response
210
+ * }
211
+ * );
212
+ * ```
213
+ *
214
+ * @alpha
215
+ * @group Raw Protobufs
216
+ */
217
+ export { default as gripperApi } from './gen/component/gripper/v1/gripper_pb';
218
+ /**
219
+ * Raw Protobuf interfaces for an InputController component.
220
+ *
221
+ * Generated with https://github.com/improbable-eng/grpc-web
222
+ *
223
+ * @example
224
+ *
225
+ * ```ts
226
+ * import { grpc } from '@improbable-eng/grpc-web';
227
+ *
228
+ * const client = {}; // replace with a connected robot client
229
+ *
230
+ * const request = new inputControllerApi.GetControlsRequest();
231
+ * request.setName('myinput controller');
232
+ *
233
+ * client.inputControllerService.getControls(
234
+ * request,
235
+ * new grpc.Metadata(),
236
+ * (error, response) => {
237
+ * // do something with error or response
238
+ * }
239
+ * );
240
+ * ```
241
+ *
242
+ * @alpha
243
+ * @group Raw Protobufs
244
+ */
245
+ export { default as inputControllerApi } from './gen/component/inputcontroller/v1/input_controller_pb';
246
+ /**
247
+ * Raw Protobuf interfaces for a Motion service.
248
+ *
249
+ * Generated with https://github.com/improbable-eng/grpc-web
250
+ *
251
+ * @deprecated Use {@link MotionClient} instead.
252
+ * @alpha
253
+ * @group Raw Protobufs
254
+ */
255
+ export { default as motionApi } from './gen/service/motion/v1/motion_pb';
256
+ export { type Motion, MotionClient } from './services/motion';
257
+ /**
258
+ * Raw Protobuf interfaces for a Navigation service.
259
+ *
260
+ * Generated with https://github.com/improbable-eng/grpc-web
261
+ *
262
+ * @example
263
+ *
264
+ * ```ts
265
+ * import { grpc } from '@improbable-eng/grpc-web';
266
+ *
267
+ * const client = {}; // replace with a connected robot client
268
+ *
269
+ * const request = new navigationApi.GetWaypointsRequest();
270
+ * request.setName('mynavigation');
271
+ *
272
+ * client.navigationService.getWaypoints(
273
+ * request,
274
+ * new grpc.Metadata(),
275
+ * (error, response) => {
276
+ * // do something with error or response
277
+ * }
278
+ * );
279
+ * ```
280
+ *
281
+ * @alpha
282
+ * @group Raw Protobufs
283
+ */
284
+ export { default as navigationApi } from './gen/service/navigation/v1/navigation_pb';
285
+ /**
286
+ * Raw Protobuf interfaces for a Servo component.
287
+ *
288
+ * Generated with https://github.com/improbable-eng/grpc-web
289
+ *
290
+ * @example
291
+ *
292
+ * ```ts
293
+ * import { grpc } from '@improbable-eng/grpc-web';
294
+ *
295
+ * const client = {}; // replace with a connected robot client
296
+ *
297
+ * const request = new servoApi.GetPositionRequest();
298
+ * request.setName('myservo');
299
+ *
300
+ * client.servoService.getPosition(
301
+ * request,
302
+ * new grpc.Metadata(),
303
+ * (error, response) => {
304
+ * // do something with error or response
305
+ * }
306
+ * );
307
+ * ```
308
+ *
309
+ * @alpha
310
+ * @group Raw Protobufs
311
+ */
312
+ export { default as servoApi } from './gen/component/servo/v1/servo_pb';
313
+ /**
314
+ * Raw Protobuf interfaces for a Slam service.
315
+ *
316
+ * Generated with https://github.com/improbable-eng/grpc-web
317
+ *
318
+ * @example
319
+ *
320
+ * ```ts
321
+ * import { grpc } from '@improbable-eng/grpc-web';
322
+ *
323
+ * const client = {}; // replace with a connected robot client
324
+ *
325
+ * const request = new slamApi.GetPositionRequest();
326
+ * request.setName('myslam');
327
+ *
328
+ * client.slamService.getPosition(
329
+ * request,
330
+ * new grpc.Metadata(),
331
+ * (error, response) => {
332
+ * // do something with error or response
333
+ * }
334
+ * );
335
+ * ```
336
+ *
337
+ * @alpha
338
+ * @group Raw Protobufs
339
+ */
340
+ export { default as slamApi } from './gen/service/slam/v1/slam_pb';
341
+ /**
342
+ * Raw Protobuf interfaces for a Vision service.
343
+ *
344
+ * Generated with https://github.com/improbable-eng/grpc-web
345
+ *
346
+ * @example
347
+ *
348
+ * ```ts
349
+ * import { grpc } from '@improbable-eng/grpc-web';
350
+ *
351
+ * const client = {}; // replace with a connected robot client
352
+ *
353
+ * const request = new visionApi.GetDetectorNamesRequest();
354
+ * request.setName('myvision');
355
+ *
356
+ * client.visionService.getDetectorNames(
357
+ * request,
358
+ * new grpc.Metadata(),
359
+ * (error, response) => {
360
+ * // do something with error or response
361
+ * }
362
+ * );
363
+ * ```
364
+ *
365
+ * @alpha
366
+ * @group Raw Protobufs
367
+ */
368
+ export { default as visionApi } from './gen/service/vision/v1/vision_pb';
369
+ /**
370
+ * Raw Protobuf interfaces that are shared across multiple components and
371
+ * services.
372
+ *
373
+ * Generated with https://github.com/improbable-eng/grpc-web
374
+ *
375
+ * @alpha
376
+ * @group Raw Protobufs
377
+ */
378
+ export { default as commonApi } from './gen/common/v1/common_pb';
379
+ /**
380
+ * Raw Protobuf response and error types.
381
+ *
382
+ * Generated with https://github.com/improbable-eng/grpc-web
383
+ *
384
+ * @privateRemarks
385
+ * It doesn't matter which ServiceError we export.
386
+ * @alpha
387
+ * @group Raw Protobufs
388
+ */
33
389
  export type { ResponseStream, ServiceError, } from './gen/robot/v1/robot_pb_service';