Add boilerplate derived from OAK-D module

This commit is contained in:
hexbabe
2023-11-30 17:15:08 -05:00
parent 1d780570f4
commit f3f63a7633
12 changed files with 310 additions and 2 deletions

22
src/main.py Normal file
View File

@@ -0,0 +1,22 @@
import asyncio
from viam.components.camera import Camera
from viam.logging import getLogger
from viam.module.module import Module
from src.module import MyModule
LOGGER = getLogger(__name__)
async def main():
"""This function creates and starts a new module, after adding all desired resources.
Resources must be pre-registered. For an example, see the `__init__.py` file.
"""
module = Module.from_args()
module.add_model_from_registry(Camera.SUBTYPE, MyModule.MODEL)
await module.start()
if __name__ == "__main__":
asyncio.run(main())