Skip to content

Commit

Permalink
set default build type to release
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoxiang12 committed May 25, 2019
1 parent 1189474 commit 6c808a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ch13/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
cmake_minimum_required(VERSION 2.8)
project(myslam)

set(CMAKE_BUILD_TYPE Release)

set(CMAKE_CXX_FLAGS "-std=c++11 -Wall")
set(CMAKE_CXX_FLAGS_RELEASE "-std=c++11 -O3")
set(CMAKE_CXX_FLAGS_RELEASE "-std=c++11 -O3 -fopenmp -pthread")

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
Expand Down
3 changes: 2 additions & 1 deletion ch13/config/default.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
%YAML:1.0
# data
# the tum dataset directory, change it to yours!
dataset_dir: /media/xiang/Data/Dataset/Kitti/dataset/sequences/00
# dataset_dir: /media/xiang/Data/Dataset/Kitti/dataset/sequences/00
dataset_dir: /mnt/1A9286BD92869CBF/Dataset/Kitti/dataset/sequences/05

# camera intrinsics
camera.fx: 517.3
Expand Down
8 changes: 6 additions & 2 deletions ch13/src/visual_odometry.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
// Created by gaoxiang on 19-5-4.
//

#include "myslam/visual_odometry.h"
#include <chrono>
#include "myslam/config.h"

namespace myslam {
Expand Down Expand Up @@ -42,10 +42,14 @@ bool VisualOdometry::Init() {
void VisualOdometry::Run() {
while (1) {
LOG(INFO) << "VO is running";
auto t1 = std::chrono::steady_clock::now();
if (Step() == false) {
break;
}
usleep(10000);
auto t2 = std::chrono::steady_clock::now();
auto time_used =
std::chrono::duration_cast<std::chrono::duration<double>>(t2 - t1);
LOG(INFO) << "VO cost time: " << time_used.count() << " seconds.";
}

backend_->Stop();
Expand Down

0 comments on commit 6c808a3

Please sign in to comment.