Change model to be unique; Remove mentions of OAK-D; Update README.md to include note of caution

This commit is contained in:
hexbabe
2023-12-01 12:26:14 -05:00
parent 120a61e7e8
commit b468c02655
4 changed files with 4 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
This is an example of using AppImageBuilder to bundle a Python module as an AppImage (only supported on AArch64 for now), and then running it on a robot.
The built AppImage is a binary that runs the Viam module on any Linux AArch64 robot without installing anything else or worrying about the system Python runtime and package dependencies. It is executed via `run.sh`, and packaged to the Viam Modular Registry as a tar.gz file (see Makefile for details).
The built AppImage is a binary that runs the Viam module on any Linux AArch64 robot without installing anything else or worrying about the system Python runtime and package dependencies. It is executed via `run.sh`, and packaged to the Viam Modular Registry as a tar.gz file (see Makefile for details). Note that the AppImage bundling isn't always the best solution for packaging Viam Python modules, but likely the best choice for some use cases.
Use this repository's build process as boilerplate to deploy your own Python Viam module as an AppImage.

View File

@@ -6,7 +6,7 @@
"models": [
{
"api": "rdk:component:camera",
"model": "viam:camera:oak-d"
"model": "viam:camera:python-appimage-example"
}
],
"entrypoint": "run.sh"

View File

@@ -2,7 +2,7 @@ version: 1
script:
- python3 -m pip install -r requirements.txt # install dependency packages as modules in root (modules in this context means Python modules)
- mkdir -p AppDir/usr/lib/python3.10 && cp -r /usr/local/lib/python3.10/site-packages AppDir/usr/lib/python3.10 # cp from root into appdir; site-packages contains all our modules including dependencies
- cp -r src AppDir/usr/lib/python3.10/site-packages # add source code dir to site-packages so the OAK-D module can be discovered in PYTHONPATH and be run as a Python module
- cp -r src AppDir/usr/lib/python3.10/site-packages # add source code dir to site-packages so the module can be discovered in PYTHONPATH and be run as a Python module
- mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps/ && cp viam-server.png AppDir/usr/share/icons/hicolor/256x256/apps/ # icon is required
AppDir:

View File

@@ -30,7 +30,7 @@ class MyModule(Camera, Reconfigurable): # use a better name than this
"""The distortion parameters of the camera"""
MODEL: ClassVar[Model] = Model(ModelFamily("viam", "camera"), "oak-d") # make sure this matches the model in meta.json
MODEL: ClassVar[Model] = Model(ModelFamily("viam", "camera"), "python-appimage-example") # make sure this matches the model in meta.json
# create any class parameters here, 'some_pin' is used as an example (change/add as needed)
some_pin: int