Skip to content
Permalink
Browse files

Merge branch 'aaron_dev'

  • Loading branch information...
amarburg committed Jun 11, 2016
2 parents 44e8ad3 + 1c12417 commit 805c285061670e495dd84b589ed7499d3d068941
Showing with 911 additions and 412 deletions.
  1. +1 −1 .travis/build.sh
  2. +14 −8 CMakeLists.txt
  3. +11 −5 README.md
  4. +26 −0 Sophus_test.cpp
  5. +0 −24 ZED.md
  6. +3 −1 cmake/BuildG2O.cmake
  7. +11 −1 cmake/BuildG3Log.cmake
  8. +2 −0 cmake/BuildGTestLibraries.cmake
  9. +20 −21 cmake/BuildGoogleSnappy.cmake
  10. +4 −1 cmake/BuildPangolin.cmake
  11. +32 −0 doc/RecorderPerformance.md
  12. +60 −0 doc/performance_analyses/jetson_recorder_stats.csv
  13. +134 −0 doc/performance_analyses/jetson_recorder_stats.ipynb
  14. +4 −0 lib/active_object/active.h
  15. +56 −54 lib/lsd_core/DataStructures/CurrentKeyFrame.h
  16. +2 −6 lib/lsd_core/DataStructures/Frame.cpp
  17. +2 −0 lib/lsd_core/DataStructures/Frame.h
  18. +9 −6 lib/lsd_core/DataStructures/FrameMemory.cpp
  19. +30 −42 lib/lsd_core/DepthEstimation/DepthMap.cpp
  20. +20 −13 lib/lsd_core/SlamSystem.cpp
  21. +5 −5 lib/lsd_core/SlamSystem.h
  22. +85 −68 lib/lsd_core/SlamSystem/MappingThread.cpp
  23. +31 −9 lib/lsd_core/SlamSystem/MappingThread.h
  24. +32 −26 lib/lsd_core/SlamSystem/TrackingThread.cpp
  25. +2 −2 lib/lsd_core/SlamSystem/TrackingThread.h
  26. +26 −16 lib/lsd_core/Tracking/SE3Tracker.cpp
  27. +3 −0 lib/lsd_core/util/G3LogSinks.h
  28. +2 −2 lib/lsd_core/util/globalFuncs.cpp
  29. +1 −1 lib/lsd_core/util/settings.cpp
  30. +15 −0 test_recordings.rb
  31. +8 −3 thirdparty/Sophus/sophus/se3.hpp
  32. +2 −2 tools/CMakeLists.txt
  33. +11 −2 tools/LSD.cpp
  34. 0 tools/{LSDGuiThread.cpp → LSD/GuiThread.cpp}
  35. +1 −1 tools/{LSDInputThread.cpp → LSD/InputThread.cpp}
  36. 0 tools/{ → LSD}/LSD.h
  37. +96 −92 tools/ZedRecorder.cpp
  38. +86 −0 tools/ZedRecorder/Display.h
  39. +64 −0 tools/ZedRecorder/ImageOutput.h
@@ -7,4 +7,4 @@ BUILD_TYPE=${BUILD_TYPE:=Release}
if [ ! -d build_ci ]; then mkdir build_ci; fi

cmake -Bbuild_ci -H. -DCMAKE_BUILD_TYPE:string=$BUILD_TYPE -DEXTERNAL_PROJECT_PARALLELISM:string=0
cd build_ci && make && make unit_test
cd build_ci && make deps && make unit_test
@@ -24,11 +24,12 @@ find_package(ZLIB REQUIRED)

include( ${PROJECT_SOURCE_DIR}/cmake/BuildG3Log.cmake )

set( EXTERNAL_PROJECTS g3log )
## Command used to build the external projects
set( EXTERNAL_PROJECT_PARALLELISM 4 CACHE STRING "Level of parallelism when making ExternalProjects" )
set( EXTERNAL_PROJECT_MAKE_COMMAND "make" )
if( EXTERNAL_PROJECT_PARALLELISM GREATER 0 )
message( "Building ExternalProjects in Parallel")
message( "Building ExternalProjects in Parallel, to disable set EXTERNAL_PROJECT_PARALLELISM to 0")
set( EXTERNAL_PROJECT_MAKE_COMMAND make -j${EXTERNAL_PROJECT_PARALLELISM} )
endif()

@@ -45,6 +46,7 @@ option( USE_OPENMP "Enable OpenMP (currently only in local copy of G2O)" OFF )
option( BUILD_LOCAL_G2O "Build a local copy of G2O" ON )
if( BUILD_LOCAL_G2O )
set( G2O_USE_OPENMP ${USE_OPENMP} )
list( APPEND EXTERNAL_PROJECTS G2O )

