I’ve got a Raspberry-Pi-3-based robot that I’ve put a pixy on. Everything is running in a python program:
- webcam server using opencv (serves video from another camera at /dev/video0)
- websocket server (gets robot commands via a remote javascript websocket connection)
- PWM server (moves robot motors and various servos, using a Pololu Maestro and its python libraries)
All the above works fine.
Enter the pixycam. I’ve got the pixy python libraries working and integrated into my robot program, but when the pixy python starts its pantilt processing to follow objects, it brings the processor to its knees.
I’m thinking that multiprocessing can fix me up. Everything above is running on a single core of the processor. The raspberry pi 3 has four CPU cores, and three are going unused.
To my question…
How can I get the pixy_init() process to kick off in a separate process? I’ve googled and tried several things, but I just don’t know enough about multithreading to figure it out.
Has anyone here got any examples of the pixy python code working with python’s multiprocessing capabilities?
Thanks very much for any help.