Connect USB Webcam to UR Control Box USB3.0 just to take images

our goal is to connect a usb webcam to the usb 3 port on the UR control box and trigger it to take images as the robot moves around. These images will be saved onto either the control box itself or on a usb storage stick located on the second usb 2.0 port on the control box.

Is this Doable?

Option 1: URCAP

One way to do it is by developing a URCAP.

For example if you wanted to take a picture at a specific point in the program, you could create a URCap node that takes a picture (e.g. by sending a command to a daemon) when the node is reached in the program.

Another example is if you want a picture to be taken every few seconds, you can create a background thread that takes a picture. Just make sure you have some way of managing the number of pictures taken as this could end up filling up the storage!

You could also create an installation node where you can set various parameters/calibrate the camera.

I would say this is probably the best option if you’d like the camera to be fully controlled directly from the robot controller.

Option 2: External PC

You can connect the webcam to an external PC and use a communication interface (i.e. ethernet) to connect it to the robot. With that you can set-up a program in the PC that opens a socket and waits for a “take picture” command which can be sent from the the UR Controller.

Option 3: Camera I/O Trigger

Another way is to use some form of external trigger option that some cameras provide and connect it with a digital out pin from the robot controller. Then in the program tree you can simply use the set node to set the output high/send a pulse signal. The camera would need some form of internal memory however.

You can also look for industrial cameras that have this functionality built-in.

Feel free to DM me if you need further info on the URCAP option.

Thanks for the awesome and quick reply! We ended up doing Option 3 using a 24V to 3.3V Level shifter between the UR Control Box and a RaspberryPi

2 Likes

How do i get started with developing a URCAP?

You can go to the official URCap tutorial series and start from here: https://plus.universal-robots.com/myfirsturcap/ or here: https://plus.universal-robots.com/urcap-basics/

For this application though, you might also need to take a look at some of the example caps on their Github: Universal Robots A/S · GitHub

You might need to also install some drivers for the webcam into the UR Controller, before doing that I’d recommend doing a full system back-up.

If you’re interested in getting a URCap made for you, you can DM me.

Best of luck!

1 Like

Thanks! I’ll try it myself first and will ping/hire you if I need help!
s

1 Like

I was wondering the your attempt with option 3 was successful or not ? we are starting same project as yours

Nice, this is what I would do if you hate Java (also avoiding installing any packages on the robot unless you dig Python 2.7)

  1. Write a Python 3 + OpenCV script/class for capture/save.
  2. Make the capture function available on an XMLRPC server (Also Python).
  3. Package into a binary with Pyinstaller inside a 32-bit Linux VM.
  4. Move the binary to the robot and have the code/server start on boot as a service.
  5. Call the capture function with XMLRPC in the robot code.
  6. Profit?

Edit: step 4 could also use the demo daemon URCap to run the binary once Polyscope is loaded but now you’ve got to keep track of URCap versions as well as Polyscope gets updated.