Take a picture with a webcam from within ROS
I posted this before, but then realized it should probably be its own question!
I have been browsing for hours! I am still confused...
I am running ROS Diamondback in Ubuntu. My codes compile, but I the webcam will not work with it!
I have a 2 Microsoft Webcams, and call opencv functions from within ROS, but the camera will not initialize. I don't understand it. I am just calling
capture = cvCaptureFromCAM(1); if (!capture) { printf("Couldn't initialize the camera for picture taking!\n"); return -1; }
and each time, the camera will not initialize!
I thought it had something to do with the fact that I didn't have a driver. However, i downloaded the usb_cam driver. I don't know how to link this in with the code to make it so that ROS can call opencv functions.
My ultimate goal is to use stereovision (2 cameras).
I can't even get one to work. What on earth do I have to do in order to get ROS to recognize my camera, and take pictures/video from inside a ROS node?!
-jj