Skip to content

Commit

Permalink
DOCS-910: Sensor controlled base (#2430)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguequierre committed Jan 31, 2024
1 parent 0f4854e commit c8a6cf2
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/components/base/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ For configuration information, click on the model name:
| Model | Description |
| ----- | ----------- |
| [`wheeled`](wheeled/) | Mobile wheeled robot |
| [`sensor-controlled`](sensor-controlled/) | A model that wraps other base models with feedback control from a movement sensor |
| [`fake`](fake/) | A model used for testing, with no physical hardware |

### Modular Resources
Expand Down
84 changes: 84 additions & 0 deletions docs/components/base/sensor-controlled.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
title: "Configure a Sensor-Controlled Base"
linkTitle: "sensor-controlled"
weight: 40
type: "docs"
description: "Configure a sensor-controlled base, a robotic base with feedback control from a movement sensor."
images: ["/icons/components/base.svg"]
tags: ["base", "components"]
aliases:
- "/components/base/sensor-controlled/"
# SMEs: Rand H., Martha J.
---

A `sensor-controlled` base supports a robotic base with feedback control from a movement sensor.

{{% alert title="Requirements" color="note" %}}
1 or more [movement sensors](/components/movement-sensor/) providing:

- Linear and angular velocity feedback, used by the base's [SetVelocity()](/components/base/#setvelocity) endpoint
- Orientation feedback, used by the base's [Spin()](/components/base/#spin) endpoint
{{% /alert %}}

To configure a `sensor-controlled` base as a component of your machine, first configure the [model of base](/components/base/) you want to wrap with feedback control and each required [movement sensor](/components/movement-sensor/).
To see what models of movement sensor report which feedback, reference the appropriate column in [Movement Sensor API](/components/movement-sensor/#api).

Configure a `sensor-controlled` base as follows:

{{< tabs name="Configure a Sensor-Controlled Base" >}}
{{% tab name="Config Builder" %}}

Navigate to the **Config** tab of your machine's page in the [Viam app](https://app.viam.com).
Click on the **Components** subtab and click **Create component**.
Select the `base` type, then select the `sensor-controlled` model.
Enter a name for your base and click **Create**.

{{< imgproc src="/components/base/sensor-controlled-base-ui-config.png" alt="An example configuration for a sensor-controlled base in the Viam app config builder" resize="600x" >}}

Edit and fill in the attributes as applicable.

{{% /tab %}}
{{% tab name="JSON Template" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"components": [
{ ... INSERT MOVEMENT SENSOR CONFIGURATION },
{ ... INSERT BASE CONFIGURATION },
{
"name": "my-sensor-controlled-base",
"model": "sensor-controlled",
"type": "base",
"namespace": "rdk",
"attributes": {
"movement_sensor": [
"<your-orientation-or-velocity-movement-sensor-1>",
"<your-orientation-or-velocity-movement-sensor-2>"
],
"base": "<your-base>"
},
"depends_on": []
}
]
}
```

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

The following attributes are available for `sensor-controlled` bases:

<!-- prettier-ignore -->
| Name | Type | Inclusion | Description |
| ---- | ---- | --------- | ----------- |
| `movement-sensor` | array | **Required** | Array with the `name`s of any movement sensors on your base you want to gather feedback from. The driver will select the first movement sensor providing appropriate feedback for either the `SetVelocity()` or the `Spin()` endpoint. |
| `base` | string | **Required** | String with the `name` of the base you want to wrap with sensor control. |

## Test the base

{{< readfile "/static/include/components/test-control/base-control.md" >}}

The following base control API methods are available with feedback control on a `sensor-controlled` base:

- [SetVelocity()](/components/base/#setvelocity): available if base is configured to receive angular and linear velocity feedback.
- [Spin()](/components/base/#spin): available if base is configured to receive orientation feedback.

0 comments on commit c8a6cf2

Please sign in to comment.