说在前面,最近真的很幸苦啊,晚饭都顾不上吃,就是为了调试程序能够运行。在师弟的帮助下,经过几天的努力,终于能够将PLSLAM在我的电脑上跑起来,没天都劝诫自己要坚持坚持再坚持,当然,有时候并不是不想坚持,主要是怕浪费时间,但是这种事情,不可能找别人来给你做,所以就只能自己硬着头皮去完成。言归正传。
1)Cmakelist.txt的修改
主要更改的地方是跟G2O有关系的,还有个EIgen的路径好像,不会给代码部分改颜色,对比着自己的cmakelist.txt看看吧,其他的也不用怎么改,比如 .so 这个东西,不用管它,只要通过cmake软件能够generate一个解决方案sln,之后再在VS里面改就好了
project( PL-SLAM )
cmake_minimum_required(VERSION 2.7)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}}/3rdparty/g2o/cmake_modules")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}}/3rdparty/g2o/cmake_modules/FindG2O.cmake")
find_package(OpenCV 3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS regex thread system filesystem)
# find_package(G2O REQUIRED)
find_package(Eigen3 REQUIRED)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
link_directories(${OpenCV_LIBS_DIR})
include_directories(${OpenCV2_INCLUDE_DIRS})
# Odometry library (Future TODO: integrate with this library)
SET( StVO_LIBRARY "" CACHE FILEPATH "Visual Odometry Library" )
SET( StVO_INCLUDE_DIR "" CACHE PATH "Visual Odometry Include folder" )
set(DEFAULT_HAS_MRPT ON)
set(HAS_MRPT ${DEFAULT_HAS_MRPT} CACHE BOOL "Build the PointGrey Bumblebee2 SVO application that employs the MRPT library")
SET(BUILD_SHARED_LIBS ON)
SET(CMAKE_MODULE_PATH $ENV{CMAKE_MODULE_PATH})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -mtune=native -march=native")
add_definitions(-DBOOST_NO_CXX11_SCOPED_ENUMS)
# MRPT library (optional, only with representation purposes)
if(HAS_MRPT)
FI