Skip to content

Commit

Permalink
Document SLAM and Nav methods
Browse files Browse the repository at this point in the history
  • Loading branch information
skyleilani committed Jan 17, 2024
1 parent 5ad360b commit a5f12fc
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 0 deletions.
49 changes: 49 additions & 0 deletions docs/mobility/navigation/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,55 @@ waypoints, err := myNav.Waypoints(context.Background(), nil)
{{% /tab %}}
{{< /tabs >}}

### GetProperties

Get information regarding the current navigation service.

{{< tabs >}}
{{% tab name="Python" %}}

**Parameters:**

- `timeout` [(Optional\[float\])](https://docs.python.org/library/typing.html#typing.Optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

**Returns:**

- [`MapType.ValueType`](https://python.viam.dev/autoapi/viam/proto/service/navigation/index.html#viam.proto.service.navigation.GetPropertiesResponse): Property information for the named navigation service.

```python {class="line-numbers linkable-line-numbers"}
my_nav = NavigationClient.from_robot(robot=robot, name="my_nav_service")

# Get the properties of the current navigation service.
nav_properties = await my_nav.get_properties()
```

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/navigation/client/index.html#viam.services.navigation.client.NavigationClient.get_properties).
{{% /tab %}}
{{% tab name="Go" %}}

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.

**Returns:**

- [Properties](https://pkg.go.dev/go.viam.com/[email protected]/services/navigation#Properties): Information regarding the current navigation service.
This includes the map type being ingested and used by the navigation service.
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/services/navigation#Service).

```go {class="line-numbers linkable-line-numbers"}
ctx := context.Background()
myNav, err := navigation.FromRobot(robot, "my_nav_service")

// Get the properties of your current service
navProperties, err := myNav.Properties(ctx)
```

{{% /tab %}}
{{< /tabs >}}

### AddWaypoint

Add a waypoint to the service's data storage.
Expand Down
49 changes: 49 additions & 0 deletions docs/mobility/slam/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,55 @@ pcd_map, err := slam_svc.GetPointCloudMap(context.Background())
{{% /tab %}}
{{< /tabs >}}

### GetProperties

Get information regarding the current SLAM session.

{{< tabs >}}
{{% tab name="Python" %}}

**Parameters:**

- `timeout` [(Optional\[float\])](https://docs.python.org/library/typing.html#typing.Optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.

**Returns:**

- Tuple[[bool](https://docs.python.org/3/library/functions.html#bool), [MappingMode.ValueType](https://python.viam.dev/autoapi/viam/proto/service/slam/index.html#viam.proto.service.slam.MappingMode)]: A tuple containing a boolean which indicates whether the session is being run in the cloud, as well as the current session's mode.

For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/viam/services/slam/client/index.html#viam.services.slam.client.SLAMClient.get_properties).

```python {class="line-numbers linkable-line-numbers"}
slam_svc = SLAMClient.from_robot(robot=robot, name="my_slam_service")

# Get the properties of your current SLAM session.
slam_properties = await slam_svc.get_properties()
```

{{% /tab %}}
{{% tab name="Go" %}}

**Parameters:**

- `ctx` [(Context)](https://pkg.go.dev/context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.

**Returns:**

- [Properties](https://pkg.go.dev/go.viam.com/services/slam#Properties): Information regarding the current SLAM session.
This includes whether the SLAM process is running in the cloud, as well as its mapping mode.
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.

For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/services/slam#Properties).

```go {class="line-numbers linkable-line-numbers"}
slam_svc, err := slam.FromRobot(robot, "my_slam_service")

// Get the properties of your current SLAM session
properties, err := slam_svc.Properties(context.Background())
```

{{% /tab %}}
{{< /tabs >}}

### GetInternalState

Get the internal state of the SLAM algorithm required to continue mapping/localization.
Expand Down
1 change: 1 addition & 0 deletions static/include/services/apis/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Method Name | Description
[`SetMode`](/mobility/navigation/#setmode) | Set the mode the service is operating in.
[`Location`](/mobility/navigation/#location) | Get the current location of the robot.
[`Waypoints`](/mobility/navigation/#waypoints) | Get the waypoints currently in the service's data storage.
[`GetProperties`](/mobility/navigation/#getproperties) | Get information regarding the current service.
[`AddWaypoint`](/mobility/navigation/#addwaypoint) | Add a waypoint to the service's data storage.
[`RemoveWaypoint`](/mobility/navigation/#removewaypoint) | Remove a waypoint from the service's data storage.
[`Paths`](/mobility/navigation/#paths) | Get each path, the series of geo points the robot plans to travel through to get to a destination waypoint, in the robot's motion planning.
Expand Down
1 change: 1 addition & 0 deletions static/include/services/apis/slam.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
| ------------| ----------- |
| [`GetPosition`](/mobility/slam/#getposition) | Get the current position of the specified source component in the point cloud SLAM map. |
| [`GetPointCloudMap`](/mobility/slam/#getpointcloudmap) | Get the point cloud SLAM map. |
| [`GetProperties`](/mobility/slam/#getproperties) | Get information regarding the current SLAM session. |
| [`GetInternalState`](/mobility/slam/#getinternalstate) | Get the internal state of the SLAM algorithm required to continue mapping/localization. |
| [`GetLatestMapInfo`](/mobility/slam/#getlatestmapinfo) | Get the timestamp of the last update to the point cloud SLAM map. |
| [`DoCommand`](/mobility/slam/#docommand) | Send arbitrary commands to the resource. |
Expand Down

0 comments on commit a5f12fc

Please sign in to comment.