Ubuntu12.04 下编译MRPT安装
1.下载Linux mrpt 1.0.2源码地址:
http://sourceforge.net/projects/mrpt/files/MRPT-all/MRPT-1.0.0/
2.安装编译依赖的库
sudo apt-get install build-essential pkg-config cmake
sudo apt-get install libwxgtk2.8-dev
sudo apt-get install freeglut3-dev libusb-1.0.0-dev
sudo apt-get install libdc1394-22-dev libavformat-dev libswscale-dev
sudo apt-get install libftdi-dev zlib1g-dev lib3ds-dev libjpeg-dev
如果需要安装opencv:sudo apt-get install libopencv-dev
3.编译mrpt源码
3.1 $ cd /home/../MRPT 进入MRPT源码目录
3.3 $ccmake .
MRPT编译平台以及接口的选择:
●BUILD_APPLICATIONS: If you only want the MRPT libraries, disable tthis.Default is ON
●BUILD_ARIA: Build an embedded version of ActivMedia ARIA library (interface to mobile robots).Default is ON
●BUILD_EXAMPLES: Build examples? Default is OFF
●BUILD_KINECT: Build support for Xbox Kinect.Default is ON
●BUILD_SHARED_LIBS: Build shared libraries (.dll/.so) instead of static ones (.lib/.a) default is ON
●BUILD_TESTING: Build MRPT tests. Default is ON
●BUILD_XSENS: Build an embedded version of xSens library (interface to xSens MTi device).Default is ON
MRPT编译必要的库:
● BUILD_mrpt-base: Build the library mrpt-base
● BUILD_mrpt-bayes: Build the library mrpt-bayes
● BUILD_mrpt-detectors: Build the library mrpt-detectors
● BUILD_mrpt-graphs: Build the library mrpt-graphs
● BUILD_mrpt-graphslam: Build the library mrpt-graphslam
● BUILD_mrpt-gui: Build the library mrpt-gui● BUILD_mrpt-hmtslam: Build the library mrpt-hmtslam
● BUILD_mrpt-hwdrivers: Build the library mrpt-hwdrivers
● BUILD_mrpt-kinematics: Build the library mrpt-kinematics
● BUILD_mrpt-maps: Build the library mrpt-maps
● BUILD_mrpt-obs: Build the library mrpt-obs
● BUILD_mrpt-opengl: Build the library mrpt-opengl
● BUILD_mrpt-reactivenav: Build the library mrpt-reactivenav
● BUILD_mrpt-scanmatching: Build the library mrpt-scanmatching
● BUILD_mrpt-slam: Build the library mrpt-slam
● BUILD_mrpt-srba: Build the library mrpt-srba
● BUILD_mrpt-topography: Build the library mrpt-topography
● BUILD_mrpt-vision: Build the library mrpt-vision
MRPT安装库、头文件等等文件的路径以及一些选项
●CMAKE_INSTALL_PREFIX: Install path prefix, prepended onto install directories. Default is /usr/local
●EIGEN_USE_EMBEDDED_VERSION: Use embedded Eigen3 version or system .version. Default is ON
●ENABLE_SOLUTION_FOLDERS: Group projects under virtual folders of the compiler IDE (e.g. VisualStudio).Default is ON
●EXECUTABLE_OUTPUT_PATH: Output directory for applications
●TDI_CONFIG_FILE: Path to a file.
●INOTIFY_HEADER_FILE: Path to a file.
●LAS_CONFIG_FILE: Path to a file
●LIB3DS_CONFIG_FILE: Path to a file.
●LIBCLANG_LIBRARY: Path to a library.
●LIBRARY_OUTPUT_PATH: Output directory for libraries
●MRPT_ALWAYS_CHECKS_DEBUG: Additional checks even in Release.Default is OFF
●MRPT_ALWAYS_CHECKS_DEBUG_MATRICES: Additional checks even in Release (Only in matrix classes).Default is OFF
●MRPT_CONFIG_FILE_INCLUDE_DIR: Where to create the platform-dependant config.h
For GNU GCC compiler only:
●MRPT_ENABLE_LIBSTD_PARALLEL_MODE : Enables the GNU libstdc++ parallel- mode(Seehttp://gcc.gnu.org/onlinedocs/libstdc++/manual/parallel_mode.html). Default is OFF.
●MRPT_ENABLE_PROFILING : Enables generation of information required for profiling. Default is OFF.
●MRPT_OPTIMIZE_NATIVE : Enables optimization for the current architecture (mtune=native). Default is OFF for old GCC versions, ON for 4.2+. If you have an old version of GCC (<4.2), this option cannot be set since it's not recognized by the ompiler.Instead, set USER_EXTRA_CPP_FLAGS to the optimization flags for your platform, for example: -march=pentium4.
●MRPT_OPTIMIZE_FFAST-MATH: GCC optimization for floating math (-ffast-math).Default is OFF
4.make
5.sudo make install
安装完成后,MRPT的库、头文件等等在 /usr/local目录下
6.如果需要MRPT支持Kinect还需要做:
6.1 sudo apt-get install libusb-1.0.-dev
6.2 Accessing the device requires root privileges (executing as "sudo"). To avoid that, install this file:
cd /etc/udev/rules.d/
vi 51-kinect.rules (将以下网址的内容写入,保存退出)
http://mrpt.googlecode.com/svn/trunk/scripts/51-kinect.rules
7.测试
$ cd /home/../MRPT/bin
./kinect-3d-view