Ubuntu12.04下编译MRPT安装
1.下载Linuxmrpt1.0.2源码地址:
http://sourceforge.net/projects/mrpt/files/MRPT-all/MRPT-1.0.0/
2.安装编译依赖的库
sudoapt-getinstallbuild-essentialpkg-configcmake
sudoapt-getinstalllibwxgtk2.8-dev
sudoapt-getinstallfreeglut3-devlibusb-1.0.0-dev
sudoapt-getinstalllibdc1394-22-devlibavformat-devlibswscale-dev
sudoapt-getinstalllibftdi-devzlib1g-devlib3ds-devlibjpeg-dev
如果需要安装opencv:sudoapt-getinstalllibopencv-dev
3.编译mrpt源码
3.1$cd/home/../MRPT进入MRPT源码目录
3.2$cmake.
3.3$ccmake.
MRPT编译平台以及接口的选择:
●BUILD_APPLICATIONS:IfyouonlywanttheMRPTlibraries,disabletthis.DefaultisON
●BUILD_ARIA:BuildanembeddedversionofActivMediaARIAlibrary(interfacetomobilerobots).DefaultisON
●BUILD_EXAMPLES:Buildexamples?DefaultisOFF
●BUILD_KINECT:BuildsupportforXBoxKinect.DefaultisON
●BUILD_SHARED_LIBS:Buildsharedlibraries(.dll/.so)insteadofstaticones(.lib/.a)defaultisON
●BUILD_TESTING:BuildMRPTtests.DefaultisON
●BUILD_XSENS:BuildanembeddedversionofxSenslibrary(interfacetoxSensMTidevice).DefaultisON
MRPT编译必要的库:
●BUILD_mrpt-base:Buildthelibrarymrpt-base
●BUILD_mrpt-bayes:Buildthelibrarymrpt-bayes
●BUILD_mrpt-detectors:Buildthelibrarymrpt-detectors
●BUILD_mrpt-graphs:Buildthelibrarymrpt-graphs
●BUILD_mrpt-graphslam:Buildthelibrarymrpt-graphslam
● BUILD_mrpt-gui:Buildthelibrarymrpt-gui●BUILD_mrpt-hmtslam:Buildthelibrarymrpt-hmtslam
●BUILD_mrpt-hwdrivers:Buildthelibrarymrpt-hwdrivers
●BUILD_mrpt-kinematics:Buildthelibrarymrpt-kinematics
●BUILD_mrpt-maps:Buildthelibrarymrpt-maps
●BUILD_mrpt-obs:Buildthelibrarymrpt-obs
●BUILD_mrpt-opengl:Buildthelibrarymrpt-opengl
●BUILD_mrpt-reactivenav:Buildthelibrarymrpt-reactivenav
●BUILD_mrpt-scanmatching:Buildthelibrarymrpt-scanmatching
●BUILD_mrpt-slam:Buildthelibrarymrpt-slam
●BUILD_mrpt-srba:Buildthelibrarymrpt-srba
●BUILD_mrpt-topography:Buildthelibrarymrpt-topography
●BUILD_mrpt-vision:Buildthelibrarymrpt-vision
●CMAKE_INSTALL_PREFIX:Installpathprefix,prependedontoinstalldirectories. Defaultis/usr/local
●EIGEN_USE_EMBEDDED_VERSION:UseembeddedEigen3versionorsystem .version.DefaultisON
●ENABLE_SOLUTION_FOLDERS:Groupprojectsundervirtualfoldersofthe compilerIDE(e.g.VisualStudio).DefaultisON
●EXECUTABLE_OUTPUT_PATH:Outputdirectoryforapplications
●TDI_CONFIG_FILE:Pathtoafile.
●INOTIFY_HEADER_FILE:Pathtoafile.
●LAS_CONFIG_FILE:Pathtoafile
●LIB3DS_CONFIG_FILE:Pathtoafile.
●LIBCLANG_LIBRARY:Pathtoalibrary.
●LIBRARY_OUTPUT_PATH:Outputdirectoryforlibraries
●MRPT_ALWAYS_CHECKS_DEBUG:AdditionalcheckseveninRelease.Defaultis OFF
●MRPT_ALWAYS_CHECKS_DEBUG_MATRICES:Additionalchecksevenin Release(Onlyinmatrixclasses).DefaultisOFF
●MRPT_CONFIG_FILE_INCLUDE_DIR:Wheretocreatetheplatform-dependant config.h
ForGNUGCCcompileronly:
●MRPT_ENABLE_LIBSTD_PARALLEL_MODE:EnablestheGNUlibstdc++ parallel- mode(Seehttp://gcc.gnu.org/onlinedocs/libstdc++/manual/parallel_mode.html). DefaultisOFF.
●MRPT_ENABLE_PROFILING:Enablesgenerationofinformationrequired for profiling.DefaultisOFF.
●MRPT_OPTIMIZE_NATIVE:Enablesoptimizationforthecurrentarchitecture (mtune=native).DefaultisOFFforoldGCCversions,ONfor4.2+.Ifyouhaveanold versionofGCC(<4.2),thisoptioncannotbesetsinceit'snotrecognizedbythe ompiler.Instead,setUSER_EXTRA_CPP_FLAGStotheoptimizationflagsforyour platform,forexample:-march=pentium4.
●MRPT_OPTIMIZE_FFAST-MATH:GCCoptimizationforfloatingmath(-ffast-math).DefaultisOFF
4.make
5.sudomakeinstall
安装完成后,MRPT的库、头文件等等在/usr/local目录下
6.如果需要MRPT支持Kinect还需要做:
6.1sudoapt-getinstalllibusb-1.0.-dev
6.2Accessingthedevicerequiresrootprivileges(executingas"sudo").Toavoid that,installthisfile:
cd/etc/udev/rules.d/
vi51-kinect.rules(将以下网址的内容写入,保存退出)
http://mrpt.googlecode.com/svn/trunk/scripts/51-kinect.rules
7.测试
$cd/home/../MRPT/bin
./kinect-3d-view
原文链接:https://www.f2er.com/ubuntu/350768.html