Use USB camera to take pictures on UR5e

Hi there,

we would like to connect a USB camera to the UR5e. In a program we would then like the robot to move to a position and then the camera to take a photo and save it on an inserted USB stick.
How can this be implemented? Via a URScript, using URCap and OpenCV Daemon or are there easier ways?
We don’t want to buy an expensive camera now, we have a small budget for this project.

Best Regards

Not a direct answer but I have used a Pi zeroW ($5) and the Pi camera ($20) module to take and save a picture when a handheld barcode reader triggered.

You could be something similar over a Pi GPIO pin that connects to the UR with just a little scripting.

in the Pi the command is raspistill -0 {output name}.jpg