@viamrobotics/sdk 0.41.0 → 0.43.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.
@@ -565,6 +565,12 @@ export declare class RobotClient extends EventDispatcher implements Robot {
565
565
  readonly O: typeof import("../gen/common/v1/common_pb").GetGeometriesResponse;
566
566
  readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
567
567
  };
568
+ readonly getKinematics: {
569
+ readonly name: "GetKinematics";
570
+ readonly I: typeof import("../gen/common/v1/common_pb").GetKinematicsRequest;
571
+ readonly O: typeof import("../gen/common/v1/common_pb").GetKinematicsResponse;
572
+ readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
573
+ };
568
574
  };
569
575
  }>;
570
576
  get mlModelService(): PromiseClient<{
@@ -41,6 +41,9 @@ export interface Motion extends Resource {
41
41
  * const moved = await motion.move(goalPoseInFrame, gripperName);
42
42
  * ```
43
43
  *
44
+ * For more information, see [Motion
45
+ * API](https://docs.viam.com/dev/reference/apis/services/motion/#move).
46
+ *
44
47
  * @param destination - Destination to move to, which can a pose in the
45
48
  * reference frame of any frame in the robot's frame system.
46
49
  * @param componentName - Component on the robot to move to the specified
@@ -97,6 +100,9 @@ export interface Motion extends Resource {
97
100
  * );
98
101
  * ```
99
102
  *
103
+ * For more information, see [Motion
104
+ * API](https://docs.viam.com/dev/reference/apis/services/motion/#moveonmap).
105
+ *
100
106
  * @param destination - Specify a destination to, which can be any `Pose` with
101
107
  * respect to the SLAM map's origin.
102
108
  * @param componentName - Component on the robot to move to the specified
@@ -148,6 +154,9 @@ export interface Motion extends Resource {
148
154
  * );
149
155
  * ```
150
156
  *
157
+ * For more information, see [Motion
158
+ * API](https://docs.viam.com/dev/reference/apis/services/motion/#moveonglobe).
159
+ *
151
160
  * @param destination - Destination for the component to move to, represented
152
161
  * as a `GeoPoint`.
153
162
  * @param componentName - The name of the component to move.
@@ -180,6 +189,9 @@ export interface Motion extends Resource {
180
189
  * await motion.stopPlan(baseName);
181
190
  * ```
182
191
  *
192
+ * For more information, see [Motion
193
+ * API](https://docs.viam.com/dev/reference/apis/services/motion/#stopplan).
194
+ *
183
195
  * @param componentName - The component to stop
184
196
  */
185
197
  stopPlan: (componentName: ResourceName, extra?: Struct) => Promise<null>;
@@ -212,6 +224,9 @@ export interface Motion extends Resource {
212
224
  * const response = await motion.getPlan(baseName);
213
225
  * ```
214
226
  *
227
+ * For more information, see [Motion
228
+ * API](https://docs.viam.com/dev/reference/apis/services/motion/#getplan).
229
+ *
215
230
  * @param componentName - The component to query
216
231
  * @param destinationFrame - The reference frame in which the component's
217
232
  * `Pose` should be provided, if unset this defaults to the "world"
@@ -239,6 +254,9 @@ export interface Motion extends Resource {
239
254
  * const response = await motion.listPlanStatuses();
240
255
  * ```
241
256
  *
257
+ * For more information, see [Motion
258
+ * API](https://docs.viam.com/dev/reference/apis/services/motion/#listplanstatuses).
259
+ *
242
260
  * @param onlyActivePlans - If true, the response will only return plans which
243
261
  * are executing.
244
262
  */
@@ -266,6 +284,9 @@ export interface Motion extends Resource {
266
284
  * );
267
285
  * ```
268
286
  *
287
+ * For more information, see [Motion
288
+ * API](https://docs.viam.com/dev/reference/apis/services/motion/#getpose).
289
+ *
269
290
  * @param componentName - The component whose `Pose` is being requested.
270
291
  * @param destinationFrame - The reference frame in which the component's
271
292
  * `Pose` should be provided, if unset this defaults to the "world"
@@ -4,38 +4,169 @@ import type { Mode, NavigationPosition, NavigationProperties, Path, Waypoint } f
4
4
  /**
5
5
  * A service that uses GPS to automatically navigate a robot to user defined
6
6
  * endpoints.
7
+ *
8
+ * @example
9
+ *
10
+ * ```ts
11
+ * const navigation = new VIAM.NavigationClient(machine, 'my_navigation');
12
+ *
13
+ * const mode = await navigation.getMode();
14
+ * ```
15
+ *
16
+ * For more information, see [Navigation
17
+ * API](https://docs.viam.com/dev/reference/apis/services/navigation/#getmode).
7
18
  */
8
19
  export interface Navigation extends Resource {
9
- /** Get the mode the robot is operating in. */
20
+ /**
21
+ * Get the mode the robot is operating in.
22
+ *
23
+ * @example
24
+ *
25
+ * ```ts
26
+ * const navigation = new VIAM.NavigationClient(machine, 'my_navigation');
27
+ *
28
+ * const mode = await navigation.getMode();
29
+ * ```
30
+ *
31
+ * For more information, see [Navigation
32
+ * API](https://docs.viam.com/dev/reference/apis/services/navigation/#getmode).
33
+ */
10
34
  getMode: (extra?: Struct) => Promise<Mode>;
11
35
  /**
12
36
  * Set the mode the robot is operating in.
13
37
  *
38
+ * @example
39
+ *
40
+ * ```ts
41
+ * const navigation = new VIAM.NavigationClient(machine, 'my_navigation');
42
+ *
43
+ * // Set the mode to 2 which corresponds to WAYPOINT
44
+ * await navigation.setMode(2);
45
+ * ```
46
+ *
47
+ * For more information, see [Navigation
48
+ * API](https://docs.viam.com/dev/reference/apis/services/navigation/#setmode).
49
+ *
14
50
  * @param mode - The mode for the service to operate in.
51
+ *
52
+ * - 0: MODE_UNSPECIFIED
53
+ * - 1: MODE_MANUAL
54
+ * - 2: MODE_WAYPOINT
55
+ * - 3: MODE_EXPLORE
15
56
  */
16
57
  setMode: (mode: Mode, extra?: Struct) => Promise<void>;
17
- /** Get the current location of the robot. */
58
+ /**
59
+ * Get the current location of the robot.
60
+ *
61
+ * @example
62
+ *
63
+ * ```ts
64
+ * const navigation = new VIAM.NavigationClient(machine, 'my_navigation');
65
+ *
66
+ * const location = await navigation.getLocation();
67
+ * ```
68
+ *
69
+ * For more information, see [Navigation
70
+ * API](https://docs.viam.com/dev/reference/apis/services/navigation/#getlocation).
71
+ */
18
72
  getLocation: (extra?: Struct) => Promise<NavigationPosition>;
19
- /** Get an array of waypoints currently in the service's data storage. */
73
+ /**
74
+ * Get an array of waypoints currently in the service's data storage.
75
+ *
76
+ * @example
77
+ *
78
+ * ```ts
79
+ * const navigation = new VIAM.NavigationClient(machine, 'my_navigation');
80
+ *
81
+ * const waypoints = await navigation.getWayPoints();
82
+ * ```
83
+ *
84
+ * For more information, see [Navigation
85
+ * API](https://docs.viam.com/dev/reference/apis/services/navigation/#getwaypoints).
86
+ */
20
87
  getWayPoints: (extra?: Struct) => Promise<Waypoint[]>;
21
88
  /**
22
89
  * Add a waypoint to the service's data storage.
23
90
  *
24
- * @param location - The current location of the robot n the navigation
25
- * service with latitude and longitude values.
91
+ * @example
92
+ *
93
+ * ```ts
94
+ * const navigation = new VIAM.NavigationClient(machine, 'my_navigation');
95
+ *
96
+ * const location = { latitude: 40.7128, longitude: -74.006 };
97
+ * await navigation.addWayPoint(location);
98
+ * ```
99
+ *
100
+ * For more information, see [Navigation
101
+ * API](https://docs.viam.com/dev/reference/apis/services/navigation/#addwaypoint).
102
+ *
103
+ * @param location - A waypoint described by latitude and longitude values.
26
104
  */
27
105
  addWayPoint: (location: GeoPoint, extra?: Struct) => Promise<void>;
28
106
  /**
29
107
  * Remove a waypoint from the service's data storage.
30
108
  *
109
+ * @example
110
+ *
111
+ * ```ts
112
+ * const navigation = new VIAM.NavigationClient(machine, 'my_navigation');
113
+ *
114
+ * // Remove the first waypoint
115
+ * if (waypoints.length > 0) {
116
+ * await navigation.removeWayPoint(waypoints[0].id);
117
+ * }
118
+ * ```
119
+ *
120
+ * For more information, see [Navigation
121
+ * API](https://docs.viam.com/dev/reference/apis/services/navigation/#removewaypoint).
122
+ *
31
123
  * @param id - The MongoDB ObjectID of the waypoint to remove from the
32
124
  * service's data storage.
33
125
  */
34
126
  removeWayPoint: (id: string, extra?: Struct) => Promise<void>;
35
- /** Get a list of obstacles. */
127
+ /**
128
+ * Get a list of obstacles.
129
+ *
130
+ * @example
131
+ *
132
+ * ```ts
133
+ * const navigation = new VIAM.NavigationClient(machine, 'my_navigation');
134
+ *
135
+ * const obstacles = await navigation.getObstacles();
136
+ * ```
137
+ *
138
+ * For more information, see [Navigation
139
+ * API](https://docs.viam.com/dev/reference/apis/services/navigation/#getobstacles).
140
+ */
36
141
  getObstacles: (extra?: Struct) => Promise<GeoGeometry[]>;
37
- /** Gets the list of paths known to the navigation service. */
142
+ /**
143
+ * Gets the list of paths known to the navigation service.
144
+ *
145
+ * @example
146
+ *
147
+ * ```ts
148
+ * const navigation = new VIAM.NavigationClient(machine, 'my_navigation');
149
+ *
150
+ * const paths = await navigation.getPaths();
151
+ * ```
152
+ *
153
+ * For more information, see [Navigation
154
+ * API](https://docs.viam.com/dev/reference/apis/services/navigation/#getpaths).
155
+ */
38
156
  getPaths: (extra?: Struct) => Promise<Path[]>;
39
- /** Gets information on the properties of the current navigation service. */
157
+ /**
158
+ * Gets information on the properties of the current navigation service.
159
+ *
160
+ * @example
161
+ *
162
+ * ```ts
163
+ * const navigation = new VIAM.NavigationClient(machine, 'my_navigation');
164
+ *
165
+ * const properties = await navigation.getProperties();
166
+ * ```
167
+ *
168
+ * For more information, see [Navigation
169
+ * API](https://docs.viam.com/dev/reference/apis/services/navigation/#getproperties).
170
+ */
40
171
  getProperties: () => Promise<NavigationProperties>;
41
172
  }
@@ -15,8 +15,8 @@ export declare class SlamClient implements Slam {
15
15
  callOptions: CallOptions;
16
16
  constructor(client: RobotClient, name: string, options?: Options);
17
17
  getPosition(callOptions?: CallOptions): Promise<import("../../gen/service/slam/v1/slam_pb").GetPositionResponse>;
18
- getPointCloudMap: (returnEditedMap?: boolean, callOptions?: CallOptions) => Promise<Uint8Array>;
19
- getInternalState: (callOptions?: CallOptions) => Promise<Uint8Array>;
18
+ getPointCloudMap(returnEditedMap?: boolean, callOptions?: CallOptions): Promise<Uint8Array>;
19
+ getInternalState(callOptions?: CallOptions): Promise<Uint8Array>;
20
20
  getProperties(callOptions?: CallOptions): Promise<import("../../gen/service/slam/v1/slam_pb").GetPropertiesResponse>;
21
21
  doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
22
22
  }
@@ -18,6 +18,9 @@ export interface Slam extends Resource {
18
18
  * const position = await slam.getPosition();
19
19
  * console.log('Current position:', position);
20
20
  * ```
21
+ *
22
+ * For more information, see [SLAM
23
+ * API](https://docs.viam.com/dev/reference/apis/services/slam/#getposition).
21
24
  */
22
25
  getPosition: () => Promise<SlamPosition>;
23
26
  /**
@@ -34,6 +37,9 @@ export interface Slam extends Resource {
34
37
  * // Get the edited point cloud map
35
38
  * const editedMap = await slam.getPointCloudMap(true);
36
39
  * ```
40
+ *
41
+ * For more information, see [SLAM
42
+ * API](https://docs.viam.com/dev/reference/apis/services/slam/#getpointcloudmap).
37
43
  */
38
44
  getPointCloudMap: (returnEditedMap?: boolean) => Promise<Uint8Array>;
39
45
  /**
@@ -48,6 +54,9 @@ export interface Slam extends Resource {
48
54
  * // Get the internal state of the SLAM algorithm
49
55
  * const internalState = await slam.getInternalState();
50
56
  * ```
57
+ *
58
+ * For more information, see [SLAM
59
+ * API](https://docs.viam.com/dev/reference/apis/services/slam/#getinternalstate).
51
60
  */
52
61
  getInternalState: () => Promise<Uint8Array>;
53
62
  /**
@@ -62,6 +71,9 @@ export interface Slam extends Resource {
62
71
  * const properties = await slam.getProperties();
63
72
  * console.log('SLAM properties:', properties);
64
73
  * ```
74
+ *
75
+ * For more information, see [SLAM
76
+ * API](https://docs.viam.com/dev/reference/apis/services/slam/#getproperties).
65
77
  */
66
78
  getProperties: () => Promise<SlamProperties>;
67
79
  }
package/dist/types.d.ts CHANGED
@@ -13,10 +13,13 @@ export interface Resource {
13
13
  * @example
14
14
  *
15
15
  * ```ts
16
- * const result = await resource.doCommand({
17
- * name: 'myCommand',
18
- * args: { key: 'value' },
19
- * });
16
+ * import { Struct } from '@viamrobotics/sdk';
17
+ *
18
+ * const result = await resource.doCommand(
19
+ * Struct.fromJson({
20
+ * myCommand: { key: 'value' },
21
+ * })
22
+ * );
20
23
  * ```
21
24
  *
22
25
  * @param command - The command to execute.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamrobotics/sdk",
3
- "version": "0.41.0",
3
+ "version": "0.43.0",
4
4
  "description": "",
5
5
  "main": "./dist/main.umd.js",
6
6
  "module": "./dist/main.es.js",