@viamrobotics/sdk 0.2.1 → 0.2.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.
- package/dist/events.d.ts +2 -0
- package/dist/gen/component/gantry/v1/gantry_pb.d.ts +52 -0
- package/dist/gen/component/gantry/v1/gantry_pb_service.d.ts +19 -0
- package/dist/main.es.js +220 -52
- package/dist/main.umd.js +3 -3
- package/dist/robot/client.d.ts +3 -1
- package/dist/robot/robot.d.ts +14 -0
- package/package.json +1 -1
package/dist/events.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
type Callback = (args: unknown) => void;
|
|
2
|
+
export declare const RECONNECTED = "reconnected";
|
|
3
|
+
export declare const DISCONNECTED = "disconnected";
|
|
2
4
|
export declare class EventDispatcher {
|
|
3
5
|
listeners: Record<string, Set<Callback>>;
|
|
4
6
|
on(type: string, listener: Callback): void;
|
|
@@ -63,6 +63,11 @@ export class MoveToPositionRequest extends jspb.Message {
|
|
|
63
63
|
setPositionsMmList(value: Array<number>): void;
|
|
64
64
|
addPositionsMm(value: number, index?: number): number;
|
|
65
65
|
|
|
66
|
+
clearSpeedsMmPerSecList(): void;
|
|
67
|
+
getSpeedsMmPerSecList(): Array<number>;
|
|
68
|
+
setSpeedsMmPerSecList(value: Array<number>): void;
|
|
69
|
+
addSpeedsMmPerSec(value: number, index?: number): number;
|
|
70
|
+
|
|
66
71
|
hasExtra(): boolean;
|
|
67
72
|
clearExtra(): void;
|
|
68
73
|
getExtra(): google_protobuf_struct_pb.Struct | undefined;
|
|
@@ -82,6 +87,7 @@ export namespace MoveToPositionRequest {
|
|
|
82
87
|
export type AsObject = {
|
|
83
88
|
name: string,
|
|
84
89
|
positionsMmList: Array<number>,
|
|
90
|
+
speedsMmPerSecList: Array<number>,
|
|
85
91
|
extra?: google_protobuf_struct_pb.Struct.AsObject,
|
|
86
92
|
}
|
|
87
93
|
}
|
|
@@ -102,6 +108,52 @@ export namespace MoveToPositionResponse {
|
|
|
102
108
|
}
|
|
103
109
|
}
|
|
104
110
|
|
|
111
|
+
export class HomeRequest extends jspb.Message {
|
|
112
|
+
getName(): string;
|
|
113
|
+
setName(value: string): void;
|
|
114
|
+
|
|
115
|
+
hasExtra(): boolean;
|
|
116
|
+
clearExtra(): void;
|
|
117
|
+
getExtra(): google_protobuf_struct_pb.Struct | undefined;
|
|
118
|
+
setExtra(value?: google_protobuf_struct_pb.Struct): void;
|
|
119
|
+
|
|
120
|
+
serializeBinary(): Uint8Array;
|
|
121
|
+
toObject(includeInstance?: boolean): HomeRequest.AsObject;
|
|
122
|
+
static toObject(includeInstance: boolean, msg: HomeRequest): HomeRequest.AsObject;
|
|
123
|
+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
124
|
+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
125
|
+
static serializeBinaryToWriter(message: HomeRequest, writer: jspb.BinaryWriter): void;
|
|
126
|
+
static deserializeBinary(bytes: Uint8Array): HomeRequest;
|
|
127
|
+
static deserializeBinaryFromReader(message: HomeRequest, reader: jspb.BinaryReader): HomeRequest;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export namespace HomeRequest {
|
|
131
|
+
export type AsObject = {
|
|
132
|
+
name: string,
|
|
133
|
+
extra?: google_protobuf_struct_pb.Struct.AsObject,
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export class HomeResponse extends jspb.Message {
|
|
138
|
+
getHomed(): boolean;
|
|
139
|
+
setHomed(value: boolean): void;
|
|
140
|
+
|
|
141
|
+
serializeBinary(): Uint8Array;
|
|
142
|
+
toObject(includeInstance?: boolean): HomeResponse.AsObject;
|
|
143
|
+
static toObject(includeInstance: boolean, msg: HomeResponse): HomeResponse.AsObject;
|
|
144
|
+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
145
|
+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
146
|
+
static serializeBinaryToWriter(message: HomeResponse, writer: jspb.BinaryWriter): void;
|
|
147
|
+
static deserializeBinary(bytes: Uint8Array): HomeResponse;
|
|
148
|
+
static deserializeBinaryFromReader(message: HomeResponse, reader: jspb.BinaryReader): HomeResponse;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export namespace HomeResponse {
|
|
152
|
+
export type AsObject = {
|
|
153
|
+
homed: boolean,
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
105
157
|
export class GetLengthsRequest extends jspb.Message {
|
|
106
158
|
getName(): string;
|
|
107
159
|
setName(value: string): void;
|
|
@@ -23,6 +23,15 @@ type GantryServiceMoveToPosition = {
|
|
|
23
23
|
readonly responseType: typeof component_gantry_v1_gantry_pb.MoveToPositionResponse;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
+
type GantryServiceHome = {
|
|
27
|
+
readonly methodName: string;
|
|
28
|
+
readonly service: typeof GantryService;
|
|
29
|
+
readonly requestStream: false;
|
|
30
|
+
readonly responseStream: false;
|
|
31
|
+
readonly requestType: typeof component_gantry_v1_gantry_pb.HomeRequest;
|
|
32
|
+
readonly responseType: typeof component_gantry_v1_gantry_pb.HomeResponse;
|
|
33
|
+
};
|
|
34
|
+
|
|
26
35
|
type GantryServiceGetLengths = {
|
|
27
36
|
readonly methodName: string;
|
|
28
37
|
readonly service: typeof GantryService;
|
|
@@ -72,6 +81,7 @@ export class GantryService {
|
|
|
72
81
|
static readonly serviceName: string;
|
|
73
82
|
static readonly GetPosition: GantryServiceGetPosition;
|
|
74
83
|
static readonly MoveToPosition: GantryServiceMoveToPosition;
|
|
84
|
+
static readonly Home: GantryServiceHome;
|
|
75
85
|
static readonly GetLengths: GantryServiceGetLengths;
|
|
76
86
|
static readonly Stop: GantryServiceStop;
|
|
77
87
|
static readonly IsMoving: GantryServiceIsMoving;
|
|
@@ -129,6 +139,15 @@ export class GantryServiceClient {
|
|
|
129
139
|
requestMessage: component_gantry_v1_gantry_pb.MoveToPositionRequest,
|
|
130
140
|
callback: (error: ServiceError|null, responseMessage: component_gantry_v1_gantry_pb.MoveToPositionResponse|null) => void
|
|
131
141
|
): UnaryResponse;
|
|
142
|
+
home(
|
|
143
|
+
requestMessage: component_gantry_v1_gantry_pb.HomeRequest,
|
|
144
|
+
metadata: grpc.Metadata,
|
|
145
|
+
callback: (error: ServiceError|null, responseMessage: component_gantry_v1_gantry_pb.HomeResponse|null) => void
|
|
146
|
+
): UnaryResponse;
|
|
147
|
+
home(
|
|
148
|
+
requestMessage: component_gantry_v1_gantry_pb.HomeRequest,
|
|
149
|
+
callback: (error: ServiceError|null, responseMessage: component_gantry_v1_gantry_pb.HomeResponse|null) => void
|
|
150
|
+
): UnaryResponse;
|
|
132
151
|
getLengths(
|
|
133
152
|
requestMessage: component_gantry_v1_gantry_pb.GetLengthsRequest,
|
|
134
153
|
metadata: grpc.Metadata,
|
package/dist/main.es.js
CHANGED
|
@@ -22913,7 +22913,33 @@ var __webpack_exports__ = {};
|
|
|
22913
22913
|
})();
|
|
22914
22914
|
var __webpack_exports__ConnectionClosedError = __webpack_exports__.iJ, __webpack_exports__GRPCError = __webpack_exports__.o;
|
|
22915
22915
|
__webpack_exports__.X$;
|
|
22916
|
-
var __webpack_exports__dialDirect = __webpack_exports__.ry, __webpack_exports__dialWebRTC = __webpack_exports__.WP
|
|
22916
|
+
var __webpack_exports__dialDirect = __webpack_exports__.ry, __webpack_exports__dialWebRTC = __webpack_exports__.WP;
|
|
22917
|
+
const RECONNECTED = "reconnected", DISCONNECTED = "disconnected";
|
|
22918
|
+
class EventDispatcher {
|
|
22919
|
+
listeners = {};
|
|
22920
|
+
on(e, s) {
|
|
22921
|
+
const { listeners: i } = this;
|
|
22922
|
+
i[e] ??= /* @__PURE__ */ new Set(), i[e]?.add(s);
|
|
22923
|
+
}
|
|
22924
|
+
once(e, s) {
|
|
22925
|
+
const i = (u) => {
|
|
22926
|
+
s(u), this.off(e, s);
|
|
22927
|
+
};
|
|
22928
|
+
this.on(e, i);
|
|
22929
|
+
}
|
|
22930
|
+
has(e, s) {
|
|
22931
|
+
return this.listeners[e]?.has(s);
|
|
22932
|
+
}
|
|
22933
|
+
off(e, s) {
|
|
22934
|
+
this.listeners[e]?.delete(s);
|
|
22935
|
+
}
|
|
22936
|
+
emit(e, s) {
|
|
22937
|
+
for (const i of this.listeners[e] ?? [])
|
|
22938
|
+
i(s);
|
|
22939
|
+
}
|
|
22940
|
+
}
|
|
22941
|
+
const events = new EventDispatcher();
|
|
22942
|
+
var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
|
|
22917
22943
|
get exports() {
|
|
22918
22944
|
return grpcWebClient_umdExports;
|
|
22919
22945
|
},
|
|
@@ -28092,7 +28118,7 @@ var EncoderServiceClient_1 = EncoderServiceClient, gantry_pb = {};
|
|
|
28092
28118
|
var g = annotations_pb;
|
|
28093
28119
|
s.object.extend(proto, g);
|
|
28094
28120
|
var p = struct_pb;
|
|
28095
|
-
s.object.extend(proto, p), s.exportSymbol("proto.viam.component.gantry.v1.GetLengthsRequest", null, i), s.exportSymbol("proto.viam.component.gantry.v1.GetLengthsResponse", null, i), s.exportSymbol("proto.viam.component.gantry.v1.GetPositionRequest", null, i), s.exportSymbol("proto.viam.component.gantry.v1.GetPositionResponse", null, i), s.exportSymbol("proto.viam.component.gantry.v1.IsMovingRequest", null, i), s.exportSymbol("proto.viam.component.gantry.v1.IsMovingResponse", null, i), s.exportSymbol("proto.viam.component.gantry.v1.MoveToPositionRequest", null, i), s.exportSymbol("proto.viam.component.gantry.v1.MoveToPositionResponse", null, i), s.exportSymbol("proto.viam.component.gantry.v1.Status", null, i), s.exportSymbol("proto.viam.component.gantry.v1.StopRequest", null, i), s.exportSymbol("proto.viam.component.gantry.v1.StopResponse", null, i), proto.viam.component.gantry.v1.GetPositionRequest = function(o) {
|
|
28121
|
+
s.object.extend(proto, p), s.exportSymbol("proto.viam.component.gantry.v1.GetLengthsRequest", null, i), s.exportSymbol("proto.viam.component.gantry.v1.GetLengthsResponse", null, i), s.exportSymbol("proto.viam.component.gantry.v1.GetPositionRequest", null, i), s.exportSymbol("proto.viam.component.gantry.v1.GetPositionResponse", null, i), s.exportSymbol("proto.viam.component.gantry.v1.HomeRequest", null, i), s.exportSymbol("proto.viam.component.gantry.v1.HomeResponse", null, i), s.exportSymbol("proto.viam.component.gantry.v1.IsMovingRequest", null, i), s.exportSymbol("proto.viam.component.gantry.v1.IsMovingResponse", null, i), s.exportSymbol("proto.viam.component.gantry.v1.MoveToPositionRequest", null, i), s.exportSymbol("proto.viam.component.gantry.v1.MoveToPositionResponse", null, i), s.exportSymbol("proto.viam.component.gantry.v1.Status", null, i), s.exportSymbol("proto.viam.component.gantry.v1.StopRequest", null, i), s.exportSymbol("proto.viam.component.gantry.v1.StopResponse", null, i), proto.viam.component.gantry.v1.GetPositionRequest = function(o) {
|
|
28096
28122
|
e.Message.initialize(this, o, 0, -1, null, null);
|
|
28097
28123
|
}, s.inherits(proto.viam.component.gantry.v1.GetPositionRequest, e.Message), s.DEBUG && !COMPILED && (proto.viam.component.gantry.v1.GetPositionRequest.displayName = "proto.viam.component.gantry.v1.GetPositionRequest"), proto.viam.component.gantry.v1.GetPositionResponse = function(o) {
|
|
28098
28124
|
e.Message.initialize(this, o, 0, -1, proto.viam.component.gantry.v1.GetPositionResponse.repeatedFields_, null);
|
|
@@ -28100,7 +28126,11 @@ var EncoderServiceClient_1 = EncoderServiceClient, gantry_pb = {};
|
|
|
28100
28126
|
e.Message.initialize(this, o, 0, -1, proto.viam.component.gantry.v1.MoveToPositionRequest.repeatedFields_, null);
|
|
28101
28127
|
}, s.inherits(proto.viam.component.gantry.v1.MoveToPositionRequest, e.Message), s.DEBUG && !COMPILED && (proto.viam.component.gantry.v1.MoveToPositionRequest.displayName = "proto.viam.component.gantry.v1.MoveToPositionRequest"), proto.viam.component.gantry.v1.MoveToPositionResponse = function(o) {
|
|
28102
28128
|
e.Message.initialize(this, o, 0, -1, null, null);
|
|
28103
|
-
}, s.inherits(proto.viam.component.gantry.v1.MoveToPositionResponse, e.Message), s.DEBUG && !COMPILED && (proto.viam.component.gantry.v1.MoveToPositionResponse.displayName = "proto.viam.component.gantry.v1.MoveToPositionResponse"), proto.viam.component.gantry.v1.
|
|
28129
|
+
}, s.inherits(proto.viam.component.gantry.v1.MoveToPositionResponse, e.Message), s.DEBUG && !COMPILED && (proto.viam.component.gantry.v1.MoveToPositionResponse.displayName = "proto.viam.component.gantry.v1.MoveToPositionResponse"), proto.viam.component.gantry.v1.HomeRequest = function(o) {
|
|
28130
|
+
e.Message.initialize(this, o, 0, -1, null, null);
|
|
28131
|
+
}, s.inherits(proto.viam.component.gantry.v1.HomeRequest, e.Message), s.DEBUG && !COMPILED && (proto.viam.component.gantry.v1.HomeRequest.displayName = "proto.viam.component.gantry.v1.HomeRequest"), proto.viam.component.gantry.v1.HomeResponse = function(o) {
|
|
28132
|
+
e.Message.initialize(this, o, 0, -1, null, null);
|
|
28133
|
+
}, s.inherits(proto.viam.component.gantry.v1.HomeResponse, e.Message), s.DEBUG && !COMPILED && (proto.viam.component.gantry.v1.HomeResponse.displayName = "proto.viam.component.gantry.v1.HomeResponse"), proto.viam.component.gantry.v1.GetLengthsRequest = function(o) {
|
|
28104
28134
|
e.Message.initialize(this, o, 0, -1, null, null);
|
|
28105
28135
|
}, s.inherits(proto.viam.component.gantry.v1.GetLengthsRequest, e.Message), s.DEBUG && !COMPILED && (proto.viam.component.gantry.v1.GetLengthsRequest.displayName = "proto.viam.component.gantry.v1.GetLengthsRequest"), proto.viam.component.gantry.v1.GetLengthsResponse = function(o) {
|
|
28106
28136
|
e.Message.initialize(this, o, 0, -1, proto.viam.component.gantry.v1.GetLengthsResponse.repeatedFields_, null);
|
|
@@ -28224,12 +28254,13 @@ var EncoderServiceClient_1 = EncoderServiceClient, gantry_pb = {};
|
|
|
28224
28254
|
return e.Message.addToRepeatedField(this, 1, o, r);
|
|
28225
28255
|
}, proto.viam.component.gantry.v1.GetPositionResponse.prototype.clearPositionsMmList = function() {
|
|
28226
28256
|
return this.setPositionsMmList([]);
|
|
28227
|
-
}, proto.viam.component.gantry.v1.MoveToPositionRequest.repeatedFields_ = [2], e.Message.GENERATE_TO_OBJECT && (proto.viam.component.gantry.v1.MoveToPositionRequest.prototype.toObject = function(o) {
|
|
28257
|
+
}, proto.viam.component.gantry.v1.MoveToPositionRequest.repeatedFields_ = [2, 3], e.Message.GENERATE_TO_OBJECT && (proto.viam.component.gantry.v1.MoveToPositionRequest.prototype.toObject = function(o) {
|
|
28228
28258
|
return proto.viam.component.gantry.v1.MoveToPositionRequest.toObject(o, this);
|
|
28229
28259
|
}, proto.viam.component.gantry.v1.MoveToPositionRequest.toObject = function(o, r) {
|
|
28230
28260
|
var n, l = {
|
|
28231
28261
|
name: e.Message.getFieldWithDefault(r, 1, ""),
|
|
28232
28262
|
positionsMmList: (n = e.Message.getRepeatedFloatingPointField(r, 2)) == null ? void 0 : n,
|
|
28263
|
+
speedsMmPerSecList: (n = e.Message.getRepeatedFloatingPointField(r, 3)) == null ? void 0 : n,
|
|
28233
28264
|
extra: (n = r.getExtra()) && p.Struct.toObject(o, n)
|
|
28234
28265
|
};
|
|
28235
28266
|
return o && (l.$jspbMessageInstance = r), l;
|
|
@@ -28248,11 +28279,18 @@ var EncoderServiceClient_1 = EncoderServiceClient, gantry_pb = {};
|
|
|
28248
28279
|
o.setName(d);
|
|
28249
28280
|
break;
|
|
28250
28281
|
case 2:
|
|
28251
|
-
for (var
|
|
28282
|
+
for (var c = (
|
|
28252
28283
|
/** @type {!Array<number>} */
|
|
28253
28284
|
r.isDelimited() ? r.readPackedDouble() : [r.readDouble()]
|
|
28254
|
-
),
|
|
28255
|
-
o.addPositionsMm(l
|
|
28285
|
+
), l = 0; l < c.length; l++)
|
|
28286
|
+
o.addPositionsMm(c[l]);
|
|
28287
|
+
break;
|
|
28288
|
+
case 3:
|
|
28289
|
+
for (var c = (
|
|
28290
|
+
/** @type {!Array<number>} */
|
|
28291
|
+
r.isDelimited() ? r.readPackedDouble() : [r.readDouble()]
|
|
28292
|
+
), l = 0; l < c.length; l++)
|
|
28293
|
+
o.addSpeedsMmPerSec(c[l]);
|
|
28256
28294
|
break;
|
|
28257
28295
|
case 99:
|
|
28258
28296
|
var d = new p.Struct();
|
|
@@ -28275,6 +28313,9 @@ var EncoderServiceClient_1 = EncoderServiceClient, gantry_pb = {};
|
|
|
28275
28313
|
), n = o.getPositionsMmList(), n.length > 0 && r.writePackedDouble(
|
|
28276
28314
|
2,
|
|
28277
28315
|
n
|
|
28316
|
+
), n = o.getSpeedsMmPerSecList(), n.length > 0 && r.writePackedDouble(
|
|
28317
|
+
3,
|
|
28318
|
+
n
|
|
28278
28319
|
), n = o.getExtra(), n != null && r.writeMessage(
|
|
28279
28320
|
99,
|
|
28280
28321
|
n,
|
|
@@ -28298,6 +28339,17 @@ var EncoderServiceClient_1 = EncoderServiceClient, gantry_pb = {};
|
|
|
28298
28339
|
return e.Message.addToRepeatedField(this, 2, o, r);
|
|
28299
28340
|
}, proto.viam.component.gantry.v1.MoveToPositionRequest.prototype.clearPositionsMmList = function() {
|
|
28300
28341
|
return this.setPositionsMmList([]);
|
|
28342
|
+
}, proto.viam.component.gantry.v1.MoveToPositionRequest.prototype.getSpeedsMmPerSecList = function() {
|
|
28343
|
+
return (
|
|
28344
|
+
/** @type {!Array<number>} */
|
|
28345
|
+
e.Message.getRepeatedFloatingPointField(this, 3)
|
|
28346
|
+
);
|
|
28347
|
+
}, proto.viam.component.gantry.v1.MoveToPositionRequest.prototype.setSpeedsMmPerSecList = function(o) {
|
|
28348
|
+
return e.Message.setField(this, 3, o || []);
|
|
28349
|
+
}, proto.viam.component.gantry.v1.MoveToPositionRequest.prototype.addSpeedsMmPerSec = function(o, r) {
|
|
28350
|
+
return e.Message.addToRepeatedField(this, 3, o, r);
|
|
28351
|
+
}, proto.viam.component.gantry.v1.MoveToPositionRequest.prototype.clearSpeedsMmPerSecList = function() {
|
|
28352
|
+
return this.setSpeedsMmPerSecList([]);
|
|
28301
28353
|
}, proto.viam.component.gantry.v1.MoveToPositionRequest.prototype.getExtra = function() {
|
|
28302
28354
|
return (
|
|
28303
28355
|
/** @type{?proto.google.protobuf.Struct} */
|
|
@@ -28331,6 +28383,112 @@ var EncoderServiceClient_1 = EncoderServiceClient, gantry_pb = {};
|
|
|
28331
28383
|
var o = new e.BinaryWriter();
|
|
28332
28384
|
return proto.viam.component.gantry.v1.MoveToPositionResponse.serializeBinaryToWriter(this, o), o.getResultBuffer();
|
|
28333
28385
|
}, proto.viam.component.gantry.v1.MoveToPositionResponse.serializeBinaryToWriter = function(o, r) {
|
|
28386
|
+
}, e.Message.GENERATE_TO_OBJECT && (proto.viam.component.gantry.v1.HomeRequest.prototype.toObject = function(o) {
|
|
28387
|
+
return proto.viam.component.gantry.v1.HomeRequest.toObject(o, this);
|
|
28388
|
+
}, proto.viam.component.gantry.v1.HomeRequest.toObject = function(o, r) {
|
|
28389
|
+
var n, l = {
|
|
28390
|
+
name: e.Message.getFieldWithDefault(r, 1, ""),
|
|
28391
|
+
extra: (n = r.getExtra()) && p.Struct.toObject(o, n)
|
|
28392
|
+
};
|
|
28393
|
+
return o && (l.$jspbMessageInstance = r), l;
|
|
28394
|
+
}), proto.viam.component.gantry.v1.HomeRequest.deserializeBinary = function(o) {
|
|
28395
|
+
var r = new e.BinaryReader(o), n = new proto.viam.component.gantry.v1.HomeRequest();
|
|
28396
|
+
return proto.viam.component.gantry.v1.HomeRequest.deserializeBinaryFromReader(n, r);
|
|
28397
|
+
}, proto.viam.component.gantry.v1.HomeRequest.deserializeBinaryFromReader = function(o, r) {
|
|
28398
|
+
for (; r.nextField() && !r.isEndGroup(); ) {
|
|
28399
|
+
var n = r.getFieldNumber();
|
|
28400
|
+
switch (n) {
|
|
28401
|
+
case 1:
|
|
28402
|
+
var l = (
|
|
28403
|
+
/** @type {string} */
|
|
28404
|
+
r.readString()
|
|
28405
|
+
);
|
|
28406
|
+
o.setName(l);
|
|
28407
|
+
break;
|
|
28408
|
+
case 99:
|
|
28409
|
+
var l = new p.Struct();
|
|
28410
|
+
r.readMessage(l, p.Struct.deserializeBinaryFromReader), o.setExtra(l);
|
|
28411
|
+
break;
|
|
28412
|
+
default:
|
|
28413
|
+
r.skipField();
|
|
28414
|
+
break;
|
|
28415
|
+
}
|
|
28416
|
+
}
|
|
28417
|
+
return o;
|
|
28418
|
+
}, proto.viam.component.gantry.v1.HomeRequest.prototype.serializeBinary = function() {
|
|
28419
|
+
var o = new e.BinaryWriter();
|
|
28420
|
+
return proto.viam.component.gantry.v1.HomeRequest.serializeBinaryToWriter(this, o), o.getResultBuffer();
|
|
28421
|
+
}, proto.viam.component.gantry.v1.HomeRequest.serializeBinaryToWriter = function(o, r) {
|
|
28422
|
+
var n = void 0;
|
|
28423
|
+
n = o.getName(), n.length > 0 && r.writeString(
|
|
28424
|
+
1,
|
|
28425
|
+
n
|
|
28426
|
+
), n = o.getExtra(), n != null && r.writeMessage(
|
|
28427
|
+
99,
|
|
28428
|
+
n,
|
|
28429
|
+
p.Struct.serializeBinaryToWriter
|
|
28430
|
+
);
|
|
28431
|
+
}, proto.viam.component.gantry.v1.HomeRequest.prototype.getName = function() {
|
|
28432
|
+
return (
|
|
28433
|
+
/** @type {string} */
|
|
28434
|
+
e.Message.getFieldWithDefault(this, 1, "")
|
|
28435
|
+
);
|
|
28436
|
+
}, proto.viam.component.gantry.v1.HomeRequest.prototype.setName = function(o) {
|
|
28437
|
+
return e.Message.setProto3StringField(this, 1, o);
|
|
28438
|
+
}, proto.viam.component.gantry.v1.HomeRequest.prototype.getExtra = function() {
|
|
28439
|
+
return (
|
|
28440
|
+
/** @type{?proto.google.protobuf.Struct} */
|
|
28441
|
+
e.Message.getWrapperField(this, p.Struct, 99)
|
|
28442
|
+
);
|
|
28443
|
+
}, proto.viam.component.gantry.v1.HomeRequest.prototype.setExtra = function(o) {
|
|
28444
|
+
return e.Message.setWrapperField(this, 99, o);
|
|
28445
|
+
}, proto.viam.component.gantry.v1.HomeRequest.prototype.clearExtra = function() {
|
|
28446
|
+
return this.setExtra(void 0);
|
|
28447
|
+
}, proto.viam.component.gantry.v1.HomeRequest.prototype.hasExtra = function() {
|
|
28448
|
+
return e.Message.getField(this, 99) != null;
|
|
28449
|
+
}, e.Message.GENERATE_TO_OBJECT && (proto.viam.component.gantry.v1.HomeResponse.prototype.toObject = function(o) {
|
|
28450
|
+
return proto.viam.component.gantry.v1.HomeResponse.toObject(o, this);
|
|
28451
|
+
}, proto.viam.component.gantry.v1.HomeResponse.toObject = function(o, r) {
|
|
28452
|
+
var n = {
|
|
28453
|
+
homed: e.Message.getBooleanFieldWithDefault(r, 1, !1)
|
|
28454
|
+
};
|
|
28455
|
+
return o && (n.$jspbMessageInstance = r), n;
|
|
28456
|
+
}), proto.viam.component.gantry.v1.HomeResponse.deserializeBinary = function(o) {
|
|
28457
|
+
var r = new e.BinaryReader(o), n = new proto.viam.component.gantry.v1.HomeResponse();
|
|
28458
|
+
return proto.viam.component.gantry.v1.HomeResponse.deserializeBinaryFromReader(n, r);
|
|
28459
|
+
}, proto.viam.component.gantry.v1.HomeResponse.deserializeBinaryFromReader = function(o, r) {
|
|
28460
|
+
for (; r.nextField() && !r.isEndGroup(); ) {
|
|
28461
|
+
var n = r.getFieldNumber();
|
|
28462
|
+
switch (n) {
|
|
28463
|
+
case 1:
|
|
28464
|
+
var l = (
|
|
28465
|
+
/** @type {boolean} */
|
|
28466
|
+
r.readBool()
|
|
28467
|
+
);
|
|
28468
|
+
o.setHomed(l);
|
|
28469
|
+
break;
|
|
28470
|
+
default:
|
|
28471
|
+
r.skipField();
|
|
28472
|
+
break;
|
|
28473
|
+
}
|
|
28474
|
+
}
|
|
28475
|
+
return o;
|
|
28476
|
+
}, proto.viam.component.gantry.v1.HomeResponse.prototype.serializeBinary = function() {
|
|
28477
|
+
var o = new e.BinaryWriter();
|
|
28478
|
+
return proto.viam.component.gantry.v1.HomeResponse.serializeBinaryToWriter(this, o), o.getResultBuffer();
|
|
28479
|
+
}, proto.viam.component.gantry.v1.HomeResponse.serializeBinaryToWriter = function(o, r) {
|
|
28480
|
+
var n = void 0;
|
|
28481
|
+
n = o.getHomed(), n && r.writeBool(
|
|
28482
|
+
1,
|
|
28483
|
+
n
|
|
28484
|
+
);
|
|
28485
|
+
}, proto.viam.component.gantry.v1.HomeResponse.prototype.getHomed = function() {
|
|
28486
|
+
return (
|
|
28487
|
+
/** @type {boolean} */
|
|
28488
|
+
e.Message.getBooleanFieldWithDefault(this, 1, !1)
|
|
28489
|
+
);
|
|
28490
|
+
}, proto.viam.component.gantry.v1.HomeResponse.prototype.setHomed = function(o) {
|
|
28491
|
+
return e.Message.setProto3BooleanField(this, 1, o);
|
|
28334
28492
|
}, e.Message.GENERATE_TO_OBJECT && (proto.viam.component.gantry.v1.GetLengthsRequest.prototype.toObject = function(o) {
|
|
28335
28493
|
return proto.viam.component.gantry.v1.GetLengthsRequest.toObject(o, this);
|
|
28336
28494
|
}, proto.viam.component.gantry.v1.GetLengthsRequest.toObject = function(o, r) {
|
|
@@ -28722,6 +28880,14 @@ GantryService.MoveToPosition = {
|
|
|
28722
28880
|
requestType: component_gantry_v1_gantry_pb.MoveToPositionRequest,
|
|
28723
28881
|
responseType: component_gantry_v1_gantry_pb.MoveToPositionResponse
|
|
28724
28882
|
};
|
|
28883
|
+
GantryService.Home = {
|
|
28884
|
+
methodName: "Home",
|
|
28885
|
+
service: GantryService,
|
|
28886
|
+
requestStream: !1,
|
|
28887
|
+
responseStream: !1,
|
|
28888
|
+
requestType: component_gantry_v1_gantry_pb.HomeRequest,
|
|
28889
|
+
responseType: component_gantry_v1_gantry_pb.HomeResponse
|
|
28890
|
+
};
|
|
28725
28891
|
GantryService.GetLengths = {
|
|
28726
28892
|
methodName: "GetLengths",
|
|
28727
28893
|
service: GantryService,
|
|
@@ -28811,6 +28977,29 @@ GantryServiceClient.prototype.moveToPosition = function t(e, s, i) {
|
|
|
28811
28977
|
}
|
|
28812
28978
|
};
|
|
28813
28979
|
};
|
|
28980
|
+
GantryServiceClient.prototype.home = function t(e, s, i) {
|
|
28981
|
+
arguments.length === 2 && (i = arguments[1]);
|
|
28982
|
+
var u = grpc$g.unary(GantryService.Home, {
|
|
28983
|
+
request: e,
|
|
28984
|
+
host: this.serviceHost,
|
|
28985
|
+
metadata: s,
|
|
28986
|
+
transport: this.options.transport,
|
|
28987
|
+
debug: this.options.debug,
|
|
28988
|
+
onEnd: function(g) {
|
|
28989
|
+
if (i)
|
|
28990
|
+
if (g.status !== grpc$g.Code.OK) {
|
|
28991
|
+
var p = new Error(g.statusMessage);
|
|
28992
|
+
p.code = g.status, p.metadata = g.trailers, i(p, null);
|
|
28993
|
+
} else
|
|
28994
|
+
i(null, g.message);
|
|
28995
|
+
}
|
|
28996
|
+
});
|
|
28997
|
+
return {
|
|
28998
|
+
cancel: function() {
|
|
28999
|
+
i = null, u.close();
|
|
29000
|
+
}
|
|
29001
|
+
};
|
|
29002
|
+
};
|
|
28814
29003
|
GantryServiceClient.prototype.getLengths = function t(e, s, i) {
|
|
28815
29004
|
arguments.length === 2 && (i = arguments[1]);
|
|
28816
29005
|
var u = grpc$g.unary(GantryService.GetLengths, {
|
|
@@ -39156,30 +39345,6 @@ VisionServiceClient.prototype.doCommand = function t(e, s, i) {
|
|
|
39156
39345
|
};
|
|
39157
39346
|
};
|
|
39158
39347
|
var VisionServiceClient_1 = VisionServiceClient;
|
|
39159
|
-
class EventDispatcher {
|
|
39160
|
-
listeners = {};
|
|
39161
|
-
on(e, s) {
|
|
39162
|
-
const { listeners: i } = this;
|
|
39163
|
-
i[e] ??= /* @__PURE__ */ new Set(), i[e]?.add(s);
|
|
39164
|
-
}
|
|
39165
|
-
once(e, s) {
|
|
39166
|
-
const i = (u) => {
|
|
39167
|
-
s(u), this.off(e, s);
|
|
39168
|
-
};
|
|
39169
|
-
this.on(e, i);
|
|
39170
|
-
}
|
|
39171
|
-
has(e, s) {
|
|
39172
|
-
return this.listeners[e]?.has(s);
|
|
39173
|
-
}
|
|
39174
|
-
off(e, s) {
|
|
39175
|
-
this.listeners[e]?.delete(s);
|
|
39176
|
-
}
|
|
39177
|
-
emit(e, s) {
|
|
39178
|
-
for (const i of this.listeners[e] ?? [])
|
|
39179
|
-
i(s);
|
|
39180
|
-
}
|
|
39181
|
-
}
|
|
39182
|
-
const events = new EventDispatcher();
|
|
39183
39348
|
class ViamResponseStream extends EventDispatcher {
|
|
39184
39349
|
stream;
|
|
39185
39350
|
constructor(e) {
|
|
@@ -39346,7 +39511,7 @@ class SessionManager {
|
|
|
39346
39511
|
}
|
|
39347
39512
|
}
|
|
39348
39513
|
}
|
|
39349
|
-
class RobotClient {
|
|
39514
|
+
class RobotClient extends EventDispatcher {
|
|
39350
39515
|
serviceHost;
|
|
39351
39516
|
webrtcOptions;
|
|
39352
39517
|
sessionOptions;
|
|
@@ -39375,14 +39540,30 @@ class RobotClient {
|
|
|
39375
39540
|
servoServiceClient;
|
|
39376
39541
|
slamServiceClient;
|
|
39377
39542
|
constructor(e, s, i) {
|
|
39378
|
-
this.serviceHost = e, this.webrtcOptions = s, this.sessionOptions = i, this.sessionManager = new SessionManager(
|
|
39543
|
+
super(), this.serviceHost = e, this.webrtcOptions = s, this.sessionOptions = i, this.sessionManager = new SessionManager(
|
|
39379
39544
|
e,
|
|
39380
39545
|
(u) => {
|
|
39381
39546
|
if (!this.transportFactory)
|
|
39382
39547
|
throw new Error(RobotClient.notConnectedYetStr);
|
|
39383
39548
|
return this.transportFactory(u);
|
|
39384
39549
|
}
|
|
39385
|
-
)
|
|
39550
|
+
), events.on(RECONNECTED, () => {
|
|
39551
|
+
this.emit(RECONNECTED, {});
|
|
39552
|
+
}), events.on(DISCONNECTED, () => {
|
|
39553
|
+
if (this.emit(DISCONNECTED, {}), this.webrtcOptions?.noReconnect)
|
|
39554
|
+
return;
|
|
39555
|
+
let u = 0;
|
|
39556
|
+
console.debug("connection closed, will try to reconnect"), backOff_1(
|
|
39557
|
+
() => this.connect().then(
|
|
39558
|
+
() => {
|
|
39559
|
+
console.debug("reconnected successfully!"), events.emit(RECONNECTED, {});
|
|
39560
|
+
},
|
|
39561
|
+
(g) => {
|
|
39562
|
+
throw console.debug(`failed to reconnect - retries count: ${u}`), u += 1, g;
|
|
39563
|
+
}
|
|
39564
|
+
)
|
|
39565
|
+
);
|
|
39566
|
+
});
|
|
39386
39567
|
}
|
|
39387
39568
|
get sessionId() {
|
|
39388
39569
|
return this.sessionManager.sessionID;
|
|
@@ -39488,6 +39669,9 @@ class RobotClient {
|
|
|
39488
39669
|
await this.connecting;
|
|
39489
39670
|
this.peerConn && (this.peerConn.close(), this.peerConn = void 0), this.sessionManager.reset();
|
|
39490
39671
|
}
|
|
39672
|
+
isConnected() {
|
|
39673
|
+
return this.peerConn?.iceConnectionState === "connected";
|
|
39674
|
+
}
|
|
39491
39675
|
async connect(e = this.savedAuthEntity, s = this.savedCreds) {
|
|
39492
39676
|
if (this.connecting) {
|
|
39493
39677
|
for (; this.connecting; )
|
|
@@ -39514,23 +39698,7 @@ class RobotClient {
|
|
|
39514
39698
|
i
|
|
39515
39699
|
);
|
|
39516
39700
|
this.peerConn = p.peerConnection, this.peerConn.addEventListener("iceconnectionstatechange", () => {
|
|
39517
|
-
|
|
39518
|
-
if (this.webrtcOptions?.noReconnect)
|
|
39519
|
-
return;
|
|
39520
|
-
let o = 0;
|
|
39521
|
-
console.debug("connection closed, will try to reconnect"), backOff_1(
|
|
39522
|
-
() => this.connect().then(
|
|
39523
|
-
() => {
|
|
39524
|
-
console.debug("reconnected successfully!"), events.emit("reconnected", {});
|
|
39525
|
-
},
|
|
39526
|
-
(r) => {
|
|
39527
|
-
throw console.debug(
|
|
39528
|
-
`failed to reconnect - retries count: ${o}`
|
|
39529
|
-
), o += 1, r;
|
|
39530
|
-
}
|
|
39531
|
-
)
|
|
39532
|
-
);
|
|
39533
|
-
}
|
|
39701
|
+
this.peerConn?.iceConnectionState === "connected" ? events.emit(RECONNECTED, {}) : this.peerConn?.iceConnectionState === "closed" && (console.log("emit disconnected"), events.emit(DISCONNECTED, {}));
|
|
39534
39702
|
}), this.transportFactory = p.transportFactory, p.peerConnection.ontrack = (o) => {
|
|
39535
39703
|
const [r] = o.streams;
|
|
39536
39704
|
if (!r)
|
|
@@ -42487,7 +42655,7 @@ class ServoClient {
|
|
|
42487
42655
|
return doCommandFromClient(s, this.name, e, this.options);
|
|
42488
42656
|
}
|
|
42489
42657
|
}
|
|
42490
|
-
const version = "0.2.
|
|
42658
|
+
const version = "0.2.2";
|
|
42491
42659
|
export {
|
|
42492
42660
|
ArmClient,
|
|
42493
42661
|
BaseClient,
|