diff --git a/.gitignore b/.gitignore index 611b5adb2c..11e25e0db4 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,10 @@ Vocabulary/ORBvoc.txt build/ *~ lib/ +Datasets/* +FrameTrajectory_KITTI_Format.txt + +FrameTrajectory_TUM_Format.txt + +KeyFrameTrajectory_TUM_Format.txt diff --git a/2020-03-12-15_30_49.log b/2020-03-12-15_30_49.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/2020-03-12-15_31_25.log b/2020-03-12-15_31_25.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/2020-03-12-15_32_36.log b/2020-03-12-15_32_36.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 08a8af468e..f24cf0fee4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,25 +10,25 @@ MESSAGE("Build type: " ${CMAKE_BUILD_TYPE}) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -march=native ") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -march=native") -# Check C++11 or C++0x support +# Check C++14 or C++0x support include(CheckCXXCompilerFlag) -CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX11) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) if(COMPILER_SUPPORTS_CXX11) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") add_definitions(-DCOMPILEDWITHC11) - message(STATUS "Using flag -std=c++11.") + message(STATUS "Using flag -std=c++14.") elseif(COMPILER_SUPPORTS_CXX0X) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") add_definitions(-DCOMPILEDWITHC0X) message(STATUS "Using flag -std=c++0x.") else() - message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") + message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.") endif() LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules) -find_package(OpenCV 3.0 QUIET) +find_package(OpenCV 4.0 QUIET) if(NOT OpenCV_FOUND) find_package(OpenCV 2.4.3 QUIET) if(NOT OpenCV_FOUND) @@ -36,7 +36,7 @@ if(NOT OpenCV_FOUND) endif() endif() -find_package(Eigen3 3.1.0 REQUIRED) +find_package(Eigen3 3.1.0 REQUIRED NO_MODULE) find_package(Pangolin REQUIRED) include_directories( diff --git a/Examples/Monocular/mono_euroc.cc b/Examples/Monocular/mono_euroc.cc index 4bcb90f170..55d6888d1a 100644 --- a/Examples/Monocular/mono_euroc.cc +++ b/Examples/Monocular/mono_euroc.cc @@ -23,6 +23,7 @@ #include #include #include +#include "unistd.h" #include @@ -70,7 +71,7 @@ int main(int argc, char **argv) for(int ni=0; ni #include #include +#include "unistd.h" #include @@ -65,7 +66,7 @@ int main(int argc, char **argv) for(int ni=0; ni #include #include +#include "unistd.h" #include @@ -65,7 +66,7 @@ int main(int argc, char **argv) for(int ni=0; ni #include #include +#include "unistd.h" #include @@ -77,8 +78,8 @@ int main(int argc, char **argv) for(int ni=0; ni diff --git a/Examples/ROS/ORB_SLAM2/src/AR/ros_mono_ar.cc b/Examples/ROS/ORB_SLAM2/src/AR/ros_mono_ar.cc index 58d204a0f7..704338c51a 100644 --- a/Examples/ROS/ORB_SLAM2/src/AR/ros_mono_ar.cc +++ b/Examples/ROS/ORB_SLAM2/src/AR/ros_mono_ar.cc @@ -23,6 +23,7 @@ #include #include #include +#include "unistd.h" #include #include diff --git a/Examples/ROS/ORB_SLAM2/src/ros_mono.cc b/Examples/ROS/ORB_SLAM2/src/ros_mono.cc index 2913525bfc..d45fd0124b 100644 --- a/Examples/ROS/ORB_SLAM2/src/ros_mono.cc +++ b/Examples/ROS/ORB_SLAM2/src/ros_mono.cc @@ -23,6 +23,7 @@ #include #include #include +#include "unistd.h" //<- Added later #include #include @@ -61,7 +62,7 @@ int main(int argc, char **argv) ImageGrabber igb(&SLAM); ros::NodeHandle nodeHandler; - ros::Subscriber sub = nodeHandler.subscribe("/camera/image_raw", 1, &ImageGrabber::GrabImage,&igb); + ros::Subscriber sub = nodeHandler.subscribe("/zed2/zed_node/rgb/image_rect_color", 1, &ImageGrabber::GrabImage,&igb); ros::spin(); diff --git a/Examples/ROS/ORB_SLAM2/src/ros_rgbd.cc b/Examples/ROS/ORB_SLAM2/src/ros_rgbd.cc index afa567dc9b..0d1d73b9a7 100644 --- a/Examples/ROS/ORB_SLAM2/src/ros_rgbd.cc +++ b/Examples/ROS/ORB_SLAM2/src/ros_rgbd.cc @@ -23,7 +23,7 @@ #include #include #include - +#include "unistd.h" #include #include #include @@ -65,8 +65,10 @@ int main(int argc, char **argv) ros::NodeHandle nh; - message_filters::Subscriber rgb_sub(nh, "/camera/rgb/image_raw", 1); - message_filters::Subscriber depth_sub(nh, "camera/depth_registered/image_raw", 1); + //message_filters::Subscriber rgb_sub(nh, "/camera/rgb/image_raw", 1); + //message_filters::Subscriber depth_sub(nh, "camera/depth_registered/image_raw", 1); + message_filters::Subscriber rgb_sub(nh, "/zed2/zed_node/rgb/image_rect_color", 1); + message_filters::Subscriber depth_sub(nh, "/zed2/zed_node/depth/depth_registered", 1); typedef message_filters::sync_policies::ApproximateTime sync_pol; message_filters::Synchronizer sync(sync_pol(10), rgb_sub,depth_sub); sync.registerCallback(boost::bind(&ImageGrabber::GrabRGBD,&igb,_1,_2)); @@ -108,7 +110,9 @@ void ImageGrabber::GrabRGBD(const sensor_msgs::ImageConstPtr& msgRGB,const senso ROS_ERROR("cv_bridge exception: %s", e.what()); return; } - + //< remap from="/camera/aligned_depth_to_color/image_raw"to="/camera/depth_registered/image_raw" /> + //< remap from="/camera/color/image_raw" to="/camera/rgb/image_raw" /> + mpSLAM->TrackRGBD(cv_ptrRGB->image,cv_ptrD->image,cv_ptrRGB->header.stamp.toSec()); } diff --git a/Examples/ROS/ORB_SLAM2/src/ros_stereo.cc b/Examples/ROS/ORB_SLAM2/src/ros_stereo.cc index 9a0f9acc35..ff9360b14c 100644 --- a/Examples/ROS/ORB_SLAM2/src/ros_stereo.cc +++ b/Examples/ROS/ORB_SLAM2/src/ros_stereo.cc @@ -23,6 +23,7 @@ #include #include #include +#include "unistd.h" #include #include @@ -109,8 +110,10 @@ int main(int argc, char **argv) ros::NodeHandle nh; - message_filters::Subscriber left_sub(nh, "/camera/left/image_raw", 1); - message_filters::Subscriber right_sub(nh, "camera/right/image_raw", 1); + //message_filters::Subscriber left_sub(nh, "/camera/left/image_raw", 1); + //message_filters::Subscriber right_sub(nh, "camera/right/image_raw", 1); + message_filters::Subscriber left_sub(nh, "/zed2/zed_node/left/image_rect_color", 1); + message_filters::Subscriber right_sub(nh, "/zed2/zed_node/right/image_rect_color", 1); typedef message_filters::sync_policies::ApproximateTime sync_pol; message_filters::Synchronizer sync(sync_pol(10), left_sub,right_sub); sync.registerCallback(boost::bind(&ImageGrabber::GrabStereo,&igb,_1,_2)); diff --git a/Examples/Stereo/stereo_euroc.cc b/Examples/Stereo/stereo_euroc.cc index 6bc09c50be..a20201a971 100644 --- a/Examples/Stereo/stereo_euroc.cc +++ b/Examples/Stereo/stereo_euroc.cc @@ -24,6 +24,7 @@ #include #include #include +#include "unistd.h" #include @@ -116,8 +117,8 @@ int main(int argc, char **argv) for(int ni=0; ni #include #include +#include "unistd.h" #include @@ -66,8 +67,8 @@ int main(int argc, char **argv) for(int ni=0; ni,int> ConsistentGroup; typedef map, - Eigen::aligned_allocator > > KeyFrameAndPose; + Eigen::aligned_allocator > > KeyFrameAndPose; public: diff --git a/include/ORBextractor.h b/include/ORBextractor.h index 66e8e7a547..268148a1ee 100644 --- a/include/ORBextractor.h +++ b/include/ORBextractor.h @@ -23,7 +23,7 @@ #include #include -#include +#include namespace ORB_SLAM2 diff --git a/include/PnPsolver.h b/include/PnPsolver.h index f92544fc8f..0873dfde7a 100644 --- a/include/PnPsolver.h +++ b/include/PnPsolver.h @@ -52,6 +52,10 @@ #define PNPSOLVER_H #include +#include +#include +using namespace cv; + #include "MapPoint.h" #include "Frame.h" diff --git a/include/Sim3Solver.h b/include/Sim3Solver.h index 9af66cb26f..b69d1291a2 100644 --- a/include/Sim3Solver.h +++ b/include/Sim3Solver.h @@ -24,6 +24,9 @@ #include #include +#include +#include +using namespace cv; #include "KeyFrame.h" diff --git a/include/System.h b/include/System.h index b377b453d1..571a2c6f5b 100644 --- a/include/System.h +++ b/include/System.h @@ -25,6 +25,9 @@ #include #include #include +#include +#include +using namespace cv; #include "Tracking.h" #include "FrameDrawer.h" diff --git a/roscpp/.rosinstall b/roscpp/.rosinstall new file mode 100644 index 0000000000..6f4d5d047c --- /dev/null +++ b/roscpp/.rosinstall @@ -0,0 +1,5 @@ +# IT IS UNLIKELY YOU WANT TO EDIT THIS FILE BY HAND, +# UNLESS FOR REMOVING ENTRIES. +# IF YOU WANT TO CHANGE THE ROS ENVIRONMENT VARIABLES +# USE THE rosinstall TOOL INSTEAD. +# IF YOU CHANGE IT, USE rosinstall FOR THE CHANGES TO TAKE EFFECT diff --git a/src/Converter.cc b/src/Converter.cc index 00ea8ee597..3e151e8406 100644 --- a/src/Converter.cc +++ b/src/Converter.cc @@ -20,7 +20,7 @@ #include "Converter.h" - +#include "unistd.h" namespace ORB_SLAM2 { diff --git a/src/Frame.cc b/src/Frame.cc index 0e37d49335..ff41f7464f 100644 --- a/src/Frame.cc +++ b/src/Frame.cc @@ -22,6 +22,7 @@ #include "Converter.h" #include "ORBmatcher.h" #include +#include "unistd.h" namespace ORB_SLAM2 { diff --git a/src/FrameDrawer.cc b/src/FrameDrawer.cc index e23b86c207..ff72fd8b26 100644 --- a/src/FrameDrawer.cc +++ b/src/FrameDrawer.cc @@ -20,12 +20,15 @@ #include "FrameDrawer.h" #include "Tracking.h" +#include "unistd.h" #include #include #include - +#include +#include +using namespace cv; namespace ORB_SLAM2 { diff --git a/src/Initializer.cc b/src/Initializer.cc index 6094b8f51b..ec5aa37fab 100644 --- a/src/Initializer.cc +++ b/src/Initializer.cc @@ -19,6 +19,7 @@ */ #include "Initializer.h" +#include "unistd.h" #include "Thirdparty/DBoW2/DUtils/Random.h" diff --git a/src/KeyFrame.cc b/src/KeyFrame.cc index 4ef1e78e0f..262a5b0f59 100644 --- a/src/KeyFrame.cc +++ b/src/KeyFrame.cc @@ -22,6 +22,7 @@ #include "Converter.h" #include "ORBmatcher.h" #include +#include "unistd.h" namespace ORB_SLAM2 { diff --git a/src/KeyFrameDatabase.cc b/src/KeyFrameDatabase.cc index 826860cab9..b4e47bb238 100644 --- a/src/KeyFrameDatabase.cc +++ b/src/KeyFrameDatabase.cc @@ -22,6 +22,7 @@ #include "KeyFrame.h" #include "Thirdparty/DBoW2/DBoW2/BowVector.h" +#include "unistd.h" #include diff --git a/src/LocalMapping.cc b/src/LocalMapping.cc index 6c87a6e55a..963155043e 100644 --- a/src/LocalMapping.cc +++ b/src/LocalMapping.cc @@ -22,6 +22,7 @@ #include "LoopClosing.h" #include "ORBmatcher.h" #include "Optimizer.h" +#include "unistd.h" #include diff --git a/src/LoopClosing.cc b/src/LoopClosing.cc index 5e317dd420..ecaaddea2a 100644 --- a/src/LoopClosing.cc +++ b/src/LoopClosing.cc @@ -23,6 +23,7 @@ #include "Sim3Solver.h" #include "Converter.h" +#include "unistd.h" #include "Optimizer.h" @@ -30,7 +31,9 @@ #include #include - +#include +#include +using namespace cv; namespace ORB_SLAM2 { diff --git a/src/Map.cc b/src/Map.cc index 15fcd86914..c3d70d3074 100644 --- a/src/Map.cc +++ b/src/Map.cc @@ -21,6 +21,7 @@ #include "Map.h" #include +#include "unistd.h" namespace ORB_SLAM2 { diff --git a/src/MapDrawer.cc b/src/MapDrawer.cc index 4d9990bc8a..d7b6b45dc8 100644 --- a/src/MapDrawer.cc +++ b/src/MapDrawer.cc @@ -23,6 +23,7 @@ #include "KeyFrame.h" #include #include +#include "unistd.h" namespace ORB_SLAM2 { diff --git a/src/MapPoint.cc b/src/MapPoint.cc index 3b2921197b..ac81fcdc2a 100644 --- a/src/MapPoint.cc +++ b/src/MapPoint.cc @@ -22,6 +22,7 @@ #include "ORBmatcher.h" #include +#include "unistd.h" namespace ORB_SLAM2 { diff --git a/src/ORBextractor.cc b/src/ORBextractor.cc index 14be2efae5..878ba8cb84 100644 --- a/src/ORBextractor.cc +++ b/src/ORBextractor.cc @@ -59,6 +59,7 @@ #include #include #include +#include "unistd.h" #include "ORBextractor.h" diff --git a/src/ORBmatcher.cc b/src/ORBmatcher.cc index 56bf279d0f..9e52f739fc 100644 --- a/src/ORBmatcher.cc +++ b/src/ORBmatcher.cc @@ -24,6 +24,7 @@ #include #include +#include "unistd.h" #include "Thirdparty/DBoW2/DBoW2/FeatureVector.h" diff --git a/src/Optimizer.cc b/src/Optimizer.cc index 83d9264546..f8a960e102 100644 --- a/src/Optimizer.cc +++ b/src/Optimizer.cc @@ -27,12 +27,16 @@ #include "Thirdparty/g2o/g2o/core/robust_kernel_impl.h" #include "Thirdparty/g2o/g2o/solvers/linear_solver_dense.h" #include "Thirdparty/g2o/g2o/types/types_seven_dof_expmap.h" +#include "unistd.h" #include #include "Converter.h" #include +#include +#include +using namespace cv; namespace ORB_SLAM2 { diff --git a/src/PnPsolver.cc b/src/PnPsolver.cc index af3511b165..3741ecc2be 100644 --- a/src/PnPsolver.cc +++ b/src/PnPsolver.cc @@ -51,6 +51,7 @@ #include #include "PnPsolver.h" +#include "unistd.h" #include #include diff --git a/src/Sim3Solver.cc b/src/Sim3Solver.cc index 4ad44ff0de..baa6ca1c9c 100644 --- a/src/Sim3Solver.cc +++ b/src/Sim3Solver.cc @@ -24,6 +24,8 @@ #include #include #include +#include +#include "unistd.h" #include "KeyFrame.h" #include "ORBmatcher.h" diff --git a/src/System.cc b/src/System.cc index 8df4157095..46b3c8466f 100644 --- a/src/System.cc +++ b/src/System.cc @@ -25,6 +25,7 @@ #include #include #include +#include "unistd.h" namespace ORB_SLAM2 { diff --git a/src/Tracking.cc b/src/Tracking.cc index 2273b2ce48..a1ca138dd4 100644 --- a/src/Tracking.cc +++ b/src/Tracking.cc @@ -29,6 +29,7 @@ #include"Converter.h" #include"Map.h" #include"Initializer.h" +#include "unistd.h" #include"Optimizer.h" #include"PnPsolver.h" @@ -36,7 +37,9 @@ #include #include - +#include +#include +using namespace cv; using namespace std; diff --git a/src/Viewer.cc b/src/Viewer.cc index dec3204f53..5fff887c67 100644 --- a/src/Viewer.cc +++ b/src/Viewer.cc @@ -20,6 +20,7 @@ #include "Viewer.h" #include +#include "unistd.h" #include