This is an example of a Viam module using our Python SDK. This repo shows how to:
- Use a Python virtualenv to install your module's dependencies on the robot
- Write a simple module in Python
- Use CI to automatically publish a new version when you create a Github release
If you want to copy this repo and run it yourself, you'll need to make a few changes:
- Get the Viam CLI (todo: link to docs)
- Rename the existing
meta.json
tometa.json.old
- Use
viam module create
to create a copy in your own account - Copy all the fields except
name
from meta.json.old (your choice whether to make it public or private)
You'll need to change all the namespace references in the codebase ('viam') to the namespace of your organization on Viam.
- You should already have done this in meta.json above
- In the "model" field in meta.json (on line 9 when this was written)
- In the ModelFamily in gas_sensor.py, around here.
Instructions for setting the secret are here.