运行
open_quadtree_mapping的后续
- 1、open_chisel
Dependencies
Eigen
C++11
catkin build system
Compilation note: For speed, it is essential to compile open_chisel with optimization. You will need to add the flag -DCMAKE_BUILD_TYPE=Release to your catkin_make command when building
- 2、chisel_ros
chisel_ros is a wrapper around open_chisel that interfaces with ROS-based depth and color sensors. The main class chisel_ros provides is ChiselServer, which subscribes to depth images, color images, TF frames, and camera intrinsics.
Note: you will also need to get the messages package, 3、chisel_msgs to build this.
Dependencies
Eigen
C++11
catkin (ros-hydro or ros-indigo or higher)
PCL 1.8 compiled with stdC++11 enabled.
ROS OpenCV cv_bridge
A note on PCL
Unfortunately, PCL 1.7x (the standard PCL included in current versions of ROS) doesn't work with C++11. This project makes use of C++11, so in order to use Chisel, you will have to download and install PCL 1.8 from source, and compile it with C++11 enabled.
- 支线1
Download PCL 1.8 from here: https://github.com/PointCloudLibrary/pcl
Modify line 112 of CMakeLists.txt in PCL to say SET(CMAKE_CXX_FLAGS "-Wall -std=c++11 ...
我在cmakelists.txt中添加了
SET(CMAKE_C_COMPILER g++)
add_compile_options(-std=c++11)
Build and install PCL 1.8
~/pcl/release$ cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_GPU=ON-DBUILD_apps=ON -DBUILD_examples=ON \ -DCMAKE_INSTALL_PREFIX=/usr .
/pcl/release$ make -j4
sudo make install
- 支线2
Download pcl_ros from here: https://github.com/ros-perception/perception_pcl
Change the dependency from PCL to PCL 1.8 in find_package of the CMakeLists.txt
Compile pcl_ros.
将下载的perception_pcl-melodic-devel放到工作空间pcl-ros_ws的src下
cd pcl-ros_ws/
catkin_make
[100%] Built target download
- Rebuild Chisel
If PCL does not gain c++11 support by default soon, we may just get rid of c++11 in OpenChisel and use boost instead.
将 1、open_chisel 和 2、chisel_ros 和 3、chisel_msg三个放到Chisel文件夹下的src里面
根据官方的pull requests里面的解决方案
修改open_chisel的include下面的open_chisel的threading下面的Threading.h里加上一句
#include <vector>
否则会报一堆错误
然后在Chisel_ws路径下运行catkin_make
放弃open_quadtree_mapping
尝试VI-MEAN
How to compile
Choose correct CUDA_NVCC_FLAGS in stereo_mapper/CMakeLists.txt 我没改
Install the following dependencies:
OpenCV
Eigen
Ceres (http://ceres-solver.org/)
Modified OpenChisel (already included in this repo), which requires PCL compiled with c++11. Please follow OpenChisel's instruction.
Subset of camodocal (already inclued in this repo with name of camera_model) to support wide-angle lens.
catkin_make
所以就是将camodocal-master和VI-MEAN-master放在Vi-mean_ws的src下,同上修改threading.h
报错1
/home/fcl/Vi-mean_ws/src/VI-MEAN/self_calibration_estimator/src/self_calibration_estimator_node.cpp:8:10: fatal error: ros/ros.h: 没有那个文件或目录
#include <ros/ros.h>
参考https://blog.csdn.net/weixin_43948162/article/details/90238393和https://blog.csdn.net/qq_36501182/article/details/79541954
解决在Vi-mean_ws/src/VI-MEAN/self_calibration_estimator的CMakeLists.txt的第21行
include_directories(include ${catkin_INCLUDE_DIRS} ${CERES_INCLUDE_DIRS})添加粗体部分
报错2
/home/fcl/Vi-mean_ws/src/VI-MEAN/feature_tracker/src/feature_tracker.h:10:10: fatal error: opencv2/gpu/gpu.hpp: 没有那个文件或目录
#include <opencv2/gpu/gpu.hpp>
尝试同上的方法,不管用,恢复
参考http://www.cocoachina.com/articles/34552和https://answers.opencv.org/question/105308/where-to-find-opencv2gpugpuhpp-in-opencv-310/
找到解决办法
将/home/fcl/Vi-mean_ws/src/VI-MEAN/feature_tracker/src/feature_tracker.h里的
/*#include <opencv2/gpu/gpu.hpp>*/改为
#include <opencv2/core/cuda.hpp>
报错3
/home/fcl/Vi-mean_ws/src/VI-MEAN/stereo_mapper/src/parameters.h:4:10: fatal error: ros/ros.h: 没有那个文件或目录
同报错1的解决办法
将/home/fcl/Vi-mean_ws/src/VI-MEAN/stereo_mapper路径下的CMakeLists.txt中添加黑体部分
include_directories(include ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR})
报错4
/home/fcl/Vi-mean_ws/src/VI-MEAN/stereo_mapper/src/stereo_mapper.h:4:10: fatal error: opencv2/gpu/gpu.hpp: 没有那个文件或目录
同报错2的解决办法
编辑/home/fcl/Vi-mean_ws/src/VI-MEAN/stereo_mapper/src/stereo_mapper.h
/*#include <opencv2/gpu/gpu.hpp>*/
#include <opencv2/core/cuda.hpp>
所有的cv::gpu改为cv::cuda
cv::cuda::GpuMat raw_img_l, raw_img_r;
cv::cuda::GpuMat img_l, img_r, img_warp, img_diff;
cv::cuda::GpuMat raw_cost, sgm_cost;
cv::cuda::GpuMat dep;
cv::cuda::GpuMat tmp;
cv::cuda::GpuMat map1_l, map2_l;
cv::cuda::GpuMat map1_r, map2_r;
报错5
/home/fcl/Vi-mean_ws/src/VI-MEAN/stereo_mapper/src/stereo_mapper_node.cpp:8:10: fatal error: opencv2/gpu/gpu.hpp: 没有那个文件或目录
同上处理