Skip to content

Commit 253275c

Browse files
committed
docs: add README, link configuration instructions for module
1 parent 9950ed0 commit 253275c

File tree

2 files changed

+67
-4
lines changed

2 files changed

+67
-4
lines changed

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# `refill-controller` module
2+
3+
This [module](https://docs.viam.com/registry/modular-resources/) implements the [`rdk:service:generic` API](https://docs.viam.com/appendix/apis/services/generic/) for the Smart Snack Dispenser demo.
4+
5+
With this model, you can set up automated refilling of a snack bowl from a motorized dispenser using computer vision.
6+
7+
## Requirements
8+
9+
This module assumes you have a Viam machine configured with a camera component, a motor component, and a vision service that can perform image classification.
10+
11+
## Model: viam-demo:refill-controller:refiller
12+
13+
With this model, you can set up automated refilling of a snack bowl from a motorized dispenser using computer vision.
14+
15+
Navigate to the [**CONFIGURE** tab](https://docs.viam.com/configure/) of your [machine](https://docs.viam.com/fleet/machines/) in the [Viam app](https://app.viam.com/).
16+
[Add `viam-demo:refill-controller` to your machine](https://docs.viam.com/configure/#services).
17+
18+
### Attributes
19+
20+
The following attributes are available for `viam-demo:refill-controller:refiller` generic service:
21+
22+
| Name | Type | Required? | Default | Description |
23+
| ------- | ------ | ------------ | ------- | ----------- |
24+
| `camera_name` | string | Required | N/A | The name of the camera component to use to get images. |
25+
| `motor_name` | string | Required | N/A | The name of the motor component to use to dispense snacks. |
26+
| `vision_name` | string | Required | N/A | The name of the vision service to use to get classifications using the image from the camera. |
27+
| `confidence_level` | number | Optional | 0.55 | Number between 0 and 1 as a minimum percentage of confidence for the returned classifications from the vision service |
28+
29+
### Example configuration
30+
31+
```json
32+
{
33+
"camera_name": "camera-1",
34+
"motor_name": "motor-1",
35+
"vision_name": "vision-1"
36+
}
37+
```
38+
39+
## Commands
40+
41+
This module implements the following commands to be used by the `DoCommand` method in the Control tab of the Viam app or one of the language SDKs.
42+
43+
**start**
44+
45+
Start the control loop for detecting an empty bowl and triggering refills.
46+
47+
```json
48+
{
49+
"start": []
50+
}
51+
```
52+
53+
**stop**
54+
55+
Stop the control loop.
56+
57+
```json
58+
{
59+
"stop": []
60+
}
61+
```

meta.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
22
"$schema": "https://dl.viam.dev/module.schema.json",
33
"module_id": "viam-demo:refill-controller",
4-
"visibility": "private",
5-
"url": "",
4+
"visibility": "public",
5+
"url": "https://github.com/viam-devrel/refill-controller",
66
"description": "Modular generic service: refiller",
77
"models": [
88
{
99
"api": "rdk:service:generic",
10-
"model": "viam-demo:refill-controller:refiller"
10+
"model": "viam-demo:refill-controller:refiller",
11+
"short_description": "Automatically run a motor based on classifications from a vision service",
12+
"markdown_link": "README.md#model-viam-demorefill-controllerrefiller"
1113
}
1214
],
1315
"entrypoint": "dist/main",
@@ -21,4 +23,4 @@
2123
"linux/arm64"
2224
]
2325
}
24-
}
26+
}

0 commit comments

Comments
 (0)