Compilitaion

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Compilitaion

senia
Hi,
I'm trying to compile Rtab-Map on my laptop(Ubuntu 14.04), yet I get compilation error.
Cmake output:

- Found OpenCV: /usr/local/include/opencv;/usr/local/include
-- Found PCL: /usr/include/pcl-1.7;/usr/include/eigen3;/usr/include;/usr/include/ni;/usr/include/openni2;/usr/include/vtk-5.8
-- Found ZLIB: /usr/include
-- Found Freenect: /usr/include
-- Found OpenNI2: /usr/include/openni2
-- Found DC1394: /usr/include/dc1394
-- Found g2o: /usr/local/include;/usr/include/suitesparse
-- GTSAM include directory:  /usr/local/lib/cmake/GTSAM/../../../include;/usr/include
-- Found cvsba: /usr/local/include
-- Found Pthreads
-- --------------------------------------------
-- Info :
--   CMAKE_INSTALL_PREFIX = /usr/local
--   CMAKE_BUILD_TYPE = Release
--   BUILD_SHARED_LIBS = ON
--   With OpenCV 3 xfeatures2d module (SIFT/SURF/BRIEF/FREAK) = YES
--   With Freenect             = YES
--   With OpenNI2              = YES
--   With Freenect2            = NO (libfreenect2 not found)
--   With dc1394               = YES
--   With FlyCapture2/Triclops = NO (Point Grey SDK not found)
--   With g2o                  = YES
--   With GTSAM                = YES
--   With cvsba                = YES
--   With Qt                   = YES (version 4)
-- --------------------------------------------
-- Configuring done
-- Generating done

make process output:

[  7%] Building CXX object corelib/src/CMakeFiles/rtabmap_core.dir/Graph.cpp.o
In file included from /usr/local/include/gtsam/geometry/Pose2.h:24:0,
                 from /home/user/Desktop/rtab-master-14.12.15/rtabmap/corelib/src/Graph.cpp:72:
/usr/local/include/gtsam/base/Matrix.h: In function ‘void gtsam::inplace_QR(MATRIX&)’:
/usr/local/include/gtsam/base/Matrix.h:316:71: error: expected ‘;’ before ‘::’ token
   Eigen::internal::householder_qr_inplace_blocked<MATRIX, HCoeffsType>::run(A, hCoeffs, 48, temp.data());
                                                                       ^
In file included from /usr/local/include/gtsam/geometry/Pose2.h:26:0,
                 from /home/user/Desktop/rtab-master-14.12.15/rtabmap/corelib/src/Graph.cpp:72:
/usr/local/include/gtsam/geometry/Point2.h: In static member function ‘static gtsam::Vector gtsam::Point2::Logmap(const gtsam::Point2&)’:
/usr/local/include/gtsam/geometry/Point2.h:175:86: error: could not convert ‘Eigen::DenseBase<Derived>::operator<<(const Scalar&) [with Derived = Eigen::Matrix<double, -1, 1>; Eigen::DenseBase<Derived>::Scalar = double]((* &(& dp)->gtsam::Point2::x())).Eigen::CommaInitializer<MatrixType>::operator,<Eigen::Matrix<double, -1, 1> >((* &(& dp)->gtsam::Point2::y()))’ from ‘Eigen::CommaInitializer<Eigen::Matrix<double, -1, 1> >’ to ‘gtsam::Vector {aka Eigen::Matrix<double, -1, 1>}’
   static inline Vector Logmap(const Point2& dp) { return (Vector(2) << dp.x(), dp.y()); }
                                                                                      ^
..
..
..

In file included from /home/user/Desktop/rtab-master-14.12.15/rtabmap/corelib/src/vertigo/gtsam/betweenFactorSwitchable.h:18:0,
                 from /home/user/Desktop/rtab-master-14.12.15/rtabmap/corelib/src/Graph.cpp:87:
/home/user/Desktop/rtab-master-14.12.15/rtabmap/corelib/src/vertigo/gtsam/switchVariableSigmoid.h: In member function ‘gtsam::Vector vertigo::SwitchVariableSigmoid::localCoordinates(const vertigo::SwitchVariableSigmoid&) const’:
/home/user/Desktop/rtab-master-14.12.15/rtabmap/corelib/src/vertigo/gtsam/switchVariableSigmoid.h:62:129: warning: control reaches end of non-void function [-Wreturn-type]
     inline gtsam::Vector localCoordinates(const SwitchVariableSigmoid& t2) const { return gtsam::Vector1(t2.value() - value()); }
                                                                                                                                 ^
make[2]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/Graph.cpp.o] Error 1
make[1]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/all] Error 2
make: *** [all] Error 2

