srv / fovis

ROS wrapper for fovis, a visual odometry library
23 stars 21 forks source link

Unable to build the package #12

Closed jackcviers closed 9 years ago

jackcviers commented 9 years ago
catkin_make
Base path: /home/jackcviers/Development/fovis_ws
Source space: /home/jackcviers/Development/fovis_ws/src
Build space: /home/jackcviers/Development/fovis_ws/build
Devel space: /home/jackcviers/Development/fovis_ws/devel
Install space: /home/jackcviers/Development/fovis_ws/install
####
#### Running command: "cmake /home/jackcviers/Development/fovis_ws/src -DCATKIN_DEVEL_PREFIX=/home/jackcviers/Development/fovis_ws/devel -DCMAKE_INSTALL_PREFIX=/home/jackcviers/Development/fovis_ws/install" in "/home/jackcviers/Development/fovis_ws/build"
####
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- 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
-- 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
-- Using CATKIN_DEVEL_PREFIX: /home/jackcviers/Development/fovis_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /opt/ros/indigo
-- Found PythonInterp: /usr/bin/python (found version "2.7.6") 
-- 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/jackcviers/Development/fovis_ws/build/test_results
-- Looking for include file pthread.h
-- Looking for include file 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.6.9
-- BUILD_SHARED_LIBS is on
WARNING: Package "libg2o" does not follow the version conventions. It should not contain leading zeros (unless the number is 0).
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 2 packages in topological order:
-- ~~  - fovis (metapackage)
-- ~~  - fovis_ros
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin metapackage: 'fovis'
-- ==> add_subdirectory(fovis/fovis)
-- +++ processing catkin package: 'fovis_ros'
-- ==> add_subdirectory(fovis/fovis_ros)
-- Using these message generators: gencpp;genlisp;genpy
-- checking for module 'eigen3'
--   found eigen3, version 3.2.0
-- Found eigen: /usr/include/eigen3  
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
-- checking for module 'flann'
--   found flann, version 1.8.4
-- Found Flann: /usr/lib/x86_64-linux-gnu/libflann_cpp_s.a  
-- Found qhull: /usr/lib/x86_64-linux-gnu/libqhull.so  
-- checking for module 'openni-dev'
--   package 'openni-dev' not found
-- Found openni: /usr/lib/libOpenNI.so  
-- Found libusb-1.0: /usr/include  
-- checking for module 'openni-dev'
--   package 'openni-dev' not found
-- checking for module 'openni-dev'
--   package 'openni-dev' not found
-- looking for PCL_COMMON
-- Found PCL_COMMON: /usr/lib/libpcl_common.so  
-- looking for PCL_KDTREE
-- Found PCL_KDTREE: /usr/lib/libpcl_kdtree.so  
-- looking for PCL_OCTREE
-- Found PCL_OCTREE: /usr/lib/libpcl_octree.so  
-- looking for PCL_SEARCH
-- Found PCL_SEARCH: /usr/lib/libpcl_search.so  
-- looking for PCL_SURFACE
-- Found PCL_SURFACE: /usr/lib/libpcl_surface.so  
-- looking for PCL_GEOMETRY
-- Found PCL_GEOMETRY: /usr/include/pcl-1.7  
-- looking for PCL_SAMPLE_CONSENSUS
-- Found PCL_SAMPLE_CONSENSUS: /usr/lib/libpcl_sample_consensus.so  
-- looking for PCL_FILTERS
-- Found PCL_FILTERS: /usr/lib/libpcl_filters.so  
-- looking for PCL_FEATURES
-- Found PCL_FEATURES: /usr/lib/libpcl_features.so  
-- looking for PCL_SEGMENTATION
-- Found PCL_SEGMENTATION: /usr/lib/libpcl_segmentation.so  
-- looking for PCL_IO
-- Found PCL_IO: /usr/lib/libpcl_io.so  
-- looking for PCL_REGISTRATION
-- Found PCL_REGISTRATION: /usr/lib/libpcl_registration.so  
-- looking for PCL_KEYPOINTS
-- Found PCL_KEYPOINTS: /usr/lib/libpcl_keypoints.so  
-- looking for PCL_RECOGNITION
-- Found PCL_RECOGNITION: /usr/lib/libpcl_recognition.so  
-- looking for PCL_VISUALIZATION
-- Found PCL_VISUALIZATION: /usr/lib/libpcl_visualization.so  
-- looking for PCL_PEOPLE
-- Found PCL_PEOPLE: /usr/lib/libpcl_people.so  
-- looking for PCL_OUTOFCORE
-- Found PCL_OUTOFCORE: /usr/lib/libpcl_outofcore.so  
-- looking for PCL_TRACKING
-- Found PCL_TRACKING: /usr/lib/libpcl_tracking.so  
-- looking for PCL_APPS
-- Found PCL_APPS: /usr/lib/libpcl_apps.so  
-- Found PCL: /usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_iostreams.so;/usr/lib/x86_64-linux-gnu/libboost_serialization.so;/usr/lib/x86_64-linux-gnu/libpthread.so;optimized;/usr/lib/libpcl_common.so;debug;/usr/lib/libpcl_common.so;optimized;/usr/lib/x86_64-linux-gnu/libflann_cpp_s.a;debug;/usr/lib/x86_64-linux-gnu/libflann_cpp_s.a;optimized;/usr/lib/libpcl_kdtree.so;debug;/usr/lib/libpcl_kdtree.so;optimized;/usr/lib/libpcl_octree.so;debug;/usr/lib/libpcl_octree.so;optimized;/usr/lib/libpcl_search.so;debug;/usr/lib/libpcl_search.so;optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so;optimized;/usr/lib/libpcl_surface.so;debug;/usr/lib/libpcl_surface.so;optimized;/usr/lib/libpcl_sample_consensus.so;debug;/usr/lib/libpcl_sample_consensus.so;optimized;/usr/lib/libpcl_filters.so;debug;/usr/lib/libpcl_filters.so;optimized;/usr/lib/libpcl_features.so;debug;/usr/lib/libpcl_features.so;optimized;/usr/lib/libpcl_segmentation.so;debug;/usr/lib/libpcl_segmentation.so;/usr/lib/libOpenNI.so;vtkCommon;vtkRendering;vtkHybrid;vtkCharts;optimized;/usr/lib/libpcl_io.so;debug;/usr/lib/libpcl_io.so;optimized;/usr/lib/libpcl_registration.so;debug;/usr/lib/libpcl_registration.so;optimized;/usr/lib/libpcl_keypoints.so;debug;/usr/lib/libpcl_keypoints.so;optimized;/usr/lib/libpcl_recognition.so;debug;/usr/lib/libpcl_recognition.so;optimized;/usr/lib/libpcl_visualization.so;debug;/usr/lib/libpcl_visualization.so;optimized;/usr/lib/libpcl_people.so;debug;/usr/lib/libpcl_people.so;optimized;/usr/lib/libpcl_outofcore.so;debug;/usr/lib/libpcl_outofcore.so;optimized;/usr/lib/libpcl_tracking.so;debug;/usr/lib/libpcl_tracking.so;optimized;/usr/lib/libpcl_apps.so;debug;/usr/lib/libpcl_apps.so;/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_iostreams.so;/usr/lib/x86_64-linux-gnu/libboost_serialization.so;/usr/lib/x86_64-linux-gnu/libpthread.so;optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so;/usr/lib/libOpenNI.so;optimized;/usr/lib/x86_64-linux-gnu/libflann_cpp_s.a;debug;/usr/lib/x86_64-linux-gnu/libflann_cpp_s.a;vtkCommon;vtkRendering;vtkHybrid;vtkCharts  
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   signals
--   thread
-- fovis_ros: 1 messages, 0 services
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jackcviers/Development/fovis_ws/build
####
#### Running command: "make -j8 -l8" in "/home/jackcviers/Development/fovis_ws/build"
####
Scanning dependencies of target _fovis_ros_generate_messages_check_deps_FovisInfo
Scanning dependencies of target std_msgs_generate_messages_cpp
Scanning dependencies of target std_msgs_generate_messages_py
Scanning dependencies of target std_msgs_generate_messages_lisp
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] [  0%] Built target std_msgs_generate_messages_cpp
Built target std_msgs_generate_messages_py
[  0%] Built target _fovis_ros_generate_messages_check_deps_FovisInfo
Scanning dependencies of target fovis_ros_generate_messages_cpp
Scanning dependencies of target fovis_ros_generate_messages_py
Scanning dependencies of target fovis_ros_generate_messages_lisp
[ 28%] [ 28%] [ 42%] Generating C++ code from fovis_ros/FovisInfo.msg
Generating Lisp code from fovis_ros/FovisInfo.msg
Generating Python from MSG fovis_ros/FovisInfo
[ 57%] [ 57%] Built target fovis_ros_generate_messages_lisp
Generating Python msg __init__.py for fovis_ros
[ 57%] Built target fovis_ros_generate_messages_py
[ 57%] Built target fovis_ros_generate_messages_cpp
Scanning dependencies of target fovis_ros_generate_messages
Scanning dependencies of target visualization
[ 57%] Built target fovis_ros_generate_messages
[ 71%] Building CXX object fovis/fovis_ros/CMakeFiles/visualization.dir/src/visualization.cpp.o
/home/jackcviers/Development/fovis_ws/src/fovis/fovis_ros/src/visualization.cpp: In function ‘cv::Mat fovis_ros::visualization::paint(const fovis::VisualOdometry*)’:
/home/jackcviers/Development/fovis_ws/src/fovis/fovis_ros/src/visualization.cpp:118:32: error: ‘CV_GRAY2BGR’ was not declared in this scope
   cv::cvtColor(canvas, canvas, CV_GRAY2BGR);
                                ^
