@viamrobotics/sdk 0.2.3-next.0 → 0.2.3
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/gantry/client.d.ts +22 -0
- package/dist/components/gantry/gantry.d.ts +29 -0
- package/dist/components/gantry.d.ts +2 -0
- package/dist/main.d.ts +11 -28
- package/dist/main.es.js +53 -1
- package/dist/main.umd.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RobotClient } from '../../robot';
|
|
2
|
+
import type { Options, StructType } from '../../types';
|
|
3
|
+
import type { Gantry } from './gantry';
|
|
4
|
+
/**
|
|
5
|
+
* A gRPC-web client for the Gantry component.
|
|
6
|
+
*
|
|
7
|
+
* @group Clients
|
|
8
|
+
*/
|
|
9
|
+
export declare class GantryClient implements Gantry {
|
|
10
|
+
private client;
|
|
11
|
+
private readonly name;
|
|
12
|
+
private readonly options;
|
|
13
|
+
constructor(client: RobotClient, name: string, options?: Options);
|
|
14
|
+
private get GantryService();
|
|
15
|
+
getPosition(extra?: {}): Promise<number[]>;
|
|
16
|
+
moveToPosition(positionsMm: number[], speedsMmPerSec: number[], extra?: {}): Promise<void>;
|
|
17
|
+
home(extra?: {}): Promise<boolean>;
|
|
18
|
+
getLengths(extra?: {}): Promise<number[]>;
|
|
19
|
+
stop(extra?: {}): Promise<void>;
|
|
20
|
+
isMoving(): Promise<boolean>;
|
|
21
|
+
doCommand(command: StructType): Promise<StructType>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Resource, StructType } from '../../types';
|
|
2
|
+
/** Represents a physical gantry that exists in three-dimensional space. */
|
|
3
|
+
export interface Gantry extends Resource {
|
|
4
|
+
/**
|
|
5
|
+
* Move each axis of the gantry to the positionsMm at the speeds in
|
|
6
|
+
* speedsMmPerSec
|
|
7
|
+
*
|
|
8
|
+
* @param positionsMm - The goal positions for each axis of the gantry.
|
|
9
|
+
* @param speedsMmPerSec - The desired speed for each axis to move to the
|
|
10
|
+
* respective position in positionsMm.
|
|
11
|
+
*/
|
|
12
|
+
moveToPosition: (positionsMm: number[], speedsMmPerSec: number[], extra?: StructType) => Promise<void>;
|
|
13
|
+
/** @returns The current position of each axis. */
|
|
14
|
+
getPosition: (extra?: StructType) => Promise<number[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Runs the homing sequence to find the start and end positions of the gantry
|
|
17
|
+
* axis.
|
|
18
|
+
*
|
|
19
|
+
* @returns A bool representing whether the gantry has run the homing sequence
|
|
20
|
+
* successfully.
|
|
21
|
+
*/
|
|
22
|
+
home: (extra?: StructType) => Promise<boolean>;
|
|
23
|
+
/** @returns The lengths of the axes of the gantry in millimeters. */
|
|
24
|
+
getLengths: (extra?: StructType) => Promise<number[]>;
|
|
25
|
+
/** Stops the motion of the gantry. */
|
|
26
|
+
stop: (extra?: StructType) => Promise<void>;
|
|
27
|
+
/** Get if the gantry is currently moving. */
|
|
28
|
+
isMoving: () => Promise<boolean>;
|
|
29
|
+
}
|
package/dist/main.d.ts
CHANGED
|
@@ -70,6 +70,17 @@ export { type Camera, type MimeType, CameraClient } from './components/camera';
|
|
|
70
70
|
*/
|
|
71
71
|
export { default as encoderApi } from './gen/component/encoder/v1/encoder_pb';
|
|
72
72
|
export { type Encoder, type EncoderProperties, EncoderPositionType, EncoderClient, } from './components/encoder';
|
|
73
|
+
/**
|
|
74
|
+
* Raw Protobuf interfaces for a Gantry component.
|
|
75
|
+
*
|
|
76
|
+
* Generated with https://github.com/improbable-eng/grpc-web
|
|
77
|
+
*
|
|
78
|
+
* @deprecated Use {@link GantryClient} instead.
|
|
79
|
+
* @alpha
|
|
80
|
+
* @group Raw Protobufs
|
|
81
|
+
*/
|
|
82
|
+
export { default as gantryApi } from './gen/component/gantry/v1/gantry_pb';
|
|
83
|
+
export { type Gantry, GantryClient } from './components/gantry';
|
|
73
84
|
/**
|
|
74
85
|
* Raw Protobuf interfaces for a Motor component.
|
|
75
86
|
*
|
|
@@ -140,34 +151,6 @@ export { default as sensorsApi } from './gen/service/sensors/v1/sensors_pb';
|
|
|
140
151
|
*/
|
|
141
152
|
export { default as streamApi } from './gen/proto/stream/v1/stream_pb';
|
|
142
153
|
export { type Stream, StreamClient } from './extra/stream';
|
|
143
|
-
/**
|
|
144
|
-
* Raw Protobuf interfaces for a Gantry component.
|
|
145
|
-
*
|
|
146
|
-
* Generated with https://github.com/improbable-eng/grpc-web
|
|
147
|
-
*
|
|
148
|
-
* @example
|
|
149
|
-
*
|
|
150
|
-
* ```ts
|
|
151
|
-
* import { grpc } from '@improbable-eng/grpc-web';
|
|
152
|
-
*
|
|
153
|
-
* const client = {}; // replace with a connected robot client
|
|
154
|
-
*
|
|
155
|
-
* const request = new gantryApi.GetLengthsRequest();
|
|
156
|
-
* request.setName('mygantry');
|
|
157
|
-
*
|
|
158
|
-
* client.gantryService.getLengths(
|
|
159
|
-
* request,
|
|
160
|
-
* new grpc.Metadata(),
|
|
161
|
-
* (error, response) => {
|
|
162
|
-
* // do something with error or response
|
|
163
|
-
* }
|
|
164
|
-
* );
|
|
165
|
-
* ```
|
|
166
|
-
*
|
|
167
|
-
* @alpha
|
|
168
|
-
* @group Raw Protobufs
|
|
169
|
-
*/
|
|
170
|
-
export { default as gantryApi } from './gen/component/gantry/v1/gantry_pb';
|
|
171
154
|
/**
|
|
172
155
|
* Raw Protobuf interfaces for a Generic component.
|
|
173
156
|
*
|
package/dist/main.es.js
CHANGED
|
@@ -41660,6 +41660,57 @@ class EncoderClient {
|
|
|
41660
41660
|
);
|
|
41661
41661
|
}
|
|
41662
41662
|
}
|
|
41663
|
+
class GantryClient {
|
|
41664
|
+
client;
|
|
41665
|
+
name;
|
|
41666
|
+
options;
|
|
41667
|
+
constructor(e, s, i = {}) {
|
|
41668
|
+
this.client = e.createServiceClient(GantryServiceClient_1), this.name = s, this.options = i;
|
|
41669
|
+
}
|
|
41670
|
+
get GantryService() {
|
|
41671
|
+
return this.client;
|
|
41672
|
+
}
|
|
41673
|
+
async getPosition(e = {}) {
|
|
41674
|
+
const s = this.GantryService, i = new gantry_pb.GetPositionRequest();
|
|
41675
|
+
return i.setName(this.name), i.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(i), (await promisify(s.getPosition.bind(s), i)).getPositionsMmList();
|
|
41676
|
+
}
|
|
41677
|
+
async moveToPosition(e, s, i = {}) {
|
|
41678
|
+
const u = this.GantryService, g = new gantry_pb.MoveToPositionRequest();
|
|
41679
|
+
g.setName(this.name), g.setPositionsMmList(e), g.setSpeedsMmPerSecList(s), g.setExtra(struct_pb.Struct.fromJavaScript(i)), this.options.requestLogger?.(g), await promisify(
|
|
41680
|
+
u.moveToPosition.bind(u),
|
|
41681
|
+
g
|
|
41682
|
+
);
|
|
41683
|
+
}
|
|
41684
|
+
async home(e = {}) {
|
|
41685
|
+
const s = this.GantryService, i = new gantry_pb.HomeRequest();
|
|
41686
|
+
return i.setName(this.name), i.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(i), (await promisify(
|
|
41687
|
+
s.home.bind(s),
|
|
41688
|
+
i
|
|
41689
|
+
)).getHomed();
|
|
41690
|
+
}
|
|
41691
|
+
async getLengths(e = {}) {
|
|
41692
|
+
const s = this.GantryService, i = new gantry_pb.GetLengthsRequest();
|
|
41693
|
+
return i.setName(this.name), i.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(i), (await promisify(s.getLengths.bind(s), i)).getLengthsMmList();
|
|
41694
|
+
}
|
|
41695
|
+
async stop(e = {}) {
|
|
41696
|
+
const s = this.GantryService, i = new gantry_pb.StopRequest();
|
|
41697
|
+
i.setName(this.name), i.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(i), await promisify(
|
|
41698
|
+
s.stop.bind(s),
|
|
41699
|
+
i
|
|
41700
|
+
);
|
|
41701
|
+
}
|
|
41702
|
+
async isMoving() {
|
|
41703
|
+
const e = this.GantryService, s = new gantry_pb.IsMovingRequest();
|
|
41704
|
+
return s.setName(this.name), this.options.requestLogger?.(s), (await promisify(
|
|
41705
|
+
e.isMoving.bind(e),
|
|
41706
|
+
s
|
|
41707
|
+
)).getIsMoving();
|
|
41708
|
+
}
|
|
41709
|
+
async doCommand(e) {
|
|
41710
|
+
const s = this.GantryService;
|
|
41711
|
+
return doCommandFromClient(s, this.name, e, this.options);
|
|
41712
|
+
}
|
|
41713
|
+
}
|
|
41663
41714
|
class MotorClient {
|
|
41664
41715
|
client;
|
|
41665
41716
|
name;
|
|
@@ -42798,7 +42849,7 @@ class ServoClient {
|
|
|
42798
42849
|
return doCommandFromClient(s, this.name, e, this.options);
|
|
42799
42850
|
}
|
|
42800
42851
|
}
|
|
42801
|
-
const version = "0.2.3
|
|
42852
|
+
const version = "0.2.3";
|
|
42802
42853
|
export {
|
|
42803
42854
|
ArmClient,
|
|
42804
42855
|
BaseClient,
|
|
@@ -42808,6 +42859,7 @@ export {
|
|
|
42808
42859
|
DataManagerClient,
|
|
42809
42860
|
EncoderClient,
|
|
42810
42861
|
EncoderPositionType,
|
|
42862
|
+
GantryClient,
|
|
42811
42863
|
GripperClient,
|
|
42812
42864
|
MotionClient,
|
|
42813
42865
|
MotorClient,
|