include( ${PROJECT_SOURCE_DIR}/cmake/BuildG2O.cmake )
elseif()
@@ -72,6 +74,7 @@ list( APPEND G2O_INCLUDE_DIR
##==== Option to build local copy of Pangolin ======================
option( BUILD_LOCAL_PANGOLIN "Build a local copy of Pangolin" ON )
if( BUILD_LOCAL_PANGOLIN )
list( APPEND EXTERNAL_PROJECTS Pangolin )
include( ${PROJECT_SOURCE_DIR}/cmake/BuildPangolin.cmake )
elseif()
find_package(Pangolin 0.1 REQUIRED)
@@ -84,8 +87,10 @@ include( ${PROJECT_SOURCE_DIR}/cmake/Zed.cmake )

##====== Support for Google Snappy compression lib ==================
option( USE_GOOGLE_SNAPPY "Use Google Snappy" ON )
include( ${PROJECT_SOURCE_DIR}/cmake/BuildGoogleSnappy.cmake )

if( USE_GOOGLE_SNAPPY )
include( ${PROJECT_SOURCE_DIR}/cmake/BuildGoogleSnappy.cmake )
list( APPEND EXTERNAL_PROJECTS snappy )
endif()

## C++ flags applied to all builds
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
@@ -97,14 +102,12 @@ message( STATUS "Architecture: ${ARCHITECTURE}" )
if( ${ARCHITECTURE} STREQUAL "aarch64" )

## For compilation on Jetson TX1
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a") # -DENABLE_NEON" )

elseif( ${ARCHITECTURE} STREQUAL "x86_64" )
# Note this enables Jakob's original SSE optimizations in his code,
# -DENABLE_SSE enables Jakob's original SSE optimizations in his code,
# it has nothing to do with gcc
add_definitions("-DENABLE_SSE")

set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -msse4.1 -msse3 -msse2 -msse -march=native" )
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -msse4.1 -msse3 -msse2 -msse -march=native -DENABLE_SSE" )
endif()


@@ -134,8 +137,11 @@ option( BUILD_UNIT_TESTS "Build unit tests" ON )
if( BUILD_UNIT_TESTS )
## Build a local copy of gtest (as per the GTest FAQ)
include( ${CMAKE_SOURCE_DIR}/cmake/BuildGTestLibraries.cmake )
list( APPEND EXTERNAL_PROJECTS gtest )

add_subdirectory( test/unit/active_object )
add_subdirectory( test/unit/logger )
add_subdirectory( test/unit/lsd_core )
endif()

