Skip to content

Commit 9dfbe03

Browse files
Moving to new locations.
0 parents  commit 9dfbe03

29 files changed

+6765
-0
lines changed

CMakeLists.txt

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# cmake requirements
2+
cmake_minimum_required(VERSION 2.8)
3+
4+
# Build options have to be before PROJECT(...)
5+
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE PATH "Configuration types")
6+
#set(CMAKE_BUILD_TYPE "Debug" CACHE PATH "Current build configuration")
7+
8+
# PUTSLAM Project configuration
9+
project(PlaneLoc)
10+
set(CMAKE_CXX_FLAGS "-std=c++11 -pthread -g")
11+
#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -o3")
12+
13+
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
14+
15+
option(BUILD_DEMO_OBJEXTRACT "Build ObjExtract demo" OFF)
16+
17+
option(BUILD_DEMO_PLANESLAM "Build PlaneSlam demo" ON)
18+
19+
# Include directory
20+
include_directories("${CMAKE_SOURCE_DIR}/include")
21+
22+
# Boost
23+
find_package(Boost COMPONENTS system filesystem)
24+
25+
# OpenCV
26+
find_package(OpenCV REQUIRED)
27+
include_directories(${OpenCV_INCLUDE_DIRS} )
28+
29+
# PCL
30+
find_package(PCL REQUIRED)
31+
include_directories(${PCL_INCLUDE_DIRS})
32+
link_directories(${PCL_LIBRARY_DIRS})
33+
add_definitions(${PCL_DEFINITIONS})
34+
35+
# Eigen
36+
find_package(Eigen3 REQUIRED)
37+
include_directories(${EIGEN3_INCLUDE_DIR})
38+
39+
#OpenGM
40+
set(OPENGM_EXTERNAL_LIBS_DIR "/home/jachu/lib/opengm-master/build/src/external" CACHE PATH "OpenGM external library directory")
41+
set(OPENGM_MAXFLOW_INCLUDE_DIR "/home/jachu/lib/opengm-master/src/external/MaxFlow-v3.02.src-patched" CACHE PATH "OpenGM MaxFlow include directory")
42+
43+
include_directories(/usr/local/include)
44+
include_directories(${OPENGM_MAXFLOW_INCLUDE_DIR})
45+
link_directories(${OPENGM_EXTERNAL_LIBS_DIR})
46+
set(OPENGM_LIBRARIES
47+
external-library-maxflow)
48+
49+
#g2o library
50+
find_package(G2O REQUIRED)
51+
include_directories(${G2O_INCLUDE_DIR})
52+
link_directories(${G2O_LIBRARY_DIRS})
53+
54+
#zlib library
55+
find_package(ZLIB REQUIRED)
56+
include_directories(${ZLUB_INCLUDE_DIR})
57+
link_directories(${ZLIB_LIBRARY_DIRS})
58+
59+
#ElasticFusion
60+
find_package(GLUT REQUIRED)
61+
include_directories(${GLUT_INCLUDE_DIRS} )
62+
63+
find_package(CUDA REQUIRED)
64+
include_directories(${CUDA_INCLUDE_DIRS})
65+
66+
find_package(Pangolin 0.1 REQUIRED)
67+
include_directories(${Pangolin_INCLUDE_DIRS})
68+
69+
find_package(efusion REQUIRED)
70+
include_directories(${EFUSION_INCLUDE_DIR})
71+
72+
#-------------------------------------------------------
73+
74+
set(pngToKlg_SOURCES
75+
utils/pngToKlg.cpp)
76+
add_executable(pngToKlg
77+
${pngToKlg_SOURCES})
78+
target_link_libraries(pngToKlg
79+
${OpenCV_LIBS}
80+
${Boost_LIBRARIES}
81+
${ZLIB_LIBRARY})
82+
83+
#-------------------------------------------------------
84+
85+
set(convertGt_SOURCES
86+
utils/convertGt.cpp)
87+
add_executable(convertGt
88+
${convertGt_SOURCES})
89+
target_link_libraries(convertGt)
90+
91+
#-------------------------------------------------------
92+
93+
set(makeCloudsEFusion_SOURCES
94+
utils/makeCloudsEFusion.cpp)
95+
add_executable(makeCloudsEFusion
96+
${makeCloudsEFusion_SOURCES})
97+
target_link_libraries(makeCloudsEFusion
98+
${OpenCV_LIBS}
99+
${Boost_LIBRARIES}
100+
${GLUT_LIBRARY}
101+
${CUDA_LIBRARIES}
102+
${Pangolin_LIBRARIES}
103+
${EFUSION_LIBRARY}
104+
${PCL_LIBRARIES})
105+
106+
#-------------------------------------------------------
107+
108+
set(convert7places_SOURCES
109+
utils/convert7places.cpp)
110+
add_executable(convert7places
111+
${convert7places_SOURCES})
112+
target_link_libraries(convert7places
113+
${OpenCV_LIBS}
114+
${Boost_LIBRARIES}
115+
${ZLIB_LIBRARY})
116+
117+
#-------------------------------------------------------
118+
119+
set(illustration_SOURCES
120+
utils/illustration.cpp)
121+
add_executable(illustration
122+
${illustration_SOURCES})
123+
target_link_libraries(illustration
124+
${PCL_LIBRARIES})
125+
126+
#-------------------------------------------------------
127+
128+
set(PlaneSlam_SOURCES
129+
src/Matching.cpp
130+
src/FileGrabber.cpp
131+
src/Segmentation2.cpp
132+
src/ObjInstance.cpp
133+
src/PlaneSlam.cpp
134+
src/Map.cpp
135+
src/Misc.cpp
136+
src/UnionFind.cpp
137+
src/SegInfo.cpp)
138+
139+
add_library(PlaneSlam
140+
${PlaneSlam_SOURCES})
141+
142+
#-------------------------------------------------------
143+
144+
if(BUILD_DEMO_OBJEXTRACT)
145+
set(demoObjExtract_SOURCES
146+
demos/demoExtract.cpp)
147+
add_executable(demoObjExtract
148+
${demoObjExtract_SOURCES})
149+
target_link_libraries(demoObjExtract
150+
PlaneSlam
151+
${OpenCV_LIBS}
152+
${Boost_LIBRARIES}
153+
${PCL_LIBRARIES}
154+
${OPENGM_LIBRARIES})
155+
156+
endif(BUILD_DEMO_OBJEXTRACT)
157+
158+
#-------------------------------------------------------
159+
160+
if(BUILD_DEMO_PLANESLAM)
161+
set(demoPlaneSlam_SOURCES
162+
demos/demoSlam.cpp)
163+
add_executable(demoPlaneSlam
164+
${demoPlaneSlam_SOURCES})
165+
target_link_libraries(demoPlaneSlam
166+
PlaneSlam
167+
${OpenCV_LIBS}
168+
${Boost_LIBRARIES}
169+
${PCL_LIBRARIES}
170+
${OPENGM_LIBRARIES}
171+
${G2O_TYPES_SLAM3D}
172+
${G2O_TYPES_SBA}
173+
${GLUT_LIBRARY}
174+
${CUDA_LIBRARIES}
175+
${Pangolin_LIBRARIES}
176+
${EFUSION_LIBRARY})
177+
178+
endif(BUILD_DEMO_PLANESLAM)
179+

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Mobile Robots Laboratory at Poznan University of Technology,
4+
Jan Wietrzykowski name.surname [at] put.poznan.pl
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# PlaneLoc
2+
3+
An open source project that provides a probabilistic framework
4+
for global localization using segmented planes.
5+
6+
Prerequesties:
7+
-Boost
8+
-Eigen
9+
-PCL 1.8
10+
-OpenCV >= 3.0
11+
-ElasticFusion (only for fusing point clouds)
12+
-g2o (included in _3rdParty_ folder)
13+
14+
###Building:
15+
16+
Tested on Ubuntu 14.04.
17+
1. Install Boost and Eigen:
18+
```commandline
19+
sudo apt-get install libboost-system-dev libboost-filesystem-dev libeigen3-dev
20+
```
21+
2. Build PCL from sources and install it:
22+
```commandline
23+
wget https://github.com/PointCloudLibrary/pcl/archive/pcl-1.8.0.tar.gz
24+
tar xvfj pcl-pcl-1.8.0.tar.gz && cd pcl-pcl-1.8.0
25+
mkdir build && cd build
26+
cmake -DCMAKE_BUILD_TYPE=Release ..
27+
make -j$(nproc)
28+
sudo make install
29+
```
30+
3. Build OpenCV from sources and install it:
31+
```commandline
32+
wget https://sourceforge.net/projects/opencvlibrary/files/opencv-unix/3.1.0/opencv-3.1.0.zip
33+
unzip opencv-3.1.0.zip && cd opencv-3.1.0
34+
mkdir build && cd build
35+
cmake -D CMAKE_INSTALL_PREFIX=/usr/local ..
36+
make -j$(nproc)
37+
sudo make install
38+
```
39+
4. Build ElasticFusion using [instruction on Github](https://github.com/mp3guy/ElasticFusion).
40+
5. Build g2o and install it:
41+
```commandline
42+
cd 3rdParty/g2o
43+
mkdir build && cd build
44+
cmake ..
45+
make -j$(nproc)
46+
sudo make install
47+
```
48+
6. Build PlaneLoc:
49+
```commandline
50+
mkdir build && cd build
51+
cmake ..
52+
make -j$(nproc)
53+
```
54+
55+
###Launching:
56+
57+
1. Adjust settings file in _res/settings.xml_ for your dataset.
58+
2. Launch demo:
59+
60+
```commandline
61+
./demoPlaneSlam -s ../res/settings.xml
62+
```

cmake_modules/FindG2O.cmake

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Find the header files
2+
3+
FIND_PATH(G2O_INCLUDE_DIR g2o/core/base_vertex.h
4+
${G2O_ROOT}/include
5+
$ENV{G2O_ROOT}/include
6+
$ENV{G2O_ROOT}
7+
/usr/local/include
8+
/usr/include
9+
/opt/local/include
10+
/sw/local/include
11+
/sw/include
12+
NO_DEFAULT_PATH
13+
)
14+
15+
# Macro to unify finding both the debug and release versions of the
16+
# libraries; this is adapted from the OpenSceneGraph FIND_LIBRARY
17+
# macro.
18+
19+
MACRO(FIND_G2O_LIBRARY MYLIBRARY MYLIBRARYNAME)
20+
21+
FIND_LIBRARY("${MYLIBRARY}_DEBUG"
22+
NAMES "g2o_${MYLIBRARYNAME}_d"
23+
PATHS
24+
${G2O_ROOT}/lib/Debug
25+
${G2O_ROOT}/lib
26+
$ENV{G2O_ROOT}/lib/Debug
27+
$ENV{G2O_ROOT}/lib
28+
NO_DEFAULT_PATH
29+
)
30+
31+
FIND_LIBRARY("${MYLIBRARY}_DEBUG"
32+
NAMES "g2o_${MYLIBRARYNAME}_d"
33+
PATHS
34+
~/Library/Frameworks
35+
/Library/Frameworks
36+
/usr/local/lib
37+
/usr/local/lib64
38+
/usr/lib
39+
/usr/lib64
40+
/opt/local/lib
41+
/sw/local/lib
42+
/sw/lib
43+
)
44+
45+
FIND_LIBRARY(${MYLIBRARY}
46+
NAMES "g2o_${MYLIBRARYNAME}"
47+
PATHS
48+
${G2O_ROOT}/lib/Release
49+
${G2O_ROOT}/lib
50+
$ENV{G2O_ROOT}/lib/Release
51+
$ENV{G2O_ROOT}/lib
52+
NO_DEFAULT_PATH
53+
)
54+
55+
FIND_LIBRARY(${MYLIBRARY}
56+
NAMES "g2o_${MYLIBRARYNAME}"
57+
PATHS
58+
~/Library/Frameworks
59+
/Library/Frameworks
60+
/usr/local/lib
61+
/usr/local/lib64
62+
/usr/lib
63+
/usr/lib64
64+
/opt/local/lib
65+
/sw/local/lib
66+
/sw/lib
67+
)
68+
69+
IF(NOT ${MYLIBRARY}_DEBUG)
70+
IF(MYLIBRARY)
71+
SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
72+
ENDIF(MYLIBRARY)
73+
ENDIF( NOT ${MYLIBRARY}_DEBUG)
74+
75+
ENDMACRO(FIND_G2O_LIBRARY LIBRARY LIBRARYNAME)
76+
77+
# Find the core elements
78+
FIND_G2O_LIBRARY(G2O_STUFF_LIBRARY stuff)
79+
FIND_G2O_LIBRARY(G2O_CORE_LIBRARY core)
80+
81+
# Find the CLI library
82+
FIND_G2O_LIBRARY(G2O_CLI_LIBRARY cli)
83+
84+
# Find the pluggable solvers
85+
FIND_G2O_LIBRARY(G2O_SOLVER_CHOLMOD solver_cholmod)
86+
FIND_G2O_LIBRARY(G2O_SOLVER_CSPARSE solver_csparse)
87+
FIND_G2O_LIBRARY(G2O_SOLVER_CSPARSE_EXTENSION csparse_extension)
88+
FIND_G2O_LIBRARY(G2O_SOLVER_DENSE solver_dense)
89+
FIND_G2O_LIBRARY(G2O_SOLVER_PCG solver_pcg)
90+
FIND_G2O_LIBRARY(G2O_SOLVER_SLAM2D_LINEAR solver_slam2d_linear)
91+
FIND_G2O_LIBRARY(G2O_SOLVER_STRUCTURE_ONLY solver_structure_only)
92+
FIND_G2O_LIBRARY(G2O_SOLVER_EIGEN solver_eigen)
93+
94+
# Find the predefined types
95+
FIND_G2O_LIBRARY(G2O_TYPES_DATA types_data)
96+
FIND_G2O_LIBRARY(G2O_TYPES_ICP types_icp)
97+
FIND_G2O_LIBRARY(G2O_TYPES_SBA types_sba)
98+
FIND_G2O_LIBRARY(G2O_TYPES_SCLAM2D types_sclam2d)
99+
FIND_G2O_LIBRARY(G2O_TYPES_SIM3 types_sim3)
100+
FIND_G2O_LIBRARY(G2O_TYPES_SLAM2D types_slam2d)
101+
FIND_G2O_LIBRARY(G2O_TYPES_SLAM3D types_slam3d)
102+
103+
# G2O solvers declared found if we found at least one solver
104+
SET(G2O_SOLVERS_FOUND "NO")
105+
IF(G2O_SOLVER_CHOLMOD OR G2O_SOLVER_CSPARSE OR G2O_SOLVER_DENSE OR G2O_SOLVER_PCG OR G2O_SOLVER_SLAM2D_LINEAR OR G2O_SOLVER_STRUCTURE_ONLY OR G2O_SOLVER_EIGEN)
106+
SET(G2O_SOLVERS_FOUND "YES")
107+
ENDIF(G2O_SOLVER_CHOLMOD OR G2O_SOLVER_CSPARSE OR G2O_SOLVER_DENSE OR G2O_SOLVER_PCG OR G2O_SOLVER_SLAM2D_LINEAR OR G2O_SOLVER_STRUCTURE_ONLY OR G2O_SOLVER_EIGEN)
108+
109+
# G2O itself declared found if we found the core libraries and at least one solver
110+
SET(G2O_FOUND "NO")
111+
IF(G2O_STUFF_LIBRARY AND G2O_CORE_LIBRARY AND G2O_INCLUDE_DIR AND G2O_SOLVERS_FOUND)
112+
SET(G2O_FOUND "YES")
113+
ENDIF(G2O_STUFF_LIBRARY AND G2O_CORE_LIBRARY AND G2O_INCLUDE_DIR AND G2O_SOLVERS_FOUND)

0 commit comments

Comments
 (0)