diff --git a/src/services/slam/slam.ts b/src/services/slam/slam.ts index 1843f5355..0a7838a75 100644 --- a/src/services/slam/slam.ts +++ b/src/services/slam/slam.ts @@ -9,18 +9,63 @@ export interface Slam extends Resource { /** * Get the current position of the specified source component in the point * cloud SLAM map. + * + * @example + * + * ```ts + * const slam = new VIAM.SlamClient(machine, 'my_slam'); + * + * // Get the current position of the robot in the SLAM map + * const position = await slam.getPosition(); + * console.log('Current position:', position); + * ``` */ getPosition: () => Promise; - /** Get the point cloud SLAM map. */ + /** + * Get the point cloud SLAM map. + * + * @example + * + * ```ts + * const slam = new VIAM.SlamClient(machine, 'my_slam'); + * + * // Get the point cloud map + * const pointCloudMap = await slam.getPointCloudMap(); + * + * // Get the edited point cloud map + * const editedMap = await slam.getPointCloudMap(true); + * ``` + */ getPointCloudMap: (returnEditedMap?: boolean) => Promise; /** * Get the internal state of the SLAM algorithm required to continue * mapping/localization. + * + * @example + * + * ```ts + * const slam = new VIAM.SlamClient(machine, 'my_slam'); + * + * // Get the internal state of the SLAM algorithm + * const internalState = await slam.getInternalState(); + * ``` */ getInternalState: () => Promise; - /** Gets information on the properties of the current SLAM service. */ + /** + * Get information on the properties of the current SLAM service. + * + * @example + * + * ```ts + * const slam = new VIAM.SlamClient(machine, 'my_slam'); + * + * // Get the properties of the SLAM service + * const properties = await slam.getProperties(); + * console.log('SLAM properties:', properties); + * ``` + */ getProperties: () => Promise; }