# Node for monocular camera (Augmented Reality Demo)
rosbuild_add_executable(MonoAR
src/AR/ros_mono_ar.cc
src/AR/ViewerAR.h
src/AR/ViewerAR.cc
)
target_link_libraries(MonoAR
${LIBS}
)
复制代码
注释掉之后,应该就可以成功编译其他部分了
[rosbuild] Including /opt/ros/melodic/share/roslisp/rosbuild/roslisp.cmake
[rosbuild] Including /opt/ros/melodic/share/roscpp/rosbuild/roscpp.cmake
[rosbuild] Including /opt/ros/melodic/share/rospy/rosbuild/rospy.cmake
Build type: Release
-- Using flag -std=c++11.
-- Configuring done
-- Generating done
-- Build files have been written to: /work/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/build
[ 0%] Built target rospack_genmsg_libexe
[ 0%] Built target rosbuild_precompile
[ 40%] Built target RGBD
[ 40%] Built target Stereo
[ 80%] Built target Mono_Inertial
[ 80%] Built target Stereo_Inertial
[100%] Built target Mono
复制代码
假如你需要MonoAR,就需要上手改代码了。参考github.com/UZ-SLAMLab/ORB_SLAM3/issues/442,依次修复题目。
这部分修改很杂,你可以直接根据我的提交记载来修改:Fix compile error of ROS AR, used opencv 3.2.0 for ROS compile. · musnows/ORB_SLAM3@4e1cbdb · GitHub 1)范例Sophus::SE3<float>和cv::Mat不匹配
/work/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR/ros_mono_ar.cc: In member function 'void ImageGrabber::GrabImage(const ImageConstPtr&)':
/work/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR/ros_mono_ar.cc:151:41: error: conversion from 'Sophus::SE3f {aka Sophus::SE3<float>}' to non-scalar type 'cv::Mat' requested
/work/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR/ViewerAR.cc: In member function 'void ORB_SLAM3::Plane::Recompute()':
/work/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR/ViewerAR.cc:530:42: error: conversion from 'Eigen::Vector3f {aka Eigen::Matrix<float, 3, 1>}' to non-scalar type 'cv::Mat' requested
4)尾插错误 no matching function for call to 'std::vector<cv::Mat>::push_back(Eigen::Vector3f)'
这个题目也是范例不匹配
/work/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR/ViewerAR.cc: In member function 'ORB_SLAM3::Plane* ORB_SLAM3::ViewerAR::DetectPlane(cv::Mat, const std::vector<ORB_SLAM3::MapPoint*>&, int)':
/work/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR/ViewerAR.cc:405:53: error: no matching function for call to 'std::vector<cv::Mat>::push_back(Eigen::Vector3f)'
官网说明:cvg.cit.tum.de/data/datasets/rgbd-dataset/file_formats#intrinsic… Color images and depth maps
We provide the time-stamped color and depth images as a gzipped tar file (TGZ).
The color images are stored as 640x480 8-bit RGB images in PNG format.
The depth maps are stored as 640x480 16-bit monochrome images in PNG format.
The color and depth images are already pre-registered using the OpenNI driver from PrimeSense, i.e., the pixels in the color and depth images correspond already 1:1.
The depth images are scaled by a factor of 5000, i.e., a pixel value of 5000 in the depth image corresponds to a distance of 1 meter from the camera, 10000 to 2 meter distance, etc. A pixel value of 0 means missing value/no data.