ros-drivers / libuvc_ros

http://www.ros.org/wiki/libuvc_ros
81 stars 96 forks source link

Compilation with Clang fails #13

Closed jmtatsch closed 10 years ago

jmtatsch commented 10 years ago

Hello,

Compilation with Clang under OSX fails due to:

/Users/tatsch/catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp/Users/tatsch/catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp::128128::55:: errorerror: : use useof ofundeclared undeclaredidentifier 'uvc_set_focus_auto';identifier did 'uvc_set_focus_auto'; youdid mean you'uvc_set_focus_abs'? mean 'uvc_set_focus_abs'?

When the incriminating line is commented:

//PARAM_INT(auto_focus, focus_auto, new_config.auto_focus ? 1 : 0);

I still can't compile due to:

make[2]: * No rule to make target /usr/local/Cellar/libuvc/0.0.3/lib/libuvc.so', needed by/Users/tatsch/catkin_ws/devel/lib/libuvc_camera/camera_node'. Stop. make[1]: * [libuvc_ros/libuvc_camera/CMakeFiles/camera_node.dir/all] Error 2 make[1]: * Waiting for unfinished jobs.... make[2]: * No rule to make target /usr/local/Cellar/libuvc/0.0.3/lib/libuvc.so', needed by/Users/tatsch/catkin_ws/devel/lib/liblibuvc_camera_nodelet.dylib'. Stop. make[1]: *\ [libuvc_ros/libuvc_camera/CMakeFiles/libuvc_camera_nodelet.dir/all] Error 2

But I guess that is libuvc's fault? Or can somebody give me some hints?

ktossell commented 10 years ago

For the first part: it's looking for a function (uvc_set_focus_auto) that wasn't available in libuvc 0.0.3. Could you try updating to 0.0.5 or to the latest git revision of libuvc?

The second part: yes, it's because libuvc's cmake module assumes that the library's called libuvc.so (should be something like libuvc.dylib on OS X). Do you have a libuvc.dylib in your /usr/local/Cellar/libuvc/0.0.3/lib directory? I've just pushed a new revision to libuvc.git to fix the '.so' assumption. https://github.com/ktossell/libuvc/commit/235701b14ec54f5b49ed020791dea6a07a0e8139

jmtatsch commented 10 years ago

Works like a charm, thanks a million!

jmtatsch commented 10 years ago

Unfortunately I still can't get a picture out of the builtin camera of MacBook Pro

rosrun libuvc_camera camera_node vendor:=0x106B yields uvc_find_device: No such device (-4) or sudo -E rosrun libuvc_camera camera_node vendor:=0x106B yields dyld: Library not loaded: librospack.dylib Referenced from: /opt/ros/hydro/bin/rospack Reason: image not found

Am I doing something wrong here or are the builtin cameras simply not uvc capable?

ktossell commented 10 years ago

It may be a PCI device, not USB: http://mactaris.blogspot.com/2013/07/webcam-settings-20-will-support.html

jmtatsch commented 10 years ago

Good point, it really is a PCI camera, seems like all new Facetime HD cameras will be. Support in libuvc doesn't really make sense, right?