add_custom_target( deps DEPENDS ${EXTERNAL_PROJECTS} )
@@ -49,17 +49,23 @@ and optionally
* the [StereoLabs Zed](https://www.stereolabs.com/) SDK
* [Google Snappy](https://github.com/google/snappy) for file compression.

By default, LSD-SLAM will use CMake ExternalProjects to build each of these dependencies automatically. This is the most repeatable path but will be slow to re-compile as it will update each dependency every time.
LSD-SLAM will use CMake ExternalProjects to build each of these
dependencies automatically. **This no longer happens automatically as part
of a `make` or `make all` ---** it was taking too long to re-check the dependencies
every time. Instead, `make dep` should be run the first time. This will
build just the dependencies. CMake will (still) not resolve these dependencies
correctly when building in parallel ('make -j').

**CMake will not resolve these dependencies correctly when building in parallel ('make -j'). On the first build, use just 'make'. Once the dependencies have been made (they should be reasonably stable), you can 'make -j' when rebuilding just LSD-SLAM.**

Set the appropriate CMake variable `BUILD_LOCAL_* = OFF` to disable building local copies. If you want to build G2O, Pangolin, etc. yourself, see the `cmake/Build*` files for the CMake flags I used.
Set the appropriate CMake variable `BUILD_LOCAL_* = OFF` to disable building
local copies. If you want to build G2O, Pangolin, etc. yourself, see
the `cmake/Build*` files for the CMake flags I used.

See also [doc/CommonProblems.md](doc/CommonProblems.md)

# 4. Running

Supports directories or sets of raw PNG images. For example, you can download any dataset from [here](http://vision.in.tum.de/lsdslam) in PNG format, and run:
Supports directories or sets of raw PNG images. For example, you can download
any dataset from [here](http://vision.in.tum.de/lsdslam) in PNG format, and run:

./LSD --calib datasets/LSD_machine/cameraCalibration.cfg datasets/LSD_machine/images/

@@ -0,0 +1,26 @@
//
// g++ -ggdb -I/usr/include/eigen3 -I./thirdparty/Sophus -o Sophus_test Sophus_test.cpp
//

#include <stdio.h>
#include "sophus/se3.hpp"

using namespace std;

int main( int argc, char **argv )
{
Eigen::Matrix<float,6,1> inc;
inc << -0.000324532f, 0.00119352f, -1.57896e-05f, -0.000128844f, 0.00168068f, 0.00248538f;
Sophus::SE3f exp_increment = Sophus::SE3f::exp((inc));

printf(" log exp_increment =%.4f %.4f %.4f %.4f %.4f %.4f\n",
exp_increment.log()[0],exp_increment.log()[1],exp_increment.log()[2],
exp_increment.log()[3],exp_increment.log()[4],exp_increment.log()[5]);

// Eigen::Matrix3f omega;
// omega << 0, 0.00248538004, -0.00168067997, -0.00248538004, 0, -0.000128843996, 0.00168067997, 0.000128843996, 0;
// cout << omega << endl;
//
// Eigen::Matrix3f omega_sq = omega*omega;
// cout << omega_sq << endl;
}
24 ZED.md

This file was deleted.

Oops, something went wrong.
@@ -3,7 +3,7 @@ SET( G2O_PREFIX_DIR ${PROJECT_BINARY_DIR}/g2o )
SET( G2O_INSTALL_DIR ${G2O_PREFIX_DIR} )

ExternalProject_Add( G2O
GIT_REPOSITORY https://github.com/RainerKuemmerle/g2o.git
GIT_REPOSITORY https://github.com/amarburg/g2o.git
PREFIX g2o
BUILD_COMMAND ${EXTERNAL_PROJECT_MAKE_COMMAND}
CMAKE_CACHE_ARGS -DCMAKE_BUILD_TYPE:string=Release
@@ -24,3 +24,5 @@ set( G2O_LIBRARIES

set( G2O_INCLUDE_DIR
${G2O_INSTALL_DIR}/include )

set_target_properties(G2O PROPERTIES EXCLUDE_FROM_ALL TRUE)
@@ -3,13 +3,21 @@ SET( G3LOG_PREFIX_DIR ${PROJECT_BINARY_DIR}/g3log )
SET( G3LOG_INSTALL_DIR ${G3LOG_PREFIX_DIR} )
SET( G3LOG_SOURCE_DIR ${G3LOG_PREFIX_DIR}/src/g3log )

SET( G3LOG_CMAKE_OPTS -DADD_FATAL_EXAMPLE:bool=OFF )
LIST(APPEND G3LOG_CMAKE_OPTS -DCMAKE_BUILD_TYPE:string=${CMAKE_BUILD_TYPE} )
IF( ${CMAKE_BUILD_TYPE} STREQUAL Release )
message( "Disabling the DEBUG level in G3LOG" )
LIST(APPEND G3LOG_CMAKE_OPTS -DIGNORE_DEBUG_LEVEL:bool=ON )
ENDIF()

## Uses my fork which doesn't create src/g3log/generated_definitions.hpp
## And thus doesn't need to be re-built every time...
ExternalProject_Add( g3log
GIT_REPOSITORY https://github.com/amarburg/g3log.git
PREFIX g3log
UPDATE_COMMAND git pull origin master
BUILD_COMMAND ${EXTERNAL_PROJECT_MAKE_COMMAND}
CMAKE_CACHE_ARGS -DADD_FATAL_EXAMPLE:bool=OFF
CMAKE_ARGS ${G3LOG_CMAKE_OPTS}
INSTALL_COMMAND "" )

## g3log doesn't have an "install" target
@@ -20,3 +28,5 @@ link_directories(
)

set( G3LOG_LIB g3logger )

set_target_properties(g3log PROPERTIES EXCLUDE_FROM_ALL TRUE)
@@ -21,3 +21,5 @@ set( GTEST_INCLUDE_DIRS ${INSTALL_DIR}/include )
set( GTEST_LIBRARY ${INSTALL_DIR}/lib/libgtest.a )
set( GTEST_MAIN_LIBRARY ${INSTALL_DIR}/lib/libgtest_main.a )
set( GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY} )

set_target_properties(gtest PROPERTIES EXCLUDE_FROM_ALL TRUE)
@@ -1,26 +1,25 @@

add_definitions( -DUSE_SNAPPY )

if( USE_GOOGLE_SNAPPY )
add_definitions( -DUSE_SNAPPY )
SET( SNAPPY_PREFIX_DIR ${PROJECT_BINARY_DIR}/google-snappy )
SET( SNAPPY_INSTALL_DIR ${SNAPPY_PREFIX_DIR} )
SET( SNAPPY_SOURCE_DIR ${SNAPPY_PREFIX_DIR}/src/snappy )
ExternalProject_Add( snappy
GIT_REPOSITORY https://github.com/google/snappy.git
PREFIX google-snappy
SOURCE_DIR ${SNAPPY_SOURCE_DIR}
BINARY_DIR ${SNAPPY_SOURCE_DIR}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ./autogen.sh && ./configure --prefix=${SNAPPY_INSTALL_DIR}
BUILD_COMMAND ${EXTERNAL_PROJECT_MAKE_COMMAND} -C ${SNAPPY_SOURCE_DIR} )

SET( SNAPPY_PREFIX_DIR ${PROJECT_BINARY_DIR}/google-snappy )
SET( SNAPPY_INSTALL_DIR ${SNAPPY_PREFIX_DIR} )
SET( SNAPPY_SOURCE_DIR ${SNAPPY_PREFIX_DIR}/src/snappy )
ExternalProject_Add( snappy
GIT_REPOSITORY https://github.com/google/snappy.git
PREFIX google-snappy
SOURCE_DIR ${SNAPPY_SOURCE_DIR}
BINARY_DIR ${SNAPPY_SOURCE_DIR}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ./autogen.sh && ./configure --prefix=${SNAPPY_INSTALL_DIR}
BUILD_COMMAND ${EXTERNAL_PROJECT_MAKE_COMMAND} -C ${SNAPPY_SOURCE_DIR} )
set( SNAPPY_INCLUDE_DIRS ${SNAPPY_INSTALL_DIR}/include )

set( SNAPPY_INCLUDE_DIRS ${SNAPPY_INSTALL_DIR}/include )

## This doesn't seem right.
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set( SNAPPY_LIBRARIES ${SNAPPY_INSTALL_DIR}/lib/libsnappy.dylib )
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set( SNAPPY_LIBRARIES ${SNAPPY_INSTALL_DIR}/lib/libsnappy.so )
endif()
## This doesn't seem right.
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set( SNAPPY_LIBRARIES ${SNAPPY_INSTALL_DIR}/lib/libsnappy.dylib )
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set( SNAPPY_LIBRARIES ${SNAPPY_INSTALL_DIR}/lib/libsnappy.so )
endif()

set_target_properties(snappy PROPERTIES EXCLUDE_FROM_ALL TRUE)
@@ -8,7 +8,7 @@ find_package( GLUT REQUIRED )
find_package( GLM REQUIRED ) # n.b. we provide the FindGLM.cmake file

ExternalProject_Add( Pangolin
GIT_REPOSITORY https://github.com/stevenlovegrove/Pangolin.git
GIT_REPOSITORY https://github.com/amarburg/Pangolin.git
PREFIX Pangolin
BUILD_COMMAND ${EXTERNAL_PROJECT_MAKE_COMMAND}
CMAKE_CACHE_ARGS -DCMAKE_BUILD_TYPE:string=Release
@@ -30,3 +30,6 @@ endif()

set( Pangolin_INCLUDE_DIRS
${PANGOLIN_INSTALL_DIR}/include )


set_target_properties(Pangolin PROPERTIES EXCLUDE_FROM_ALL TRUE)
@@ -0,0 +1,32 @@

SVO Recording Data Rates
----

All resolutions recorded over a 10 sec interval, Zed SDK 0.9.3 unless otherwise noted.

On a Core i7 w/ GTX970, writing to a Samsung 850 Pro SSD on SATA.

<table>
<tr><th>Resolution</th><th>Nom. FPS</th><th>Meas. FPS</th><th>File Size (MB)</th><th>Rate (MB/s)</th><tr>
<tr><td>HD2K</td><td>15</td><td>15.0802</td><td>1569</td><td>156.695</td></tr>
<tr><td>HD1080</td><td>30</td><td>28.6462</td><td>2230</td><td>222.582</td></tr>
<tr><td>HD720</td><td>60</td><td>59.6885</td><td>2091</td><td>209.06</td></tr>
<tr><td>VGA</td><td>100</td><td>99.2432</td><td>1162</td><td>116.134</td></tr>
</table>

On the Jetson TX1 writing to an Intel 710 SSD on SATA (achieved ~200MB/sec with a simple dd test). Zed SDK 0.9.4 beta, averaged over 10 runs.

<table>
<tr><th>Resolution</th><th>Display?</th><th>Nom. FPS</th><th>Meas. FPS</th><th>File Size (MB)</th><th>Rate (MB/s)</th><th>Rate (MB/frame)</th><tr>
<tr><td>HD2K</td><td>n/a</td></tr>
<tr><td> HD1080 </td><td> -- </td><td> 15.0 </td><td> 12.7063563011 </td><td> 735.6467 </td><td> 71.7925428718 </td><td> 5.65012826421 </td></tr>
<tr><td> HD1080 </td><td> VNC </td><td> 15.0 </td><td> 11.1310442493 </td><td> 775.1976 </td><td> 75.294579298 </td><td> 6.76437696335 </td></tr>
<tr><td> HD720 </td><td> -- </td><td> 30.0 </td><td> 26.0903853965 </td><td> 724.575 </td><td> 71.6077310556 </td><td> 2.74460227273 </td></tr>
<tr><td> HD720 </td><td> VNC </td><td> 30.0 </td><td> 22.7924848302 </td><td> 745.3174 </td><td> 72.8145543644 </td><td> 3.19467381054 </td></tr>
<tr><td> VGA </td><td> -- </td><td> 60.0 </td><td> 52.2519096223 </td><td> 560.81165 </td><td> 55.3993376518 </td><td> 1.06023565554 </td></tr>
<tr><td> VGA </td><td> VNC </td><td> 60.0 </td><td> 53.5902394152 </td><td> 583.1363 </td><td> 57.6788739917 </td><td> 1.07629438907 </td></tr>
</table>


ZedRecorder Log Format Data Rates
----
@@ -0,0 +1,60 @@
HD1080,15,,136,10.1264,632.814
HD1080,15,,137,10.2486,664.455
HD1080,15,,128,10.3662,719.826
HD1080,15,,112,10.0523,751.467
HD1080,15,,135,10.3468,775.198
HD1080,15,,138,10.6031,783.108
HD1080,15,,131,10.0909,656.545
HD1080,15,,129,10.115,822.659
HD1080,15,,135,10.4673,854.299
HD1080,15,,121,10.0518,696.096
HD1080,15,display,114,10.3892,791.018
HD1080,15,display,101,10.4312,783.108
HD1080,15,display,100,10.5939,735.647
HD1080,15,display,104,10.1009,743.557
HD1080,15,display,127,10.0731,806.838
HD1080,15,display,116,10.4631,767.287
HD1080,15,display,110,10.5119,767.287
HD1080,15,display,118,10.151,783.108
HD1080,15,display,128,10.1784,783.108
HD1080,15,display,128,10.0626,791.018
HD720,30,,268,10.3847,650.395
HD720,30,,261,10.0637,755.864
HD720,30,,244,10.142,752.349
HD720,30,,259,10.0935,755.864
HD720,30,,283,10.1034,745.317
HD720,30,,261,10.0534,689.067
HD720,30,,262,10.1305,762.896
HD720,30,,257,10.1397,745.317
HD720,30,,278,10.0597,738.286
HD720,30,,267,10.0161,650.395
HD720,30,display,209,10.4639,717.192
HD720,30,display,243,10.0573,713.677
HD720,30,display,251,10.0215,762.896
HD720,30,display,234,10.1349,755.864
HD720,30,display,241,10.0579,738.286
HD720,30,display,221,10.4724,766.411
HD720,30,display,224,10.4688,766.411
HD720,30,display,206,10.0078,689.067
HD720,30,display,246,10.2375,762.896
HD720,30,display,258,10.4363,780.474
VGA,60,,486,10.3034,498.057
VGA,60,,483,10.0551,488.681
VGA,60,,540,10.0072,561.339
VGA,60,,499,10.0399,527.354
VGA,60,,526,10.3327,551.964
VGA,60,,528,10.2691,557.823
VGA,60,,501,10.152,548.448
VGA,60,,533,10.0528,548.448
VGA,60,,543,10.0817,554.308
VGA,60,,522,10.0671,548.448
VGA,60,display,543,10.042,584.777
VGA,60,display,538,10.0835,580.089
VGA,60,display,532,10.0761,580.089
VGA,60,display,543,10.1303,578.918
VGA,60,display,543,10.0855,583.605
VGA,60,display,518,10.0888,557.823
VGA,60,display,544,10.0706,576.574
VGA,60,display,539,10.0849,584.777
VGA,60,display,540,10.0738,581.261
VGA,60,display,578,10.365,623.45
Oops, something went wrong.

0 comments on commit 805c285

Please sign in to comment.
You can’t perform that action at this time.