@viamrobotics/sdk 0.0.42 → 0.0.44
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/README.md +7 -3
- package/dist/components/base/Base.d.ts +2 -0
- package/dist/components/base/Client.d.ts +1 -0
- package/dist/components/encoder/Client.d.ts +19 -0
- package/dist/components/encoder/Encoder.d.ts +18 -0
- package/dist/components/encoder.d.ts +2 -0
- package/dist/components/motor/Client.d.ts +1 -0
- package/dist/components/motor/Motor.d.ts +2 -0
- package/dist/gen/component/camera/v1/camera_pb.d.ts +8 -0
- package/dist/main.d.ts +13 -1
- package/dist/main.es.js +1284 -494
- package/dist/main.umd.js +5 -5
- package/dist/robot/Client.d.ts +3 -0
- package/dist/robot/dial.d.ts +17 -2
- package/dist/robot.d.ts +1 -1
- package/dist/services/{datamanager → data-manager}/client.d.ts +2 -2
- package/dist/services/{datamanager/datamanager.d.ts → data-manager/data-manager.d.ts} +1 -1
- package/dist/services/data-manager.d.ts +2 -0
- package/dist/types.d.ts +5 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Viam TypeScript SDK
|
|
2
2
|
|
|
3
|
+
[](https://github.com/viamrobotics/viam-typescript-sdk/blob/main/LICENSE)
|
|
4
|
+
[](https://www.npmjs.com/package/@viamrobotics/sdk)
|
|
5
|
+
[](https://ts.viam.dev)
|
|
6
|
+
|
|
3
7
|
## (In)stability Notice
|
|
4
8
|
|
|
5
9
|
> **Warning**
|
|
@@ -15,9 +19,9 @@ npm install --save @viamrobotics/sdk
|
|
|
15
19
|
|
|
16
20
|
### Examples
|
|
17
21
|
|
|
18
|
-
[The examples directory](examples) contains small apps that demonstrate how to use this SDK to operate a robot running Viam.
|
|
22
|
+
[The examples directory](https://github.com/viamrobotics/viam-typescript-sdk/tree/main/examples) contains small apps that demonstrate how to use this SDK to operate a robot running Viam.
|
|
19
23
|
|
|
20
24
|
## License
|
|
21
|
-
Copyright 2022 Viam Inc.
|
|
25
|
+
Copyright 2022-2023 Viam Inc.
|
|
22
26
|
|
|
23
|
-
Apache 2.0 - See [LICENSE](LICENSE) file
|
|
27
|
+
Apache 2.0 - See [LICENSE](https://github.com/viamrobotics/viam-typescript-sdk/blob/main/LICENSE) file
|
|
@@ -34,4 +34,6 @@ export interface Base {
|
|
|
34
34
|
setVelocity(linear: Vector3D, angular: Vector3D, extra?: Extra): Promise<void>;
|
|
35
35
|
/** Stop a base */
|
|
36
36
|
stop(extra?: Extra): Promise<void>;
|
|
37
|
+
/** Return true if the base is in motion. */
|
|
38
|
+
isMoving(extra?: Extra): Promise<boolean>;
|
|
37
39
|
}
|
|
@@ -17,4 +17,5 @@ export declare class BaseClient implements Base {
|
|
|
17
17
|
setPower(linear: Vector3D, angular: Vector3D, extra?: {}): Promise<void>;
|
|
18
18
|
setVelocity(linear: Vector3D, angular: Vector3D, extra?: {}): Promise<void>;
|
|
19
19
|
stop(extra?: {}): Promise<void>;
|
|
20
|
+
isMoving(): Promise<boolean>;
|
|
20
21
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RobotClient } from '../../robot';
|
|
2
|
+
import type { Encoder } from './Encoder';
|
|
3
|
+
import { type Options, PositionType } from '../../types';
|
|
4
|
+
import encoderApi from '../../gen/component/encoder/v1/encoder_pb';
|
|
5
|
+
/**
|
|
6
|
+
* A gRPC-web client for the Encoder component.
|
|
7
|
+
*
|
|
8
|
+
* @group Clients
|
|
9
|
+
*/
|
|
10
|
+
export declare class EncoderClient implements Encoder {
|
|
11
|
+
private client;
|
|
12
|
+
private readonly name;
|
|
13
|
+
private readonly options;
|
|
14
|
+
constructor(client: RobotClient, name: string, options?: Options);
|
|
15
|
+
private get encoderService();
|
|
16
|
+
resetPosition(extra?: {}): Promise<void>;
|
|
17
|
+
getProperties(extra?: {}): Promise<encoderApi.GetPropertiesResponse.AsObject>;
|
|
18
|
+
getPosition(positionType?: PositionType, extra?: {}): Promise<readonly [number, 0 | 2 | 1]>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Extra, PositionType } from '../../types';
|
|
2
|
+
import pb from '../../gen/component/encoder/v1/encoder_pb';
|
|
3
|
+
export type EncoderProperties = pb.GetPropertiesResponse.AsObject;
|
|
4
|
+
/** Represents a physical encoder. */
|
|
5
|
+
export interface Encoder {
|
|
6
|
+
/** Set the current position of the encoder as the new zero position. */
|
|
7
|
+
resetPosition(extra?: Extra): Promise<void>;
|
|
8
|
+
/** Return the encoder's properties. */
|
|
9
|
+
getProperties(extra?: Extra): Promise<EncoderProperties>;
|
|
10
|
+
/**
|
|
11
|
+
* Return the current position either in relative units (ticks away from a
|
|
12
|
+
* zero position) or absolute units (degrees along a circle).
|
|
13
|
+
*
|
|
14
|
+
* @param positionType - The type of position the encoder returns (ticks or
|
|
15
|
+
* degrees)
|
|
16
|
+
*/
|
|
17
|
+
getPosition(positionType?: PositionType, extra?: Extra): Promise<readonly [number, PositionType]>;
|
|
18
|
+
}
|
|
@@ -51,4 +51,6 @@ export interface Motor {
|
|
|
51
51
|
getPosition(extra?: Extra): Promise<number>;
|
|
52
52
|
/** Return true if the motor is on. */
|
|
53
53
|
isPowered(extra?: Extra): Promise<readonly [boolean, number]>;
|
|
54
|
+
/** Return true if the motor is in motion. */
|
|
55
|
+
isMoving(): Promise<boolean>;
|
|
54
56
|
}
|
|
@@ -216,6 +216,12 @@ export class Webcam extends jspb.Message {
|
|
|
216
216
|
setPropertiesList(value: Array<Property>): void;
|
|
217
217
|
addProperties(value?: Property, index?: number): Property;
|
|
218
218
|
|
|
219
|
+
getName(): string;
|
|
220
|
+
setName(value: string): void;
|
|
221
|
+
|
|
222
|
+
getId(): string;
|
|
223
|
+
setId(value: string): void;
|
|
224
|
+
|
|
219
225
|
serializeBinary(): Uint8Array;
|
|
220
226
|
toObject(includeInstance?: boolean): Webcam.AsObject;
|
|
221
227
|
static toObject(includeInstance: boolean, msg: Webcam): Webcam.AsObject;
|
|
@@ -231,6 +237,8 @@ export namespace Webcam {
|
|
|
231
237
|
label: string,
|
|
232
238
|
status: string,
|
|
233
239
|
propertiesList: Array<Property.AsObject>,
|
|
240
|
+
name: string,
|
|
241
|
+
id: string,
|
|
234
242
|
}
|
|
235
243
|
}
|
|
236
244
|
|
package/dist/main.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const version: string;
|
|
|
9
9
|
* @group Raw Protobufs
|
|
10
10
|
*/
|
|
11
11
|
export { default as robotApi } from './gen/robot/v1/robot_pb';
|
|
12
|
-
export { type Robot, type DialDirectConf, type DialWebRTCConf, RobotClient, createRobotClient, } from './robot';
|
|
12
|
+
export { type Robot, type DialConf, type DialDirectConf, type DialWebRTCConf, RobotClient, createRobotClient, } from './robot';
|
|
13
13
|
/**
|
|
14
14
|
* @deprecated Use {@link RobotClient} instead.
|
|
15
15
|
* @group Clients
|
|
@@ -59,6 +59,17 @@ export { type Board, BoardClient } from './components/board';
|
|
|
59
59
|
*/
|
|
60
60
|
export { default as cameraApi } from './gen/component/camera/v1/camera_pb';
|
|
61
61
|
export { type Camera, CameraClient } from './components/camera';
|
|
62
|
+
/**
|
|
63
|
+
* Raw Protobuf interfaces for an Encoder component.
|
|
64
|
+
*
|
|
65
|
+
* Generated with https://github.com/improbable-eng/grpc-web
|
|
66
|
+
*
|
|
67
|
+
* @deprecated Use {@link EncoderClient} instead.
|
|
68
|
+
* @alpha
|
|
69
|
+
* @group Raw Protobufs
|
|
70
|
+
*/
|
|
71
|
+
export { default as encoderApi } from './gen/component/encoder/v1/encoder_pb';
|
|
72
|
+
export { type Encoder, type EncoderProperties, EncoderClient, } from './components/encoder';
|
|
62
73
|
/**
|
|
63
74
|
* Raw Protobuf interfaces for a Motor component.
|
|
64
75
|
*
|
|
@@ -254,6 +265,7 @@ export { default as inputControllerApi } from './gen/component/inputcontroller/v
|
|
|
254
265
|
*/
|
|
255
266
|
export { default as motionApi } from './gen/service/motion/v1/motion_pb';
|
|
256
267
|
export { type Motion, type MotionConstraints, MotionClient, } from './services/motion';
|
|
268
|
+
export { type DataManager, DataManagerClient } from './services/data-manager';
|
|
257
269
|
/**
|
|
258
270
|
* Raw Protobuf interfaces for a Navigation service.
|
|
259
271
|
*
|