ros-drivers / libuvc_ros

http://www.ros.org/wiki/libuvc_ros
82 stars 95 forks source link

Compilation issue: "camera_driver.cpp:<line> error: <xxx> was not declared in this scope" #23

Open tobyhijzen opened 9 years ago

tobyhijzen commented 9 years ago

I am getting a bunch of errors trying to compile the code all in the following format:

"camera_driver.cpp: error: was not declared in this scope" if (uvcset##fn(devh_, val)) { \

For example:

libuvc_ros/libuvc_camera/src/camera_driver.cpp:117:34: error: 'uvc_set_gain' was not declared in this scope if (uvcset##fn(devh_, val)) {

I have installed libuvc from https://github.com/ktossell/libuvc compiling with _catkin build libuvcros

tobyhijzen commented 9 years ago

I commented out lines 129-131 in _cameradriver.cpp which solves the problem for now:

//PARAM_INT(gain, gain, new_config.gain); //PARAM_INT(iris_absolute, iris_abs, new_config.iris_absolute); //PARAM_INT(brightness, brightness, new_config.brightness);

kubiak54 commented 8 years ago

Hi tobyhijzen, I am getting the same errors, like:

/home/jakub/catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp: In member function ‘void libuvc_camera::CameraDriver::ReconfigureCallback(libuvc_camera::UVCCameraConfig&, uint32_t)’: /home/jakub/catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:117:34: error: ‘uvc_set_gain’ was not declared in this scope if (uvcset##fn(devh_, val)) { \ ^ /home/jakub/catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:129:5: note: in expansion of macro ‘PARAM_INT’ PARAM_INT(gain, gain, new_config.gain); ^ /home/jakub/catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:117:34: error: ‘uvc_set_iris_abs’ was not declared in this scope if (uvcset##fn(devh_, val)) { \ ^

Very probably the same as on your side, did you manage to solve this?

tobyhijzen commented 8 years ago

Actually I'm now compiling with libuvc-release from https://github.com/ktossell/libuvc-release. This is, I believe, the code that is also part of the ros distributed libuvc package. I'm not sure if this fixed it but you can try compiling against this first. I did make some additional changes in order to obtain the latest functionality of libuvc. Thus I forked libuvc-release branch: debian/indigo/trusty/libuvc and updated the libuvc version, https://github.com/tobyhijzen/libuvc-release.git. You can also try using this. Also make sure that you have UNinstalled the ros-indigo-libuvc when compiling your own libuvc-release otherwise ros might compile against this library.

kubiak54 commented 8 years ago

Thanks tobyhijzen, will give this a try

skohlbr commented 8 years ago

I also got this when trying to build from source on Indigo. It thus appears this package is not usable since at least half a year when trying to build from source on Indigo. I'm very interested in a proper fix :)

skohlbr commented 8 years ago

Ok, so I identified the offending commit.

5ef11b9bf54ec1d900fa4cb9cd2b5a52cfe6d5a9 checked out builds fine.

e93697b5f15c285514b8b84e5b0fe75d9d1dfba8 (part of #21) results in:

/home/kohlbrecher/hector_tracker_install/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp: In member function ‘void libuvc_camera::CameraDriver::ReconfigureCallback(libuvc_camera::UVCCameraConfig&, uint32_t)’: /home/kohlbrecher/hector_tracker_install/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:117:34: error: ‘uvc_set_gain’ was not declared in this scope if (uvc_set_##fn(devh_, val)) { \ ^ /home/kohlbrecher/hector_tracker_install/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:129:5: note: in expansion of macro ‘PARAM_INT’ PARAM_INT(gain, gain, new_config.gain); ^ /home/kohlbrecher/hector_tracker_install/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:117:34: error: ‘uvc_set_iris_abs’ was not declared in this scope if (uvc_set_##fn(devh_, val)) { \ ^ /home/kohlbrecher/hector_tracker_install/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:130:5: note: in expansion of macro ‘PARAM_INT’ PARAM_INT(iris_absolute, iris_abs, new_config.iris_absolute); ^ /home/kohlbrecher/hector_tracker_install/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:117:34: error: ‘uvc_set_brightness’ was not declared in this scope if (uvc_set_##fn(devh_, val)) { \ ^ /home/kohlbrecher/hector_tracker_install/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:131:5: note: in expansion of macro ‘PARAM_INT’ PARAM_INT(brightness, brightness, new_config.brightness); ....

skohlbr commented 8 years ago

So it appears this probably requires a updated libuvc. Are there any instructions on how to properly get a working config for compilation using a compatible libuvc?