Ubuntu18.04+ros-melodic
(有openvslam、cmake-3.18.1、Eigen3、g2o、opencv、OpenREALM、Pangolin、OpenREALM_ROS1_Bridge)
1、https://github.com/laxnpander/OpenREALM_ROS1_Bridge
根据里面步骤使用脚本安装
cmake可以先用着原始的,后面再下载3.18.1
opencv(编译opencv的时候会报错如下)
error: ‘glBindAttribLocation’ was not declared in this scope glBindAttribLocation(prog, DEFAULT_LOCATION_POSITION, DEFAULT_NAME_POSITION);
需要安装Pangolin0.5,不要直接在官网下载,因为默认版本是最新的。
链接:https://pan.baidu.com/s/1jhwouKcWJwe4ig33GIj_nA
提取码:0000
cd Pangolin
mkdir build
cd build
cmake ..
make
sudo make install
make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/build.make:56...
找到报错路径的cv2.cpp文件,一般路径为/opencv/modules/python/src2/,修改成
char* str = (char *)PyString_AsString(obj);
2、https://github.com/laxnpander/OpenREALM
按照里面步骤完成刚g2o、openvslam安装
完成后需要编译安装OpenREALM,cmake -DTESTS_ENABLED=ON ..时会出现一些报错,但是我没有管,再次cmake就没有报错并成功安装。
3、按照第二步的网址创建工作空间,并git clone “OpenREALM_ROS1_Bridge”,再进行catkin_make -DCMAKE_BUILD_TYPE=Release。(注意会有以下报错)
Target "realm_ros" links to target "fbow::fbow" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?
根据报错找出该项目的cmakelist,加入
find_package(fbow REQUIRED)
Target "realm_exiv2_grabber" links to target "Boost::filesystem" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?
根据报错找出该项目的cmakelist,找出target_link_libraries(...)
target_link_libraries(${PROJECTNAME} PUBLIC
${catkin_LIBRARIES}
${cmake_modules_LIBRARIES}
${OpenCV_LIBRARIES}
${Boost_FILESYSTEM_LIBRARIES}
${Boost_SYSTEM_LIBRARIES}
realm_stages
)
就可以成功cmake了
在运行数据集的时候,因为作者是分开安装依赖和Bridge,所以可能会链接不上g2o的.so,如( error while loading shared libraries: libg2o_csparse_extension.so: cannot open shared object file: No such file or directory)。
解决方法:
sudo gedit /etc/ld.so.conf
加上
/usr/local/lib
并
sudo ldconfig
再次运行launch文件即可。