Launch COGIP Robot Camera.
During installation of cogip-tools, setuptools is configured
to create the cogip-robotcam script using this function as entrypoint.
Source code in cogip/tools/robotcam/main.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 | def main() -> None:
"""
Launch COGIP Robot Camera.
During installation of cogip-tools, `setuptools` is configured
to create the `cogip-robotcam` script using this function as entrypoint.
"""
settings = Settings()
frame_queue = Queue(maxsize=1)
stream_queue = Queue(maxsize=1)
server.set_queues(frame_queue, stream_queue)
# Start Camera handler process
p = Process(target=start_camera_handler, args=(frame_queue, stream_queue))
p.start()
# Start web server
uvicorn.run(
app,
host="0.0.0.0",
port=8100 + settings.id,
workers=settings.nb_workers,
log_level="warning",
)
p.terminate()
p.join()
|