@viamrobotics/sdk 0.0.39 → 0.0.40-alpha.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.
@@ -34,7 +34,11 @@ declare abstract class ServiceClient {
34
34
  options?: grpc.RpcOptions | undefined;
35
35
  constructor(serviceHost: string, options?: grpc.RpcOptions | undefined);
36
36
  }
37
- /** A gRPC-web client for the Robot component. */
37
+ /**
38
+ * A gRPC-web client for a Robot.
39
+ *
40
+ * @group Clients
41
+ */
38
42
  export declare class RobotClient implements Robot {
39
43
  private readonly serviceHost;
40
44
  private readonly webrtcOptions;
@@ -6,9 +6,6 @@ export interface Robot {
6
6
  /**
7
7
  * Get the list of operations currently running on the robot.
8
8
  *
9
- * @privateRemarks
10
- * TODO: this function should return an more idiomatic type instead of just
11
- * passing along a proto type.
12
9
  * @group Operations
13
10
  * @alpha
14
11
  */
@@ -43,9 +40,6 @@ export interface Robot {
43
40
  /**
44
41
  * Get the configuration of the frame system of a given robot.
45
42
  *
46
- * @privateRemarks
47
- * TODO: this function should return an more idiomatic type instead of just
48
- * passing along a proto type.
49
43
  * @group Frame System
50
44
  * @alpha
51
45
  */
@@ -54,9 +48,6 @@ export interface Robot {
54
48
  * Transform a given source Pose from the reference frame to a new specified
55
49
  * destination which is a reference frame.
56
50
  *
57
- * @privateRemarks
58
- * TODO: this function should return an more idiomatic type instead of just
59
- * passing along a proto type.
60
51
  * @param query - The pose that should be transformed
61
52
  * @param destination - The name of the reference frame to transform the given
62
53
  * @param supplementalTransforms - Pose information on any additional
@@ -85,9 +76,6 @@ export interface Robot {
85
76
  /**
86
77
  * Get the list of discovered component configurations.
87
78
  *
88
- * @privateRemarks
89
- * TODO: this function should return an more idiomatic type instead of just
90
- * passing along a proto type.
91
79
  * @param queries - The list of component models to discovery.
92
80
  * @group Discovery
93
81
  * @alpha
@@ -0,0 +1,16 @@
1
+ import type { RobotClient } from '../../robot';
2
+ import type { Options } from '../../types';
3
+ import type { Motion } from './Motion';
4
+ import common from '../../gen/common/v1/common_pb';
5
+ import pb from '../../gen/service/motion/v1/motion_pb';
6
+ export declare class MotionClient implements Motion {
7
+ private client;
8
+ private readonly name;
9
+ private readonly options;
10
+ constructor(client: RobotClient, name: string, options?: Options);
11
+ private get service();
12
+ move(destination: common.PoseInFrame.AsObject, componentName: common.ResourceName.AsObject, worldState?: common.WorldState.AsObject, constraints?: pb.Constraints.AsObject, extra?: {}): Promise<boolean>;
13
+ moveOnMap(destination: common.Pose.AsObject, componentName: common.ResourceName.AsObject, slamServiceName: common.ResourceName.AsObject, extra?: {}): Promise<boolean>;
14
+ moveSingleComponent(destination: common.PoseInFrame.AsObject, componentName: common.ResourceName.AsObject, worldState?: common.WorldState.AsObject, extra?: {}): Promise<boolean>;
15
+ getPose(componentName: common.ResourceName.AsObject, destinationFrame: string, supplementalTransforms: common.Transform.AsObject[], extra?: {}): Promise<common.PoseInFrame.AsObject>;
16
+ }
@@ -0,0 +1,51 @@
1
+ import common from '../../gen/common/v1/common_pb';
2
+ import pb from '../../gen/service/motion/v1/motion_pb';
3
+ import type { Extra } from '../../types';
4
+ /**
5
+ * A service that coordinates motion planning across all of the components in a
6
+ * given robot.
7
+ */
8
+ export interface Motion {
9
+ /**
10
+ * Move any component on the robot to a specified destination which can be
11
+ * from the reference frame of any other component on the robot.
12
+ *
13
+ * @param destination - Destination to move to, which can a pose in the
14
+ * reference frame of any frame in the robot's frame system.
15
+ * @param componentName - Component on the robot to move to the specified
16
+ * destination.
17
+ * @param worldState - Avoid obstacles by specifying their geometries in the
18
+ * world state. Augment the frame system of the robot by specifying
19
+ * additional transforms to add to it for the duration of the Move.
20
+ * @param constraints - Constrain the way the robot will move.
21
+ */
22
+ move: (destination: common.PoseInFrame.AsObject, componentName: common.ResourceName.AsObject, worldState?: common.WorldState.AsObject, constraints?: pb.Constraints.AsObject, extra?: Extra) => Promise<boolean>;
23
+ /**
24
+ * @param destination - Specify a destination to, which can be any pose with
25
+ * respect to the SLAM map's origin.
26
+ * @param componentName - Component on the robot to move to the specified
27
+ * destination.
28
+ * @param slamServiceName - Name of the slam service from which the SLAM map
29
+ * is requested
30
+ */
31
+ moveOnMap: (destination: common.Pose.AsObject, componentName: common.ResourceName.AsObject, slamServiceName: common.ResourceName.AsObject, extra?: Extra) => Promise<boolean>;
32
+ /**
33
+ * @param destination - Destination to move to, which can a pose in the
34
+ * reference frame of any frame in the robot's frame system.
35
+ * @param componentName - Component on the robot to move to the specified
36
+ * destination.
37
+ * @param worldState - Avoid obstacles by specifying their geometries in the
38
+ * world state. Augment the frame system of the robot by specifying
39
+ * additional transforms to add to it for the duration of the Move.
40
+ */
41
+ moveSingleComponent: (destination: common.PoseInFrame.AsObject, componentName: common.ResourceName.AsObject, worldState?: common.WorldState.AsObject, extra?: Extra) => Promise<boolean>;
42
+ /**
43
+ * @param componentName - The component whose pose is being requested.
44
+ * @param destinationFrame - The reference frame in which the component's pose
45
+ * should be provided, if unset this defaults to the "world" reference
46
+ * frame.
47
+ * @param supplementalTransforms - Pose information on any additional
48
+ * reference frames that are needed to compute the component's pose.
49
+ */
50
+ getPose: (componentName: common.ResourceName.AsObject, destinationFrame: string, supplementalTransforms: common.Transform.AsObject[], extra?: Extra) => Promise<common.PoseInFrame.AsObject>;
51
+ }
@@ -0,0 +1,2 @@
1
+ export type { Motion } from './motion/Motion';
2
+ export { MotionClient } from './motion/Client';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamrobotics/sdk",
3
- "version": "0.0.39",
3
+ "version": "0.0.40-alpha.2",
4
4
  "description": "",
5
5
  "main": "./dist/main.umd.js",
6
6
  "module": "./dist/main.es.js",
@@ -10,6 +10,7 @@
10
10
  "dist/robot/**/*.d.ts",
11
11
  "dist/events.*",
12
12
  "dist/components/**/*.d.ts",
13
+ "dist/services/**/*.d.ts",
13
14
  "dist/extra/**/*.d.ts",
14
15
  "dist/main.*",
15
16
  "dist/gen/**/*.esm.d.ts",
@@ -25,6 +26,7 @@
25
26
  "build": "vite build",
26
27
  "check": "npm-check --production",
27
28
  "doc": "typedoc",
29
+ "doc:watch": "typedoc --watch",
28
30
  "format": "prettier --write './src/**/*.{ts,js}'",
29
31
  "lint:prettier": "prettier --check './src/**/*.{ts,js}'",
30
32
  "lint:eslint": "eslint './src/**/*.{ts,js}' --fix",
@@ -45,6 +47,7 @@
45
47
  "@viamrobotics/rpc": "^0.1.34"
46
48
  },
47
49
  "devDependencies": {
50
+ "@bufbuild/buf": "^1.15.0-1",
48
51
  "@improbable-eng/grpc-web": "^0.15.0",
49
52
  "@improbable-eng/grpc-web-fake-transport": "^0.15.0",
50
53
  "@types/google-protobuf": "^3.15.6",
@@ -52,6 +55,7 @@
52
55
  "@typescript-eslint/parser": "^5.43.0",
53
56
  "eslint": "^8.27.0",
54
57
  "eslint-config-prettier": "^8.5.0",
58
+ "eslint-plugin-tsdoc": "^0.2.17",
55
59
  "google-protobuf": "^3.21.2",
56
60
  "grpc-web": "^1.4.2",
57
61
  "happy-dom": "^8.2.6",