@viamrobotics/sdk 0.2.4 → 0.2.5-next.1
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/power-sensor/client.d.ts +20 -0
- package/dist/components/power-sensor/power-sensor.d.ts +17 -0
- package/dist/components/powersensor.d.ts +2 -0
- package/dist/gen/component/powersensor/v1/powersensor_pb.d.ts +154 -0
- package/dist/gen/component/powersensor/v1/powersensor_pb_service.d.ts +121 -0
- package/dist/gen/service/mlmodel/v1/mlmodel_pb.d.ts +360 -0
- package/dist/main.d.ts +15 -38
- package/dist/main.es.js +1242 -473
- package/dist/main.umd.js +8 -6
- package/dist/robot/client.d.ts +12 -2
- package/dist/robot/dial.d.ts +4 -1
- package/dist/robot/grpc-connection-manager.d.ts +12 -0
- package/dist/services/motion/client.d.ts +2 -1
- package/dist/services/motion/motion.d.ts +32 -10
- package/dist/services/navigation/client.d.ts +25 -0
- package/dist/services/navigation/navigation.d.ts +36 -0
- package/dist/services/navigation/types.d.ts +3 -0
- package/dist/services/navigation.d.ts +3 -0
- package/dist/services/slam/client.d.ts +21 -0
- package/dist/services/slam/slam.d.ts +22 -0
- package/dist/services/slam/types.d.ts +2 -0
- package/dist/services/slam.d.ts +3 -0
- package/dist/types.d.ts +1 -0
- package/dist/utils.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RobotClient } from '../../robot';
|
|
2
|
+
import type { Options, StructType } from '../../types';
|
|
3
|
+
import type { PowerSensor, PowerSensorReadings } from './power-sensor';
|
|
4
|
+
/**
|
|
5
|
+
* A gRPC-web client for the MovementSensor component.
|
|
6
|
+
*
|
|
7
|
+
* @group Clients
|
|
8
|
+
*/
|
|
9
|
+
export declare class PowerSensorClient implements PowerSensor {
|
|
10
|
+
private client;
|
|
11
|
+
private readonly name;
|
|
12
|
+
private readonly options;
|
|
13
|
+
constructor(client: RobotClient, name: string, options?: Options);
|
|
14
|
+
private get powersensorService();
|
|
15
|
+
getVoltage(extra?: {}): Promise<readonly [number, boolean]>;
|
|
16
|
+
getCurrent(extra?: {}): Promise<readonly [number, boolean]>;
|
|
17
|
+
getPower(extra?: {}): Promise<number>;
|
|
18
|
+
getReadings(extra?: {}): Promise<PowerSensorReadings>;
|
|
19
|
+
doCommand(command: StructType): Promise<StructType>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { StructType } from '../../types';
|
|
2
|
+
import type { Sensor } from '../sensor';
|
|
3
|
+
export type PowerSensorReadings = {
|
|
4
|
+
voltage?: number;
|
|
5
|
+
current?: number;
|
|
6
|
+
isAc?: boolean;
|
|
7
|
+
power?: number;
|
|
8
|
+
};
|
|
9
|
+
/** Represents any sensor that reports voltage, current, and/or power */
|
|
10
|
+
export interface PowerSensor extends Sensor {
|
|
11
|
+
/** Get Voltage in volts and a boolean that returns true if AC */
|
|
12
|
+
getVoltage(extra?: StructType): Promise<readonly [number, boolean]>;
|
|
13
|
+
/** Get Current in amps and a boolean that returns true if AC */
|
|
14
|
+
getCurrent(extra?: StructType): Promise<readonly [number, boolean]>;
|
|
15
|
+
/** Get Power in watts */
|
|
16
|
+
getPower(extra?: StructType): Promise<number>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// package: viam.component.powersensor.v1
|
|
2
|
+
// file: component/powersensor/v1/powersensor.proto
|
|
3
|
+
|
|
4
|
+
import * as jspb from "google-protobuf";
|
|
5
|
+
import * as common_v1_common_pb from "../../../common/v1/common_pb";
|
|
6
|
+
import * as google_api_annotations_pb from "../../../google/api/annotations_pb";
|
|
7
|
+
import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb";
|
|
8
|
+
|
|
9
|
+
export class GetVoltageRequest extends jspb.Message {
|
|
10
|
+
getName(): string;
|
|
11
|
+
setName(value: string): void;
|
|
12
|
+
|
|
13
|
+
hasExtra(): boolean;
|
|
14
|
+
clearExtra(): void;
|
|
15
|
+
getExtra(): google_protobuf_struct_pb.Struct | undefined;
|
|
16
|
+
setExtra(value?: google_protobuf_struct_pb.Struct): void;
|
|
17
|
+
|
|
18
|
+
serializeBinary(): Uint8Array;
|
|
19
|
+
toObject(includeInstance?: boolean): GetVoltageRequest.AsObject;
|
|
20
|
+
static toObject(includeInstance: boolean, msg: GetVoltageRequest): GetVoltageRequest.AsObject;
|
|
21
|
+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
22
|
+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
23
|
+
static serializeBinaryToWriter(message: GetVoltageRequest, writer: jspb.BinaryWriter): void;
|
|
24
|
+
static deserializeBinary(bytes: Uint8Array): GetVoltageRequest;
|
|
25
|
+
static deserializeBinaryFromReader(message: GetVoltageRequest, reader: jspb.BinaryReader): GetVoltageRequest;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export namespace GetVoltageRequest {
|
|
29
|
+
export type AsObject = {
|
|
30
|
+
name: string,
|
|
31
|
+
extra?: google_protobuf_struct_pb.Struct.AsObject,
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export class GetVoltageResponse extends jspb.Message {
|
|
36
|
+
getVolts(): number;
|
|
37
|
+
setVolts(value: number): void;
|
|
38
|
+
|
|
39
|
+
getIsAc(): boolean;
|
|
40
|
+
setIsAc(value: boolean): void;
|
|
41
|
+
|
|
42
|
+
serializeBinary(): Uint8Array;
|
|
43
|
+
toObject(includeInstance?: boolean): GetVoltageResponse.AsObject;
|
|
44
|
+
static toObject(includeInstance: boolean, msg: GetVoltageResponse): GetVoltageResponse.AsObject;
|
|
45
|
+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
46
|
+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
47
|
+
static serializeBinaryToWriter(message: GetVoltageResponse, writer: jspb.BinaryWriter): void;
|
|
48
|
+
static deserializeBinary(bytes: Uint8Array): GetVoltageResponse;
|
|
49
|
+
static deserializeBinaryFromReader(message: GetVoltageResponse, reader: jspb.BinaryReader): GetVoltageResponse;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export namespace GetVoltageResponse {
|
|
53
|
+
export type AsObject = {
|
|
54
|
+
volts: number,
|
|
55
|
+
isAc: boolean,
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export class GetCurrentRequest extends jspb.Message {
|
|
60
|
+
getName(): string;
|
|
61
|
+
setName(value: string): void;
|
|
62
|
+
|
|
63
|
+
hasExtra(): boolean;
|
|
64
|
+
clearExtra(): void;
|
|
65
|
+
getExtra(): google_protobuf_struct_pb.Struct | undefined;
|
|
66
|
+
setExtra(value?: google_protobuf_struct_pb.Struct): void;
|
|
67
|
+
|
|
68
|
+
serializeBinary(): Uint8Array;
|
|
69
|
+
toObject(includeInstance?: boolean): GetCurrentRequest.AsObject;
|
|
70
|
+
static toObject(includeInstance: boolean, msg: GetCurrentRequest): GetCurrentRequest.AsObject;
|
|
71
|
+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
72
|
+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
73
|
+
static serializeBinaryToWriter(message: GetCurrentRequest, writer: jspb.BinaryWriter): void;
|
|
74
|
+
static deserializeBinary(bytes: Uint8Array): GetCurrentRequest;
|
|
75
|
+
static deserializeBinaryFromReader(message: GetCurrentRequest, reader: jspb.BinaryReader): GetCurrentRequest;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export namespace GetCurrentRequest {
|
|
79
|
+
export type AsObject = {
|
|
80
|
+
name: string,
|
|
81
|
+
extra?: google_protobuf_struct_pb.Struct.AsObject,
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export class GetCurrentResponse extends jspb.Message {
|
|
86
|
+
getAmperes(): number;
|
|
87
|
+
setAmperes(value: number): void;
|
|
88
|
+
|
|
89
|
+
getIsAc(): boolean;
|
|
90
|
+
setIsAc(value: boolean): void;
|
|
91
|
+
|
|
92
|
+
serializeBinary(): Uint8Array;
|
|
93
|
+
toObject(includeInstance?: boolean): GetCurrentResponse.AsObject;
|
|
94
|
+
static toObject(includeInstance: boolean, msg: GetCurrentResponse): GetCurrentResponse.AsObject;
|
|
95
|
+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
96
|
+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
97
|
+
static serializeBinaryToWriter(message: GetCurrentResponse, writer: jspb.BinaryWriter): void;
|
|
98
|
+
static deserializeBinary(bytes: Uint8Array): GetCurrentResponse;
|
|
99
|
+
static deserializeBinaryFromReader(message: GetCurrentResponse, reader: jspb.BinaryReader): GetCurrentResponse;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export namespace GetCurrentResponse {
|
|
103
|
+
export type AsObject = {
|
|
104
|
+
amperes: number,
|
|
105
|
+
isAc: boolean,
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export class GetPowerRequest extends jspb.Message {
|
|
110
|
+
getName(): string;
|
|
111
|
+
setName(value: string): void;
|
|
112
|
+
|
|
113
|
+
hasExtra(): boolean;
|
|
114
|
+
clearExtra(): void;
|
|
115
|
+
getExtra(): google_protobuf_struct_pb.Struct | undefined;
|
|
116
|
+
setExtra(value?: google_protobuf_struct_pb.Struct): void;
|
|
117
|
+
|
|
118
|
+
serializeBinary(): Uint8Array;
|
|
119
|
+
toObject(includeInstance?: boolean): GetPowerRequest.AsObject;
|
|
120
|
+
static toObject(includeInstance: boolean, msg: GetPowerRequest): GetPowerRequest.AsObject;
|
|
121
|
+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
122
|
+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
123
|
+
static serializeBinaryToWriter(message: GetPowerRequest, writer: jspb.BinaryWriter): void;
|
|
124
|
+
static deserializeBinary(bytes: Uint8Array): GetPowerRequest;
|
|
125
|
+
static deserializeBinaryFromReader(message: GetPowerRequest, reader: jspb.BinaryReader): GetPowerRequest;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export namespace GetPowerRequest {
|
|
129
|
+
export type AsObject = {
|
|
130
|
+
name: string,
|
|
131
|
+
extra?: google_protobuf_struct_pb.Struct.AsObject,
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export class GetPowerResponse extends jspb.Message {
|
|
136
|
+
getWatts(): number;
|
|
137
|
+
setWatts(value: number): void;
|
|
138
|
+
|
|
139
|
+
serializeBinary(): Uint8Array;
|
|
140
|
+
toObject(includeInstance?: boolean): GetPowerResponse.AsObject;
|
|
141
|
+
static toObject(includeInstance: boolean, msg: GetPowerResponse): GetPowerResponse.AsObject;
|
|
142
|
+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
143
|
+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
144
|
+
static serializeBinaryToWriter(message: GetPowerResponse, writer: jspb.BinaryWriter): void;
|
|
145
|
+
static deserializeBinary(bytes: Uint8Array): GetPowerResponse;
|
|
146
|
+
static deserializeBinaryFromReader(message: GetPowerResponse, reader: jspb.BinaryReader): GetPowerResponse;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export namespace GetPowerResponse {
|
|
150
|
+
export type AsObject = {
|
|
151
|
+
watts: number,
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// package: viam.component.powersensor.v1
|
|
2
|
+
// file: component/powersensor/v1/powersensor.proto
|
|
3
|
+
|
|
4
|
+
import * as component_powersensor_v1_powersensor_pb from "../../../component/powersensor/v1/powersensor_pb";
|
|
5
|
+
import * as common_v1_common_pb from "../../../common/v1/common_pb";
|
|
6
|
+
import {grpc} from "@improbable-eng/grpc-web";
|
|
7
|
+
|
|
8
|
+
type PowerSensorServiceGetVoltage = {
|
|
9
|
+
readonly methodName: string;
|
|
10
|
+
readonly service: typeof PowerSensorService;
|
|
11
|
+
readonly requestStream: false;
|
|
12
|
+
readonly responseStream: false;
|
|
13
|
+
readonly requestType: typeof component_powersensor_v1_powersensor_pb.GetVoltageRequest;
|
|
14
|
+
readonly responseType: typeof component_powersensor_v1_powersensor_pb.GetVoltageResponse;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type PowerSensorServiceGetCurrent = {
|
|
18
|
+
readonly methodName: string;
|
|
19
|
+
readonly service: typeof PowerSensorService;
|
|
20
|
+
readonly requestStream: false;
|
|
21
|
+
readonly responseStream: false;
|
|
22
|
+
readonly requestType: typeof component_powersensor_v1_powersensor_pb.GetCurrentRequest;
|
|
23
|
+
readonly responseType: typeof component_powersensor_v1_powersensor_pb.GetCurrentResponse;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type PowerSensorServiceGetPower = {
|
|
27
|
+
readonly methodName: string;
|
|
28
|
+
readonly service: typeof PowerSensorService;
|
|
29
|
+
readonly requestStream: false;
|
|
30
|
+
readonly responseStream: false;
|
|
31
|
+
readonly requestType: typeof component_powersensor_v1_powersensor_pb.GetPowerRequest;
|
|
32
|
+
readonly responseType: typeof component_powersensor_v1_powersensor_pb.GetPowerResponse;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
type PowerSensorServiceDoCommand = {
|
|
36
|
+
readonly methodName: string;
|
|
37
|
+
readonly service: typeof PowerSensorService;
|
|
38
|
+
readonly requestStream: false;
|
|
39
|
+
readonly responseStream: false;
|
|
40
|
+
readonly requestType: typeof common_v1_common_pb.DoCommandRequest;
|
|
41
|
+
readonly responseType: typeof common_v1_common_pb.DoCommandResponse;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export class PowerSensorService {
|
|
45
|
+
static readonly serviceName: string;
|
|
46
|
+
static readonly GetVoltage: PowerSensorServiceGetVoltage;
|
|
47
|
+
static readonly GetCurrent: PowerSensorServiceGetCurrent;
|
|
48
|
+
static readonly GetPower: PowerSensorServiceGetPower;
|
|
49
|
+
static readonly DoCommand: PowerSensorServiceDoCommand;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
|
|
53
|
+
export type Status = { details: string, code: number; metadata: grpc.Metadata }
|
|
54
|
+
|
|
55
|
+
interface UnaryResponse {
|
|
56
|
+
cancel(): void;
|
|
57
|
+
}
|
|
58
|
+
interface ResponseStream<T> {
|
|
59
|
+
cancel(): void;
|
|
60
|
+
on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
|
|
61
|
+
on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
|
|
62
|
+
on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
|
|
63
|
+
}
|
|
64
|
+
interface RequestStream<T> {
|
|
65
|
+
write(message: T): RequestStream<T>;
|
|
66
|
+
end(): void;
|
|
67
|
+
cancel(): void;
|
|
68
|
+
on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
|
|
69
|
+
on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
|
|
70
|
+
}
|
|
71
|
+
interface BidirectionalStream<ReqT, ResT> {
|
|
72
|
+
write(message: ReqT): BidirectionalStream<ReqT, ResT>;
|
|
73
|
+
end(): void;
|
|
74
|
+
cancel(): void;
|
|
75
|
+
on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
|
|
76
|
+
on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
|
|
77
|
+
on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export class PowerSensorServiceClient {
|
|
81
|
+
readonly serviceHost: string;
|
|
82
|
+
|
|
83
|
+
constructor(serviceHost: string, options?: grpc.RpcOptions);
|
|
84
|
+
getVoltage(
|
|
85
|
+
requestMessage: component_powersensor_v1_powersensor_pb.GetVoltageRequest,
|
|
86
|
+
metadata: grpc.Metadata,
|
|
87
|
+
callback: (error: ServiceError|null, responseMessage: component_powersensor_v1_powersensor_pb.GetVoltageResponse|null) => void
|
|
88
|
+
): UnaryResponse;
|
|
89
|
+
getVoltage(
|
|
90
|
+
requestMessage: component_powersensor_v1_powersensor_pb.GetVoltageRequest,
|
|
91
|
+
callback: (error: ServiceError|null, responseMessage: component_powersensor_v1_powersensor_pb.GetVoltageResponse|null) => void
|
|
92
|
+
): UnaryResponse;
|
|
93
|
+
getCurrent(
|
|
94
|
+
requestMessage: component_powersensor_v1_powersensor_pb.GetCurrentRequest,
|
|
95
|
+
metadata: grpc.Metadata,
|
|
96
|
+
callback: (error: ServiceError|null, responseMessage: component_powersensor_v1_powersensor_pb.GetCurrentResponse|null) => void
|
|
97
|
+
): UnaryResponse;
|
|
98
|
+
getCurrent(
|
|
99
|
+
requestMessage: component_powersensor_v1_powersensor_pb.GetCurrentRequest,
|
|
100
|
+
callback: (error: ServiceError|null, responseMessage: component_powersensor_v1_powersensor_pb.GetCurrentResponse|null) => void
|
|
101
|
+
): UnaryResponse;
|
|
102
|
+
getPower(
|
|
103
|
+
requestMessage: component_powersensor_v1_powersensor_pb.GetPowerRequest,
|
|
104
|
+
metadata: grpc.Metadata,
|
|
105
|
+
callback: (error: ServiceError|null, responseMessage: component_powersensor_v1_powersensor_pb.GetPowerResponse|null) => void
|
|
106
|
+
): UnaryResponse;
|
|
107
|
+
getPower(
|
|
108
|
+
requestMessage: component_powersensor_v1_powersensor_pb.GetPowerRequest,
|
|
109
|
+
callback: (error: ServiceError|null, responseMessage: component_powersensor_v1_powersensor_pb.GetPowerResponse|null) => void
|
|
110
|
+
): UnaryResponse;
|
|
111
|
+
doCommand(
|
|
112
|
+
requestMessage: common_v1_common_pb.DoCommandRequest,
|
|
113
|
+
metadata: grpc.Metadata,
|
|
114
|
+
callback: (error: ServiceError|null, responseMessage: common_v1_common_pb.DoCommandResponse|null) => void
|
|
115
|
+
): UnaryResponse;
|
|
116
|
+
doCommand(
|
|
117
|
+
requestMessage: common_v1_common_pb.DoCommandRequest,
|
|
118
|
+
callback: (error: ServiceError|null, responseMessage: common_v1_common_pb.DoCommandResponse|null) => void
|
|
119
|
+
): UnaryResponse;
|
|
120
|
+
}
|
|
121
|
+
|