Skip to content

Commit 3d1e13a

Browse files
committed
bugfix and now can build example evaluation
1 parent 67dbfa9 commit 3d1e13a

4 files changed

Lines changed: 59 additions & 16 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ add_definitions(-DEIGEN_INITIALIZE_MATRICES_BY_ZERO)
1414
find_package(OpenCV REQUIRED)
1515
# Eigen
1616
find_package(Eigen3 REQUIRED)
17+
# Google log
18+
find_package(Glog REQUIRED)
1719
# Protobuf
1820
find_package(Protobuf REQUIRED)
1921
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROJECT_SOURCE_DIR}/protocols/vlslam.proto)
20-
2122
# facebook folly
2223
find_package(Folly REQUIRED)
2324

@@ -31,6 +32,7 @@ include_directories(
3132
${EIGEN3_INCLUDE_DIR}
3233
${PROTOBUF_INCLUDE_DIRS}
3334
${FOLLY_INCLUDE_DIR}
35+
${GLOG_INCLUDE_DIRS}
3436
)
3537
message(STATUS "Found Eigen at ${EIGEN3_INCLUDE_DIR}")
3638

@@ -55,6 +57,7 @@ link_libraries(
5557
${OpenCV_MINIMAL}
5658
${FOLLY_LIBRARY}
5759
double-conversion # for folly
60+
glog
5861
)
5962

6063
add_library(visma SHARED
@@ -72,14 +75,14 @@ if (${build_evaluation})
7275
${PROJECT_SOURCE_DIR}/thirdparty/Open3D/include/Open3D
7376
${PROJECT_SOURCE_DIR}/thirdparty/Sophus/include)
7477
link_directories(
75-
${PROJECT_SOURCE_DIR}/Open3D/lib
78+
${PROJECT_SOURCE_DIR}/thirdparty/Open3D/lib
7679
)
7780
add_library(visma_eval SHARED
7881
src/constrained_icp.cpp
7982
src/evaluation.cpp
8083
src/visualization.cpp)
81-
target_link_libraries(visma_eval visma)
82-
add_executable(example_evaluate example/example_tool.cpp)
83-
target_link_libraries(example_evaluate visma_eval visma)
84+
85+
add_executable(example_evaluate example/example_evaluate.cpp)
86+
target_link_libraries(example_evaluate visma_eval visma Open3D)
8487
endif(${build_evaluation})
8588

‎CMakeModules/FindGlog.cmake‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# - Try to find Glog
2+
#
3+
# The following variables are optionally searched for defaults
4+
# GLOG_ROOT_DIR: Base directory where all GLOG components are found
5+
#
6+
# The following are set after configuration is done:
7+
# GLOG_FOUND
8+
# GLOG_INCLUDE_DIRS
9+
# GLOG_LIBRARIES
10+
# GLOG_LIBRARYRARY_DIRS
11+
12+
include(FindPackageHandleStandardArgs)
13+
14+
set(GLOG_ROOT_DIR "" CACHE PATH "Folder contains Google glog")
15+
16+
if(WIN32)
17+
find_path(GLOG_INCLUDE_DIR glog/logging.h
18+
PATHS ${GLOG_ROOT_DIR}/src/windows)
19+
else()
20+
find_path(GLOG_INCLUDE_DIR glog/logging.h
21+
PATHS ${GLOG_ROOT_DIR})
22+
endif()
23+
24+
if(MSVC)
25+
find_library(GLOG_LIBRARY_RELEASE libglog_static
26+
PATHS ${GLOG_ROOT_DIR}
27+
PATH_SUFFIXES Release)
28+
29+
find_library(GLOG_LIBRARY_DEBUG libglog_static
30+
PATHS ${GLOG_ROOT_DIR}
31+
PATH_SUFFIXES Debug)
32+
33+
set(GLOG_LIBRARY optimized ${GLOG_LIBRARY_RELEASE} debug ${GLOG_LIBRARY_DEBUG})
34+
else()
35+
find_library(GLOG_LIBRARY glog
36+
PATHS ${GLOG_ROOT_DIR}
37+
PATH_SUFFIXES lib lib64)
38+
endif()
39+
40+
find_package_handle_standard_args(Glog DEFAULT_MSG GLOG_INCLUDE_DIR GLOG_LIBRARY)
41+
42+
if(GLOG_FOUND)
43+
set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR})
44+
set(GLOG_LIBRARIES ${GLOG_LIBRARY})
45+
message(STATUS "Found glog (include: ${GLOG_INCLUDE_DIR}, library: ${GLOG_LIBRARY})")
46+
mark_as_advanced(GLOG_ROOT_DIR GLOG_LIBRARY_RELEASE GLOG_LIBRARY_DEBUG
47+
GLOG_LIBRARY GLOG_INCLUDE_DIR)
48+
endif()

‎example/example_evaluate.cpp‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
#include "common/eigen_alias.h"
2-
3-
// stl
4-
#include <chrono>
5-
#include <sophus/se3.hpp>
61
// folly
72
#include "folly/dynamic.h"
83
#include "folly/json.h"
94
#include "folly/FileUtil.h"
105
// igl
11-
#include "igl/readOBJ.h"
12-
// feh
13-
#include "io_utils.h"
146
#include "tool.h"
157

168
using namespace feh;

‎src/visualization.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// libigl
1313
#include "igl/readOBJ.h"
1414
#include <igl/writeOBJ.h>
15-
#include <vlslam.pb.h>
1615
#include "igl/readPLY.h"
1716
// Open3D
1817
#include "IO/IO.h"
@@ -26,6 +25,7 @@
2625
#include "io_utils.h"
2726
#include "geometry.h"
2827
#include "dataset_loaders.h"
28+
#include <vlslam.pb.h>
2929

3030
namespace feh {
3131

@@ -48,9 +48,9 @@ void AssembleScene(const folly::dynamic &config,
4848
// LOAD SCENE POINT CLOUD
4949
std::list<Eigen::Matrix<double, 6, 1>> sceneV;
5050
if (show_original) {
51-
auto scene = std::make_shared<three::PointCloud>();
51+
auto scene = std::make_shared<open3d::PointCloud>();
5252
try {
53-
three::ReadPointCloudFromPLY(scene_dir + "/test.klg.ply", *scene);
53+
open3d::ReadPointCloudFromPLY(scene_dir + "/test.klg.ply", *scene);
5454
for (int i = 0; i < scene->points_.size(); ++i) {
5555
sceneV.push_back({});
5656
sceneV.back().head<3>() = scene->points_[i];

0 commit comments

Comments
 (0)