From 3f208bed65b414aa788ac14de8e345811c2884bb Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 18 Jul 2019 00:56:12 +0200 Subject: [PATCH 1/9] Add #include where needed --- Examples/Monocular/mono_euroc.cc | 1 + Examples/Monocular/mono_kitti.cc | 1 + Examples/Monocular/mono_tum.cc | 1 + Examples/RGB-D/rgbd_tum.cc | 1 + Examples/Stereo/stereo_euroc.cc | 1 + Examples/Stereo/stereo_kitti.cc | 1 + src/LocalMapping.cc | 2 ++ src/LoopClosing.cc | 1 + src/System.cc | 1 + src/Tracking.cc | 2 ++ src/Viewer.cc | 1 + 11 files changed, 13 insertions(+) diff --git a/Examples/Monocular/mono_euroc.cc b/Examples/Monocular/mono_euroc.cc index 4bcb90f170..65b21f3754 100644 --- a/Examples/Monocular/mono_euroc.cc +++ b/Examples/Monocular/mono_euroc.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include diff --git a/Examples/Monocular/mono_kitti.cc b/Examples/Monocular/mono_kitti.cc index f2f7b3ebfd..fc0b2ccb4f 100644 --- a/Examples/Monocular/mono_kitti.cc +++ b/Examples/Monocular/mono_kitti.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include diff --git a/Examples/Monocular/mono_tum.cc b/Examples/Monocular/mono_tum.cc index 09a2afc4b7..abe316e3bd 100644 --- a/Examples/Monocular/mono_tum.cc +++ b/Examples/Monocular/mono_tum.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include diff --git a/Examples/RGB-D/rgbd_tum.cc b/Examples/RGB-D/rgbd_tum.cc index 001199d1aa..6d9bab1acd 100644 --- a/Examples/RGB-D/rgbd_tum.cc +++ b/Examples/RGB-D/rgbd_tum.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include diff --git a/Examples/Stereo/stereo_euroc.cc b/Examples/Stereo/stereo_euroc.cc index 6bc09c50be..f873fb7c6d 100644 --- a/Examples/Stereo/stereo_euroc.cc +++ b/Examples/Stereo/stereo_euroc.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include diff --git a/Examples/Stereo/stereo_kitti.cc b/Examples/Stereo/stereo_kitti.cc index cb8bc4096e..fecb3a73c2 100644 --- a/Examples/Stereo/stereo_kitti.cc +++ b/Examples/Stereo/stereo_kitti.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include diff --git a/src/LocalMapping.cc b/src/LocalMapping.cc index 6c87a6e55a..b3a9d83948 100644 --- a/src/LocalMapping.cc +++ b/src/LocalMapping.cc @@ -23,6 +23,8 @@ #include "ORBmatcher.h" #include "Optimizer.h" +#include + #include namespace ORB_SLAM2 diff --git a/src/LoopClosing.cc b/src/LoopClosing.cc index 5e317dd420..27d13e3346 100644 --- a/src/LoopClosing.cc +++ b/src/LoopClosing.cc @@ -28,6 +28,7 @@ #include "ORBmatcher.h" +#include #include #include diff --git a/src/System.cc b/src/System.cc index 8df4157095..29c93494df 100644 --- a/src/System.cc +++ b/src/System.cc @@ -25,6 +25,7 @@ #include #include #include +#include namespace ORB_SLAM2 { diff --git a/src/Tracking.cc b/src/Tracking.cc index 2273b2ce48..147f6b7dad 100644 --- a/src/Tracking.cc +++ b/src/Tracking.cc @@ -33,6 +33,8 @@ #include"Optimizer.h" #include"PnPsolver.h" +#include + #include #include diff --git a/src/Viewer.cc b/src/Viewer.cc index dec3204f53..6f5e83f375 100644 --- a/src/Viewer.cc +++ b/src/Viewer.cc @@ -22,6 +22,7 @@ #include #include +#include namespace ORB_SLAM2 { From 2033f0e0b7056fef110dc6ddb4beed6156937f96 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 18 Jul 2019 00:57:37 +0200 Subject: [PATCH 2/9] Fix compilation error: const-ness error when using Eigen --- include/LoopClosing.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/LoopClosing.h b/include/LoopClosing.h index 7eb0416b15..c3adf13acd 100644 --- a/include/LoopClosing.h +++ b/include/LoopClosing.h @@ -47,7 +47,7 @@ class LoopClosing typedef pair,int> ConsistentGroup; typedef map, - Eigen::aligned_allocator > > KeyFrameAndPose; + Eigen::aligned_allocator > > KeyFrameAndPose; public: From 379c7633191b178b19a7c635b9df0fe370b05b6d Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 18 Jul 2019 00:58:36 +0200 Subject: [PATCH 3/9] Update to OpenCV 4 --- CMakeLists.txt | 2 +- Examples/Monocular/mono_euroc.cc | 1 + Examples/Monocular/mono_kitti.cc | 1 + Examples/Monocular/mono_tum.cc | 1 + Examples/RGB-D/rgbd_tum.cc | 1 + Examples/ROS/ORB_SLAM2/CMakeLists.txt | 2 +- Examples/Stereo/stereo_euroc.cc | 1 + Examples/Stereo/stereo_kitti.cc | 1 + Thirdparty/DBoW2/CMakeLists.txt | 2 +- include/ORBextractor.h | 2 +- include/PnPsolver.h | 1 + include/Tracking.h | 1 + src/PnPsolver.cc | 1 + src/Sim3Solver.cc | 1 + src/Tracking.cc | 1 + 15 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08a8af468e..d8db0877b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ endif() LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules) -find_package(OpenCV 3.0 QUIET) +find_package(OpenCV 4 QUIET) if(NOT OpenCV_FOUND) find_package(OpenCV 2.4.3 QUIET) if(NOT OpenCV_FOUND) diff --git a/Examples/Monocular/mono_euroc.cc b/Examples/Monocular/mono_euroc.cc index 65b21f3754..00175ff39b 100644 --- a/Examples/Monocular/mono_euroc.cc +++ b/Examples/Monocular/mono_euroc.cc @@ -26,6 +26,7 @@ #include #include +#include #include diff --git a/Examples/Monocular/mono_kitti.cc b/Examples/Monocular/mono_kitti.cc index fc0b2ccb4f..c4d9fbd9fc 100644 --- a/Examples/Monocular/mono_kitti.cc +++ b/Examples/Monocular/mono_kitti.cc @@ -27,6 +27,7 @@ #include #include +#include #include"System.h" diff --git a/Examples/Monocular/mono_tum.cc b/Examples/Monocular/mono_tum.cc index abe316e3bd..5c6e68c811 100644 --- a/Examples/Monocular/mono_tum.cc +++ b/Examples/Monocular/mono_tum.cc @@ -26,6 +26,7 @@ #include #include +#include #include diff --git a/Examples/RGB-D/rgbd_tum.cc b/Examples/RGB-D/rgbd_tum.cc index 6d9bab1acd..53d41d202a 100644 --- a/Examples/RGB-D/rgbd_tum.cc +++ b/Examples/RGB-D/rgbd_tum.cc @@ -26,6 +26,7 @@ #include #include +#include #include diff --git a/Examples/ROS/ORB_SLAM2/CMakeLists.txt b/Examples/ROS/ORB_SLAM2/CMakeLists.txt index 7cbf71c199..d25c873cdd 100644 --- a/Examples/ROS/ORB_SLAM2/CMakeLists.txt +++ b/Examples/ROS/ORB_SLAM2/CMakeLists.txt @@ -30,7 +30,7 @@ endif() LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../../cmake_modules) -find_package(OpenCV 3.0 QUIET) +find_package(OpenCV 4 QUIET) if(NOT OpenCV_FOUND) find_package(OpenCV 2.4.3 QUIET) if(NOT OpenCV_FOUND) diff --git a/Examples/Stereo/stereo_euroc.cc b/Examples/Stereo/stereo_euroc.cc index f873fb7c6d..b6149f6c67 100644 --- a/Examples/Stereo/stereo_euroc.cc +++ b/Examples/Stereo/stereo_euroc.cc @@ -27,6 +27,7 @@ #include #include +#include #include diff --git a/Examples/Stereo/stereo_kitti.cc b/Examples/Stereo/stereo_kitti.cc index fecb3a73c2..5fd55a3e35 100644 --- a/Examples/Stereo/stereo_kitti.cc +++ b/Examples/Stereo/stereo_kitti.cc @@ -27,6 +27,7 @@ #include #include +#include #include diff --git a/Thirdparty/DBoW2/CMakeLists.txt b/Thirdparty/DBoW2/CMakeLists.txt index 0eb512600a..8b1061f1f4 100644 --- a/Thirdparty/DBoW2/CMakeLists.txt +++ b/Thirdparty/DBoW2/CMakeLists.txt @@ -24,7 +24,7 @@ set(SRCS_DUTILS DUtils/Random.cpp DUtils/Timestamp.cpp) -find_package(OpenCV 3.0 QUIET) +find_package(OpenCV 4 QUIET) if(NOT OpenCV_FOUND) find_package(OpenCV 2.4.3 QUIET) if(NOT OpenCV_FOUND) diff --git a/include/ORBextractor.h b/include/ORBextractor.h index 66e8e7a547..b4e244d9d4 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..120f842d5e 100644 --- a/include/PnPsolver.h +++ b/include/PnPsolver.h @@ -52,6 +52,7 @@ #define PNPSOLVER_H #include +#include #include "MapPoint.h" #include "Frame.h" diff --git a/include/Tracking.h b/include/Tracking.h index 5aaa93ef26..c3e699e15b 100644 --- a/include/Tracking.h +++ b/include/Tracking.h @@ -23,6 +23,7 @@ #define TRACKING_H #include +#include #include #include"Viewer.h" diff --git a/src/PnPsolver.cc b/src/PnPsolver.cc index af3511b165..cdb714c982 100644 --- a/src/PnPsolver.cc +++ b/src/PnPsolver.cc @@ -55,6 +55,7 @@ #include #include #include +#include #include "Thirdparty/DBoW2/DUtils/Random.h" #include diff --git a/src/Sim3Solver.cc b/src/Sim3Solver.cc index 4ad44ff0de..cfb982c549 100644 --- a/src/Sim3Solver.cc +++ b/src/Sim3Solver.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include "KeyFrame.h" #include "ORBmatcher.h" diff --git a/src/Tracking.cc b/src/Tracking.cc index 147f6b7dad..77e6c2bc46 100644 --- a/src/Tracking.cc +++ b/src/Tracking.cc @@ -22,6 +22,7 @@ #include "Tracking.h" #include +#include #include #include"ORBmatcher.h" From fa0c07e1a272e43c9c701ecff13ba7dd4e82c3d0 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 23 Jul 2019 16:10:29 +0200 Subject: [PATCH 4/9] add IWYU pragmas. IWYU (include what you use) is a tool that automatically determines which #include statements should be in a source file, to avoid strange transitive include dependencies that might be fragile --- src/Converter.cc | 2 +- src/Frame.cc | 2 +- src/FrameDrawer.cc | 2 +- src/Initializer.cc | 2 +- src/KeyFrame.cc | 2 +- src/KeyFrameDatabase.cc | 2 +- src/LocalMapping.cc | 2 +- src/LoopClosing.cc | 2 +- src/Map.cc | 2 +- src/MapDrawer.cc | 2 +- src/MapPoint.cc | 2 +- src/ORBextractor.cc | 2 +- src/ORBmatcher.cc | 2 +- src/Optimizer.cc | 2 +- src/PnPsolver.cc | 2 +- src/Sim3Solver.cc | 2 +- src/System.cc | 2 +- src/Tracking.cc | 2 +- src/Viewer.cc | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Converter.cc b/src/Converter.cc index 00ea8ee597..524054c4a1 100644 --- a/src/Converter.cc +++ b/src/Converter.cc @@ -19,7 +19,7 @@ */ -#include "Converter.h" +#include "Converter.h" // IWYU pragma: associated namespace ORB_SLAM2 { diff --git a/src/Frame.cc b/src/Frame.cc index 0e37d49335..bb03714e72 100644 --- a/src/Frame.cc +++ b/src/Frame.cc @@ -18,7 +18,7 @@ * along with ORB-SLAM2. If not, see . */ -#include "Frame.h" +#include "Frame.h" // IWYU pragma: associated #include "Converter.h" #include "ORBmatcher.h" #include diff --git a/src/FrameDrawer.cc b/src/FrameDrawer.cc index e23b86c207..7ab64aad11 100644 --- a/src/FrameDrawer.cc +++ b/src/FrameDrawer.cc @@ -18,7 +18,7 @@ * along with ORB-SLAM2. If not, see . */ -#include "FrameDrawer.h" +#include "FrameDrawer.h" // IWYU pragma: associated #include "Tracking.h" #include diff --git a/src/Initializer.cc b/src/Initializer.cc index 6094b8f51b..ec85220877 100644 --- a/src/Initializer.cc +++ b/src/Initializer.cc @@ -18,7 +18,7 @@ * along with ORB-SLAM2. If not, see . */ -#include "Initializer.h" +#include "Initializer.h" // IWYU pragma: associated #include "Thirdparty/DBoW2/DUtils/Random.h" diff --git a/src/KeyFrame.cc b/src/KeyFrame.cc index 4ef1e78e0f..d91c56b65a 100644 --- a/src/KeyFrame.cc +++ b/src/KeyFrame.cc @@ -18,7 +18,7 @@ * along with ORB-SLAM2. If not, see . */ -#include "KeyFrame.h" +#include "KeyFrame.h" // IWYU pragma: associated #include "Converter.h" #include "ORBmatcher.h" #include diff --git a/src/KeyFrameDatabase.cc b/src/KeyFrameDatabase.cc index 826860cab9..8759f74936 100644 --- a/src/KeyFrameDatabase.cc +++ b/src/KeyFrameDatabase.cc @@ -18,7 +18,7 @@ * along with ORB-SLAM2. If not, see . */ -#include "KeyFrameDatabase.h" +#include "KeyFrameDatabase.h" // IWYU pragma: associated #include "KeyFrame.h" #include "Thirdparty/DBoW2/DBoW2/BowVector.h" diff --git a/src/LocalMapping.cc b/src/LocalMapping.cc index b3a9d83948..bd96728301 100644 --- a/src/LocalMapping.cc +++ b/src/LocalMapping.cc @@ -18,7 +18,7 @@ * along with ORB-SLAM2. If not, see . */ -#include "LocalMapping.h" +#include "LocalMapping.h" // IWYU pragma: associated #include "LoopClosing.h" #include "ORBmatcher.h" #include "Optimizer.h" diff --git a/src/LoopClosing.cc b/src/LoopClosing.cc index 27d13e3346..442fa71fe6 100644 --- a/src/LoopClosing.cc +++ b/src/LoopClosing.cc @@ -18,7 +18,7 @@ * along with ORB-SLAM2. If not, see . */ -#include "LoopClosing.h" +#include "LoopClosing.h" // IWYU pragma: associated #include "Sim3Solver.h" diff --git a/src/Map.cc b/src/Map.cc index 15fcd86914..99c0b3c31c 100644 --- a/src/Map.cc +++ b/src/Map.cc @@ -18,7 +18,7 @@ * along with ORB-SLAM2. If not, see . */ -#include "Map.h" +#include "Map.h" // IWYU pragma: associated #include diff --git a/src/MapDrawer.cc b/src/MapDrawer.cc index 4d9990bc8a..ad773ae8ee 100644 --- a/src/MapDrawer.cc +++ b/src/MapDrawer.cc @@ -18,7 +18,7 @@ * along with ORB-SLAM2. If not, see . */ -#include "MapDrawer.h" +#include "MapDrawer.h" // IWYU pragma: associated #include "MapPoint.h" #include "KeyFrame.h" #include diff --git a/src/MapPoint.cc b/src/MapPoint.cc index 3b2921197b..fc7966640f 100644 --- a/src/MapPoint.cc +++ b/src/MapPoint.cc @@ -18,7 +18,7 @@ * along with ORB-SLAM2. If not, see . */ -#include "MapPoint.h" +#include "MapPoint.h" // IWYU pragma: associated #include "ORBmatcher.h" #include diff --git a/src/ORBextractor.cc b/src/ORBextractor.cc index 14be2efae5..9c121fdd81 100644 --- a/src/ORBextractor.cc +++ b/src/ORBextractor.cc @@ -60,7 +60,7 @@ #include #include -#include "ORBextractor.h" +#include "ORBextractor.h" // IWYU pragma: associated using namespace cv; diff --git a/src/ORBmatcher.cc b/src/ORBmatcher.cc index 56bf279d0f..eb05785e4b 100644 --- a/src/ORBmatcher.cc +++ b/src/ORBmatcher.cc @@ -18,7 +18,7 @@ * along with ORB-SLAM2. If not, see . */ -#include "ORBmatcher.h" +#include "ORBmatcher.h" // IWYU pragma: associated #include diff --git a/src/Optimizer.cc b/src/Optimizer.cc index 83d9264546..8819c64579 100644 --- a/src/Optimizer.cc +++ b/src/Optimizer.cc @@ -18,7 +18,7 @@ * along with ORB-SLAM2. If not, see . */ -#include "Optimizer.h" +#include "Optimizer.h" // IWYU pragma: associated #include "Thirdparty/g2o/g2o/core/block_solver.h" #include "Thirdparty/g2o/g2o/core/optimization_algorithm_levenberg.h" diff --git a/src/PnPsolver.cc b/src/PnPsolver.cc index cdb714c982..b515bdf381 100644 --- a/src/PnPsolver.cc +++ b/src/PnPsolver.cc @@ -50,7 +50,7 @@ #include -#include "PnPsolver.h" +#include "PnPsolver.h" // IWYU pragma: associated #include #include diff --git a/src/Sim3Solver.cc b/src/Sim3Solver.cc index cfb982c549..68437630fa 100644 --- a/src/Sim3Solver.cc +++ b/src/Sim3Solver.cc @@ -19,7 +19,7 @@ */ -#include "Sim3Solver.h" +#include "Sim3Solver.h" // IWYU pragma: associated #include #include diff --git a/src/System.cc b/src/System.cc index 29c93494df..b58790d386 100644 --- a/src/System.cc +++ b/src/System.cc @@ -20,7 +20,7 @@ -#include "System.h" +#include "System.h" // IWYU pragma: associated #include "Converter.h" #include #include diff --git a/src/Tracking.cc b/src/Tracking.cc index 77e6c2bc46..52976d5f08 100644 --- a/src/Tracking.cc +++ b/src/Tracking.cc @@ -19,7 +19,7 @@ */ -#include "Tracking.h" +#include "Tracking.h" // IWYU pragma: associated #include #include diff --git a/src/Viewer.cc b/src/Viewer.cc index 6f5e83f375..f9f6467257 100644 --- a/src/Viewer.cc +++ b/src/Viewer.cc @@ -18,7 +18,7 @@ * along with ORB-SLAM2. If not, see . */ -#include "Viewer.h" +#include "Viewer.h" // IWYU pragma: associated #include #include From 98cecf94424c024eb28d6bf86ffb150903aad8cb Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 23 Jul 2019 16:12:41 +0200 Subject: [PATCH 5/9] iwyu helper tools --- gen_imp.sh | 16 +++++++++++ iwyu.imp | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ iwyu.sh | 8 ++++++ 3 files changed, 106 insertions(+) create mode 100644 gen_imp.sh create mode 100644 iwyu.imp create mode 100644 iwyu.sh diff --git a/gen_imp.sh b/gen_imp.sh new file mode 100644 index 0000000000..bd29f87311 --- /dev/null +++ b/gen_imp.sh @@ -0,0 +1,16 @@ +dir="`pwd`" + +echo '[' + +pushd /usr/include/eigen3/Eigen &> /dev/null +for i in *; do echo " { include: ['@', 'private', '', 'public'] },"; done | sed s/\'/\"/g +popd &>/dev/null + +echo + +pushd /usr/include/opencv4/opencv2 &>/dev/null +for i in *.hpp; do echo " { include: ['@', 'private', '', 'public'] },"; done | sed s/\'/\"/g +popd &> /dev/null + +echo ' { include: ["", "private", "", "public"] }' +echo ']' diff --git a/iwyu.imp b/iwyu.imp new file mode 100644 index 0000000000..7d8634b552 --- /dev/null +++ b/iwyu.imp @@ -0,0 +1,82 @@ +[ +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] }, +{ include: ["@", "private", "", "public"] } +] diff --git a/iwyu.sh b/iwyu.sh new file mode 100644 index 0000000000..234f20ad67 --- /dev/null +++ b/iwyu.sh @@ -0,0 +1,8 @@ +mkdir -p build +cd build + +# create compile_commands.json +cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + +echo "Running include-what-you-use. This can take a very long time (5-15 minutes)." +iwyu-tool -p . -- -Xiwyu --mapping_file=../iwyu.imp | tee iwyu.out From 67b96067b700d80b6ca1aa53bebb99cbeb799f6d Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 23 Jul 2019 17:18:29 +0200 Subject: [PATCH 6/9] iwyu tooling complete --- iwyu.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iwyu.sh b/iwyu.sh index 234f20ad67..8ef810fd5f 100644 --- a/iwyu.sh +++ b/iwyu.sh @@ -6,3 +6,6 @@ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON echo "Running include-what-you-use. This can take a very long time (5-15 minutes)." iwyu-tool -p . -- -Xiwyu --mapping_file=../iwyu.imp | tee iwyu.out + +echo "Now fixing the includes" +iwyu-fix-includes -m < iwyu.out From 8d21f54179907d33b160a3022e23406a45dc896b Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 23 Jul 2019 17:19:42 +0200 Subject: [PATCH 7/9] Run include-what-you-use on the code --- include/Frame.h | 6 +++++- include/KeyFrame.h | 9 +++++++-- include/LocalMapping.h | 8 ++++++-- include/LoopClosing.h | 19 +++++++++++++++---- include/Map.h | 7 ++++--- include/Optimizer.h | 12 +++++++++++- include/PnPsolver.h | 6 ++++++ include/Sim3Solver.h | 4 ++++ include/Viewer.h | 5 +++-- src/Converter.cc | 4 ++++ src/Frame.cc | 14 +++++++++++++- src/FrameDrawer.cc | 11 ++++++++--- src/Initializer.cc | 11 ++++++++--- src/KeyFrame.cc | 14 +++++++++++++- src/KeyFrameDatabase.cc | 8 ++++++++ src/LocalMapping.cc | 16 ++++++++++++++-- src/LoopClosing.cc | 19 +++++++++++++++---- src/Map.cc | 3 +++ src/MapDrawer.cc | 11 +++++++++-- src/MapPoint.cc | 11 +++++++++++ src/ORBextractor.cc | 19 +++++++++++++------ src/PnPsolver.cc | 11 ++++++----- src/Sim3Solver.cc | 10 ++++++---- src/System.cc | 23 ++++++++++++++++++++--- src/Viewer.cc | 11 +++++++++-- 25 files changed, 221 insertions(+), 51 deletions(-) diff --git a/include/Frame.h b/include/Frame.h index a6a8032f57..176a7f5de9 100644 --- a/include/Frame.h +++ b/include/Frame.h @@ -23,6 +23,10 @@ #include +#include +#include +#include + #include "MapPoint.h" #include "Thirdparty/DBoW2/DBoW2/BowVector.h" #include "Thirdparty/DBoW2/DBoW2/FeatureVector.h" @@ -30,7 +34,7 @@ #include "KeyFrame.h" #include "ORBextractor.h" -#include +namespace ORB_SLAM2 { class ORBextractor; } namespace ORB_SLAM2 { diff --git a/include/KeyFrame.h b/include/KeyFrame.h index 67f4348273..71e3a5db5c 100644 --- a/include/KeyFrame.h +++ b/include/KeyFrame.h @@ -21,6 +21,13 @@ #ifndef KEYFRAME_H #define KEYFRAME_H +#include +#include +#include +#include +#include +#include + #include "MapPoint.h" #include "Thirdparty/DBoW2/DBoW2/BowVector.h" #include "Thirdparty/DBoW2/DBoW2/FeatureVector.h" @@ -29,8 +36,6 @@ #include "Frame.h" #include "KeyFrameDatabase.h" -#include - namespace ORB_SLAM2 { diff --git a/include/LocalMapping.h b/include/LocalMapping.h index 1361a5757a..5cf34dccd6 100644 --- a/include/LocalMapping.h +++ b/include/LocalMapping.h @@ -21,14 +21,16 @@ #ifndef LOCALMAPPING_H #define LOCALMAPPING_H +#include +#include +#include + #include "KeyFrame.h" #include "Map.h" #include "LoopClosing.h" #include "Tracking.h" #include "KeyFrameDatabase.h" -#include - namespace ORB_SLAM2 { @@ -36,6 +38,8 @@ namespace ORB_SLAM2 class Tracking; class LoopClosing; class Map; +class KeyFrame; +class MapPoint; class LocalMapping { diff --git a/include/LoopClosing.h b/include/LoopClosing.h index c3adf13acd..abcc167c48 100644 --- a/include/LoopClosing.h +++ b/include/LoopClosing.h @@ -21,17 +21,25 @@ #ifndef LOOPCLOSING_H #define LOOPCLOSING_H +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "KeyFrame.h" #include "LocalMapping.h" #include "Map.h" #include "ORBVocabulary.h" #include "Tracking.h" - #include "KeyFrameDatabase.h" - -#include -#include #include "Thirdparty/g2o/g2o/types/types_seven_dof_expmap.h" +#include "Thirdparty/g2o/g2o/types/sim3.h" namespace ORB_SLAM2 { @@ -39,6 +47,9 @@ namespace ORB_SLAM2 class Tracking; class LocalMapping; class KeyFrameDatabase; +class KeyFrame; +class Map; +class MapPoint; class LoopClosing diff --git a/include/Map.h b/include/Map.h index a75339feea..53f2c8ca75 100644 --- a/include/Map.h +++ b/include/Map.h @@ -21,11 +21,12 @@ #ifndef MAP_H #define MAP_H -#include "MapPoint.h" -#include "KeyFrame.h" #include - #include +#include + +#include "MapPoint.h" +#include "KeyFrame.h" diff --git a/include/Optimizer.h b/include/Optimizer.h index 2c4378ed3b..0aca5822fb 100644 --- a/include/Optimizer.h +++ b/include/Optimizer.h @@ -21,18 +21,28 @@ #ifndef OPTIMIZER_H #define OPTIMIZER_H +#include +#include +#include +#include + #include "Map.h" #include "MapPoint.h" #include "KeyFrame.h" #include "LoopClosing.h" #include "Frame.h" - #include "Thirdparty/g2o/g2o/types/types_seven_dof_expmap.h" +namespace g2o { struct Sim3; } + namespace ORB_SLAM2 { class LoopClosing; +class Frame; +class KeyFrame; +class Map; +class MapPoint; class Optimizer { diff --git a/include/PnPsolver.h b/include/PnPsolver.h index 120f842d5e..5558dcbd41 100644 --- a/include/PnPsolver.h +++ b/include/PnPsolver.h @@ -53,11 +53,17 @@ #include #include +#include +#include +#include + #include "MapPoint.h" #include "Frame.h" namespace ORB_SLAM2 { +class Frame; +class MapPoint; class PnPsolver { public: diff --git a/include/Sim3Solver.h b/include/Sim3Solver.h index 9af66cb26f..35bb0882b4 100644 --- a/include/Sim3Solver.h +++ b/include/Sim3Solver.h @@ -23,6 +23,8 @@ #define SIM3SOLVER_H #include +#include +#include #include #include "KeyFrame.h" @@ -31,6 +33,8 @@ namespace ORB_SLAM2 { +class KeyFrame; +class MapPoint; class Sim3Solver { diff --git a/include/Viewer.h b/include/Viewer.h index 251e223c54..c842ed4965 100644 --- a/include/Viewer.h +++ b/include/Viewer.h @@ -22,13 +22,14 @@ #ifndef VIEWER_H #define VIEWER_H +#include +#include + #include "FrameDrawer.h" #include "MapDrawer.h" #include "Tracking.h" #include "System.h" -#include - namespace ORB_SLAM2 { diff --git a/src/Converter.cc b/src/Converter.cc index 524054c4a1..b0f2872d7b 100644 --- a/src/Converter.cc +++ b/src/Converter.cc @@ -21,6 +21,10 @@ #include "Converter.h" // IWYU pragma: associated +#include +#include +#include + namespace ORB_SLAM2 { diff --git a/src/Frame.cc b/src/Frame.cc index bb03714e72..1af0526fac 100644 --- a/src/Frame.cc +++ b/src/Frame.cc @@ -19,9 +19,21 @@ */ #include "Frame.h" // IWYU pragma: associated + +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "Converter.h" #include "ORBmatcher.h" -#include +#include "MapPoint.h" +#include "ORBextractor.h" namespace ORB_SLAM2 { diff --git a/src/FrameDrawer.cc b/src/FrameDrawer.cc index 7ab64aad11..03dffebdb7 100644 --- a/src/FrameDrawer.cc +++ b/src/FrameDrawer.cc @@ -19,10 +19,15 @@ */ #include "FrameDrawer.h" // IWYU pragma: associated -#include "Tracking.h" -#include -#include +#include +#include +#include + +#include "Tracking.h" +#include "Frame.h" +#include "Map.h" +#include "MapPoint.h" #include diff --git a/src/Initializer.cc b/src/Initializer.cc index ec85220877..92c78dc01f 100644 --- a/src/Initializer.cc +++ b/src/Initializer.cc @@ -20,10 +20,15 @@ #include "Initializer.h" // IWYU pragma: associated -#include "Thirdparty/DBoW2/DUtils/Random.h" +#include +#include +#include +#include +#include +#include -#include "Optimizer.h" -#include "ORBmatcher.h" +#include "Thirdparty/DBoW2/DUtils/Random.h" +#include "Frame.h" #include diff --git a/src/KeyFrame.cc b/src/KeyFrame.cc index d91c56b65a..082ab3a586 100644 --- a/src/KeyFrame.cc +++ b/src/KeyFrame.cc @@ -19,8 +19,20 @@ */ #include "KeyFrame.h" // IWYU pragma: associated + +#include +#include +#include +#include +#include +#include + #include "Converter.h" -#include "ORBmatcher.h" +#include "Frame.h" +#include "KeyFrameDatabase.h" +#include "Map.h" +#include "MapPoint.h" + #include namespace ORB_SLAM2 diff --git a/src/KeyFrameDatabase.cc b/src/KeyFrameDatabase.cc index 8759f74936..731e6d03b0 100644 --- a/src/KeyFrameDatabase.cc +++ b/src/KeyFrameDatabase.cc @@ -20,8 +20,16 @@ #include "KeyFrameDatabase.h" // IWYU pragma: associated +#include +#include +#include +#include +#include +#include + #include "KeyFrame.h" #include "Thirdparty/DBoW2/DBoW2/BowVector.h" +#include "Frame.h" #include diff --git a/src/LocalMapping.cc b/src/LocalMapping.cc index bd96728301..0c025fbb91 100644 --- a/src/LocalMapping.cc +++ b/src/LocalMapping.cc @@ -19,11 +19,23 @@ */ #include "LocalMapping.h" // IWYU pragma: associated + +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "LoopClosing.h" #include "ORBmatcher.h" #include "Optimizer.h" - -#include +#include "KeyFrame.h" +#include "Map.h" +#include "MapPoint.h" #include diff --git a/src/LoopClosing.cc b/src/LoopClosing.cc index 442fa71fe6..280cbb405a 100644 --- a/src/LoopClosing.cc +++ b/src/LoopClosing.cc @@ -20,15 +20,26 @@ #include "LoopClosing.h" // IWYU pragma: associated -#include "Sim3Solver.h" +#include +#include +#include +#include +#include +#include +#include +#include "Sim3Solver.h" #include "Converter.h" - #include "Optimizer.h" - #include "ORBmatcher.h" +#include "KeyFrame.h" +#include "KeyFrameDatabase.h" +#include "LocalMapping.h" +#include "Map.h" +#include "MapPoint.h" + +namespace DBoW2 { class BowVector; } -#include #include #include diff --git a/src/Map.cc b/src/Map.cc index 99c0b3c31c..87aa7d220a 100644 --- a/src/Map.cc +++ b/src/Map.cc @@ -20,6 +20,9 @@ #include "Map.h" // IWYU pragma: associated +#include "KeyFrame.h" +#include "MapPoint.h" + #include namespace ORB_SLAM2 diff --git a/src/MapDrawer.cc b/src/MapDrawer.cc index ad773ae8ee..a0b411a649 100644 --- a/src/MapDrawer.cc +++ b/src/MapDrawer.cc @@ -19,10 +19,17 @@ */ #include "MapDrawer.h" // IWYU pragma: associated -#include "MapPoint.h" -#include "KeyFrame.h" + #include +#include +#include #include +#include +#include + +#include "MapPoint.h" +#include "KeyFrame.h" +#include "Map.h" namespace ORB_SLAM2 { diff --git a/src/MapPoint.cc b/src/MapPoint.cc index fc7966640f..1ee29acee5 100644 --- a/src/MapPoint.cc +++ b/src/MapPoint.cc @@ -19,7 +19,18 @@ */ #include "MapPoint.h" // IWYU pragma: associated + +#include +#include +#include +#include +#include +#include + #include "ORBmatcher.h" +#include "Frame.h" +#include "KeyFrame.h" +#include "Map.h" #include diff --git a/src/ORBextractor.cc b/src/ORBextractor.cc index 9c121fdd81..4ca2c16c04 100644 --- a/src/ORBextractor.cc +++ b/src/ORBextractor.cc @@ -54,14 +54,21 @@ */ -#include -#include -#include -#include -#include - #include "ORBextractor.h" // IWYU pragma: associated +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + using namespace cv; using namespace std; diff --git a/src/PnPsolver.cc b/src/PnPsolver.cc index b515bdf381..f65b697d8b 100644 --- a/src/PnPsolver.cc +++ b/src/PnPsolver.cc @@ -48,16 +48,17 @@ * either expressed or implied, of the FreeBSD Project */ -#include - #include "PnPsolver.h" // IWYU pragma: associated +#include #include #include -#include -#include -#include "Thirdparty/DBoW2/DUtils/Random.h" #include +#include + +#include "Thirdparty/DBoW2/DUtils/Random.h" +#include "Frame.h" +#include "MapPoint.h" using namespace std; diff --git a/src/Sim3Solver.cc b/src/Sim3Solver.cc index 68437630fa..cb92505f72 100644 --- a/src/Sim3Solver.cc +++ b/src/Sim3Solver.cc @@ -21,15 +21,17 @@ #include "Sim3Solver.h" // IWYU pragma: associated +#include +#include +#include #include #include -#include -#include +#include +#include #include "KeyFrame.h" -#include "ORBmatcher.h" - #include "Thirdparty/DBoW2/DUtils/Random.h" +#include "MapPoint.h" namespace ORB_SLAM2 { diff --git a/src/System.cc b/src/System.cc index b58790d386..95ef708c20 100644 --- a/src/System.cc +++ b/src/System.cc @@ -21,14 +21,31 @@ #include "System.h" // IWYU pragma: associated -#include "Converter.h" -#include + #include -#include #include +#include +#include +#include +#include +#include +#include + +#include "Converter.h" +#include "Frame.h" +#include "FrameDrawer.h" +#include "KeyFrame.h" +#include "KeyFrameDatabase.h" +#include "LocalMapping.h" +#include "LoopClosing.h" +#include "Map.h" +#include "MapDrawer.h" +#include "Tracking.h" +#include "Viewer.h" namespace ORB_SLAM2 { +class MapPoint; System::System(const string &strVocFile, const string &strSettingsFile, const eSensor sensor, const bool bUseViewer):mSensor(sensor), mpViewer(static_cast(NULL)), mbReset(false),mbActivateLocalizationMode(false), diff --git a/src/Viewer.cc b/src/Viewer.cc index f9f6467257..9fc13e6505 100644 --- a/src/Viewer.cc +++ b/src/Viewer.cc @@ -19,10 +19,17 @@ */ #include "Viewer.h" // IWYU pragma: associated -#include -#include +#include #include +#include +#include +#include +#include + +#include "FrameDrawer.h" +#include "MapDrawer.h" +#include "System.h" namespace ORB_SLAM2 { From 9e272a8cc99d19fa067cecfd92ed08615d23a9b4 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 6 Nov 2019 16:24:31 +0100 Subject: [PATCH 8/9] Cleanup: replace 4-tuple-of-lists by list-of-4-tuples The Tracking class writes entries for each frame in mlRelativeFramePoses, mlpReferences, mlFrameTimes and mlbLost; these values belong together logically, so they have been fused into a struct TrackedFrame and a single list tracked_frames. --- include/Tracking.h | 12 ++++++++---- src/System.cc | 26 ++++++++------------------ src/Tracking.cc | 24 ++++++++++-------------- 3 files changed, 26 insertions(+), 36 deletions(-) diff --git a/include/Tracking.h b/include/Tracking.h index c3e699e15b..ecfea4075b 100644 --- a/include/Tracking.h +++ b/include/Tracking.h @@ -106,10 +106,14 @@ class Tracking // Lists used to recover the full camera trajectory at the end of the execution. // Basically we store the reference keyframe for each frame and its relative transformation - list mlRelativeFramePoses; - list mlpReferences; - list mlFrameTimes; - list mlbLost; + struct TrackedFrame + { + cv::Mat relative_frame_pose; + KeyFrame* reference_keyframe; + double time; + bool lost; + }; + list tracked_frames; // True if local mapping is deactivated and we are performing only localization bool mbOnlyTracking; diff --git a/src/System.cc b/src/System.cc index 95ef708c20..a5bd20fe2f 100644 --- a/src/System.cc +++ b/src/System.cc @@ -361,18 +361,12 @@ void System::SaveTrajectoryTUM(const string &filename) // We need to get first the keyframe pose and then concatenate the relative transformation. // Frames not localized (tracking failure) are not saved. - // For each frame we have a reference keyframe (lRit), the timestamp (lT) and a flag - // which is true when tracking failed (lbL). - list::iterator lRit = mpTracker->mlpReferences.begin(); - list::iterator lT = mpTracker->mlFrameTimes.begin(); - list::iterator lbL = mpTracker->mlbLost.begin(); - for(list::iterator lit=mpTracker->mlRelativeFramePoses.begin(), - lend=mpTracker->mlRelativeFramePoses.end();lit!=lend;lit++, lRit++, lT++, lbL++) + for (list::iterator iter = mpTracker->tracked_frames.begin(), iter_end = mpTracker->tracked_frames.end(); iter != iter_end; iter++) { - if(*lbL) + if(iter->lost) continue; - KeyFrame* pKF = *lRit; + KeyFrame* pKF = iter->reference_keyframe; cv::Mat Trw = cv::Mat::eye(4,4,CV_32F); @@ -385,13 +379,13 @@ void System::SaveTrajectoryTUM(const string &filename) Trw = Trw*pKF->GetPose()*Two; - cv::Mat Tcw = (*lit)*Trw; + cv::Mat Tcw = iter->relative_frame_pose*Trw; cv::Mat Rwc = Tcw.rowRange(0,3).colRange(0,3).t(); cv::Mat twc = -Rwc*Tcw.rowRange(0,3).col(3); vector q = Converter::toQuaternion(Rwc); - f << setprecision(6) << *lT << " " << setprecision(9) << twc.at(0) << " " << twc.at(1) << " " << twc.at(2) << " " << q[0] << " " << q[1] << " " << q[2] << " " << q[3] << endl; + f << setprecision(6) << iter->time << " " << setprecision(9) << twc.at(0) << " " << twc.at(1) << " " << twc.at(2) << " " << q[0] << " " << q[1] << " " << q[2] << " " << q[3] << endl; } f.close(); cout << endl << "trajectory saved!" << endl; @@ -458,13 +452,9 @@ void System::SaveTrajectoryKITTI(const string &filename) // We need to get first the keyframe pose and then concatenate the relative transformation. // Frames not localized (tracking failure) are not saved. - // For each frame we have a reference keyframe (lRit), the timestamp (lT) and a flag - // which is true when tracking failed (lbL). - list::iterator lRit = mpTracker->mlpReferences.begin(); - list::iterator lT = mpTracker->mlFrameTimes.begin(); - for(list::iterator lit=mpTracker->mlRelativeFramePoses.begin(), lend=mpTracker->mlRelativeFramePoses.end();lit!=lend;lit++, lRit++, lT++) + for (list::iterator iter = mpTracker->tracked_frames.begin(), iter_end = mpTracker->tracked_frames.end(); iter != iter_end; iter++) { - ORB_SLAM2::KeyFrame* pKF = *lRit; + ORB_SLAM2::KeyFrame* pKF = iter->reference_keyframe; cv::Mat Trw = cv::Mat::eye(4,4,CV_32F); @@ -477,7 +467,7 @@ void System::SaveTrajectoryKITTI(const string &filename) Trw = Trw*pKF->GetPose()*Two; - cv::Mat Tcw = (*lit)*Trw; + cv::Mat Tcw = iter->relative_frame_pose*Trw; cv::Mat Rwc = Tcw.rowRange(0,3).colRange(0,3).t(); cv::Mat twc = -Rwc*Tcw.rowRange(0,3).col(3); diff --git a/src/Tracking.cc b/src/Tracking.cc index 52976d5f08..b9468efb20 100644 --- a/src/Tracking.cc +++ b/src/Tracking.cc @@ -491,19 +491,18 @@ void Tracking::Track() // Store frame pose information to retrieve the complete camera trajectory afterwards. if(!mCurrentFrame.mTcw.empty()) { - cv::Mat Tcr = mCurrentFrame.mTcw*mCurrentFrame.mpReferenceKF->GetPoseInverse(); - mlRelativeFramePoses.push_back(Tcr); - mlpReferences.push_back(mpReferenceKF); - mlFrameTimes.push_back(mCurrentFrame.mTimeStamp); - mlbLost.push_back(mState==LOST); + TrackedFrame tracked_frame; + tracked_frame.relative_frame_pose = mCurrentFrame.mTcw*mCurrentFrame.mpReferenceKF->GetPoseInverse(); + tracked_frame.reference_keyframe = mpReferenceKF; + tracked_frame.time = mCurrentFrame.mTimeStamp; + tracked_frame.lost = (mState == LOST); + tracked_frames.push_back(tracked_frame); } else { // This can happen if tracking is lost - mlRelativeFramePoses.push_back(mlRelativeFramePoses.back()); - mlpReferences.push_back(mlpReferences.back()); - mlFrameTimes.push_back(mlFrameTimes.back()); - mlbLost.push_back(mState==LOST); + TrackedFrame tracked_frame = tracked_frames.back(); + tracked_frame.lost = (mState == LOST); } } @@ -805,7 +804,7 @@ void Tracking::UpdateLastFrame() { // Update pose according to reference keyframe KeyFrame* pRef = mLastFrame.mpReferenceKF; - cv::Mat Tlr = mlRelativeFramePoses.back(); + cv::Mat Tlr = tracked_frames.back().relative_frame_pose; mLastFrame.SetPose(Tlr*pRef->GetPose()); @@ -1543,10 +1542,7 @@ void Tracking::Reset() mpInitializer = static_cast(NULL); } - mlRelativeFramePoses.clear(); - mlpReferences.clear(); - mlFrameTimes.clear(); - mlbLost.clear(); + tracked_frames.clear(); if(mpViewer) mpViewer->Release(); From c7fc1970efac07e2dcbc1f28343e0c8ca28de5f8 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 6 Nov 2019 18:26:33 +0100 Subject: [PATCH 9/9] oops, fix bug introduced by last commit --- src/Tracking.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tracking.cc b/src/Tracking.cc index b9468efb20..58c74db087 100644 --- a/src/Tracking.cc +++ b/src/Tracking.cc @@ -503,6 +503,7 @@ void Tracking::Track() // This can happen if tracking is lost TrackedFrame tracked_frame = tracked_frames.back(); tracked_frame.lost = (mState == LOST); + tracked_frames.push_back(tracked_frame); } }