ros-drivers / pointgrey_camera_driver

ROS driver for Pt. Grey cameras, based on the official FlyCapture2 SDK.
128 stars 180 forks source link

Download flycapture if header files are missing #112

Closed kmhallen closed 6 years ago

kmhallen commented 7 years ago

Build failure when pointgrey_camera_driver is installed in /opt/ros and built from source in a user's workspace. The workspace source code will find libflycapture.so.2 in ``/opt/ros```, but the header files are missing.

This is solved by requiring the file flycapture/FlyCapture2.h as well.

mikepurvis commented 7 years ago

Can you clarify which version you experienced this on? I believe the just-released-to-Kinetic 0.13.1 should do this correctly already. You can check yourself by building the installspace of the current master, then extending that and building the driver from source again in an overlay workspace.

Let me know.

kmhallen commented 7 years ago

I have attached a script that reproduces the problem when flycapture is not installed. This PR fixes the error.
ptgrey.bash.tar.gz

Error message with 0.13.1

==> Processing catkin package: 'pointgrey_camera_driver'
==> Creating build directory: 'build_isolated/pointgrey_camera_driver'
==> Building with env: '/home/kmhallen/ws2/install_isolated/env.sh'
==> cmake /home/kmhallen/ws2/src/pointgrey_camera_driver/pointgrey_camera_driver -DCATKIN_DEVEL_PREFIX=/home/kmhallen/ws2/devel_isolated/pointgrey_camera_driver -DCMAKE_INSTALL_PREFIX=/home/kmhallen/ws2/install_isolated -DCMAKE_BUILD_TYPE=Release -G Unix Makefiles in '/home/kmhallen/ws2/build_isolated/pointgrey_camera_driver'
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CATKIN_DEVEL_PREFIX: /home/kmhallen/ws2/devel_isolated/pointgrey_camera_driver
-- Using CMAKE_PREFIX_PATH: /home/kmhallen/ws2/install_isolated;/home/kmhallen/ws1/install_isolated;/opt/ros/kinetic
-- This workspace overlays: /home/kmhallen/ws2/install_isolated;/home/kmhallen/ws1/install_isolated;/opt/ros/kinetic
-- Found PythonInterp: /usr/bin/python (found version "2.7.12") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/kmhallen/ws2/build_isolated/pointgrey_camera_driver/test_results
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.6
-- libflycapture found in system library path
-- libflycapture library: /home/kmhallen/ws1/install_isolated/lib/libflycapture.so.2
-- libflycapture copied from: /home/kmhallen/ws1/install_isolated/lib/libflycapture.so.2 into /home/kmhallen/ws2/devel_isolated/pointgrey_camera_driver/lib/libflycapture.so.2
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kmhallen/ws2/build_isolated/pointgrey_camera_driver
==> make -j8 -l8 in '/home/kmhallen/ws2/build_isolated/pointgrey_camera_driver'
Scanning dependencies of target pointgrey_camera_driver_gencfg
[  7%] Generating dynamic reconfigure files from cfg/PointGrey.cfg: /home/kmhallen/ws2/devel_isolated/pointgrey_camera_driver/include/pointgrey_camera_driver/PointGreyConfig.h /home/kmhallen/ws2/devel_isolated/pointgrey_camera_driver/lib/python2.7/dist-packages/pointgrey_camera_driver/cfg/PointGreyConfig.py
Generating reconfiguration files for PointGrey in pointgrey_camera_driver
Wrote header file in /home/kmhallen/ws2/devel_isolated/pointgrey_camera_driver/include/pointgrey_camera_driver/PointGreyConfig.h
[  7%] Built target pointgrey_camera_driver_gencfg
Scanning dependencies of target PointGreyCamera
[ 15%] Building CXX object CMakeFiles/PointGreyCamera.dir/src/PointGreyCamera.cpp.o
In file included from /home/kmhallen/ws2/src/pointgrey_camera_driver/pointgrey_camera_driver/src/PointGreyCamera.cpp:32:0:
/home/kmhallen/ws2/src/pointgrey_camera_driver/pointgrey_camera_driver/include/pointgrey_camera_driver/PointGreyCamera.h:46:36: fatal error: flycapture/FlyCapture2.h: No such file or directory
compilation terminated.
CMakeFiles/PointGreyCamera.dir/build.make:62: recipe for target 'CMakeFiles/PointGreyCamera.dir/src/PointGreyCamera.cpp.o' failed
make[2]: *** [CMakeFiles/PointGreyCamera.dir/src/PointGreyCamera.cpp.o] Error 1
CMakeFiles/Makefile2:1275: recipe for target 'CMakeFiles/PointGreyCamera.dir/all' failed
make[1]: *** [CMakeFiles/PointGreyCamera.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
<== Failed to process package 'pointgrey_camera_driver': 
  Command '['/home/kmhallen/ws2/install_isolated/env.sh', 'make', '-j8', '-l8']' returned non-zero exit status 2

Reproduce this error by running:
==> cd /home/kmhallen/ws2/build_isolated/pointgrey_camera_driver && /home/kmhallen/ws2/install_isolated/env.sh make -j8 -l8

Command failed, exiting.
Lohrer commented 7 years ago

I'm seeing this issue on 0.13.1 in Kinetic.

Baycken commented 7 years ago

I am experiencing this on ARM architecture, as the installation instruction provided by PointGrey is incomplete. The PointGrey instuction only tell users to copy lib folder but not include folder. This cause the compilation to fail as the cmake wrongly assumes if the compiled lib files exist then the header files must exist.

mikepurvis commented 6 years ago

Cool, thanks.