-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOCS-1201: Update
ultrasonic
sensor docs and document ultrasonic
…
…camera (#1939)
- Loading branch information
1 parent
184742d
commit b9dcd7d
Showing
7 changed files
with
104 additions
and
10 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
title: "Configure an ultrasonic Camera" | ||
linkTitle: "ultrasonic" | ||
weight: 60 | ||
type: "docs" | ||
description: "Configure an ultrasonic model camera." | ||
tags: ["camera", "components", "ultrasonic"] | ||
icon: "/icons/components/camera.svg" | ||
images: ["/icons/components/camera.svg"] | ||
# SME: #team-bucket | ||
--- | ||
|
||
{{< alert title="Usage" color="tip" >}} | ||
An ultrasonic distance sensor can also be configured as a [sensor](/components/sensor/) resource. | ||
When configured as a sensor, you can use the sensor method [`GetReadings()`](/components/sensor/#getreadings), rather than the camera method [`GetPointCloud()`](/components/camera/#getpointcloud). | ||
{{< /alert >}} | ||
|
||
Configure an `ultrasonic` camera to integrate an ultrasonic distance sensor like the [HC-S204](https://www.sparkfun.com/products/15569) into your robot: | ||
|
||
{{< tabs >}} | ||
{{% tab name="Config Builder" %}} | ||
|
||
Navigate to the **Config** tab of your robot's page in [the Viam app](https://app.viam.com). | ||
Click on the **Components** subtab and click **Create component**. | ||
Select the `camera` type, then select the `ultrasonic` model. | ||
Enter a name for your camera and click **Create**. | ||
|
||
![Creation of a ultrasonic camera in the Viam app config builder.](/components/camera/configure-ultrasonic.png) | ||
|
||
Edit and fill in the attributes as applicable. | ||
|
||
{{% /tab %}} | ||
{{% tab name="JSON Template" %}} | ||
|
||
```json {class="line-numbers linkable-line-numbers"} | ||
{ | ||
"components": [ | ||
{ | ||
"name": "<your-ultrasonic-sensor-name>", | ||
"type": "camera", | ||
"model": "ultrasonic", | ||
"attributes": { | ||
"trigger_pin": "<pin-number>", | ||
"echo_interrupt_pin": "<pin-number>", | ||
"board": "<your-board-name>", | ||
"timeout_ms": <int> | ||
}, | ||
"depends_on": [] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
{{% /tab %}} | ||
{{% tab name="JSON Example" %}} | ||
|
||
```json {class="line-numbers linkable-line-numbers"} | ||
{ | ||
"components": [ | ||
{ | ||
"name": "your-ultrasonic-sensor", | ||
"type": "camera", | ||
"model": "ultrasonic", | ||
"attributes": { | ||
"trigger_pin": "5", | ||
"echo_interrupt_pin": "15", | ||
"board": "your-board-name", | ||
"timeout_ms": "1000" | ||
}, | ||
"depends_on": [] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
{{% /tab %}} | ||
{{% /tabs %}} | ||
|
||
The following attributes are available for `ultrasonic` cameras: | ||
|
||
{{< readfile "/static/include/components/ultrasonic-attributes.md" >}} | ||
|
||
## Next Steps | ||
|
||
{{< readfile "/static/include/components/camera-model-next-steps.md" >}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!-- prettier-ignore --> | ||
| Attribute | Type | Inclusion | Description | | ||
| --------- | ---- | --------- | ----------- | | ||
| `board` | string | **Required** | The `name` of the [board](/components/board/) the ultrasonic is wired to. | | ||
| `trigger_pin` | string | **Required** | The {{< glossary_tooltip term_id="pin-number" text="pin number" >}} of the [board's](/components/board/) GPIO pin that you have wired [the ultrasonic's trigger pin](https://www.sparkfun.com/products/15569) to. | | ||
| `echo_interrupt_pin` | string | **Required** | The {{< glossary_tooltip term_id="pin-number" text="pin number" >}} of the pin [the ultrasonic's echo pin](https://www.sparkfun.com/products/15569) is wired to on the board. If you have already created a [digital interrupt](/components/board/#digital_interrupts) for this pin in the [board's configuration](/components/board/), use that digital interrupt's `name` instead. | | ||
| `timeout_ms` | int | Optional | Time to wait in milliseconds before timing out of requesting to get ultrasonic distance readings. <br> Default: `1000`. | |