ros-drivers / libuvc_ros

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

libuvc_camera install fails, OS X 10.11.12, ROS Indigo #31

Open gunshi opened 8 years ago

gunshi commented 8 years ago

Hi, I cloned the most recent version of the libuvc_ros repo (master) into my src folder and ran catkin_make_isolated --pkg libuvc_camera --install , and then I got an error while building, I reproduced the error, as suggested, and got:

<== Failed to process package 'libuvc_camera': Command '['/Users/gunshigupta/ros_catkin_ws/install_isolated/env.sh', 'make', '-j4', '-l4']' returned non-zero exit status 2

Reproduce this error by running: ==> cd /Users/gunshigupta/ros_catkin_ws/build_isolated/libuvc_camera && /Users/gunshigupta/ros_catkin_ws/install_isolated/env.sh make -j4 -l4

Command failed, exiting. yguns-MacBook-Pro:ros_catkin_ws gunshigupta$ cd /Users/gunshigupta/ros_catkin_ws/build_isolated/libuvc_camera && /Users/gunshigupta/ros_catkin_ws/install_isolated/env.sh make -j4 -l4 [ 14%] Built target libuvc_camera_gencfg [ 42%] Building CXX object CMakeFiles/libuvc_camera_nodelet.dir/src/camera_driver.cpp.o [ 42%] Building CXX object CMakeFiles/camera_node.dir/src/camera_driver.cpp.o /Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:193:/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp28::193 :28: error: error: use ofuse undeclaredof identifierundeclared 'uvc_mjpeg2rgb'identifier 'uvc_mjpeg2rgb' uvc_error_t conv_ret = uvc_mjpeg2rgb(frame, rgbframe); uvc_error_t conv_ret = uvc_mjpeg2rgb(frame, rgbframe);

                       ^
                       ^

/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:242::24259::59 : warning: warning:

        formatformat  specifiesspecifies  typetype  'unsigned int''unsigned int'  butbut  thethe  argumentargument  hashas  typetype  'size_t''size_t'

        (aka 'unsigned long')(aka 'unsigned long')  [-Wformat][-Wformat]

     status_class, event, selector, status_attribute, data_en);
     status_class, event, selector, status_attribute, data_len);                                                          ^~~~~~~~

                                                      ^~~~~~~~

/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:245:13: warning: /Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp : 245enumeration: 13value: 'UVC_STATUS_CLASS_CONTROL' notwarning : handled in switch enumeration value[-Wswitch] 'UVC_STATUS_CLASS_CONTROL' not handled in switch [-Wswitch] switch (status_class) { ^ switch (status_class) { ^ /Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:323:26: error: use of undeclared identifier 'uvc_find_devices'; did you mean 'uv_find_device'? uvc_error_t find_err = uvc_find_devices( ^~~~ uv_find_device /usr/local/Cellar/libuvc/0.0.5/include/libuvc/libuvc.h:371:13: note: 'uvc_find_device' declared here uvc_error_t uvc_find_device( ^ /Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:323:26: error: use of undeclared identifier 'uvc_find_devices'; did you mean 'uv_find_device'? uvc_error_t find_err = uvc_find_devices( ^~~~ uv_find_device /usr/local/Cellar/libuvc/0.0.5/include/libuvc/libuvc.h:371:13: note: 'uvc_find_device' declared here uvc_error_t uvc_find_device( ^ /Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp324::32411::11 : errorerror: :

        cannotcannot  initializeinitialize  aa  parameterparameter  ofof  typetype  'uvc_device_t **''uvc_device_t **'

        (aka 'uvc_device **')(aka 'uvc_device **')  withwith  anan  rvaluervalue  ofof  typetype  'uvc_device_t ***''uvc_device_t ***'

        (aka 'uvc_device ***')(aka 'uvc_device ***')

ctx_, &devs,    ctx_, &devs,

      ^~~~~          ^~~~~

/usr/local/Cellar/libuvc/0.0.5/include/libuvc/libuvc.h:373:20: note: passing argument to parameter 'dev' here uvc_device_t _dev, ^ /usr/local/Cellar/libuvc/0.0.5/include/libuvc/libuvc.h:373:20: note: passing argument to parameter 'dev' here uvc_device_t _dev, ^ 2 warnings and 3 errors generated. 2 warnings and 3 errors generated. make[2]: * [CMakeFiles/camera_node.dir/src/camera_driver.cpp.o] Error 1 make[2]: * [CMakeFiles/libuvc_camera_nodelet.dir/src/camera_driver.cpp.o] Error 1 make[1]: * [CMakeFiles/camera_node.dir/all] Error 2 make[1]: * Waiting for unfinished jobs.... make[1]: * [CMakeFiles/libuvc_camera_nodelet.dir/all] Error 2 make: * [all] Error 2

What do I do to fix it? Thanks!

gunshi commented 8 years ago

It looks like a version error, I have libuvc-0.0.5 from brew.

gunshi commented 8 years ago

Will downgrading libuvc to a lower version to test if this package builds, lead to errors with the already built ROS that I have?

pdvelez commented 8 years ago

I'm facing the same issue.

OS X Yosemite 10.10.5 ROS indigo brew libuvc version 0.0.5

EDIT: I was able to compile it by uninstalling brew libuvc, and installing it using cmake. https://int80k.com/libuvc/doc/index.html

gunshi commented 8 years ago

Hi, I just wanted to ask, why not libuvc_ros, and why libuvc? I mean in which case is installing the latter recommended?

pdvelez commented 8 years ago

Hi, actually I installed libuvc_ros but it worked only after installing libuvc.

3rd3 commented 8 years ago

This also solved it for me:

brew remove libuvc
git clone https://github.com/ktossell/libuvc.git
cd libuvc
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make && make install