My boost version is 1.5.4
-gtsam 3.2.1
-eigen 3.2

Has anybody know how can I fix it?
Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Compilitaion

matlabbe
Administrator
Hi Senia,

RTAB-Map won't build with GTSAM 3.2.1. Use the latest GTSAM version from bitbucket:
git clone https://bitbucket.org/gtborg/gtsam.git

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Compilitaion

senia
Solved the problem.
Once again, thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Compilitaion

dounia
In reply to this post by senia
Hi senia !
I have the very same errors that you had :
-- checking for module 'openni-dev'
--   package 'openni-dev' not found
-- checking for module 'openni-dev'
--   package 'openni-dev' not found
-- checking for module 'openni-dev'
--   package 'openni-dev' not found
-- Found OpenMP
-- Found OpenCV: /usr/include/opencv;/usr/include
-- Found PCL: /usr/include/pcl-1.7;/usr/include/eigen3;/usr/include;/usr/include/ni;/usr/include/vtk-5.8
-- Found ZLIB: /usr/include
-- Found Freenect: /usr/include
-- Found OpenNI2: /usr/include/openni2
-- Found DC1394: /usr/include/dc1394
-- Found g2o: /opt/ros/indigo/include;/usr/include/suitesparse;/usr/include/suitesparse
-- GTSAM include directory:  /usr/local/lib/cmake/GTSAM/../../../include;/usr/include
-- Found cvsba: /usr/local/include
-- Found Pthreads
-- --------------------------------------------
-- Info :
--   Version : 0.11.4
--   CMAKE_INSTALL_PREFIX = /home/dounia/catkin_ws/devel
--   CMAKE_BUILD_TYPE =     Release
--   CMAKE_INSTALL_LIBDIR = lib/x86_64-linux-gnu
--   BUILD_APP =            ON
--   BUILD_TOOLS =          ON
--   BUILD_EXAMPLES =       ON
--   BUILD_SHARED_LIBS =    ON
--   CMAKE_CXX_FLAGS =  -fmessage-length=0  -Wno-deprecated -fopenmp -std=c++11
--   With OpenCV 2 nonfree module (SIFT/SURF) = NO (not found, License: BSD)
--   With Freenect             = YES (License: Apache v2 and/or GPLv2)
--   With OpenNI2              = YES (License: Apache v2)
--   With Freenect2            = NO (WITH_FREENECT2=OFF)
--   With dc1394               = YES (License: LGPL)
--   With FlyCapture2/Triclops = NO (Point Grey SDK not found)
--   With TORO                 = YES (License: Creative Commons [Attribution-NonCommercial-ShareAlike])
--   With g2o                  = YES (License: BSD)
--   With GTSAM                = YES (License: BSD)
--   With VERTIGO              = YES (License: GPLv3)
--   With cvsba                = YES (License: GPLv2)
--   With Qt4                  = YES (License: Open Source or Commercial)
-- --------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dounia/rtabmap/build

after the "make" command, I had a lot of errors like :

/usr/include/ni/XnCppWrapper.h:9954:9: error: ‘XnStatus’ does not name a type
  inline XnStatus MockRawGenerator::Create(Context& context, const XnChar* strName /*= NULL*/)
         ^
/usr/include/ni/XnCppWrapper.h:9963:9: error: ‘XnStatus’ does not name a type
  inline XnStatus Codec::Create(Context& context, XnCodecID codecID, ProductionNode& initializerNode)
         ^
/usr/include/ni/XnCppWrapper.h:9972:9: error: ‘XnStatus’ does not name a type
  inline XnStatus ScriptNode::Run(EnumerationErrors* pErrors)
         ^
/usr/include/ni/XnCppWrapper.h:9977:9: error: ‘XnStatus’ does not name a type
  inline XnStatus ScriptNode::Create(Context& context, const XnChar* strFormat)
         ^
/usr/include/ni/XnCppWrapper.h:9990:31: error: variable or field ‘XN_API_DEPRECATED’ declared void
  inline void XN_API_DEPRECATED("Use xn::Version::Current() instead") GetVersion(XnVersion& Version)
                               ^
/usr/include/ni/XnCppWrapper.h:10002:54: error: expected ‘)’ before ‘handler’
   StateChangedCallbackTranslator(StateChangedHandler handler, void* pCookie) : m_UserHandler(handler), m_pUserCookie(pCookie), m_hCallback(NULL) {}
                                                      ^
/usr/include/ni/XnCppWrapper.h:10004:3: error: ‘XnStatus’ does not name a type
   XnStatus Register(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode)
   ^
