@viamrobotics/sdk 0.2.2 → 0.2.3-rc.0

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.
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export type { Gantry } from './gantry/gantry';
2
+ export { GantryClient } from './gantry/client';
@@ -5,6 +5,7 @@ import * as jspb from "google-protobuf";
5
5
  import * as common_v1_common_pb from "../../../common/v1/common_pb";
6
6
  import * as google_api_annotations_pb from "../../../google/api/annotations_pb";
7
7
  import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb";
8
+ import * as google_protobuf_timestamp_pb from "google-protobuf/google/protobuf/timestamp_pb";
8
9
 
9
10
  export class GetPositionRequest extends jspb.Message {
10
11
  getName(): string;
@@ -142,3 +143,45 @@ export namespace GetInternalStateResponse {
142
143
  }
143
144
  }
144
145
 
146
+ export class GetLatestMapInfoRequest extends jspb.Message {
147
+ getName(): string;
148
+ setName(value: string): void;
149
+
150
+ serializeBinary(): Uint8Array;
151
+ toObject(includeInstance?: boolean): GetLatestMapInfoRequest.AsObject;
152
+ static toObject(includeInstance: boolean, msg: GetLatestMapInfoRequest): GetLatestMapInfoRequest.AsObject;
153
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
154
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
155
+ static serializeBinaryToWriter(message: GetLatestMapInfoRequest, writer: jspb.BinaryWriter): void;
156
+ static deserializeBinary(bytes: Uint8Array): GetLatestMapInfoRequest;
157
+ static deserializeBinaryFromReader(message: GetLatestMapInfoRequest, reader: jspb.BinaryReader): GetLatestMapInfoRequest;
158
+ }
159
+
160
+ export namespace GetLatestMapInfoRequest {
161
+ export type AsObject = {
162
+ name: string,
163
+ }
164
+ }
165
+
166
+ export class GetLatestMapInfoResponse extends jspb.Message {
167
+ hasLastMapUpdate(): boolean;
168
+ clearLastMapUpdate(): void;
169
+ getLastMapUpdate(): google_protobuf_timestamp_pb.Timestamp | undefined;
170
+ setLastMapUpdate(value?: google_protobuf_timestamp_pb.Timestamp): void;
171
+
172
+ serializeBinary(): Uint8Array;
173
+ toObject(includeInstance?: boolean): GetLatestMapInfoResponse.AsObject;
174
+ static toObject(includeInstance: boolean, msg: GetLatestMapInfoResponse): GetLatestMapInfoResponse.AsObject;
175
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
176
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
177
+ static serializeBinaryToWriter(message: GetLatestMapInfoResponse, writer: jspb.BinaryWriter): void;
178
+ static deserializeBinary(bytes: Uint8Array): GetLatestMapInfoResponse;
179
+ static deserializeBinaryFromReader(message: GetLatestMapInfoResponse, reader: jspb.BinaryReader): GetLatestMapInfoResponse;
180
+ }
181
+
182
+ export namespace GetLatestMapInfoResponse {
183
+ export type AsObject = {
184
+ lastMapUpdate?: google_protobuf_timestamp_pb.Timestamp.AsObject,
185
+ }
186
+ }
187
+
@@ -32,6 +32,15 @@ type SLAMServiceGetInternalState = {
32
32
  readonly responseType: typeof service_slam_v1_slam_pb.GetInternalStateResponse;
33
33
  };
34
34
 
35
+ type SLAMServiceGetLatestMapInfo = {
36
+ readonly methodName: string;
37
+ readonly service: typeof SLAMService;
38
+ readonly requestStream: false;
39
+ readonly responseStream: false;
40
+ readonly requestType: typeof service_slam_v1_slam_pb.GetLatestMapInfoRequest;
41
+ readonly responseType: typeof service_slam_v1_slam_pb.GetLatestMapInfoResponse;
42
+ };
43
+
35
44
  type SLAMServiceDoCommand = {
36
45
  readonly methodName: string;
37
46
  readonly service: typeof SLAMService;
@@ -46,6 +55,7 @@ export class SLAMService {
46
55
  static readonly GetPosition: SLAMServiceGetPosition;
47
56
  static readonly GetPointCloudMap: SLAMServiceGetPointCloudMap;
48
57
  static readonly GetInternalState: SLAMServiceGetInternalState;
58
+ static readonly GetLatestMapInfo: SLAMServiceGetLatestMapInfo;
49
59
  static readonly DoCommand: SLAMServiceDoCommand;
50
60
  }
51
61
 
@@ -92,6 +102,15 @@ export class SLAMServiceClient {
92
102
  ): UnaryResponse;
93
103
  getPointCloudMap(requestMessage: service_slam_v1_slam_pb.GetPointCloudMapRequest, metadata?: grpc.Metadata): ResponseStream<service_slam_v1_slam_pb.GetPointCloudMapResponse>;
94
104
  getInternalState(requestMessage: service_slam_v1_slam_pb.GetInternalStateRequest, metadata?: grpc.Metadata): ResponseStream<service_slam_v1_slam_pb.GetInternalStateResponse>;
105
+ getLatestMapInfo(
106
+ requestMessage: service_slam_v1_slam_pb.GetLatestMapInfoRequest,
107
+ metadata: grpc.Metadata,
108
+ callback: (error: ServiceError|null, responseMessage: service_slam_v1_slam_pb.GetLatestMapInfoResponse|null) => void
109
+ ): UnaryResponse;
110
+ getLatestMapInfo(
111
+ requestMessage: service_slam_v1_slam_pb.GetLatestMapInfoRequest,
112
+ callback: (error: ServiceError|null, responseMessage: service_slam_v1_slam_pb.GetLatestMapInfoResponse|null) => void
113
+ ): UnaryResponse;
95
114
  doCommand(
96
115
  requestMessage: common_v1_common_pb.DoCommandRequest,
97
116
  metadata: grpc.Metadata,
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
  *