Skip to content

Commit de2df88

Browse files
authored
DOCS-3790: Add motion and SLAM backlinks (#543)
1 parent f5f681b commit de2df88

File tree

3 files changed

+38
-7
lines changed

3 files changed

+38
-7
lines changed

src/services/motion/motion.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ export interface Motion extends Resource {
5757
* const moved = await motion.move(goalPoseInFrame, gripperName);
5858
* ```
5959
*
60+
* For more information, see [Motion
61+
* API](https://docs.viam.com/dev/reference/apis/services/motion/#move).
62+
*
6063
* @param destination - Destination to move to, which can a pose in the
6164
* reference frame of any frame in the robot's frame system.
6265
* @param componentName - Component on the robot to move to the specified
@@ -120,6 +123,9 @@ export interface Motion extends Resource {
120123
* );
121124
* ```
122125
*
126+
* For more information, see [Motion
127+
* API](https://docs.viam.com/dev/reference/apis/services/motion/#moveonmap).
128+
*
123129
* @param destination - Specify a destination to, which can be any `Pose` with
124130
* respect to the SLAM map's origin.
125131
* @param componentName - Component on the robot to move to the specified
@@ -179,6 +185,9 @@ export interface Motion extends Resource {
179185
* );
180186
* ```
181187
*
188+
* For more information, see [Motion
189+
* API](https://docs.viam.com/dev/reference/apis/services/motion/#moveonglobe).
190+
*
182191
* @param destination - Destination for the component to move to, represented
183192
* as a `GeoPoint`.
184193
* @param componentName - The name of the component to move.
@@ -221,6 +230,9 @@ export interface Motion extends Resource {
221230
* await motion.stopPlan(baseName);
222231
* ```
223232
*
233+
* For more information, see [Motion
234+
* API](https://docs.viam.com/dev/reference/apis/services/motion/#stopplan).
235+
*
224236
* @param componentName - The component to stop
225237
*/
226238
stopPlan: (componentName: ResourceName, extra?: Struct) => Promise<null>;
@@ -254,6 +266,9 @@ export interface Motion extends Resource {
254266
* const response = await motion.getPlan(baseName);
255267
* ```
256268
*
269+
* For more information, see [Motion
270+
* API](https://docs.viam.com/dev/reference/apis/services/motion/#getplan).
271+
*
257272
* @param componentName - The component to query
258273
* @param destinationFrame - The reference frame in which the component's
259274
* `Pose` should be provided, if unset this defaults to the "world"
@@ -287,6 +302,9 @@ export interface Motion extends Resource {
287302
* const response = await motion.listPlanStatuses();
288303
* ```
289304
*
305+
* For more information, see [Motion
306+
* API](https://docs.viam.com/dev/reference/apis/services/motion/#listplanstatuses).
307+
*
290308
* @param onlyActivePlans - If true, the response will only return plans which
291309
* are executing.
292310
*/
@@ -318,6 +336,9 @@ export interface Motion extends Resource {
318336
* );
319337
* ```
320338
*
339+
* For more information, see [Motion
340+
* API](https://docs.viam.com/dev/reference/apis/services/motion/#getpose).
341+
*
321342
* @param componentName - The component whose `Pose` is being requested.
322343
* @param destinationFrame - The reference frame in which the component's
323344
* `Pose` should be provided, if unset this defaults to the "world"

src/services/slam/client.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ export class SlamClient implements Slam {
3939
return this.client.getPosition(request, callOptions);
4040
}
4141

42-
getPointCloudMap = async (
42+
async getPointCloudMap(
4343
returnEditedMap?: boolean,
4444
callOptions = this.callOptions
45-
): Promise<Uint8Array> => {
45+
): Promise<Uint8Array> {
4646
const request = new GetPointCloudMapRequest({
4747
name: this.name,
4848
returnEditedMap,
@@ -55,11 +55,9 @@ export class SlamClient implements Slam {
5555
chunks.push(chunk.pointCloudPcdChunk);
5656
}
5757
return concatArrayU8(chunks);
58-
};
58+
}
5959

60-
getInternalState = async (
61-
callOptions = this.callOptions
62-
): Promise<Uint8Array> => {
60+
async getInternalState(callOptions = this.callOptions): Promise<Uint8Array> {
6361
const request = new GetInternalStateRequest({
6462
name: this.name,
6563
});
@@ -71,7 +69,7 @@ export class SlamClient implements Slam {
7169
chunks.push(chunk.internalStateChunk);
7270
}
7371
return concatArrayU8(chunks);
74-
};
72+
}
7573

7674
async getProperties(callOptions = this.callOptions) {
7775
const request = new GetPropertiesRequest({

src/services/slam/slam.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export interface Slam extends Resource {
1919
* const position = await slam.getPosition();
2020
* console.log('Current position:', position);
2121
* ```
22+
*
23+
* For more information, see [SLAM
24+
* API](https://docs.viam.com/dev/reference/apis/services/slam/#getposition).
2225
*/
2326
getPosition: () => Promise<SlamPosition>;
2427

@@ -36,6 +39,9 @@ export interface Slam extends Resource {
3639
* // Get the edited point cloud map
3740
* const editedMap = await slam.getPointCloudMap(true);
3841
* ```
42+
*
43+
* For more information, see [SLAM
44+
* API](https://docs.viam.com/dev/reference/apis/services/slam/#getpointcloudmap).
3945
*/
4046
getPointCloudMap: (returnEditedMap?: boolean) => Promise<Uint8Array>;
4147

@@ -51,6 +57,9 @@ export interface Slam extends Resource {
5157
* // Get the internal state of the SLAM algorithm
5258
* const internalState = await slam.getInternalState();
5359
* ```
60+
*
61+
* For more information, see [SLAM
62+
* API](https://docs.viam.com/dev/reference/apis/services/slam/#getinternalstate).
5463
*/
5564
getInternalState: () => Promise<Uint8Array>;
5665

@@ -66,6 +75,9 @@ export interface Slam extends Resource {
6675
* const properties = await slam.getProperties();
6776
* console.log('SLAM properties:', properties);
6877
* ```
78+
*
79+
* For more information, see [SLAM
80+
* API](https://docs.viam.com/dev/reference/apis/services/slam/#getproperties).
6981
*/
7082
getProperties: () => Promise<SlamProperties>;
7183
}

0 commit comments

Comments
 (0)