/usr/include/ni/XnCppWrapper.h:10014:10: error: ‘XnStatus’ does not name a type
   static XnStatus RegisterToUnderlying(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
          ^
/usr/include/ni/XnCppWrapper.h:10033:10: error: ‘XnStatus’ does not name a type
   static XnStatus UnregisterFromUnderlying(_XnUnregisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, XnCallbackHandle hCallback)
          ^
/usr/include/ni/XnCppWrapper.h:10046:4: error: ‘StateChangedHandler’ does not name a type
    StateChangedHandler userHandler;
    ^
/usr/include/ni/XnCppWrapper.h:10051:15: error: variable or field ‘XN_CALLBACK_TYPE’ declared void
   static void XN_CALLBACK_TYPE StateChangedCallback(XnNodeHandle hNode, void* pCookie)
               ^
/usr/include/ni/XnCppWrapper.h:10051:15: error: expected ‘;’ at end of member declaration
/usr/include/ni/XnCppWrapper.h:10058:3: error: ‘StateChangedHandler’ does not name a type
   StateChangedHandler m_UserHandler;
   ^
/usr/include/ni/XnCppWrapper.h: In member function ‘int xn::StateChangedCallbackTranslator::StateChangedCallback(XnNodeHandle, void*)’:
/usr/include/ni/XnCppWrapper.h:10055:12: error: ‘class xn::StateChangedCallbackTranslator’ has no member named ‘m_UserHandler’
    pTrans->m_UserHandler(node, pTrans->m_pUserCookie);
            ^
/usr/include/ni/XnCppWrapper.h: At global scope:
/usr/include/ni/XnCppWrapper.h:10063:9: error: ‘XnStatus’ does not name a type
  static XnStatus _RegisterToStateChange(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
         ^
/usr/include/ni/XnCppWrapper.h: In function ‘void xn::_UnregisterFromStateChange(xn::_XnUnregisterStateChangeFuncPtr, XnNodeHandle, XnCallbackHandle)’:
/usr/include/ni/XnCppWrapper.h:10070:3: error: ‘UnregisterFromUnderlying’ is not a member of ‘xn::StateChangedCallbackTranslator’
   StateChangedCallbackTranslator::UnregisterFromUnderlying(xnFunc, hNode, hCallback);
   ^
/usr/include/ni/XnCppWrapper.h: At global scope:
/usr/include/ni/XnCppWrapper.h:10073:9: error: ‘XnStatus’ does not name a type
  inline XnStatus GeneralIntCapability::RegisterToValueChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
         ^
/usr/include/ni/XnCppWrapper.h: In member function ‘void xn::GeneralIntCapability::UnregisterFromValueChange(XnCallbackHandle)’:
/usr/include/ni/XnCppWrapper.h:10095:54: error: ‘m_strCap’ was not declared in this scope
   xnUnregisterFromGeneralIntValueChange(GetHandle(), m_strCap, pTrans->m_hCallback);
                                                      ^
/usr/include/ni/XnCppWrapper.h:10095:83: error: ‘xnUnregisterFromGeneralIntValueChange’ was not declared in this scope
   xnUnregisterFromGeneralIntValueChange(GetHandle(), m_strCap, pTrans->m_hCallback);
                                                                                   ^
In file included from /home/dounia/rtabmap/corelib/src/../include/rtabmap/core/CameraRGBD.h:41:0,
                 from /home/dounia/rtabmap/corelib/src/CameraThread.cpp:31:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h: At global scope:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:71:116: error: ‘XnUInt64’ has not been declared
       inline DepthImage (boost::shared_ptr<xn::DepthMetaData> depth_meta_data, float baseline, float focal_length, XnUInt64 shadow_value, XnUInt64 no_sample_value) throw ();
                                                                                                                    ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:71:139: error: ‘XnUInt64’ has not been declared
       inline DepthImage (boost::shared_ptr<xn::DepthMetaData> depth_meta_data, float baseline, float focal_length, XnUInt64 shadow_value, XnUInt64 no_sample_value) throw ();
                                                                                                                                           ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:127:14: error: ‘XnUInt64’ does not name a type
       inline XnUInt64
              ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:133:14: error: ‘XnUInt64’ does not name a type
       inline XnUInt64
              ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:161:7: error: ‘XnUInt64’ does not name a type
       XnUInt64 shadow_value_;
       ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:162:7: error: ‘XnUInt64’ does not name a type
       XnUInt64 no_sample_value_;
       ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:165:117: error: ‘XnUInt64’ has not been declared
   DepthImage::DepthImage (boost::shared_ptr<xn::DepthMetaData> depth_meta_data, float baseline, float focal_length, XnUInt64 shadow_value, XnUInt64 no_sample_value) throw ()
                                                                                                                     ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:165:140: error: ‘XnUInt64’ has not been declared
   DepthImage::DepthImage (boost::shared_ptr<xn::DepthMetaData> depth_meta_data, float baseline, float focal_length, XnUInt64 shadow_value, XnUInt64 no_sample_value) throw ()
                                                                                                                                            ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h: In constructor ‘openni_wrapper::DepthImage::DepthImage(boost::shared_ptr<xn::DepthMetaData>, float, float, int, int)’:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:169:5: error: class ‘openni_wrapper::DepthImage’ does not have any field named ‘shadow_value_’
   , shadow_value_ (shadow_value)
     ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:170:5: error: class ‘openni_wrapper::DepthImage’ does not have any field named ‘no_sample_value_’
   , no_sample_value_ (no_sample_value) { }
     ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h: At global scope:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:192:3: error: ‘XnUInt64’ does not name a type
   XnUInt64
   ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:198:3: error: ‘XnUInt64’ does not name a type
   XnUInt64
   ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h: In member function ‘unsigned int openni_wrapper::DepthImage::getWidth() const’:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:207:23: error: ‘class xn::DepthMetaData’ has no member named ‘XRes’
     return depth_md_->XRes ();
                       ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h: In member function ‘unsigned int openni_wrapper::DepthImage::getHeight() const’:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:213:23: error: ‘class xn::DepthMetaData’ has no member named ‘YRes’
     return depth_md_->YRes ();
                       ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h: In member function ‘unsigned int openni_wrapper::DepthImage::getFrameID() const’:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:219:23: error: ‘class xn::DepthMetaData’ has no member named ‘FrameID’
     return depth_md_->FrameID ();
                       ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h: In member function ‘long unsigned int openni_wrapper::DepthImage::getTimeStamp() const’:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_depth_image.h:225:51: error: ‘class xn::DepthMetaData’ has no member named ‘Timestamp’
     return static_cast<unsigned long> (depth_md_->Timestamp ());
                                                   ^
In file included from /home/dounia/rtabmap/corelib/src/../include/rtabmap/core/CameraRGBD.h:42:0,
                 from /home/dounia/rtabmap/corelib/src/CameraThread.cpp:31:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_image.h: In member function ‘void openni_wrapper::Image::fillRaw(unsigned char*) const’:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_image.h:121:38: error: ‘class xn::ImageMetaData’ has no member named ‘Data’
       memcpy (rgb_buffer, image_md_->Data (), image_md_->DataSize ());
                                      ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_image.h:121:58: error: ‘class xn::ImageMetaData’ has no member named ‘DataSize’
       memcpy (rgb_buffer, image_md_->Data (), image_md_->DataSize ());
                                                          ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_image.h: In member function ‘unsigned int openni_wrapper::Image::getWidth() const’:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_image.h:181:23: error: ‘class xn::ImageMetaData’ has no member named ‘XRes’
     return image_md_->XRes ();
                       ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_image.h: In member function ‘unsigned int openni_wrapper::Image::getHeight() const’:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_image.h:187:23: error: ‘class xn::ImageMetaData’ has no member named ‘YRes’
     return image_md_->YRes ();
                       ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_image.h: In member function ‘unsigned int openni_wrapper::Image::getFrameID() const’:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_image.h:193:23: error: ‘class xn::ImageMetaData’ has no member named ‘FrameID’
     return image_md_->FrameID ();
                       ^
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_image.h: In member function ‘long unsigned int openni_wrapper::Image::getTimeStamp() const’:
/usr/include/pcl-1.7/pcl/io/openni_camera/openni_image.h:199:51: error: ‘class xn::ImageMetaData’ has no member named ‘Timestamp’
     return static_cast<unsigned long> (image_md_->Timestamp ());
                                                   ^
make[2]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/CameraThread.cpp.o] Erreur 1
make[1]: *** [corelib/src/CMakeFiles/rtabmap_core.dir/all] Erreur 2
make: *** [all] Erreur 2

Can you please tell me what you did about your errors,
Thank's in advance !
Reply | Threaded
Open this post in threaded view
|

Re: Compilitaion

senia
Looks like you have problem with PCL, try to remove it:
sudo apt-get remove libpcl-1.7-all
Insure it had been removed with running cmake again and receiving a not-found PCL error.
Install it again:
sudo apt-get install libpcl-1.7-all
And try again. You could try to install it from source too.
Reply | Threaded
Open this post in threaded view
|

Re: Compilitaion

matlabbe
Administrator
This post was updated on .
Small update for the record:

While trying compiling on Fedora, I got the openni Xn*** errors too. When building with G20 enabled, "-std=c++11" is added to compilation instructions. If I do "cmake -DWITH_G2O=OFF", "-std=c++11" is not used and it builds without errors.