Skip to content

Commit

Permalink
Merge branch 'main' into 1804safetyhat
Browse files Browse the repository at this point in the history
  • Loading branch information
JessamyT authored Mar 7, 2024
2 parents df298b6 + 0ac496f commit e91d96f
Show file tree
Hide file tree
Showing 15 changed files with 376 additions and 37 deletions.
1 change: 1 addition & 0 deletions .htmltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ IgnoreURLs:
- "marketplace.visualstudio.com"
- "chrome.google.com"
- "raspberrypi.com"
- "grabcad.com"
IgnoreDirs:
- "lib"
CacheExpires: "6h"
Expand Down
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions docs/build/program/apis/data-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ To use the Viam data client API, you first need to instantiate a [`ViamClient`](

You will also need an API key and API key ID to authenticate your session.
To get an API key (and corresponding ID), you have two options:
See the following example for reference.

To get an API key and API key ID to authenticate, you have two options:

- [Create an API key using the Viam app](/fleet/rbac/#add-an-api-key)
- [Create an API key using the Viam CLI](/fleet/cli/#create-an-organization-api-key)

The following example instantiates a `ViamClient`, authenticating with an API key, and then instantiates a `DataClient`:

```python {class="line-numbers linkable-line-numbers"}
import asyncio

Expand Down
2 changes: 1 addition & 1 deletion docs/components/base/sensor-controlled.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ 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. |
| `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. <br> If your sensor has an adjustable frequency or period, set the frequency to something greater than or equal to the default base control loop frequency of 20Hz, or set the period to something less than or equal to the corresponding period of 50msecs. |
| `base` | string | **Required** | String with the `name` of the base you want to wrap with sensor control. |
| `control_parameters` | object | Optional | A JSON object containing the coefficients for the proportional, integral, and derivative terms for linear and angular velocity. If you want these values to be auto-tuned, you can set all values to 0: `[ { "type": "linear_velocity", "p": 0, "i": 0, "d": 0 }, { "type": "angular_velocity", "p": 0, "i": 0, "d": 0 } ]`, and `viam-server` will auto-tune and log the calculated values. Tuning takes several seconds and spins the motors. Copy the values from the logs and add them to the configuration once tuned for the values to take effect. If you need to auto-tune multiple controlled components that depend on the same hardware, such as a sensor controlled base and one of the motors on the base, run the auto-tuning process one component at a time. For more information see [Feedback contrel](#feedback-control). |

Expand Down
4 changes: 2 additions & 2 deletions docs/components/camera/fake.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ The following attributes are available for `fake` cameras:
<!-- prettier-ignore -->
| Name | Type | Inclusion | Description |
| ---- | ---- | --------- | ----------- |
| `width` | int | Optional | The width of the image in pixels. The default width is 1280. |
| `height` | int | Optional | The height of the image in pixels. The default height is 720. |
| `width` | int | Optional | The width of the image in pixels. The default width is 1280. The maximum width is 10000. |
| `height` | int | Optional | The height of the image in pixels. The default height is 720. The maximum height is 10000. |

## View the camera stream

Expand Down
2 changes: 1 addition & 1 deletion docs/components/movement-sensor/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ To use your GPS, IMU, accelerometer, or other movement sensor with Viam, check w

Viam supports several different models of movement sensor.
For configuration information, click on the model name:
Click the model names below for configuration information:

<!-- prettier-ignore -->
Model | Description <a name="model-table"></a>
----- | -----------
[`gps-nmea`](./gps/gps-nmea/) | [NMEA-based](https://en.wikipedia.org/wiki/NMEA_0183) GPS models
[`gps-nmea-rtk-pmtk`](./gps/gps-nmea-rtk-pmtk/) | [NTRIP-based](https://en.wikipedia.org/wiki/Networked_Transport_of_RTCM_via_Internet_Protocol) [RTK](https://en.wikipedia.org/wiki/Real-time_kinematic_positioning) GPS models using I<sup>2</sup>C (**experimental**)
[`gps-nmea-rtk-serial`](./gps/gps-nmea-rtk-serial/) | [NTRIP-based](https://en.wikipedia.org/wiki/Networked_Transport_of_RTCM_via_Internet_Protocol) [RTK](https://en.wikipedia.org/wiki/Real-time_kinematic_positioning) GPS models using serial communication (**experimental**)
[`dual-gps-rtk`](./gps/dual-gps-rtk/) | A movement sensor that calculates compass heading from two GPS movement sensors
[`imu-wit`](./imu/imu-wit/) | IMUs manufactured by [WitMotion](https://www.wit-motion.com/)
[`accel-adxl345`](./adxl345/) | The [Analog Devices ADXL345](https://www.analog.com/en/products/adxl345.html) digital accelerometer
[`gyro-mpu6050`](./mpu6050/) | A gyroscope/accelerometer manufactured by TDK InvenSense
Expand Down
114 changes: 114 additions & 0 deletions docs/components/movement-sensor/gps/dual-gps-rtk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
title: "Configure a Dual GPS Movement Sensor"
linkTitle: "dual-gps-rtk"
weight: 10
type: "docs"
description: "Configure a movement sensor that calculates compass heading from two gps movement sensors."
images: ["/icons/components/imu.svg"]
# SMEs: Rand
---

The `dual-gps-rtk` model of movement sensor calculates compass heading from two GPS movement sensors, and returns the midpoint position between the first and second GPS devices as its position.
In addition to [`GetCompassHeading()`](/components/movement-sensor/#getcompassheading), this model provides data for [`GetPosition()`](/components/movement-sensor/#getposition) and [`GetAccuracy()`](/components/movement-sensor/#getaccuracy).

{{< tabs >}}
{{% 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 `movement-sensor` type, then select the `dual-gps-rtk` model.
Enter a name for your movement sensor and click **Create**.

![Creation of a `dual-gps-rtk` movement sensor in the Viam app config builder.](/components/movement-sensor/dual-gps-rtk-builder.png)

Copy and paste the following attribute template into your movement sensor's **Attributes** box.
Then remove and fill in the attributes as applicable to your movement sensor, according to the table below.

{{< tabs >}}
{{% tab name="Attributes template" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"first_gps": "<name-of-your-first-gps-movement-sensor>",
"second_gps": "<name-of-your-second-gps-movement-sensor>",
"offset_degrees": <int>
}
```

{{% /tab %}}
{{% tab name="Attributes example" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"first_gps": "nmea-1",
"second_gps": "nmea-2",
"offset_degrees": 90
}
```

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

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

```json {class="line-numbers linkable-line-numbers"}
{
"components": [
{
"name": "your-dual-gps-rtk",
"model": "dual-gps-rtk",
"type": "movement_sensor",
"namespace": "rdk",
"attributes": {
"first_gps": "<name-of-your-first-gps-movement-sensor>",
"second_gps": "<name-of-your-second-gps-movement-sensor>",
"offset_degrees": <int>
},
"depends_on": []
}
]
}
```

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

```json {class="line-numbers linkable-line-numbers"}
{
"components": [
{
"name": "your-dual-gps-rtk",
"model": "dual-gps-rtk",
"type": "movement_sensor",
"namespace": "rdk",
"attributes": {
"first_gps": "nmea-1",
"second_gps": "nmea-2",
"offset_degrees": 90
},
"depends_on": []
}
]
}
```

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

The following attributes are available for a `dual-gps-rtk` movement sensor:

<!-- prettier-ignore -->
| Name | Type | Inclusion | Description |
| ---- | ---- | --------- | ----------- |
| `first_gps` | int | **Required** | The name you have configured for the first movement sensor you want to combine the measurements from. Must be a GPS model. |
| `second_gps` | string | **Required** | The name you have configured for the second movement sensor you want to combine the measurements from. Must be a GPS model. |
| `offset_degrees` | int | Optional | The value to offset the compass heading calculation between the two GPS devices based on their positions on the base. Calculate this as the degrees between the vector from `first_gps` to `second_gps` and the vector from the vehicle's back to the vehicle's front, counterclockwise. {{< imgproc src="/components/movement-sensor/offset_degrees.png" alt="Rand's diagram of 3 offset degree calculations." resize="600x" >}} <br> Default: `90` |

## Test the movement sensor

After you configure your movement sensor, navigate to the [Control tab](/fleet/machines/#control) and select the dedicated movement sensor dropdown panel.
This panel presents the data collected by the movement sensor.
The sections in the panel include the position, compass heading, and accuracy.

{{<imgproc src="/components/movement-sensor/movement-sensor-control-tab-dual.png" resize="800x" declaredimensions=true alt="The dual GPS movement sensor component in the control tab">}}
2 changes: 1 addition & 1 deletion docs/data/upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Also unlike data sync, this method _does not_ delete data from your device.
Upload images as machine data straight from your phone, skipping the normal data capture and cloud synchronization process, through the [Viam mobile app](/fleet/#the-viam-mobile-app).
This is useful if you want to capture images for training machine learning models on the go.

1. Select **Home** on the mobile app, choose your organization, and select a location and machine.
1. Select an organization by swiping left to right or clicking on the menu icon in the top left corner and tap an organization. Then tap the **Locations** tab and select a location and machine.
2. Click the menu button marked "**...**" in the upper right corner.
3. Click **Upload Images**.
4. Select each image you want to upload, and click **Add**.
Expand Down
2 changes: 1 addition & 1 deletion docs/fleet/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ If you update and release your module as part of a continuous integration (CI) w
| command option | description | positional arguments
| ----------- | ----------- | ----------- |
| `create` | generate new metadata for a custom module on your local filesystem | - |
| `update` | update an existing custom module on your local filesystem with recent changes to the [`meta.json` file](#the-metajson-file) | - |
| `update` | update an existing custom module on your local filesystem with recent changes to the [`meta.json` file](#the-metajson-file). Note that the `upload` command automatically runs `update` for you; you do not need to explicitly run `update` if you are also running `upload` | - |
| `upload` | validate and upload a new or existing custom module on your local filesystem to the Viam registry. See [Upload validation](#upload-validation) for more information | **module-path** : specify the path to the file, directory, or compressed archive (with `.tar.gz` or `.tgz` extension) that contains your custom module code |
| `build start` | start a module build in a cloud runner using the build step in your [`meta.json` file](#the-metajson-file). See [Using the `build` subcommand](#using-the-build-subcommand) | - |
| `build local` | start a module build locally using the build step in your [`meta.json` file](#the-metajson-file). See [Using the `build` subcommand](#using-the-build-subcommand) | - |
Expand Down
Loading

0 comments on commit e91d96f

Please sign in to comment.