Skip to content

Commit a5f12fc

Browse files
committed
Document SLAM and Nav methods
1 parent 5ad360b commit a5f12fc

File tree

4 files changed

+100
-0
lines changed

4 files changed

+100
-0
lines changed

docs/mobility/navigation/_index.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,55 @@ waypoints, err := myNav.Waypoints(context.Background(), nil)
434434
{{% /tab %}}
435435
{{< /tabs >}}
436436

437+
### GetProperties
438+
439+
Get information regarding the current navigation service.
440+
441+
{{< tabs >}}
442+
{{% tab name="Python" %}}
443+
444+
**Parameters:**
445+
446+
- `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.
447+
448+
**Returns:**
449+
450+
- [`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.
451+
452+
```python {class="line-numbers linkable-line-numbers"}
453+
my_nav = NavigationClient.from_robot(robot=robot, name="my_nav_service")
454+
455+
# Get the properties of the current navigation service.
456+
nav_properties = await my_nav.get_properties()
457+
```
458+
459+
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).
460+
{{% /tab %}}
461+
{{% tab name="Go" %}}
462+
463+
**Parameters:**
464+
465+
- `ctx` [(Context)](https://pkg.go.dev/context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
466+
467+
**Returns:**
468+
469+
- [Properties](https://pkg.go.dev/go.viam.com/[email protected]/services/navigation#Properties): Information regarding the current navigation service.
470+
This includes the map type being ingested and used by the navigation service.
471+
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.
472+
473+
For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/services/navigation#Service).
474+
475+
```go {class="line-numbers linkable-line-numbers"}
476+
ctx := context.Background()
477+
myNav, err := navigation.FromRobot(robot, "my_nav_service")
478+
479+
// Get the properties of your current service
480+
navProperties, err := myNav.Properties(ctx)
481+
```
482+
483+
{{% /tab %}}
484+
{{< /tabs >}}
485+
437486
### AddWaypoint
438487

439488
Add a waypoint to the service's data storage.

docs/mobility/slam/_index.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,55 @@ pcd_map, err := slam_svc.GetPointCloudMap(context.Background())
160160
{{% /tab %}}
161161
{{< /tabs >}}
162162

163+
### GetProperties
164+
165+
Get information regarding the current SLAM session.
166+
167+
{{< tabs >}}
168+
{{% tab name="Python" %}}
169+
170+
**Parameters:**
171+
172+
- `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.
173+
174+
**Returns:**
175+
176+
- 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.
177+
178+
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).
179+
180+
```python {class="line-numbers linkable-line-numbers"}
181+
slam_svc = SLAMClient.from_robot(robot=robot, name="my_slam_service")
182+
183+
# Get the properties of your current SLAM session.
184+
slam_properties = await slam_svc.get_properties()
185+
```
186+
187+
{{% /tab %}}
188+
{{% tab name="Go" %}}
189+
190+
**Parameters:**
191+
192+
- `ctx` [(Context)](https://pkg.go.dev/context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
193+
194+
**Returns:**
195+
196+
- [Properties](https://pkg.go.dev/go.viam.com/services/slam#Properties): Information regarding the current SLAM session.
197+
This includes whether the SLAM process is running in the cloud, as well as its mapping mode.
198+
- [(error)](https://pkg.go.dev/builtin#error): An error, if one occurred.
199+
200+
For more information, see the [Go SDK Docs](https://pkg.go.dev/go.viam.com/rdk/services/slam#Properties).
201+
202+
```go {class="line-numbers linkable-line-numbers"}
203+
slam_svc, err := slam.FromRobot(robot, "my_slam_service")
204+
205+
// Get the properties of your current SLAM session
206+
properties, err := slam_svc.Properties(context.Background())
207+
```
208+
209+
{{% /tab %}}
210+
{{< /tabs >}}
211+
163212
### GetInternalState
164213

165214
Get the internal state of the SLAM algorithm required to continue mapping/localization.

static/include/services/apis/navigation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Method Name | Description
55
[`SetMode`](/mobility/navigation/#setmode) | Set the mode the service is operating in.
66
[`Location`](/mobility/navigation/#location) | Get the current location of the robot.
77
[`Waypoints`](/mobility/navigation/#waypoints) | Get the waypoints currently in the service's data storage.
8+
[`GetProperties`](/mobility/navigation/#getproperties) | Get information regarding the current service.
89
[`AddWaypoint`](/mobility/navigation/#addwaypoint) | Add a waypoint to the service's data storage.
910
[`RemoveWaypoint`](/mobility/navigation/#removewaypoint) | Remove a waypoint from the service's data storage.
1011
[`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.

static/include/services/apis/slam.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
| ------------| ----------- |
44
| [`GetPosition`](/mobility/slam/#getposition) | Get the current position of the specified source component in the point cloud SLAM map. |
55
| [`GetPointCloudMap`](/mobility/slam/#getpointcloudmap) | Get the point cloud SLAM map. |
6+
| [`GetProperties`](/mobility/slam/#getproperties) | Get information regarding the current SLAM session. |
67
| [`GetInternalState`](/mobility/slam/#getinternalstate) | Get the internal state of the SLAM algorithm required to continue mapping/localization. |
78
| [`GetLatestMapInfo`](/mobility/slam/#getlatestmapinfo) | Get the timestamp of the last update to the point cloud SLAM map. |
89
| [`DoCommand`](/mobility/slam/#docommand) | Send arbitrary commands to the resource. |

0 commit comments

Comments
 (0)