/home/jackcviers/Development/fovis_ws/src/fovis/fovis_ros/src/visualization.cpp:138:11: error: ‘CV_FONT_HERSHEY_SIMPLEX’ was not declared in this scope
           CV_FONT_HERSHEY_SIMPLEX, 1.0, cv::Scalar(0, 255, 255), 3);
           ^
make[2]: *** [fovis/fovis_ros/CMakeFiles/visualization.dir/src/visualization.cpp.o] Error 1
make[1]: *** [fovis/fovis_ros/CMakeFiles/visualization.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed

I tried the suggestion from #11.

I looked in /usr/include/opencv2/imgproc/imgproc.hpp and it appears that the constants have changed:

imgproc.hpp#L866-874:

    COLOR_BGR2GRAY    =6,
    COLOR_RGB2GRAY    =7,
    COLOR_GRAY2BGR    =8,
    COLOR_GRAY2RGB    =COLOR_GRAY2BGR,
    COLOR_GRAY2BGRA   =9,
    COLOR_GRAY2RGBA   =COLOR_GRAY2BGRA,
    COLOR_BGRA2GRAY   =10,
    COLOR_RGBA2GRAY   =11,

I believe that you are trying to use COLOR_RGB2GRAY, so I substituted cv::COLOR_RGB2GRAY that in place of the error.

For the CV_FONT_HERSHEY_SIMPLEX error, I see that opencv/core/core.hpp has FONT_HERSHEY_SIMPLEX, so I added that include and substitutee cv::FONT_HERSHEY_SIMPLEX that in place of that error.

That's when things get weird.

catkin_make
Base path: /home/jackcviers/Development/fovis_ws
Source space: /home/jackcviers/Development/fovis_ws/src
Build space: /home/jackcviers/Development/fovis_ws/build
Devel space: /home/jackcviers/Development/fovis_ws/devel
Install space: /home/jackcviers/Development/fovis_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/jackcviers/Development/fovis_ws/build"
####
####
#### Running command: "make -j8 -l8" in "/home/jackcviers/Development/fovis_ws/build"
####
[  0%] Built target std_msgs_generate_messages_py
[  0%] [  0%] Built target std_msgs_generate_messages_lisp
Built target std_msgs_generate_messages_cpp
[  0%] Built target _fovis_ros_generate_messages_check_deps_FovisInfo
[ 42%] [ 57%] [ 57%] Built target fovis_ros_generate_messages_py
Built target fovis_ros_generate_messages_cpp
Built target fovis_ros_generate_messages_lisp
Scanning dependencies of target visualization
[ 57%] Built target fovis_ros_generate_messages
[ 71%] Building CXX object fovis/fovis_ros/CMakeFiles/visualization.dir/src/visualization.cpp.o
Linking CXX shared library /home/jackcviers/Development/fovis_ws/devel/lib/libvisualization.so
[ 71%] Built target visualization
Scanning dependencies of target fovis_mono_depth_odometer
Scanning dependencies of target fovis_stereo_odometer
[100%] [100%] Building CXX object fovis/fovis_ros/CMakeFiles/fovis_stereo_odometer.dir/src/stereo_odometer.cpp.o
Building CXX object fovis/fovis_ros/CMakeFiles/fovis_mono_depth_odometer.dir/src/mono_depth_odometer.cpp.o
In file included from /opt/ros/indigo/include/image_geometry/stereo_camera_model.h:4:0,
                 from /home/jackcviers/Development/fovis_ws/src/fovis/fovis_ros/src/stereo_odometer.cpp:3:
/opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:117:41: error: ‘CV_INTER_LINEAR’ was not declared in this scope
                     int interpolation = CV_INTER_LINEAR) const;
                                         ^
/opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:127:43: error: ‘CV_INTER_LINEAR’ was not declared in this scope
                       int interpolation = CV_INTER_LINEAR) const;
                                           ^
In file included from /opt/ros/indigo/include/image_geometry/stereo_camera_model.h:4:0,
                 from /home/jackcviers/Development/fovis_ws/src/fovis/fovis_ros/src/mono_depth_odometer.cpp:3:
/opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:117:41: error: ‘CV_INTER_LINEAR’ was not declared in this scope
                     int interpolation = CV_INTER_LINEAR) const;
                                         ^
/opt/ros/indigo/include/image_geometry/pinhole_camera_model.h:127:43: error: ‘CV_INTER_LINEAR’ was not declared in this scope
                       int interpolation = CV_INTER_LINEAR) const;
                                           ^
make[2]: *** [fovis/fovis_ros/CMakeFiles/fovis_mono_depth_odometer.dir/src/mono_depth_odometer.cpp.o] Error 1
make[1]: *** [fovis/fovis_ros/CMakeFiles/fovis_mono_depth_odometer.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [fovis/fovis_ros/CMakeFiles/fovis_stereo_odometer.dir/src/stereo_odometer.cpp.o] Error 1
make[1]: *** [fovis/fovis_ros/CMakeFiles/fovis_stereo_odometer.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed

That's obviously a bug in pinhole_camera_model.h in the ros indigo image_geometry package.

This is the third separate visual odometry library that I have attempted to compile on my workstation, and it is beginning to be obvious that whatever version of opencv2 these are compiled against, it is not the version on my machine. According to core/version.hpp, I have 2.4.8.0 installed:

#define CV_VERSION_EPOCH    2
#define CV_VERSION_MAJOR    4
#define CV_VERSION_MINOR    8
#define CV_VERSION_REVISION 0

I've tried upgrading to 2.10.4.1, but I still ended up in the same place, and because of ubuntu libav issues, the ocl and gpu modules don't compile. I uninstalled them and went back to the apt version with apt-get install --reinstall libopencv-dev, and tried the same.

When I check the /opt/ros/indigo/include/opencv2/core/version.hpp, it is using 3.0.0. What version do I need to be able to compile this package?

plnegre commented 9 years ago

Hello @jackcviers, our setup is:

In indigo opencv is not a module of ros so you can install it by doing:

wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.9/opencv-2.4.9.zip unzip opencv-2.4.9.zip cd opencv-2.4.9 mkdir build cd build cmake-gui .. # setup the flags make sudo make install

jackcviers commented 9 years ago

Thanks @plnegre I'll give 2.4.9 a shot, then. I assume you installed ros-indigo-vision-opencv to get cv_bridge, right?

plnegre commented 9 years ago

Yes! we have ros-indigo-vision-opencv installed.

jackcviers commented 9 years ago

Ok. 2.4.9 and a fresh install of indigo made this build just fine. Thanks for your help @plnegre!