mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-14 15:30:19 +08:00
Compare commits
370
Commits
0.13.2
...
0.17.6-kinetic
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db3b901063 | ||
|
|
8b055752aa | ||
|
|
dbb9cfa77a | ||
|
|
95e87fed14 | ||
|
|
02fdd677cf | ||
|
|
3b74534567 | ||
|
|
790b0e5cf7 | ||
|
|
5e08da51aa | ||
|
|
0c2287df77 | ||
|
|
b581a62c89 | ||
|
|
c341648a44 | ||
|
|
f903ffb927 | ||
|
|
124543c57d | ||
|
|
829f05e2fb | ||
|
|
d936b2d35a | ||
|
|
84a8e5830e | ||
|
|
eedc68c360 | ||
|
|
0cf37fbbf1 | ||
|
|
5f6dd0846d | ||
|
|
3c15563569 | ||
|
|
1f985ddef0 | ||
|
|
43e144e7b6 | ||
|
|
9c70b7116b | ||
|
|
3c1095be65 | ||
|
|
89f27e84d0 | ||
|
|
f64a5e75d5 | ||
|
|
94178c8cde | ||
|
|
30290c36d7 | ||
|
|
956f07785b | ||
|
|
3e6f14f3bd | ||
|
|
7cb39f02f2 | ||
|
|
c105804572 | ||
|
|
f498cf1b1a | ||
|
|
c0a2efe7e2 | ||
|
|
080d044c99 | ||
|
|
cbf14bfa08 | ||
|
|
110f4a99ee | ||
|
|
63af05ef88 | ||
|
|
0c790005b2 | ||
|
|
3ce6de573d | ||
|
|
67aa4cd28e | ||
|
|
c18f3cd539 | ||
|
|
9e13d5600a | ||
|
|
35d5200a3b | ||
|
|
e0858a9c2a | ||
|
|
b8847fd006 | ||
|
|
714d95cc34 | ||
|
|
5e60a2596c | ||
|
|
f281db8dd0 | ||
|
|
7f09a9e0cb | ||
|
|
fe52060de7 | ||
|
|
d5128ddc18 | ||
|
|
f938e8ce29 | ||
|
|
a0342671ac | ||
|
|
e03da92a90 | ||
|
|
4d5b42ab79 | ||
|
|
b63590bf1d | ||
|
|
cfdee23d33 | ||
|
|
60499e895f | ||
|
|
ddacee6d8b | ||
|
|
ae226cb1a2 | ||
|
|
a7e70ab80b | ||
|
|
e95cabb1fc | ||
|
|
173bd49a26 | ||
|
|
9ae47b79f9 | ||
|
|
15e09cd0a8 | ||
|
|
89a0eb506b | ||
|
|
4632c7650f | ||
|
|
281452434c | ||
|
|
ccdde45323 | ||
|
|
a3e13b8e72 | ||
|
|
35bc2d06a6 | ||
|
|
ee00f81b5b | ||
|
|
974db316ce | ||
|
|
d41c15dbc7 | ||
|
|
41d5e11511 | ||
|
|
c8100e1464 | ||
|
|
b783df397a | ||
|
|
62a64cd156 | ||
|
|
675da6201a | ||
|
|
d447329bf1 | ||
|
|
10b452197d | ||
|
|
973bf93c77 | ||
|
|
c91431410e | ||
|
|
a3bdb027e7 | ||
|
|
502d5e75e8 | ||
|
|
eb4de8e724 | ||
|
|
2060e0b1da | ||
|
|
dfcd7ae1a8 | ||
|
|
c6d893bc98 | ||
|
|
f638add755 | ||
|
|
9f22a2b1f8 | ||
|
|
432b0dc6f6 | ||
|
|
7424a1f463 | ||
|
|
0bf83c0cd6 | ||
|
|
230e6a311d | ||
|
|
26c004eee0 | ||
|
|
1914275fa8 | ||
|
|
055cccd151 | ||
|
|
b6b0b9a984 | ||
|
|
0fc97c28c6 | ||
|
|
11c34d383d | ||
|
|
c68dde70ec | ||
|
|
124d78fefd | ||
|
|
d34a529116 | ||
|
|
4df9ac995a | ||
|
|
4149be47e0 | ||
|
|
b7da3f7a97 | ||
|
|
206c4fe09c | ||
|
|
df7539a48e | ||
|
|
9c91fb8cd8 | ||
|
|
5cdede1482 | ||
|
|
fa174be741 | ||
|
|
5e93803eef | ||
|
|
bb0b12be27 | ||
|
|
41e93ac6f0 | ||
|
|
1df99efa14 | ||
|
|
911b8158a4 | ||
|
|
e875c7d6d1 | ||
|
|
0ddbb28fd2 | ||
|
|
e54234ec50 | ||
|
|
6dd0cd27e1 | ||
|
|
ec50b0c366 | ||
|
|
97b61f885d | ||
|
|
0d7b8f13d8 | ||
|
|
2bf7d87b29 | ||
|
|
8d5d50a198 | ||
|
|
aa743fc397 | ||
|
|
29d16633f5 | ||
|
|
d92debe356 | ||
|
|
52aed1041c | ||
|
|
8fec570c13 | ||
|
|
a39d0840ce | ||
|
|
63cc86bdcd | ||
|
|
637514d00d | ||
|
|
b2db31ff18 | ||
|
|
b044bae304 | ||
|
|
f13e384a1b | ||
|
|
bfce5cceb5 | ||
|
|
344dc165bc | ||
|
|
79c4bd7850 | ||
|
|
a82261a4df | ||
|
|
57a62dbbfd | ||
|
|
cd125ae274 | ||
|
|
d9716590b1 | ||
|
|
2b00b2c1c5 | ||
|
|
b3b0caa038 | ||
|
|
db0e833ce9 | ||
|
|
592b7c66c5 | ||
|
|
34b32f53f6 | ||
|
|
9ade28ee00 | ||
|
|
99acc9a6e7 | ||
|
|
d886c788e7 | ||
|
|
d2f7d8a9c4 | ||
|
|
7143f693d2 | ||
|
|
9cfdc00d64 | ||
|
|
4f6ab68318 | ||
|
|
7c6439e075 | ||
|
|
420fecad51 | ||
|
|
ef017c9e9d | ||
|
|
00412749e7 | ||
|
|
4188da2ef2 | ||
|
|
8d93c275ab | ||
|
|
b0b3b491a0 | ||
|
|
dd59d3c713 | ||
|
|
548f0b6130 | ||
|
|
f7e007018f | ||
|
|
436e82653c | ||
|
|
ecf598e412 | ||
|
|
257fe20c4f | ||
|
|
ba011169b8 | ||
|
|
ffe50dad22 | ||
|
|
dc289ba635 | ||
|
|
10724fac3b | ||
|
|
4969ece356 | ||
|
|
2fad881202 | ||
|
|
39b363d0b5 | ||
|
|
215eff3212 | ||
|
|
e1a0fc42ea | ||
|
|
69d28db660 | ||
|
|
c3ab04b436 | ||
|
|
918281a804 | ||
|
|
297cf3f51e | ||
|
|
93e1d732c9 | ||
|
|
1bfde1f9f0 | ||
|
|
489ab86ac7 | ||
|
|
e8f7746c87 | ||
|
|
db1139e89e | ||
|
|
5c04ce257b | ||
|
|
6cdb2a48fd | ||
|
|
37cbf79b4c | ||
|
|
00559ce8d6 | ||
|
|
07244a8a73 | ||
|
|
d181bedbfc | ||
|
|
077b3ab59e | ||
|
|
edbed67afe | ||
|
|
a947f8c783 | ||
|
|
6e131dcd7e | ||
|
|
d24097f73d | ||
|
|
bfb3a58c01 | ||
|
|
02a64a7fa3 | ||
|
|
3dfe1ccb1a | ||
|
|
c6e5f1c9f8 | ||
|
|
4c0a612ab5 | ||
|
|
09cae9cbd3 | ||
|
|
1595405871 | ||
|
|
1c8c233ebf | ||
|
|
c2d0628da1 | ||
|
|
2e58fa3c2f | ||
|
|
fced2c521c | ||
|
|
e7ceacc215 | ||
|
|
a320eb5d8e | ||
|
|
42199eefd2 | ||
|
|
56df87e60c | ||
|
|
90ed9cd15c | ||
|
|
8ca3bca810 | ||
|
|
5d2912baa1 | ||
|
|
129ec29af5 | ||
|
|
70991cf173 | ||
|
|
61199eff9c | ||
|
|
4991d3dbab | ||
|
|
3405e8b8e1 | ||
|
|
977d21eed5 | ||
|
|
09e0d0b9d8 | ||
|
|
79c38d66cb | ||
|
|
d7871fec2b | ||
|
|
9f80f4ac42 | ||
|
|
d6058768fc | ||
|
|
6a50b3f149 | ||
|
|
35045aa9d7 | ||
|
|
398ca1f8e4 | ||
|
|
7091406abc | ||
|
|
c21d478f5d | ||
|
|
f973fc3743 | ||
|
|
d776092b35 | ||
|
|
775b80eff5 | ||
|
|
ff135322f6 | ||
|
|
dafaac412f | ||
|
|
4452e637ad | ||
|
|
821c1c938e | ||
|
|
1df95702a3 | ||
|
|
274e7c579e | ||
|
|
b820e98bdc | ||
|
|
10c5cb3721 | ||
|
|
cc7db6190f | ||
|
|
9a9d81ca18 | ||
|
|
71d9816f4b | ||
|
|
8cdd138143 | ||
|
|
7dabfdc207 | ||
|
|
65e82eb37e | ||
|
|
8a14e6ccb4 | ||
|
|
5dadcf3862 | ||
|
|
c001ff763a | ||
|
|
3c59b601b5 | ||
|
|
4cb0d23136 | ||
|
|
2fd29c4b78 | ||
|
|
c0344a56ff | ||
|
|
16692d47b2 | ||
|
|
204b3e1159 | ||
|
|
41d4ee20b0 | ||
|
|
4d17f3c2ff | ||
|
|
353fe177f4 | ||
|
|
4dc4239963 | ||
|
|
0a72cab089 | ||
|
|
57202b3ea0 | ||
|
|
69e7006cc8 | ||
|
|
7ee8652cc3 | ||
|
|
8f1331dab3 | ||
|
|
2998a54713 | ||
|
|
ccba8e155e | ||
|
|
e9317dc2c7 | ||
|
|
77f88e5cac | ||
|
|
43649328cb | ||
|
|
3629c8c493 | ||
|
|
426a2f983c | ||
|
|
85273b9ed7 | ||
|
|
461dba87db | ||
|
|
d4982a8f24 | ||
|
|
de5f3657ab | ||
|
|
7a2ddd3905 | ||
|
|
d5200f859d | ||
|
|
6cee1d9ee6 | ||
|
|
6b9d4fe7c5 | ||
|
|
303f315b3e | ||
|
|
b6f41eecfd | ||
|
|
c880366aaf | ||
|
|
e40a7d6681 | ||
|
|
b3149a2b55 | ||
|
|
37a9712532 | ||
|
|
bcf65d4cae | ||
|
|
521126c982 | ||
|
|
e2aea92e3b | ||
|
|
e595f564b1 | ||
|
|
bfbabc62c4 | ||
|
|
d4248385f0 | ||
|
|
ab0aad87ec | ||
|
|
5ac5ff638e | ||
|
|
ed80acd87f | ||
|
|
fa27757719 | ||
|
|
c02cc6d193 | ||
|
|
312f6515ff | ||
|
|
f6315e48d0 | ||
|
|
8b3cff9f4c | ||
|
|
400952b327 | ||
|
|
007d23308a | ||
|
|
66e79e23cb | ||
|
|
4de2ed767b | ||
|
|
49f9a1e8d7 | ||
|
|
9a09db9212 | ||
|
|
1aad6d0517 | ||
|
|
d927f1886c | ||
|
|
0b8ff7cc01 | ||
|
|
c4ae4919a5 | ||
|
|
83e7f06500 | ||
|
|
9abd925ab7 | ||
|
|
7e0c17c5aa | ||
|
|
6da7788f61 | ||
|
|
b187409e59 | ||
|
|
079be0e072 | ||
|
|
81c8e1b192 | ||
|
|
1220eab47a | ||
|
|
44d1877892 | ||
|
|
11f8fda585 | ||
|
|
81fe104f1b | ||
|
|
feab6211d4 | ||
|
|
9691a4f361 | ||
|
|
8759fda632 | ||
|
|
74ee322312 | ||
|
|
ef4aff7d34 | ||
|
|
bfc393a090 | ||
|
|
114490f01e | ||
|
|
ad38632fc1 | ||
|
|
b737df9c40 | ||
|
|
fd18c0b2e9 | ||
|
|
cf6478b633 | ||
|
|
a70996f079 | ||
|
|
2aa56c8d49 | ||
|
|
b2fb7d5d5b | ||
|
|
16ffcc7684 | ||
|
|
16c428e360 | ||
|
|
77bdff1e4b | ||
|
|
1ae15911fc | ||
|
|
aca005c287 | ||
|
|
68fb5d7252 | ||
|
|
380fc2cbde | ||
|
|
39283a5526 | ||
|
|
3e38e467a2 | ||
|
|
4f55b56d6b | ||
|
|
54c0b3e196 | ||
|
|
9eac47f7e8 | ||
|
|
7ec58c63e9 | ||
|
|
b70ffb6331 | ||
|
|
423b47a5ff | ||
|
|
52a4e8964f | ||
|
|
964a052be1 | ||
|
|
15a14e86ba | ||
|
|
eca0c72063 | ||
|
|
2353c98919 | ||
|
|
30e5a1a7aa | ||
|
|
d94db237a9 | ||
|
|
317aa3b6ed | ||
|
|
268c92a1af | ||
|
|
bc2c998b7c | ||
|
|
73c05d2d9d | ||
|
|
f7872d346b | ||
|
|
d0d387a42f | ||
|
|
84af88ee40 | ||
|
|
aa4f7571b9 | ||
|
|
b5b96a3edb | ||
|
|
1e335e53ba |
+107
@@ -0,0 +1,107 @@
|
|||||||
|
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
- devel
|
||||||
|
|
||||||
|
os: Visual Studio 2015
|
||||||
|
|
||||||
|
clone_folder: c:\projects\rtabmap
|
||||||
|
|
||||||
|
platform: x64
|
||||||
|
configuration: Release
|
||||||
|
|
||||||
|
init:
|
||||||
|
- cmake --version
|
||||||
|
- call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
|
||||||
|
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
|
||||||
|
|
||||||
|
install:
|
||||||
|
# Qt
|
||||||
|
- set QTDIR=C:\Qt\5.10.1\msvc2015_64
|
||||||
|
# make sure Qt bin path is before cmake bin path to avoid copying qt5 dlls from cmake before qt installation
|
||||||
|
- set PATH=%QTDIR%\bin;%PATH%
|
||||||
|
# Boost
|
||||||
|
- set PATH=%PATH%;C:\Libraries\boost_1_62_0\lib64-msvc-14.0
|
||||||
|
# Openni2
|
||||||
|
- ps: wget 'https://dl.dropboxusercontent.com/s/d98jv79l6oy9fxz/OpenNI2.exe?dl=0' -outfile OpenNI2.exe
|
||||||
|
- cmd: OpenNI2.exe -o"C:\Program Files" -y
|
||||||
|
- ECHO "Installed OpenNI2:"
|
||||||
|
- ps: "ls \"C:/Program Files/OpenNI2\""
|
||||||
|
- set PATH=%PATH%;C:\Program Files\OpenNI2\Redist
|
||||||
|
- set OPENNI2_INCLUDE64=C:\Program Files\OpenNI2\Include
|
||||||
|
- set OPENNI2_LIB64=C:\Program Files\OpenNI2\Lib
|
||||||
|
- set OPENNI2_REDIST64=C:\Program Files\OpenNI2\Redist
|
||||||
|
# OpenCV
|
||||||
|
- ps: wget 'http://kent.dl.sourceforge.net/project/opencvlibrary/opencv-win/3.3.1/opencv-3.3.1-vc14.exe' -outfile opencv-3.3.1-vc14.exe
|
||||||
|
- cmd: opencv-3.3.1-vc14.exe -o"C:\Program Files" -y
|
||||||
|
- ECHO "Installed OpenCV:"
|
||||||
|
- ps: "ls \"C:/Program Files/opencv/build\""
|
||||||
|
- set PATH=%PATH%;C:\Program Files\opencv\build\x64\vc14\bin
|
||||||
|
# VTK (including QVTK)
|
||||||
|
- ps: wget 'https://dl.dropboxusercontent.com/s/1l33b5l3f3y52gf/VTK-6_3-msvc140.exe?dl=0' -outfile VTK-6_3.exe
|
||||||
|
- cmd: VTK-6_3.exe -o"C:\Program Files" -y
|
||||||
|
- ECHO "Installed PCL:"
|
||||||
|
- ps: "ls \"C:/Program Files/VTK\""
|
||||||
|
- set PATH=%PATH%;C:\Program Files\VTK\bin
|
||||||
|
# QHull
|
||||||
|
- ps: wget 'https://dl.dropboxusercontent.com/s/9widnk9msdsh2b8/Qhull-msvc140.exe?dl=0' -outfile Qhull.exe
|
||||||
|
- cmd: Qhull.exe -o"C:\Program Files" -y
|
||||||
|
- ECHO "Installed PCL:"
|
||||||
|
- ps: "ls \"C:/Program Files/Qhull\""
|
||||||
|
- set PATH=%PATH%;C:\Program Files\Qhull\bin
|
||||||
|
# FLANN
|
||||||
|
- ps: wget 'https://dl.dropboxusercontent.com/s/7k58jbmqa51sxmh/FLANN-msvc140.exe?dl=0' -outfile FLANN.exe
|
||||||
|
- cmd: FLANN.exe -o"C:\Program Files" -y
|
||||||
|
- ECHO "Installed PCL:"
|
||||||
|
- ps: "ls \"C:/Program Files/FLANN\""
|
||||||
|
- set PATH=%PATH%;C:\Program Files\FLANN\bin
|
||||||
|
# Eigen
|
||||||
|
- ps: wget 'https://dl.dropboxusercontent.com/s/3v6i9i8dxj4o8ji/Eigen.exe?dl=0' -outfile Eigen.exe
|
||||||
|
- cmd: Eigen.exe -o"C:\Program Files" -y
|
||||||
|
- ECHO "Installed PCL:"
|
||||||
|
- ps: "ls \"C:/Program Files/Eigen\""
|
||||||
|
# PCL
|
||||||
|
- ps: wget 'https://dl.dropboxusercontent.com/s/r9tvi9md54zlul2/PCL-1_8_1-July2018-msvc140.exe?dl=0' -outfile PCL_1.8.1.exe
|
||||||
|
- cmd: PCL_1.8.1.exe -o"C:\Program Files" -y
|
||||||
|
- ECHO "Installed PCL:"
|
||||||
|
- ps: "ls \"C:/Program Files/PCL\""
|
||||||
|
- set PATH=%PATH%;C:\Program Files\PCL\bin
|
||||||
|
# zlib
|
||||||
|
- ps: wget 'https://docs.google.com/uc?authuser=0&id=0B46akLGdg-uaYm9MTTI4MUtUcmc&export=download' -outfile zlib-1.2.8-vc2010-x64.zip
|
||||||
|
- ps: Expand-Archive zlib-1.2.8-vc2010-x64.zip -DestinationPath 'C:\Program Files'
|
||||||
|
- ECHO "Installed zlib:"
|
||||||
|
- ps: "ls \"C:/Program Files/zlib\""
|
||||||
|
- set PATH=%PATH%;C:\Program Files\zlib\bin
|
||||||
|
# g2o
|
||||||
|
- ps: wget 'https://dl.dropboxusercontent.com/s/ht74s5pa21wokzw/g2o.exe?dl=0' -outfile g2o.exe
|
||||||
|
- cmd: g2o.exe -o"C:\Program Files" -y
|
||||||
|
- ECHO "Installed g2o:"
|
||||||
|
- ps: "ls \"C:/Program Files/g2o\""
|
||||||
|
- set PATH=%PATH%;C:\Program Files\g2o\bin
|
||||||
|
# GTSAM
|
||||||
|
- ps: wget 'https://dl.dropboxusercontent.com/s/0fpr6r4cgsqmvhf/GTSAM-4_0_0_alpha2-msvc140.exe?dl=0' -outfile GTSAM.exe
|
||||||
|
- cmd: GTSAM.exe -o"C:\Program Files" -y
|
||||||
|
- ECHO "Installed GTSAM:"
|
||||||
|
- ps: "ls \"C:/Program Files/GTSAM\""
|
||||||
|
- set PATH=%PATH%;C:\Program Files\GTSAM\bin
|
||||||
|
|
||||||
|
before_build:
|
||||||
|
- cd c:\projects\rtabmap\build
|
||||||
|
- ECHO %PROGRAMFILES%
|
||||||
|
- ECHO %PATH%
|
||||||
|
- cmake -G "Visual Studio 14 2015 Win64" -DOpenCV_DIR="C:\Program Files\opencv\build" -DPCL_DIR="C:\Program Files\PCL\cmake" -DZLIB_ROOT="C:\Program Files\zlib" -DBUILD_AS_BUNDLE=ON ..
|
||||||
|
|
||||||
|
after_build :
|
||||||
|
- cmake --build . --config Release --target package
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
- path: build\RTABMap-*
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
- provider: Email
|
||||||
|
to:
|
||||||
|
- matlabbe@email.com
|
||||||
|
on_build_success: false
|
||||||
|
on_build_failure: false
|
||||||
|
on_build_status_changed: true
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
.settings/language.settings.xml
|
.settings/language.settings.xml
|
||||||
.idea/
|
.idea/
|
||||||
|
.vscode
|
||||||
cmake-build-debug/
|
cmake-build-debug/
|
||||||
app/android/.classpath
|
app/android/.classpath
|
||||||
app/android/.project
|
app/android/.project
|
||||||
|
|||||||
@@ -14,11 +14,13 @@ addons:
|
|||||||
- libopencv-dev
|
- libopencv-dev
|
||||||
- libqt4-dev
|
- libqt4-dev
|
||||||
- libsqlite3-dev
|
- libsqlite3-dev
|
||||||
|
- libyaml-cpp-dev
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'
|
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'
|
||||||
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
|
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
|
||||||
- sudo apt-get update
|
- sudo apt-get update
|
||||||
|
- sudo apt-get update && sudo apt-get install dpkg
|
||||||
- sudo apt-get -y install libpcl-1.7-all libfreenect-dev ros-indigo-libg2o ros-indigo-octomap libopenni2-dev
|
- sudo apt-get -y install libpcl-1.7-all libfreenect-dev ros-indigo-libg2o ros-indigo-octomap libopenni2-dev
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
|||||||
+237
-33
@@ -20,8 +20,8 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
|
|||||||
# VERSION
|
# VERSION
|
||||||
#######################
|
#######################
|
||||||
SET(RTABMAP_MAJOR_VERSION 0)
|
SET(RTABMAP_MAJOR_VERSION 0)
|
||||||
SET(RTABMAP_MINOR_VERSION 13)
|
SET(RTABMAP_MINOR_VERSION 17)
|
||||||
SET(RTABMAP_PATCH_VERSION 2)
|
SET(RTABMAP_PATCH_VERSION 6)
|
||||||
SET(RTABMAP_VERSION
|
SET(RTABMAP_VERSION
|
||||||
${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}.${RTABMAP_PATCH_VERSION})
|
${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}.${RTABMAP_PATCH_VERSION})
|
||||||
|
|
||||||
@@ -113,15 +113,13 @@ SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
|
|||||||
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
|
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
|
||||||
|
|
||||||
####### INSTALL DIR #######
|
####### INSTALL DIR #######
|
||||||
set(INSTALL_INCLUDE_DIR include/${PROJECT_PREFIX}-${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION} CACHE PATH
|
set(INSTALL_INCLUDE_DIR include/${PROJECT_PREFIX}-${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION})
|
||||||
"Installation directory for header files")
|
|
||||||
if(WIN32 AND NOT CYGWIN)
|
if(WIN32 AND NOT CYGWIN)
|
||||||
set(DEF_INSTALL_CMAKE_DIR CMake)
|
set(DEF_INSTALL_CMAKE_DIR CMake)
|
||||||
else()
|
else()
|
||||||
set(DEF_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_PREFIX}-${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION})
|
set(DEF_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_PREFIX}-${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION})
|
||||||
endif()
|
endif()
|
||||||
set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH
|
set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR})
|
||||||
"Installation directory for CMake files")
|
|
||||||
|
|
||||||
####### BUILD OPTIONS #######
|
####### BUILD OPTIONS #######
|
||||||
|
|
||||||
@@ -133,9 +131,9 @@ IF(ANDROID_PREBUILD)
|
|||||||
return()
|
return()
|
||||||
ENDIF(ANDROID_PREBUILD)
|
ENDIF(ANDROID_PREBUILD)
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE OR WIN32)
|
||||||
OPTION(BUILD_AS_BUNDLE "Set to ON to build as bundle (DragNDrop)" OFF)
|
OPTION(BUILD_AS_BUNDLE "Set to ON to build as bundle with all embedded dependencies (DragNDrop for Mac, installer for Windows)" OFF)
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE OR WIN32)
|
||||||
OPTION(BUILD_APP "Build main application" ON)
|
OPTION(BUILD_APP "Build main application" ON)
|
||||||
OPTION(BUILD_TOOLS "Build tools" ON)
|
OPTION(BUILD_TOOLS "Build tools" ON)
|
||||||
OPTION(BUILD_EXAMPLES "Build examples" ON)
|
OPTION(BUILD_EXAMPLES "Build examples" ON)
|
||||||
@@ -148,6 +146,7 @@ option(WITH_QT "Include Qt support" ON)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
option(WITH_FREENECT "Include Freenect support" ON)
|
option(WITH_FREENECT "Include Freenect support" ON)
|
||||||
option(WITH_FREENECT2 "Include Freenect2 support" ON)
|
option(WITH_FREENECT2 "Include Freenect2 support" ON)
|
||||||
|
option(WITH_K4W2 "Include Kinect for Windows v2 support" ON)
|
||||||
option(WITH_OPENNI2 "Include OpenNI2 support" ON)
|
option(WITH_OPENNI2 "Include OpenNI2 support" ON)
|
||||||
option(WITH_DC1394 "Include dc1394 support" ON)
|
option(WITH_DC1394 "Include dc1394 support" ON)
|
||||||
option(WITH_G2O "Include g2o support" ON)
|
option(WITH_G2O "Include g2o support" ON)
|
||||||
@@ -155,27 +154,47 @@ option(WITH_GTSAM "Include GTSAM support" ON)
|
|||||||
option(WITH_TORO "Include TORO support" ON)
|
option(WITH_TORO "Include TORO support" ON)
|
||||||
option(WITH_VERTIGO "Include Vertigo support" ON)
|
option(WITH_VERTIGO "Include Vertigo support" ON)
|
||||||
option(WITH_CVSBA "Include cvsba support" ON)
|
option(WITH_CVSBA "Include cvsba support" ON)
|
||||||
|
option(WITH_POINTMATCHER "Include libpointmatcher support" ON)
|
||||||
|
option(WITH_LOAM "Include LOAM support" ON)
|
||||||
option(WITH_FLYCAPTURE2 "Include FlyCapture2/Triclops support" ON)
|
option(WITH_FLYCAPTURE2 "Include FlyCapture2/Triclops support" ON)
|
||||||
option(WITH_ZED "Include ZED sdk support" ON)
|
option(WITH_ZED "Include ZED sdk support" ON)
|
||||||
option(WITH_REALSENSE "Include RealSense support" ON)
|
option(WITH_REALSENSE "Include RealSense support" ON)
|
||||||
option(WITH_REALSENSE_SLAM "Include RealSenseSlam support" ON)
|
option(WITH_REALSENSE_SLAM "Include RealSenseSlam support" ON)
|
||||||
|
option(WITH_REALSENSE2 "Include RealSense support" ON)
|
||||||
option(WITH_OCTOMAP "Include Octomap support" ON)
|
option(WITH_OCTOMAP "Include Octomap support" ON)
|
||||||
option(WITH_CPUTSDF "Include CPUTSDF support" ON)
|
option(WITH_CPUTSDF "Include CPUTSDF support" ON)
|
||||||
|
option(WITH_OPENCHISEL "Include open_chisel support" ON)
|
||||||
option(WITH_FOVIS "Include FOVIS support" ON)
|
option(WITH_FOVIS "Include FOVIS support" ON)
|
||||||
option(WITH_VISO2 "Include VISO2 support" ON)
|
option(WITH_VISO2 "Include VISO2 support" ON)
|
||||||
option(WITH_DVO "Include DVO support" ON)
|
option(WITH_DVO "Include DVO support" ON)
|
||||||
option(WITH_ORB_SLAM2 "Include ORB_SLAM2 support" ON)
|
option(WITH_ORB_SLAM2 "Include ORB_SLAM2 support" ON)
|
||||||
|
option(WITH_OKVIS "Include OKVIS support" ON)
|
||||||
|
option(WITH_MSCKF_VIO "Include MSCKF_VIO support" OFF)
|
||||||
option(PCL_OMP "With PCL OMP implementations" ON)
|
option(PCL_OMP "With PCL OMP implementations" ON)
|
||||||
|
|
||||||
FIND_PACKAGE(OpenCV REQUIRED QUIET)
|
FIND_PACKAGE(OpenCV REQUIRED QUIET)
|
||||||
FIND_PACKAGE(PCL 1.7 REQUIRED QUIET)
|
|
||||||
|
IF(WITH_QT)
|
||||||
|
FIND_PACKAGE(PCL 1.7 REQUIRED QUIET COMPONENTS common io kdtree search surface filters registration sample_consensus segmentation visualization)
|
||||||
|
ELSE()
|
||||||
|
FIND_PACKAGE(PCL 1.7 REQUIRED QUIET COMPONENTS common io kdtree search surface filters registration sample_consensus segmentation )
|
||||||
|
ENDIF()
|
||||||
|
if("${PCL_DEFINITIONS}" MATCHES "-march=native")
|
||||||
|
MESSAGE(WARNING "PCL definitions contain \"-march=native\", make sure all libraries using Eigen are also compiled with that flag to avoid some segmentation faults (with gdb referring to some Eigen functions).")
|
||||||
|
else()
|
||||||
|
MESSAGE(STATUS "PCL definitions don't contain \"-march=native\", make sure all libraries using Eigen are also compiled without that flag to avoid some segmentation faults (with gdb referring to some Eigen functions).")
|
||||||
|
endif()
|
||||||
|
|
||||||
FIND_PACKAGE(ZLIB REQUIRED QUIET)
|
FIND_PACKAGE(ZLIB REQUIRED QUIET)
|
||||||
|
|
||||||
|
FIND_PACKAGE(Sqlite3 QUIET)
|
||||||
|
IF(Sqlite3_FOUND)
|
||||||
|
MESSAGE(STATUS "Found Sqlite3: ${Sqlite3_INCLUDE_DIRS} ${Sqlite3_LIBRARIES}")
|
||||||
|
ENDIF(Sqlite3_FOUND)
|
||||||
|
|
||||||
if(NOT "${PCL_LIBRARIES}" STREQUAL "")
|
if(NOT "${PCL_LIBRARIES}" STREQUAL "")
|
||||||
# fix libproj.so not found on Xenial
|
# fix libproj.so not found on Xenial
|
||||||
list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")
|
list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")
|
||||||
# fix libmpi.so not found on Zesty
|
|
||||||
list(REMOVE_ITEM PCL_LIBRARIES "/usr/lib/libmpi.so")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# OpenMP ("-fopenmp" should be added for flann included in PCL)
|
# OpenMP ("-fopenmp" should be added for flann included in PCL)
|
||||||
@@ -233,7 +252,12 @@ IF(WITH_QT)
|
|||||||
SET(PCL_LIBRARIES "${PCL_LIBRARIES};vtkGUISupportQt")
|
SET(PCL_LIBRARIES "${PCL_LIBRARIES};vtkGUISupportQt")
|
||||||
SET(ADD_VTK_GUI_SUPPORT_QT_TO_CONF TRUE)
|
SET(ADD_VTK_GUI_SUPPORT_QT_TO_CONF TRUE)
|
||||||
ENDIF(value EQUAL -1)
|
ENDIF(value EQUAL -1)
|
||||||
|
MESSAGE(STATUS "VTK_RENDERING_BACKEND=${VTK_RENDERING_BACKEND}")
|
||||||
|
IF(VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
|
||||||
|
ADD_DEFINITIONS("-DVTK_OPENGL2")
|
||||||
|
ENDIF(VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
ADD_DEFINITIONS(-DQT_NO_KEYWORDS) # To avoid conflicts with boost signals/foreach and Qt macros
|
||||||
ENDIF(QT4_FOUND OR Qt5_FOUND)
|
ENDIF(QT4_FOUND OR Qt5_FOUND)
|
||||||
ENDIF(WITH_QT)
|
ENDIF(WITH_QT)
|
||||||
|
|
||||||
@@ -262,6 +286,13 @@ IF(WITH_FREENECT2)
|
|||||||
ENDIF(freenect2_FOUND)
|
ENDIF(freenect2_FOUND)
|
||||||
ENDIF(WITH_FREENECT2)
|
ENDIF(WITH_FREENECT2)
|
||||||
|
|
||||||
|
IF(WITH_K4W2 AND WIN32)
|
||||||
|
FIND_PACKAGE(KinectSDK2 QUIET)
|
||||||
|
IF(KinectSDK2_FOUND)
|
||||||
|
MESSAGE(STATUS "Found Kinect for Windows 2: ${KinectSDK2_INCLUDE_DIRS}")
|
||||||
|
ENDIF(KinectSDK2_FOUND)
|
||||||
|
ENDIF(WITH_K4W2 AND WIN32)
|
||||||
|
|
||||||
# IF PCL depends on OpenNI2 (already found), ignore WITH_OPENNI2
|
# IF PCL depends on OpenNI2 (already found), ignore WITH_OPENNI2
|
||||||
IF(WITH_OPENNI2 OR OpenNI2_FOUND)
|
IF(WITH_OPENNI2 OR OpenNI2_FOUND)
|
||||||
FIND_PACKAGE(OpenNI2 QUIET)
|
FIND_PACKAGE(OpenNI2 QUIET)
|
||||||
@@ -302,6 +333,21 @@ IF(WITH_CVSBA)
|
|||||||
ENDIF(cvsba_FOUND)
|
ENDIF(cvsba_FOUND)
|
||||||
ENDIF(WITH_CVSBA)
|
ENDIF(WITH_CVSBA)
|
||||||
|
|
||||||
|
IF(WITH_POINTMATCHER)
|
||||||
|
find_package(libpointmatcher QUIET)
|
||||||
|
IF(libpointmatcher_FOUND)
|
||||||
|
MESSAGE(STATUS "Found libpointmatcher: ${libpointmatcher_INCLUDE_DIRS}")
|
||||||
|
ENDIF(libpointmatcher_FOUND)
|
||||||
|
ENDIF(WITH_POINTMATCHER)
|
||||||
|
|
||||||
|
IF(WITH_LOAM)
|
||||||
|
find_package(loam_velodyne QUIET)
|
||||||
|
IF(loam_velodyne_FOUND)
|
||||||
|
MESSAGE(STATUS "Found loam_velodyne: ${loam_velodyne_INCLUDE_DIRS}")
|
||||||
|
ENDIF(loam_velodyne_FOUND)
|
||||||
|
ENDIF(WITH_LOAM)
|
||||||
|
|
||||||
|
SET(ZED_FOUND FALSE)
|
||||||
IF(WITH_ZED)
|
IF(WITH_ZED)
|
||||||
IF(WIN32) # Windows
|
IF(WIN32) # Windows
|
||||||
SET(ZED_INCLUDE_DIRS $ENV{ZED_INCLUDE_DIRS})
|
SET(ZED_INCLUDE_DIRS $ENV{ZED_INCLUDE_DIRS})
|
||||||
@@ -316,7 +362,7 @@ IF(WITH_ZED)
|
|||||||
LINK_DIRECTORIES( ${LINK_DIRECTORIES} ${ZED_LIBRARY_DIR})
|
LINK_DIRECTORIES( ${LINK_DIRECTORIES} ${ZED_LIBRARY_DIR})
|
||||||
ENDIF(ZED_LIBRARIES AND ZED_INCLUDE_DIRS)
|
ENDIF(ZED_LIBRARIES AND ZED_INCLUDE_DIRS)
|
||||||
ELSE() # Linux
|
ELSE() # Linux
|
||||||
find_package(ZED 1 QUIET)
|
find_package(ZED 2 QUIET)
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
|
|
||||||
IF(ZED_FOUND)
|
IF(ZED_FOUND)
|
||||||
@@ -345,10 +391,24 @@ IF(WITH_REALSENSE)
|
|||||||
ENDIF(RealSenseSlam_FOUND)
|
ENDIF(RealSenseSlam_FOUND)
|
||||||
ENDIF(WITH_REALSENSE)
|
ENDIF(WITH_REALSENSE)
|
||||||
|
|
||||||
|
IF(WITH_REALSENSE2)
|
||||||
|
IF(WIN32)
|
||||||
|
FIND_PACKAGE(RealSense2 QUIET)
|
||||||
|
ELSE()
|
||||||
|
FIND_PACKAGE(realsense2 QUIET)
|
||||||
|
ENDIF()
|
||||||
|
IF(realsense2_FOUND)
|
||||||
|
MESSAGE(STATUS "Found RealSense2: ${realsense2_INCLUDE_DIRS}")
|
||||||
|
ENDIF(realsense2_FOUND)
|
||||||
|
ENDIF(WITH_REALSENSE2)
|
||||||
|
|
||||||
IF(WITH_OCTOMAP)
|
IF(WITH_OCTOMAP)
|
||||||
FIND_PACKAGE(OCTOMAP QUIET)
|
FIND_PACKAGE(OCTOMAP QUIET)
|
||||||
IF(OCTOMAP_FOUND)
|
IF(OCTOMAP_FOUND)
|
||||||
MESSAGE(STATUS "Found octomap: ${OCTOMAP_INCLUDE_DIRS}")
|
MESSAGE(STATUS "Found octomap ${OCTOMAP_VERSION}: ${OCTOMAP_INCLUDE_DIRS}")
|
||||||
|
IF(OCTOMAP_VERSION VERSION_LESS 1.8)
|
||||||
|
ADD_DEFINITIONS("-DOCTOMAP_PRE_18")
|
||||||
|
ENDIF(OCTOMAP_VERSION VERSION_LESS 1.8)
|
||||||
ENDIF(OCTOMAP_FOUND)
|
ENDIF(OCTOMAP_FOUND)
|
||||||
ENDIF(WITH_OCTOMAP)
|
ENDIF(WITH_OCTOMAP)
|
||||||
|
|
||||||
@@ -359,6 +419,13 @@ IF(WITH_CPUTSDF)
|
|||||||
ENDIF(CPUTSDF_FOUND)
|
ENDIF(CPUTSDF_FOUND)
|
||||||
ENDIF(WITH_CPUTSDF)
|
ENDIF(WITH_CPUTSDF)
|
||||||
|
|
||||||
|
IF(WITH_OPENCHISEL)
|
||||||
|
find_package(open_chisel QUIET)
|
||||||
|
if(open_chisel_FOUND)
|
||||||
|
MESSAGE(STATUS "Found open_chisel: ${open_chisel_INCLUDE_DIRS}")
|
||||||
|
endif(open_chisel_FOUND)
|
||||||
|
ENDIF(WITH_OPENCHISEL)
|
||||||
|
|
||||||
IF(WITH_FOVIS)
|
IF(WITH_FOVIS)
|
||||||
FIND_PACKAGE(libfovis QUIET)
|
FIND_PACKAGE(libfovis QUIET)
|
||||||
IF(libfovis_FOUND)
|
IF(libfovis_FOUND)
|
||||||
@@ -380,6 +447,27 @@ IF(WITH_DVO)
|
|||||||
ENDIF(dvo_core_FOUND)
|
ENDIF(dvo_core_FOUND)
|
||||||
ENDIF(WITH_DVO)
|
ENDIF(WITH_DVO)
|
||||||
|
|
||||||
|
IF(WITH_OKVIS)
|
||||||
|
FIND_PACKAGE(okvis 1.1 QUIET)
|
||||||
|
IF(okvis_FOUND)
|
||||||
|
MESSAGE(STATUS "Found okvis: ${OKVIS_INCLUDE_DIRS}")
|
||||||
|
find_package(brisk 2 REQUIRED)
|
||||||
|
MESSAGE(STATUS "Found brisk: ${BRISK_INCLUDE_DIRS}")
|
||||||
|
find_package(opengv REQUIRED)
|
||||||
|
MESSAGE(STATUS "Found opengv: ${OPENGV_INCLUDE_DIRS}")
|
||||||
|
find_package(Ceres REQUIRED CONFIG PATHS ${OKVIS_CERES_CONFIG} NO_DEFAULT_PATH)
|
||||||
|
MESSAGE(STATUS "Found ceres: ${CERES_INCLUDE_DIRS}")
|
||||||
|
ENDIF(okvis_FOUND)
|
||||||
|
ENDIF(WITH_OKVIS)
|
||||||
|
|
||||||
|
IF(WITH_MSCKF_VIO)
|
||||||
|
FIND_PACKAGE(msckf_vio QUIET)
|
||||||
|
IF(msckf_vio_FOUND)
|
||||||
|
MESSAGE(STATUS "Found msckf_vio: ${msckf_vio_INCLUDE_DIRS}")
|
||||||
|
ENDIF(msckf_vio_FOUND)
|
||||||
|
ENDIF(WITH_MSCKF_VIO)
|
||||||
|
|
||||||
|
|
||||||
IF(WITH_ORB_SLAM2 AND NOT G2O_FOUND)
|
IF(WITH_ORB_SLAM2 AND NOT G2O_FOUND)
|
||||||
FIND_PACKAGE(ORB_SLAM2 QUIET)
|
FIND_PACKAGE(ORB_SLAM2 QUIET)
|
||||||
IF(ORB_SLAM2_FOUND)
|
IF(ORB_SLAM2_FOUND)
|
||||||
@@ -392,12 +480,22 @@ IF(WITH_ORB_SLAM2 AND NOT G2O_FOUND)
|
|||||||
MESSAGE(STATUS "Found Pangolin: ${Pangolin_INCLUDE_DIRS}")
|
MESSAGE(STATUS "Found Pangolin: ${Pangolin_INCLUDE_DIRS}")
|
||||||
SET(ORB_SLAM2_INCLUDE_DIRS ${ORB_SLAM2_INCLUDE_DIRS} ${Pangolin_INCLUDE_DIRS})
|
SET(ORB_SLAM2_INCLUDE_DIRS ${ORB_SLAM2_INCLUDE_DIRS} ${Pangolin_INCLUDE_DIRS})
|
||||||
SET(ORB_SLAM2_LIBRARIES ${ORB_SLAM2_LIBRARIES} ${Pangolin_LIBRARIES})
|
SET(ORB_SLAM2_LIBRARIES ${ORB_SLAM2_LIBRARIES} ${Pangolin_LIBRARIES})
|
||||||
MESSAGE(WARNING "Don't forget to build ORB_SLAM2 (and included g2o) without \"-march=native\" to avoid crash when ORB_SLAM2 starts.")
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF(ORB_SLAM2_FOUND)
|
ENDIF(ORB_SLAM2_FOUND)
|
||||||
ENDIF(WITH_ORB_SLAM2 AND NOT G2O_FOUND)
|
ENDIF(WITH_ORB_SLAM2 AND NOT G2O_FOUND)
|
||||||
|
|
||||||
IF(G2O_FOUND OR GTSAM_FOUND OR ZED_FOUND OR ANDROID OR RealSense_FOUND OR ORB_SLAM2_FOUND)
|
IF(loam_velodyne_FOUND)
|
||||||
|
#LOAM requires c++14
|
||||||
|
IF(NOT MSVC)
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
|
||||||
|
IF(COMPILER_SUPPORTS_CXX14)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
|
||||||
|
ELSE()
|
||||||
|
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler if you want to use LOAM (set \"-DWITH_LOAM=OFF\" to build without LOAM).")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(G2O_FOUND OR GTSAM_FOUND OR ZED_FOUND OR ANDROID OR RealSense_FOUND OR realsense2_FOUND OR ORB_SLAM2_FOUND OR okvis_FOUND OR open_chisel_FOUND OR msckf_vio_FOUND)
|
||||||
#Newest versions require std11
|
#Newest versions require std11
|
||||||
IF(NOT MSVC)
|
IF(NOT MSVC)
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
@@ -408,10 +506,10 @@ IF(G2O_FOUND OR GTSAM_FOUND OR ZED_FOUND OR ANDROID OR RealSense_FOUND OR ORB_SL
|
|||||||
ELSEIF(COMPILER_SUPPORTS_CXX0X)
|
ELSEIF(COMPILER_SUPPORTS_CXX0X)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||||
ELSE()
|
ELSE()
|
||||||
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler if you want to use g2o or gtsam (set \"-DWITH_G2O=OFF -DWITH_GTSAM=OFF\" to build without g2o and gtsam).")
|
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF(G2O_FOUND OR GTSAM_FOUND OR ZED_FOUND OR ANDROID OR RealSense_FOUND OR ORB_SLAM2_FOUND)
|
ENDIF()
|
||||||
|
|
||||||
####### OSX BUNDLE CMAKE_INSTALL_PREFIX #######
|
####### OSX BUNDLE CMAKE_INSTALL_PREFIX #######
|
||||||
IF(APPLE AND BUILD_AS_BUNDLE)
|
IF(APPLE AND BUILD_AS_BUNDLE)
|
||||||
@@ -454,6 +552,9 @@ IF(NOT G2O_FOUND)
|
|||||||
SET(G2O "//")
|
SET(G2O "//")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${G2O_LIBRARIES})
|
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${G2O_LIBRARIES})
|
||||||
|
IF(NOT G2O_CPP11)
|
||||||
|
SET(G2O_CPP_CONF "//")
|
||||||
|
ENDIF(NOT G2O_CPP11)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT GTSAM_FOUND)
|
IF(NOT GTSAM_FOUND)
|
||||||
SET(GTSAM "//")
|
SET(GTSAM "//")
|
||||||
@@ -471,6 +572,12 @@ IF(NOT cvsba_FOUND)
|
|||||||
ELSE()
|
ELSE()
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${cvsba_LIBRARIES})
|
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${cvsba_LIBRARIES})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
IF(NOT libpointmatcher_FOUND)
|
||||||
|
SET(POINTMATCHER "//")
|
||||||
|
ENDIF(NOT libpointmatcher_FOUND)
|
||||||
|
IF(NOT loam_velodyne_FOUND)
|
||||||
|
SET(LOAM "//")
|
||||||
|
ENDIF(NOT loam_velodyne_FOUND)
|
||||||
IF(NOT Freenect_FOUND)
|
IF(NOT Freenect_FOUND)
|
||||||
SET(FREENECT "//")
|
SET(FREENECT "//")
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -481,6 +588,11 @@ IF(NOT freenect2_FOUND)
|
|||||||
ELSE()
|
ELSE()
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${freenect2_LIBRARIES})
|
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${freenect2_LIBRARIES})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
IF(NOT KinectSDK2_FOUND)
|
||||||
|
SET(K4W2 "//")
|
||||||
|
ELSE()
|
||||||
|
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${KinectSDK2_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
IF(NOT OpenNI2_FOUND)
|
IF(NOT OpenNI2_FOUND)
|
||||||
SET(OPENNI2 "//")
|
SET(OPENNI2 "//")
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -509,6 +621,11 @@ ENDIF()
|
|||||||
IF(NOT RealSenseSlam_FOUND)
|
IF(NOT RealSenseSlam_FOUND)
|
||||||
SET(REALSENSESLAM "//")
|
SET(REALSENSESLAM "//")
|
||||||
ENDIF(NOT RealSenseSlam_FOUND)
|
ENDIF(NOT RealSenseSlam_FOUND)
|
||||||
|
IF(NOT realsense2_FOUND)
|
||||||
|
SET(REALSENSE2 "//")
|
||||||
|
ELSE()
|
||||||
|
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${realsense2_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
IF(NOT OCTOMAP_FOUND)
|
IF(NOT OCTOMAP_FOUND)
|
||||||
SET(OCTOMAP "//")
|
SET(OCTOMAP "//")
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -519,6 +636,11 @@ IF(NOT CPUTSDF_FOUND)
|
|||||||
ELSE()
|
ELSE()
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${CPUTSDF_LIBRARIES})
|
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${CPUTSDF_LIBRARIES})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
IF(NOT open_chisel_FOUND)
|
||||||
|
SET(OPENCHISEL "//")
|
||||||
|
ELSE()
|
||||||
|
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${open_chisel_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
IF(NOT libfovis_FOUND)
|
IF(NOT libfovis_FOUND)
|
||||||
SET(FOVIS "//")
|
SET(FOVIS "//")
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -534,6 +656,16 @@ IF(NOT dvo_core_FOUND)
|
|||||||
ELSE()
|
ELSE()
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${dvo_core_LIBRARIES})
|
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${dvo_core_LIBRARIES})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
IF(NOT okvis_FOUND)
|
||||||
|
SET(OKVIS "//")
|
||||||
|
ELSE()
|
||||||
|
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${OKVIS_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT msckf_vio_FOUND)
|
||||||
|
SET(MSCKF_VIO "//")
|
||||||
|
ELSE()
|
||||||
|
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${msckf_vio_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
IF(NOT ORB_SLAM2_FOUND)
|
IF(NOT ORB_SLAM2_FOUND)
|
||||||
SET(ORB_SLAM2 "//")
|
SET(ORB_SLAM2 "//")
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -545,9 +677,13 @@ IF(ADD_VTK_GUI_SUPPORT_QT_TO_CONF)
|
|||||||
ELSE()
|
ELSE()
|
||||||
SET(CONF_VTK_QT false)
|
SET(CONF_VTK_QT false)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT (OpenCV_FOUND AND OpenCV_VERSION_MAJOR EQUAL 3))
|
IF(VTK_USE_QVTK)
|
||||||
|
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${QVTK_LIBRARY})
|
||||||
|
ENDIF(VTK_USE_QVTK)
|
||||||
|
|
||||||
|
IF(NOT (OpenCV_FOUND AND NOT (OpenCV_VERSION_MAJOR LESS 3)))
|
||||||
SET(OPENCV3 "//")
|
SET(OPENCV3 "//")
|
||||||
ENDIF(NOT (OpenCV_FOUND AND OpenCV_VERSION_MAJOR EQUAL 3))
|
ENDIF(NOT (OpenCV_FOUND AND NOT (OpenCV_VERSION_MAJOR LESS 3)))
|
||||||
CONFIGURE_FILE(Version.h.in ${PROJECT_SOURCE_DIR}/corelib/include/${PROJECT_PREFIX}/core/Version.h)
|
CONFIGURE_FILE(Version.h.in ${PROJECT_SOURCE_DIR}/corelib/include/${PROJECT_PREFIX}/core/Version.h)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY( utilite )
|
ADD_SUBDIRECTORY( utilite )
|
||||||
@@ -667,7 +803,11 @@ IF(WIN32)
|
|||||||
ELSE()
|
ELSE()
|
||||||
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
|
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
SET(CPACK_GENERATOR "ZIP;NSIS")
|
IF(BUILD_AS_BUNDLE)
|
||||||
|
SET(CPACK_GENERATOR "ZIP;NSIS")
|
||||||
|
ELSE()
|
||||||
|
SET(CPACK_GENERATOR "ZIP")
|
||||||
|
ENDIF()
|
||||||
SET(CPACK_SOURCE_GENERATOR "ZIP")
|
SET(CPACK_SOURCE_GENERATOR "ZIP")
|
||||||
SET(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME}")
|
SET(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME}")
|
||||||
SET(ICON_PATH "${PROJECT_SOURCE_DIR}/app/src/${PROJECT_NAME}.ico")
|
SET(ICON_PATH "${PROJECT_SOURCE_DIR}/app/src/${PROJECT_NAME}.ico")
|
||||||
@@ -722,27 +862,35 @@ IF(NOT WIN32)
|
|||||||
# see comment above for the BUILD_SHARED_LIBS option on Windows
|
# see comment above for the BUILD_SHARED_LIBS option on Windows
|
||||||
MESSAGE(STATUS " BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}")
|
MESSAGE(STATUS " BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}")
|
||||||
ENDIF(NOT WIN32)
|
ENDIF(NOT WIN32)
|
||||||
IF(APPLE)
|
IF(APPLE OR WIN32)
|
||||||
MESSAGE(STATUS " BUILD_AS_BUNDLE = ${BUILD_AS_BUNDLE}")
|
MESSAGE(STATUS " BUILD_AS_BUNDLE = ${BUILD_AS_BUNDLE}")
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE OR WIN32)
|
||||||
MESSAGE(STATUS " CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}")
|
MESSAGE(STATUS " CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}")
|
||||||
|
MESSAGE(STATUS " PCL_DEFINITIONS = ${PCL_DEFINITIONS}")
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Optional dependencies ('*' affects some default parameters) :")
|
||||||
IF(OpenCV_FOUND)
|
IF(OpenCV_FOUND)
|
||||||
IF(OpenCV_VERSION_MAJOR EQUAL 2)
|
IF(OpenCV_VERSION_MAJOR EQUAL 2)
|
||||||
IF(OPENCV_NONFREE_FOUND)
|
IF(OPENCV_NONFREE_FOUND)
|
||||||
MESSAGE(STATUS " With OpenCV 2 nonfree module (SIFT/SURF) = YES (License: Non commercial)")
|
MESSAGE(STATUS " *With OpenCV 2 nonfree module (SIFT/SURF) = YES (License: Non commercial)")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS " With OpenCV 2 nonfree module (SIFT/SURF) = NO (not found, License: BSD)")
|
MESSAGE(STATUS " *With OpenCV 2 nonfree module (SIFT/SURF) = NO (not found, License: BSD)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSE()
|
ELSE()
|
||||||
IF(OPENCV_XFEATURES2D_FOUND)
|
IF(OPENCV_XFEATURES2D_FOUND)
|
||||||
MESSAGE(STATUS " With OpenCV 3 xfeatures2d module (SIFT/SURF/BRIEF/FREAK) = YES (License: Non commercial)")
|
MESSAGE(STATUS " *With OpenCV 3 xfeatures2d module (SIFT/SURF/BRIEF/FREAK) = YES (License: Non commercial)")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS " With OpenCV 3 xfeatures2d module (SIFT/SURF/BRIEF/FREAK) = NO (not found, License: BSD)")
|
MESSAGE(STATUS " *With OpenCV 3 xfeatures2d module (SIFT/SURF/BRIEF/FREAK) = NO (not found, License: BSD)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF(OpenCV_FOUND)
|
ENDIF(OpenCV_FOUND)
|
||||||
|
|
||||||
|
IF(Sqlite3_FOUND)
|
||||||
|
MESSAGE(STATUS " With external SQLite3 = YES (License: Public Domain)")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS " With external SQLite3 = NO (sqlite3 not found, internal version is used for convenience)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(Freenect_FOUND)
|
IF(Freenect_FOUND)
|
||||||
MESSAGE(STATUS " With Freenect = YES (License: Apache v2 and/or GPLv2)")
|
MESSAGE(STATUS " With Freenect = YES (License: Apache v2 and/or GPLv2)")
|
||||||
ELSEIF(NOT WITH_FREENECT)
|
ELSEIF(NOT WITH_FREENECT)
|
||||||
@@ -767,6 +915,14 @@ ELSE()
|
|||||||
MESSAGE(STATUS " With Freenect2 = NO (libfreenect2 not found)")
|
MESSAGE(STATUS " With Freenect2 = NO (libfreenect2 not found)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(KinectSDK2_FOUND)
|
||||||
|
MESSAGE(STATUS " With Kinect for Windows 2 = YES (License: Apache v2 and/or GPLv2)")
|
||||||
|
ELSEIF(NOT WITH_K4W2)
|
||||||
|
MESSAGE(STATUS " With Kinect for Windows 2 = NO (WITH_K4W2=OFF)")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS " With Kinect for Windows 2 = NO (Kinect for Windows 2 SDK not found)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(DC1394_FOUND)
|
IF(DC1394_FOUND)
|
||||||
MESSAGE(STATUS " With dc1394 = YES (License: LGPL)")
|
MESSAGE(STATUS " With dc1394 = YES (License: LGPL)")
|
||||||
ELSEIF(NOT WITH_DC1394)
|
ELSEIF(NOT WITH_DC1394)
|
||||||
@@ -790,19 +946,19 @@ MESSAGE(STATUS " With TORO = NO (WITH_TORO=OFF)")
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(G2O_FOUND)
|
IF(G2O_FOUND)
|
||||||
MESSAGE(STATUS " With g2o = YES (License: BSD)")
|
MESSAGE(STATUS " *With g2o = YES (License: BSD)")
|
||||||
ELSEIF(NOT WITH_G2O)
|
ELSEIF(NOT WITH_G2O)
|
||||||
MESSAGE(STATUS " With g2o = NO (WITH_G2O=OFF)")
|
MESSAGE(STATUS " *With g2o = NO (WITH_G2O=OFF)")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS " With g2o = NO (g2o not found)")
|
MESSAGE(STATUS " *With g2o = NO (g2o not found)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(GTSAM_FOUND)
|
IF(GTSAM_FOUND)
|
||||||
MESSAGE(STATUS " With GTSAM = YES (License: BSD)")
|
MESSAGE(STATUS " *With GTSAM = YES (License: BSD)")
|
||||||
ELSEIF(NOT WITH_GTSAM)
|
ELSEIF(NOT WITH_GTSAM)
|
||||||
MESSAGE(STATUS " With GTSAM = NO (WITH_GTSAM=OFF)")
|
MESSAGE(STATUS " *With GTSAM = NO (WITH_GTSAM=OFF)")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS " With GTSAM = NO (GTSAM not found)")
|
MESSAGE(STATUS " *With GTSAM = NO (GTSAM not found)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(G2O_FOUND OR GTSAM_FOUND)
|
IF(G2O_FOUND OR GTSAM_FOUND)
|
||||||
@@ -823,6 +979,22 @@ ELSE()
|
|||||||
MESSAGE(STATUS " With cvsba = NO (cvsba not found)")
|
MESSAGE(STATUS " With cvsba = NO (cvsba not found)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(libpointmatcher_FOUND)
|
||||||
|
MESSAGE(STATUS " *With libpointmatcher = YES (License: BSD)")
|
||||||
|
ELSEIF(NOT WITH_POINTMATCHER)
|
||||||
|
MESSAGE(STATUS " *With libpointmatcher = NO (WITH_POINTMATCHER=OFF)")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS " *With libpointmatcher = NO (libpointmatcher not found)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(loam_velodyne_FOUND)
|
||||||
|
MESSAGE(STATUS " With loam_velodyne = YES (License: BSD)")
|
||||||
|
ELSEIF(NOT WITH_LOAM)
|
||||||
|
MESSAGE(STATUS " With loam_velodyne = NO (WITH_LOAM=OFF)")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS " With loam_velodyne = NO (loam_velodyne not found)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(ZED_FOUND)
|
IF(ZED_FOUND)
|
||||||
IF(CUDA_FOUND)
|
IF(CUDA_FOUND)
|
||||||
MESSAGE(STATUS " With ZED = YES (With CUDA)")
|
MESSAGE(STATUS " With ZED = YES (With CUDA)")
|
||||||
@@ -850,6 +1022,14 @@ ELSE()
|
|||||||
MESSAGE(STATUS " With RealSense = NO (librealsense not found)")
|
MESSAGE(STATUS " With RealSense = NO (librealsense not found)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(realsense2_FOUND)
|
||||||
|
MESSAGE(STATUS " With RealSense2 = YES (License: Apache-2)")
|
||||||
|
ELSEIF(NOT WITH_REALSENSE2)
|
||||||
|
MESSAGE(STATUS " With RealSense2 = NO (WITH_REALSENSE2=OFF)")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS " With RealSense2 = NO (librealsense2 not found)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(OCTOMAP_FOUND)
|
IF(OCTOMAP_FOUND)
|
||||||
MESSAGE(STATUS " With OCTOMAP = YES (License: BSD)")
|
MESSAGE(STATUS " With OCTOMAP = YES (License: BSD)")
|
||||||
ELSEIF(NOT WITH_OCTOMAP)
|
ELSEIF(NOT WITH_OCTOMAP)
|
||||||
@@ -866,6 +1046,14 @@ ELSE()
|
|||||||
MESSAGE(STATUS " With CPUTSDF = NO (CPUTSDF not found)")
|
MESSAGE(STATUS " With CPUTSDF = NO (CPUTSDF not found)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(open_chisel_FOUND)
|
||||||
|
MESSAGE(STATUS " With OpenChisel = YES (License: ???)")
|
||||||
|
ELSEIF(NOT WITH_OPENCHISEL)
|
||||||
|
MESSAGE(STATUS " With OpenChisel = NO (WITH_OPENCHISEL=OFF)")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS " With OpenChisel = NO (open_chisel not found)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(libfovis_FOUND)
|
IF(libfovis_FOUND)
|
||||||
MESSAGE(STATUS " With libfovis = YES (License: GPLv2)")
|
MESSAGE(STATUS " With libfovis = YES (License: GPLv2)")
|
||||||
ELSEIF(NOT WITH_FOVIS)
|
ELSEIF(NOT WITH_FOVIS)
|
||||||
@@ -890,6 +1078,22 @@ ELSE()
|
|||||||
MESSAGE(STATUS " With dvo_core = NO (dvo_core not found)")
|
MESSAGE(STATUS " With dvo_core = NO (dvo_core not found)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(okvis_FOUND)
|
||||||
|
MESSAGE(STATUS " With okvis = YES (License: BSD)")
|
||||||
|
ELSEIF(NOT WITH_OKVIS)
|
||||||
|
MESSAGE(STATUS " With okvis = NO (WITH_OKVIS=OFF)")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS " With okvis = NO (okvis not found)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(msckf_vio_FOUND)
|
||||||
|
MESSAGE(STATUS " With msckf_vio = YES (License: Penn Software License)")
|
||||||
|
ELSEIF(NOT WITH_MSCKF_VIO)
|
||||||
|
MESSAGE(STATUS " With msckf_vio = NO (WITH_MSCKF_VIO=OFF)")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS " With msckf_vio = NO (msckf_vio not found)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(ORB_SLAM2_FOUND)
|
IF(ORB_SLAM2_FOUND)
|
||||||
MESSAGE(STATUS " With ORB_SLAM2 = YES (License: GPLv3)")
|
MESSAGE(STATUS " With ORB_SLAM2 = YES (License: GPLv3)")
|
||||||
ELSEIF(NOT WITH_ORB_SLAM2)
|
ELSEIF(NOT WITH_ORB_SLAM2)
|
||||||
|
|||||||
@@ -1,6 +1,18 @@
|
|||||||
rtabmap [](https://travis-ci.org/introlab/rtabmap)
|
rtabmap 
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
[](http://introlab.github.io/rtabmap)
|
||||||
|
|
||||||
|
[![Release][release-image]][releases]
|
||||||
|
[![License][license-image]][license]
|
||||||
|
Linux: [](https://travis-ci.org/introlab/rtabmap) Windows: [](https://ci.appveyor.com/project/matlabbe/rtabmap/branch/master)
|
||||||
|
|
||||||
|
[release-image]: https://img.shields.io/badge/release-0.16.3-green.svg?style=flat
|
||||||
|
[releases]: https://github.com/introlab/rtabmap/releases
|
||||||
|
|
||||||
|
[license-image]: https://img.shields.io/badge/license-BSD-green.svg?style=flat
|
||||||
|
[license]: https://github.com/introlab/rtabmap/blob/master/LICENSE
|
||||||
|
|
||||||
RTAB-Map library and standalone application.
|
RTAB-Map library and standalone application.
|
||||||
|
|
||||||
For more information, visit the [RTAB-Map's home page](http://introlab.github.io/rtabmap) or the [RTAB-Map's wiki](https://github.com/introlab/rtabmap/wiki).
|
For more information, visit the [RTAB-Map's home page](http://introlab.github.io/rtabmap) or the [RTAB-Map's wiki](https://github.com/introlab/rtabmap/wiki).
|
||||||
|
|||||||
@@ -40,23 +40,31 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
@NONFREE@#define RTABMAP_NONFREE
|
@NONFREE@#define RTABMAP_NONFREE
|
||||||
@TORO@#define RTABMAP_TORO
|
@TORO@#define RTABMAP_TORO
|
||||||
@G2O@#define RTABMAP_G2O
|
@G2O@#define RTABMAP_G2O
|
||||||
|
@G2O_CPP_CONF@#define RTABMAP_G2O_CPP11
|
||||||
@GTSAM@#define RTABMAP_GTSAM
|
@GTSAM@#define RTABMAP_GTSAM
|
||||||
@VERTIGO@#define RTABMAP_VERTIGO
|
@VERTIGO@#define RTABMAP_VERTIGO
|
||||||
@OPENCV3@#define RTABMAP_OPENCV3
|
@OPENCV3@#define RTABMAP_OPENCV3
|
||||||
@OPENNI2@#define RTABMAP_OPENNI2
|
@OPENNI2@#define RTABMAP_OPENNI2
|
||||||
@FREENECT@#define RTABMAP_FREENECT
|
@FREENECT@#define RTABMAP_FREENECT
|
||||||
@FREENECT2@#define RTABMAP_FREENECT2
|
@FREENECT2@#define RTABMAP_FREENECT2
|
||||||
|
@K4W2@#define RTABMAP_K4W2
|
||||||
@CVSBA@#define RTABMAP_CVSBA
|
@CVSBA@#define RTABMAP_CVSBA
|
||||||
|
@POINTMATCHER@#define RTABMAP_POINTMATCHER
|
||||||
|
@LOAM@#define RTABMAP_LOAM
|
||||||
@DC1394@#define RTABMAP_DC1394
|
@DC1394@#define RTABMAP_DC1394
|
||||||
@FLYCAPTURE2@#define RTABMAP_FLYCAPTURE2
|
@FLYCAPTURE2@#define RTABMAP_FLYCAPTURE2
|
||||||
@ZED@#define RTABMAP_ZED
|
@ZED@#define RTABMAP_ZED
|
||||||
@REALSENSE@#define RTABMAP_REALSENSE
|
@REALSENSE@#define RTABMAP_REALSENSE
|
||||||
@REALSENSESLAM@#define RTABMAP_REALSENSE_SLAM
|
@REALSENSESLAM@#define RTABMAP_REALSENSE_SLAM
|
||||||
|
@REALSENSE2@#define RTABMAP_REALSENSE2
|
||||||
@OCTOMAP@#define RTABMAP_OCTOMAP
|
@OCTOMAP@#define RTABMAP_OCTOMAP
|
||||||
@CPUTSDF@#define RTABMAP_CPUTSDF
|
@CPUTSDF@#define RTABMAP_CPUTSDF
|
||||||
|
@OPENCHISEL@#define RTABMAP_OPENCHISEL
|
||||||
@FOVIS@#define RTABMAP_FOVIS
|
@FOVIS@#define RTABMAP_FOVIS
|
||||||
@VISO2@#define RTABMAP_VISO2
|
@VISO2@#define RTABMAP_VISO2
|
||||||
@DVO@#define RTABMAP_DVO
|
@DVO@#define RTABMAP_DVO
|
||||||
|
@OKVIS@#define RTABMAP_OKVIS
|
||||||
|
@MSCKF_VIO@#define RTABMAP_MSCKF_VIO
|
||||||
@ORB_SLAM2@#define RTABMAP_ORB_SLAM2
|
@ORB_SLAM2@#define RTABMAP_ORB_SLAM2
|
||||||
|
|
||||||
#endif /* VERSION_H_ */
|
#endif /* VERSION_H_ */
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<!-- BEGIN_INCLUDE(manifest) -->
|
<!-- BEGIN_INCLUDE(manifest) -->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.introlab.rtabmap"
|
package="com.introlab.rtabmap"
|
||||||
android:versionCode="55"
|
android:versionCode="70"
|
||||||
android:versionName="@RTABMAP_VERSION@">
|
android:versionName="@RTABMAP_VERSION@">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
@@ -12,6 +12,8 @@
|
|||||||
<uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" />
|
<uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
|
<uses-feature android:name="android.hardware.location.gps" />
|
||||||
<uses-feature android:glEsVersion="0x00020000" />
|
<uses-feature android:glEsVersion="0x00020000" />
|
||||||
|
|
||||||
<!-- This is the platform API where NativeActivity was introduced. -->
|
<!-- This is the platform API where NativeActivity was introduced. -->
|
||||||
|
|||||||
+101
-30
@@ -46,7 +46,7 @@ const int scanDownsampling = 1;
|
|||||||
void onPointCloudAvailableRouter(void* context, const TangoPointCloud* point_cloud)
|
void onPointCloudAvailableRouter(void* context, const TangoPointCloud* point_cloud)
|
||||||
{
|
{
|
||||||
CameraTango* app = static_cast<CameraTango*>(context);
|
CameraTango* app = static_cast<CameraTango*>(context);
|
||||||
if(point_cloud->num_points>0)
|
if(app->isRunning() && point_cloud->num_points>0)
|
||||||
{
|
{
|
||||||
app->cloudReceived(cv::Mat(1, point_cloud->num_points, CV_32FC4, point_cloud->points[0]), point_cloud->timestamp);
|
app->cloudReceived(cv::Mat(1, point_cloud->num_points, CV_32FC4, point_cloud->points[0]), point_cloud->timestamp);
|
||||||
}
|
}
|
||||||
@@ -55,31 +55,34 @@ void onPointCloudAvailableRouter(void* context, const TangoPointCloud* point_clo
|
|||||||
void onFrameAvailableRouter(void* context, TangoCameraId id, const TangoImageBuffer* color)
|
void onFrameAvailableRouter(void* context, TangoCameraId id, const TangoImageBuffer* color)
|
||||||
{
|
{
|
||||||
CameraTango* app = static_cast<CameraTango*>(context);
|
CameraTango* app = static_cast<CameraTango*>(context);
|
||||||
cv::Mat tangoImage;
|
if(app->isRunning())
|
||||||
if(color->format == TANGO_HAL_PIXEL_FORMAT_RGBA_8888)
|
|
||||||
{
|
{
|
||||||
tangoImage = cv::Mat(color->height, color->width, CV_8UC4, color->data);
|
cv::Mat tangoImage;
|
||||||
}
|
if(color->format == TANGO_HAL_PIXEL_FORMAT_RGBA_8888)
|
||||||
else if(color->format == TANGO_HAL_PIXEL_FORMAT_YV12)
|
{
|
||||||
{
|
tangoImage = cv::Mat(color->height, color->width, CV_8UC4, color->data);
|
||||||
tangoImage = cv::Mat(color->height+color->height/2, color->width, CV_8UC1, color->data);
|
}
|
||||||
}
|
else if(color->format == TANGO_HAL_PIXEL_FORMAT_YV12)
|
||||||
else if(color->format == TANGO_HAL_PIXEL_FORMAT_YCrCb_420_SP)
|
{
|
||||||
{
|
tangoImage = cv::Mat(color->height+color->height/2, color->width, CV_8UC1, color->data);
|
||||||
tangoImage = cv::Mat(color->height+color->height/2, color->width, CV_8UC1, color->data);
|
}
|
||||||
}
|
else if(color->format == TANGO_HAL_PIXEL_FORMAT_YCrCb_420_SP)
|
||||||
else if(color->format == 35)
|
{
|
||||||
{
|
tangoImage = cv::Mat(color->height+color->height/2, color->width, CV_8UC1, color->data);
|
||||||
tangoImage = cv::Mat(color->height+color->height/2, color->width, CV_8UC1, color->data);
|
}
|
||||||
}
|
else if(color->format == 35)
|
||||||
else
|
{
|
||||||
{
|
tangoImage = cv::Mat(color->height+color->height/2, color->width, CV_8UC1, color->data);
|
||||||
LOGE("Not supported color format : %d.", color->format);
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
LOGE("Not supported color format : %d.", color->format);
|
||||||
|
}
|
||||||
|
|
||||||
if(!tangoImage.empty())
|
if(!tangoImage.empty())
|
||||||
{
|
{
|
||||||
app->rgbReceived(tangoImage, (unsigned int)color->format, color->timestamp);
|
app->rgbReceived(tangoImage, (unsigned int)color->format, color->timestamp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +119,8 @@ CameraTango::CameraTango(bool colorCamera, int decimation, bool publishRawScan,
|
|||||||
cloudStamp_(0),
|
cloudStamp_(0),
|
||||||
tangoColorType_(0),
|
tangoColorType_(0),
|
||||||
tangoColorStamp_(0),
|
tangoColorStamp_(0),
|
||||||
colorCameraToDisplayRotation_(ROTATION_0)
|
colorCameraToDisplayRotation_(ROTATION_0),
|
||||||
|
originUpdate_(false)
|
||||||
{
|
{
|
||||||
UASSERT(decimation >= 1);
|
UASSERT(decimation >= 1);
|
||||||
}
|
}
|
||||||
@@ -425,12 +429,22 @@ void CameraTango::close()
|
|||||||
{
|
{
|
||||||
TangoConfig_free(tango_config_);
|
TangoConfig_free(tango_config_);
|
||||||
tango_config_ = nullptr;
|
tango_config_ = nullptr;
|
||||||
|
LOGI("TangoService_disconnect()");
|
||||||
TangoService_disconnect();
|
TangoService_disconnect();
|
||||||
|
LOGI("TangoService_disconnect() done.");
|
||||||
}
|
}
|
||||||
previousPose_.setNull();
|
previousPose_.setNull();
|
||||||
previousStamp_ = 0.0;
|
previousStamp_ = 0.0;
|
||||||
fisheyeRectifyMapX_ = cv::Mat();
|
fisheyeRectifyMapX_ = cv::Mat();
|
||||||
fisheyeRectifyMapY_ = cv::Mat();
|
fisheyeRectifyMapY_ = cv::Mat();
|
||||||
|
lastKnownGPS_ = GPS();
|
||||||
|
originOffset_ = Transform();
|
||||||
|
originUpdate_ = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CameraTango::resetOrigin()
|
||||||
|
{
|
||||||
|
originUpdate_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CameraTango::cloudReceived(const cv::Mat & cloud, double timestamp)
|
void CameraTango::cloudReceived(const cv::Mat & cloud, double timestamp)
|
||||||
@@ -491,10 +505,23 @@ static rtabmap::Transform opticalRotation(
|
|||||||
0.0f, 0.0f, -1.0f, 0.0f);
|
0.0f, 0.0f, -1.0f, 0.0f);
|
||||||
void CameraTango::poseReceived(const Transform & pose)
|
void CameraTango::poseReceived(const Transform & pose)
|
||||||
{
|
{
|
||||||
if(!pose.isNull() && pose.getNormSquared() < 100000)
|
if(!pose.isNull())
|
||||||
{
|
{
|
||||||
// send pose of the camera (without optical rotation), not the device
|
// send pose of the camera (without optical rotation), not the device
|
||||||
this->post(new PoseEvent(pose*deviceTColorCamera_*opticalRotation));
|
Transform p = pose*deviceTColorCamera_*opticalRotation;
|
||||||
|
if(originUpdate_)
|
||||||
|
{
|
||||||
|
originOffset_ = p.translation().inverse();
|
||||||
|
originUpdate_ = false;
|
||||||
|
}
|
||||||
|
if(!originOffset_.isNull())
|
||||||
|
{
|
||||||
|
this->post(new PoseEvent(originOffset_*p));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->post(new PoseEvent(p));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -513,6 +540,11 @@ std::string CameraTango::getSerial() const
|
|||||||
return "Tango";
|
return "Tango";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CameraTango::setGPS(const GPS & gps)
|
||||||
|
{
|
||||||
|
lastKnownGPS_ = gps;
|
||||||
|
}
|
||||||
|
|
||||||
rtabmap::Transform CameraTango::tangoPoseToTransform(const TangoPoseData * tangoPose) const
|
rtabmap::Transform CameraTango::tangoPoseToTransform(const TangoPoseData * tangoPose) const
|
||||||
{
|
{
|
||||||
UASSERT(tangoPose);
|
UASSERT(tangoPose);
|
||||||
@@ -699,6 +731,13 @@ SensorData CameraTango::captureImage(CameraInfo * info)
|
|||||||
CameraModel depthModel = model_.scaled(1.0f/float(depthSizeDec));
|
CameraModel depthModel = model_.scaled(1.0f/float(depthSizeDec));
|
||||||
std::vector<cv::Point3f> scanData(rawScanPublished_?cloud.total():0);
|
std::vector<cv::Point3f> scanData(rawScanPublished_?cloud.total():0);
|
||||||
int oi=0;
|
int oi=0;
|
||||||
|
int closePoints = 0;
|
||||||
|
float closeROI[4];
|
||||||
|
closeROI[0] = depth.cols/4;
|
||||||
|
closeROI[1] = 3*(depth.cols/4);
|
||||||
|
closeROI[2] = depth.rows/4;
|
||||||
|
closeROI[3] = 3*(depth.rows/4);
|
||||||
|
unsigned short minDepthValue=10000;
|
||||||
for(unsigned int i=0; i<cloud.total(); ++i)
|
for(unsigned int i=0; i<cloud.total(); ++i)
|
||||||
{
|
{
|
||||||
float * p = cloud.ptr<float>(0,i);
|
float * p = cloud.ptr<float>(0,i);
|
||||||
@@ -717,6 +756,17 @@ SensorData CameraTango::captureImage(CameraInfo * info)
|
|||||||
pixel_y_h = static_cast<int>((depthModel.fy()) * (pt.y / pt.z) + depthModel.cy() + 0.5f);
|
pixel_y_h = static_cast<int>((depthModel.fy()) * (pt.y / pt.z) + depthModel.cy() + 0.5f);
|
||||||
unsigned short depth_value(pt.z * 1000.0f);
|
unsigned short depth_value(pt.z * 1000.0f);
|
||||||
|
|
||||||
|
if(pixel_x_l>=closeROI[0] && pixel_x_l<closeROI[1] &&
|
||||||
|
pixel_y_l>closeROI[2] && pixel_y_l<closeROI[3] &&
|
||||||
|
depth_value < 600)
|
||||||
|
{
|
||||||
|
++closePoints;
|
||||||
|
if(depth_value < minDepthValue)
|
||||||
|
{
|
||||||
|
minDepthValue = depth_value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool pixelSet = false;
|
bool pixelSet = false;
|
||||||
if(pixel_x_l>=0 && pixel_x_l<depth.cols &&
|
if(pixel_x_l>=0 && pixel_x_l<depth.cols &&
|
||||||
pixel_y_l>0 && pixel_y_l<depth.rows && // ignore first line
|
pixel_y_l>0 && pixel_y_l<depth.rows && // ignore first line
|
||||||
@@ -746,6 +796,11 @@ SensorData CameraTango::captureImage(CameraInfo * info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(closePoints > 100)
|
||||||
|
{
|
||||||
|
this->post(new CameraTangoEvent(0, "TooClose", ""));
|
||||||
|
}
|
||||||
|
|
||||||
if(oi)
|
if(oi)
|
||||||
{
|
{
|
||||||
scan = cv::Mat(1, oi, CV_32FC3, scanData.data()).clone();
|
scan = cv::Mat(1, oi, CV_32FC3, scanData.data()).clone();
|
||||||
@@ -763,6 +818,12 @@ SensorData CameraTango::captureImage(CameraInfo * info)
|
|||||||
|
|
||||||
Transform poseDevice = getPoseAtTimestamp(rgbStamp);
|
Transform poseDevice = getPoseAtTimestamp(rgbStamp);
|
||||||
|
|
||||||
|
// adjust origin
|
||||||
|
if(!originOffset_.isNull())
|
||||||
|
{
|
||||||
|
poseDevice = originOffset_ * poseDevice;
|
||||||
|
}
|
||||||
|
|
||||||
//LOGD("Local = %s", model.localTransform().prettyPrint().c_str());
|
//LOGD("Local = %s", model.localTransform().prettyPrint().c_str());
|
||||||
//LOGD("tango = %s", poseDevice.prettyPrint().c_str());
|
//LOGD("tango = %s", poseDevice.prettyPrint().c_str());
|
||||||
//LOGD("opengl(t)= %s", (opengl_world_T_tango_world * poseDevice).prettyPrint().c_str());
|
//LOGD("opengl(t)= %s", (opengl_world_T_tango_world * poseDevice).prettyPrint().c_str());
|
||||||
@@ -830,13 +891,22 @@ SensorData CameraTango::captureImage(CameraInfo * info)
|
|||||||
|
|
||||||
if(rawScanPublished_)
|
if(rawScanPublished_)
|
||||||
{
|
{
|
||||||
data = SensorData(scan, LaserScanInfo(cloud.total()/scanDownsampling, 0, scanLocalTransform), rgb, depth, model, this->getNextSeqID(), rgbStamp);
|
data = SensorData(LaserScan::backwardCompatibility(scan, cloud.total()/scanDownsampling, 0, scanLocalTransform), rgb, depth, model, this->getNextSeqID(), rgbStamp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data = SensorData(rgb, depth, model, this->getNextSeqID(), rgbStamp);
|
data = SensorData(rgb, depth, model, this->getNextSeqID(), rgbStamp);
|
||||||
}
|
}
|
||||||
data.setGroundTruth(odom);
|
data.setGroundTruth(odom);
|
||||||
|
|
||||||
|
if(lastKnownGPS_.stamp() > 0.0 && rgbStamp-lastKnownGPS_.stamp()<1.0)
|
||||||
|
{
|
||||||
|
data.setGPS(lastKnownGPS_);
|
||||||
|
}
|
||||||
|
else if(lastKnownGPS_.stamp()>0.0)
|
||||||
|
{
|
||||||
|
LOGD("GPS too old (current time=%f, gps time = %f)", rgbStamp, lastKnownGPS_.stamp());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -866,6 +936,7 @@ void CameraTango::mainLoop()
|
|||||||
{
|
{
|
||||||
rtabmap::Transform pose = data.groundTruth();
|
rtabmap::Transform pose = data.groundTruth();
|
||||||
data.setGroundTruth(Transform());
|
data.setGroundTruth(Transform());
|
||||||
|
|
||||||
// convert stamp to epoch
|
// convert stamp to epoch
|
||||||
bool firstFrame = previousPose_.isNull();
|
bool firstFrame = previousPose_.isNull();
|
||||||
if(firstFrame)
|
if(firstFrame)
|
||||||
@@ -879,8 +950,8 @@ void CameraTango::mainLoop()
|
|||||||
info.interval = data.stamp()-previousStamp_;
|
info.interval = data.stamp()-previousStamp_;
|
||||||
info.transform = previousPose_.inverse() * pose;
|
info.transform = previousPose_.inverse() * pose;
|
||||||
}
|
}
|
||||||
info.covariance = cv::Mat::eye(6,6,CV_64FC1) * (firstFrame?9999.0:0.000001);
|
info.reg.covariance = cv::Mat::eye(6,6,CV_64FC1) * (firstFrame?9999.0:0.0001);
|
||||||
LOGI("Publish odometry message (variance=%f)", firstFrame?9999:0.000001);
|
LOGI("Publish odometry message (variance=%f)", firstFrame?9999:0.0001);
|
||||||
this->post(new OdometryEvent(data, pose, info));
|
this->post(new OdometryEvent(data, pose, info));
|
||||||
previousPose_ = pose;
|
previousPose_ = pose;
|
||||||
previousStamp_ = data.stamp();
|
previousStamp_ = data.stamp();
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#define CAMERATANGO_H_
|
#define CAMERATANGO_H_
|
||||||
|
|
||||||
#include <rtabmap/core/Camera.h>
|
#include <rtabmap/core/Camera.h>
|
||||||
|
#include <rtabmap/core/GeodeticCoords.h>
|
||||||
#include <rtabmap/utilite/UMutex.h>
|
#include <rtabmap/utilite/UMutex.h>
|
||||||
#include <rtabmap/utilite/USemaphore.h>
|
#include <rtabmap/utilite/USemaphore.h>
|
||||||
#include <rtabmap/utilite/UEventsSender.h>
|
#include <rtabmap/utilite/UEventsSender.h>
|
||||||
@@ -80,6 +81,7 @@ public:
|
|||||||
|
|
||||||
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
||||||
void close(); // close Tango connection
|
void close(); // close Tango connection
|
||||||
|
void resetOrigin();
|
||||||
virtual bool isCalibrated() const;
|
virtual bool isCalibrated() const;
|
||||||
virtual std::string getSerial() const;
|
virtual std::string getSerial() const;
|
||||||
const CameraModel & getCameraModel() const {return model_;}
|
const CameraModel & getCameraModel() const {return model_;}
|
||||||
@@ -89,6 +91,7 @@ public:
|
|||||||
void setSmoothing(bool enabled) {smoothing_ = enabled;}
|
void setSmoothing(bool enabled) {smoothing_ = enabled;}
|
||||||
void setRawScanPublished(bool enabled) {rawScanPublished_ = enabled;}
|
void setRawScanPublished(bool enabled) {rawScanPublished_ = enabled;}
|
||||||
void setScreenRotation(TangoSupportRotation colorCameraToDisplayRotation) {colorCameraToDisplayRotation_ = colorCameraToDisplayRotation;}
|
void setScreenRotation(TangoSupportRotation colorCameraToDisplayRotation) {colorCameraToDisplayRotation_ = colorCameraToDisplayRotation;}
|
||||||
|
void setGPS(const GPS & gps);
|
||||||
|
|
||||||
void cloudReceived(const cv::Mat & cloud, double timestamp);
|
void cloudReceived(const cv::Mat & cloud, double timestamp);
|
||||||
void rgbReceived(const cv::Mat & tangoImage, int type, double timestamp);
|
void rgbReceived(const cv::Mat & tangoImage, int type, double timestamp);
|
||||||
@@ -126,6 +129,9 @@ private:
|
|||||||
TangoSupportRotation colorCameraToDisplayRotation_;
|
TangoSupportRotation colorCameraToDisplayRotation_;
|
||||||
cv::Mat fisheyeRectifyMapX_;
|
cv::Mat fisheyeRectifyMapX_;
|
||||||
cv::Mat fisheyeRectifyMapY_;
|
cv::Mat fisheyeRectifyMapY_;
|
||||||
|
GPS lastKnownGPS_;
|
||||||
|
Transform originOffset_;
|
||||||
|
bool originUpdate_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace rtabmap */
|
} /* namespace rtabmap */
|
||||||
|
|||||||
+272
-115
@@ -93,12 +93,13 @@ rtabmap::ParametersMap RTABMapApp::getRtabmapParameters()
|
|||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kKpParallelized(), std::string("false")));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kKpParallelized(), std::string("false")));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kKpMaxDepth(), std::string("10"))); // to avoid extracting features in invalid depth (as we compute transformation directly from the words)
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kKpMaxDepth(), std::string("10"))); // to avoid extracting features in invalid depth (as we compute transformation directly from the words)
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDOptimizeFromGraphEnd(), std::string("true")));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDOptimizeFromGraphEnd(), std::string("true")));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kDbSqlite3InMemory(), std::string("true")));
|
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kVisMinInliers(), std::string("25")));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kVisMinInliers(), std::string("25")));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kVisEstimationType(), std::string("0"))); // 0=3D-3D 1=PnP
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kVisEstimationType(), std::string("0"))); // 0=3D-3D 1=PnP
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDOptimizeMaxError(), std::string("0.1")));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDOptimizeMaxError(), std::string("1")));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDProximityPathMaxNeighbors(), std::string("0"))); // disable scan matching to merged nodes
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDProximityPathMaxNeighbors(), std::string("0"))); // disable scan matching to merged nodes
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDProximityBySpace(), std::string("false"))); // just keep loop closure detection
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDProximityBySpace(), std::string("false"))); // just keep loop closure detection
|
||||||
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDLinearUpdate(), std::string("0.05")));
|
||||||
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDAngularUpdate(), std::string("0.05")));
|
||||||
|
|
||||||
if(parameters.find(rtabmap::Parameters::kOptimizerStrategy()) != parameters.end())
|
if(parameters.find(rtabmap::Parameters::kOptimizerStrategy()) != parameters.end())
|
||||||
{
|
{
|
||||||
@@ -183,11 +184,12 @@ RTABMapApp::RTABMapApp() :
|
|||||||
lastDrawnCloudsCount_(0),
|
lastDrawnCloudsCount_(0),
|
||||||
renderingTime_(0.0f),
|
renderingTime_(0.0f),
|
||||||
lastPostRenderEventTime_(0.0),
|
lastPostRenderEventTime_(0.0),
|
||||||
processMemoryUsedBytes(0),
|
lastPoseEventTime_(0.0),
|
||||||
processGPUMemoryUsedBytes(0),
|
|
||||||
visualizingMesh_(false),
|
visualizingMesh_(false),
|
||||||
exportedMeshUpdated_(false),
|
exportedMeshUpdated_(false),
|
||||||
optMesh_(new pcl::TextureMesh),
|
optMesh_(new pcl::TextureMesh),
|
||||||
|
optRefId_(0),
|
||||||
|
optRefPose_(0),
|
||||||
mapToOdom_(rtabmap::Transform::getIdentity())
|
mapToOdom_(rtabmap::Transform::getIdentity())
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -195,28 +197,45 @@ RTABMapApp::RTABMapApp() :
|
|||||||
}
|
}
|
||||||
|
|
||||||
RTABMapApp::~RTABMapApp() {
|
RTABMapApp::~RTABMapApp() {
|
||||||
if(camera_)
|
if(camera_)
|
||||||
{
|
{
|
||||||
delete camera_;
|
delete camera_;
|
||||||
}
|
}
|
||||||
if(rtabmapThread_)
|
if(rtabmapThread_)
|
||||||
{
|
{
|
||||||
rtabmapThread_->close(false);
|
rtabmapThread_->close(false);
|
||||||
delete rtabmapThread_;
|
delete rtabmapThread_;
|
||||||
}
|
}
|
||||||
if(logHandler_)
|
if(logHandler_)
|
||||||
{
|
{
|
||||||
delete logHandler_;
|
delete logHandler_;
|
||||||
}
|
}
|
||||||
boost::mutex::scoped_lock lock(rtabmapMutex_);
|
if(optRefPose_)
|
||||||
if(rtabmapEvents_.size())
|
{
|
||||||
{
|
delete optRefPose_;
|
||||||
for(std::list<rtabmap::RtabmapEvent*>::iterator iter=rtabmapEvents_.begin(); iter!=rtabmapEvents_.end(); ++iter)
|
}
|
||||||
{
|
{
|
||||||
delete *iter;
|
boost::mutex::scoped_lock lock(rtabmapMutex_);
|
||||||
}
|
if(rtabmapEvents_.size())
|
||||||
}
|
{
|
||||||
rtabmapEvents_.clear();
|
for(std::list<rtabmap::RtabmapEvent*>::iterator iter=rtabmapEvents_.begin(); iter!=rtabmapEvents_.end(); ++iter)
|
||||||
|
{
|
||||||
|
delete *iter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rtabmapEvents_.clear();
|
||||||
|
}
|
||||||
|
{
|
||||||
|
boost::mutex::scoped_lock lock(visLocalizationMutex_);
|
||||||
|
if(visLocalizationEvents_.size())
|
||||||
|
{
|
||||||
|
for(std::list<rtabmap::RtabmapEvent*>::iterator iter=visLocalizationEvents_.begin(); iter!=visLocalizationEvents_.end(); ++iter)
|
||||||
|
{
|
||||||
|
delete *iter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
visLocalizationEvents_.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTABMapApp::onCreate(JNIEnv* env, jobject caller_activity)
|
void RTABMapApp::onCreate(JNIEnv* env, jobject caller_activity)
|
||||||
@@ -236,8 +255,7 @@ void RTABMapApp::onCreate(JNIEnv* env, jobject caller_activity)
|
|||||||
lastDrawnCloudsCount_ = 0;
|
lastDrawnCloudsCount_ = 0;
|
||||||
renderingTime_ = 0.0f;
|
renderingTime_ = 0.0f;
|
||||||
lastPostRenderEventTime_ = 0.0;
|
lastPostRenderEventTime_ = 0.0;
|
||||||
processMemoryUsedBytes = 0;
|
lastPoseEventTime_ = 0.0;
|
||||||
processGPUMemoryUsedBytes = 0;
|
|
||||||
bufferedStatsData_.clear();
|
bufferedStatsData_.clear();
|
||||||
progressionStatus_.setJavaObjects(jvm, RTABMapActivity);
|
progressionStatus_.setJavaObjects(jvm, RTABMapActivity);
|
||||||
main_scene_.setBackgroundColor(backgroundColor_, backgroundColor_, backgroundColor_);
|
main_scene_.setBackgroundColor(backgroundColor_, backgroundColor_, backgroundColor_);
|
||||||
@@ -279,6 +297,13 @@ int RTABMapApp::openDatabase(const std::string & databasePath, bool databaseInMe
|
|||||||
this->unregisterFromEventsManager(); // to ignore published init events when closing rtabmap
|
this->unregisterFromEventsManager(); // to ignore published init events when closing rtabmap
|
||||||
status_.first = rtabmap::RtabmapEventInit::kInitializing;
|
status_.first = rtabmap::RtabmapEventInit::kInitializing;
|
||||||
rtabmapMutex_.lock();
|
rtabmapMutex_.lock();
|
||||||
|
if(rtabmapEvents_.size())
|
||||||
|
{
|
||||||
|
for(std::list<rtabmap::RtabmapEvent*>::iterator iter=rtabmapEvents_.begin(); iter!=rtabmapEvents_.end(); ++iter)
|
||||||
|
{
|
||||||
|
delete *iter;
|
||||||
|
}
|
||||||
|
}
|
||||||
rtabmapEvents_.clear();
|
rtabmapEvents_.clear();
|
||||||
openingDatabase_ = true;
|
openingDatabase_ = true;
|
||||||
if(rtabmapThread_)
|
if(rtabmapThread_)
|
||||||
@@ -296,6 +321,12 @@ int RTABMapApp::openDatabase(const std::string & databasePath, bool databaseInMe
|
|||||||
// Open visualization while we load (if there is an optimized mesh saved in database)
|
// Open visualization while we load (if there is an optimized mesh saved in database)
|
||||||
optMesh_.reset(new pcl::TextureMesh);
|
optMesh_.reset(new pcl::TextureMesh);
|
||||||
optTexture_ = cv::Mat();
|
optTexture_ = cv::Mat();
|
||||||
|
optRefId_ = 0;
|
||||||
|
if(optRefPose_)
|
||||||
|
{
|
||||||
|
delete optRefPose_;
|
||||||
|
optRefPose_ = 0;
|
||||||
|
}
|
||||||
cv::Mat cloudMat;
|
cv::Mat cloudMat;
|
||||||
std::vector<std::vector<std::vector<unsigned int> > > polygons;
|
std::vector<std::vector<std::vector<unsigned int> > > polygons;
|
||||||
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
||||||
@@ -304,14 +335,13 @@ int RTABMapApp::openDatabase(const std::string & databasePath, bool databaseInMe
|
|||||||
std::vector<std::vector<Eigen::Vector2f> > texCoords;
|
std::vector<std::vector<Eigen::Vector2f> > texCoords;
|
||||||
#endif
|
#endif
|
||||||
cv::Mat textures;
|
cv::Mat textures;
|
||||||
std::map<int, rtabmap::Transform> optPoses;
|
|
||||||
if(!databaseSource.empty())
|
if(!databaseSource.empty())
|
||||||
{
|
{
|
||||||
UEventsManager::post(new rtabmap::RtabmapEventInit(rtabmap::RtabmapEventInit::kInfo, "Loading optimized cloud/mesh..."));
|
UEventsManager::post(new rtabmap::RtabmapEventInit(rtabmap::RtabmapEventInit::kInfo, "Loading optimized cloud/mesh..."));
|
||||||
rtabmap::DBDriver * driver = rtabmap::DBDriver::create();
|
rtabmap::DBDriver * driver = rtabmap::DBDriver::create();
|
||||||
if(driver->openConnection(databaseSource))
|
if(driver->openConnection(databaseSource))
|
||||||
{
|
{
|
||||||
cloudMat = driver->loadOptimizedMesh(&optPoses, &polygons, &texCoords, &textures);
|
cloudMat = driver->loadOptimizedMesh(&polygons, &texCoords, &textures);
|
||||||
if(!cloudMat.empty())
|
if(!cloudMat.empty())
|
||||||
{
|
{
|
||||||
LOGI("Open: Found optimized mesh! Visualizing it.");
|
LOGI("Open: Found optimized mesh! Visualizing it.");
|
||||||
@@ -403,7 +433,7 @@ int RTABMapApp::openDatabase(const std::string & databasePath, bool databaseInMe
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
LOGI("Creating the meshes (%d)....", poses.size());
|
LOGI("Creating the meshes (%d)....", (int)poses.size());
|
||||||
boost::mutex::scoped_lock lock(meshesMutex_);
|
boost::mutex::scoped_lock lock(meshesMutex_);
|
||||||
createdMeshes_.clear();
|
createdMeshes_.clear();
|
||||||
int i=0;
|
int i=0;
|
||||||
@@ -480,16 +510,6 @@ int RTABMapApp::openDatabase(const std::string & databasePath, bool databaseInMe
|
|||||||
UERROR("Failed to uncompress data!");
|
UERROR("Failed to uncompress data!");
|
||||||
status=-2;
|
status=-2;
|
||||||
}
|
}
|
||||||
const rtabmap::Signature & s = signatures.at(id);
|
|
||||||
processMemoryUsedBytes += data.imageCompressed().total();
|
|
||||||
processMemoryUsedBytes += data.depthOrRightCompressed().total();
|
|
||||||
processMemoryUsedBytes += data.laserScanCompressed().total();
|
|
||||||
processMemoryUsedBytes += s.getWords().size()*4*8;
|
|
||||||
processMemoryUsedBytes += s.getWords3().size()*4*4;
|
|
||||||
if(!s.getWordsDescriptors().empty())
|
|
||||||
{
|
|
||||||
processMemoryUsedBytes +=s.getWordsDescriptors().size()*(4+s.getWordsDescriptors().begin()->second.total());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -565,6 +585,19 @@ int RTABMapApp::openDatabase(const std::string & databasePath, bool databaseInMe
|
|||||||
|
|
||||||
rtabmap_->setOptimizedPoses(poses);
|
rtabmap_->setOptimizedPoses(poses);
|
||||||
|
|
||||||
|
// for optimized mesh
|
||||||
|
if(poses.size())
|
||||||
|
{
|
||||||
|
// just take the last as reference
|
||||||
|
optRefId_ = poses.rbegin()->first;
|
||||||
|
optRefPose_ = new rtabmap::Transform(poses.rbegin()->second);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(camera_)
|
||||||
|
{
|
||||||
|
camera_->resetOrigin();
|
||||||
|
}
|
||||||
|
|
||||||
// Start threads
|
// Start threads
|
||||||
LOGI("Start rtabmap thread");
|
LOGI("Start rtabmap thread");
|
||||||
rtabmapThread_->registerToEventsManager();
|
rtabmapThread_->registerToEventsManager();
|
||||||
@@ -735,7 +768,7 @@ std::vector<pcl::Vertices> RTABMapApp::filterOrganizedPolygons(
|
|||||||
unsigned int biggestClusterSize = 0;
|
unsigned int biggestClusterSize = 0;
|
||||||
for(std::map<int, std::list<int> >::iterator iter=clusters.begin(); iter!=clusters.end(); ++iter)
|
for(std::map<int, std::list<int> >::iterator iter=clusters.begin(); iter!=clusters.end(); ++iter)
|
||||||
{
|
{
|
||||||
LOGD("cluster %d = %d", iter->first, iter->second.size());
|
LOGD("cluster %d = %d", iter->first, (int)iter->second.size());
|
||||||
|
|
||||||
if(iter->second.size() > biggestClusterSize)
|
if(iter->second.size() > biggestClusterSize)
|
||||||
{
|
{
|
||||||
@@ -995,14 +1028,12 @@ int RTABMapApp::Render()
|
|||||||
poseEvents_.clear();
|
poseEvents_.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rtabmap::Transform mapOdom = rtabmap::Transform::getIdentity();
|
|
||||||
if(!pose.isNull())
|
if(!pose.isNull())
|
||||||
{
|
{
|
||||||
// update camera pose?
|
// update camera pose?
|
||||||
if(graphOptimization_ && !visualizingMesh_ && !mapToOdom_.isIdentity())
|
if(graphOptimization_ && !mapToOdom_.isIdentity())
|
||||||
{
|
{
|
||||||
mapOdom = mapToOdom_;
|
main_scene_.SetCameraPose(opengl_world_T_rtabmap_world*mapToOdom_*rtabmap_world_T_tango_world*pose);
|
||||||
main_scene_.SetCameraPose(opengl_world_T_rtabmap_world*mapOdom*rtabmap_world_T_tango_world*pose);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1013,6 +1044,7 @@ int RTABMapApp::Render()
|
|||||||
notifyCameraStarted = true;
|
notifyCameraStarted = true;
|
||||||
cameraJustInitialized_ = false;
|
cameraJustInitialized_ = false;
|
||||||
}
|
}
|
||||||
|
lastPoseEventTime_ = UTimer::now();
|
||||||
}
|
}
|
||||||
|
|
||||||
rtabmap::OdometryEvent odomEvent;
|
rtabmap::OdometryEvent odomEvent;
|
||||||
@@ -1061,7 +1093,6 @@ int RTABMapApp::Render()
|
|||||||
mesh.texCoords = optMesh_->tex_coordinates[0];
|
mesh.texCoords = optMesh_->tex_coordinates[0];
|
||||||
mesh.texture = optTexture_;
|
mesh.texture = optTexture_;
|
||||||
}
|
}
|
||||||
|
|
||||||
main_scene_.addMesh(g_optMeshId, mesh, opengl_world_T_rtabmap_world, true);
|
main_scene_.addMesh(g_optMeshId, mesh, opengl_world_T_rtabmap_world, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1071,6 +1102,58 @@ int RTABMapApp::Render()
|
|||||||
pcl::fromPCLPointCloud2(optMesh_->cloud, *cloud);
|
pcl::fromPCLPointCloud2(optMesh_->cloud, *cloud);
|
||||||
main_scene_.addCloud(g_optMeshId, cloud, indices, opengl_world_T_rtabmap_world);
|
main_scene_.addCloud(g_optMeshId, cloud, indices, opengl_world_T_rtabmap_world);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clean up old messages if there are ones
|
||||||
|
boost::mutex::scoped_lock lock(visLocalizationMutex_);
|
||||||
|
if(visLocalizationEvents_.size())
|
||||||
|
{
|
||||||
|
for(std::list<rtabmap::RtabmapEvent*>::iterator iter=visLocalizationEvents_.begin(); iter!=visLocalizationEvents_.end(); ++iter)
|
||||||
|
{
|
||||||
|
delete *iter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
visLocalizationEvents_.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<rtabmap::RtabmapEvent*> visLocalizationEvents;
|
||||||
|
visLocalizationMutex_.lock();
|
||||||
|
visLocalizationEvents = visLocalizationEvents_;
|
||||||
|
visLocalizationEvents_.clear();
|
||||||
|
visLocalizationMutex_.unlock();
|
||||||
|
|
||||||
|
if(visLocalizationEvents.size())
|
||||||
|
{
|
||||||
|
const rtabmap::Statistics & stats = visLocalizationEvents.back()->getStats();
|
||||||
|
if(!stats.mapCorrection().isNull())
|
||||||
|
{
|
||||||
|
mapToOdom_ = stats.mapCorrection();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::map<int, rtabmap::Transform>::const_iterator iter = stats.poses().find(optRefId_);
|
||||||
|
if(iter != stats.poses().end() && !iter->second.isNull() && optRefPose_)
|
||||||
|
{
|
||||||
|
// adjust opt mesh pose
|
||||||
|
main_scene_.setCloudPose(g_optMeshId, opengl_world_T_rtabmap_world * iter->second * (*optRefPose_).inverse());
|
||||||
|
}
|
||||||
|
int fastMovement = (int)uValue(stats.data(), rtabmap::Statistics::kMemoryFast_movement(), 0.0f);
|
||||||
|
int loopClosure = (int)uValue(stats.data(), rtabmap::Statistics::kLoopAccepted_hypothesis_id(), 0.0f);
|
||||||
|
int rejected = (int)uValue(stats.data(), rtabmap::Statistics::kLoopRejectedHypothesis(), 0.0f);
|
||||||
|
if(!paused_ && loopClosure>0)
|
||||||
|
{
|
||||||
|
main_scene_.setBackgroundColor(0, 0.5f, 0); // green
|
||||||
|
}
|
||||||
|
else if(!paused_ && rejected>0)
|
||||||
|
{
|
||||||
|
main_scene_.setBackgroundColor(0, 0.2f, 0); // dark green
|
||||||
|
}
|
||||||
|
else if(!paused_ && fastMovement)
|
||||||
|
{
|
||||||
|
main_scene_.setBackgroundColor(0.2f, 0, 0.2f); // dark magenta
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
main_scene_.setBackgroundColor(backgroundColor_, backgroundColor_, backgroundColor_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//backup state
|
//backup state
|
||||||
@@ -1088,6 +1171,20 @@ int RTABMapApp::Render()
|
|||||||
|
|
||||||
// revert state
|
// revert state
|
||||||
main_scene_.setMeshRendering(isMeshRendering, isTextureRendering);
|
main_scene_.setMeshRendering(isMeshRendering, isTextureRendering);
|
||||||
|
|
||||||
|
if(visLocalizationEvents.size())
|
||||||
|
{
|
||||||
|
// send statistics to GUI
|
||||||
|
UEventsManager::post(new PostRenderEvent(visLocalizationEvents.back()));
|
||||||
|
visLocalizationEvents.pop_back();
|
||||||
|
|
||||||
|
for(std::list<rtabmap::RtabmapEvent*>::iterator iter=visLocalizationEvents.begin(); iter!=visLocalizationEvents.end(); ++iter)
|
||||||
|
{
|
||||||
|
delete *iter;
|
||||||
|
}
|
||||||
|
visLocalizationEvents.clear();
|
||||||
|
lastPostRenderEventTime_ = UTimer::now();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1155,8 +1252,7 @@ int RTABMapApp::Render()
|
|||||||
lastDrawnCloudsCount_ = 0;
|
lastDrawnCloudsCount_ = 0;
|
||||||
renderingTime_ = 0.0f;
|
renderingTime_ = 0.0f;
|
||||||
lastPostRenderEventTime_ = 0.0;
|
lastPostRenderEventTime_ = 0.0;
|
||||||
processMemoryUsedBytes = 0;
|
lastPoseEventTime_ = 0.0;
|
||||||
processGPUMemoryUsedBytes = 0;
|
|
||||||
bufferedStatsData_.clear();
|
bufferedStatsData_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1170,7 +1266,6 @@ int RTABMapApp::Render()
|
|||||||
if(added.size() != meshes)
|
if(added.size() != meshes)
|
||||||
{
|
{
|
||||||
LOGI("added (%d) != meshes (%d)", (int)added.size(), meshes);
|
LOGI("added (%d) != meshes (%d)", (int)added.size(), meshes);
|
||||||
processGPUMemoryUsedBytes = 0;
|
|
||||||
boost::mutex::scoped_lock lockRtabmap(rtabmapMutex_);
|
boost::mutex::scoped_lock lockRtabmap(rtabmapMutex_);
|
||||||
UASSERT(rtabmap_!=0);
|
UASSERT(rtabmap_!=0);
|
||||||
for(std::map<int, Mesh>::iterator iter=createdMeshes_.begin(); iter!=createdMeshes_.end(); ++iter)
|
for(std::map<int, Mesh>::iterator iter=createdMeshes_.begin(); iter!=createdMeshes_.end(); ++iter)
|
||||||
@@ -1205,14 +1300,6 @@ int RTABMapApp::Render()
|
|||||||
main_scene_.addMesh(iter->first, iter->second, opengl_world_T_rtabmap_world*iter->second.pose);
|
main_scene_.addMesh(iter->first, iter->second, opengl_world_T_rtabmap_world*iter->second.pose);
|
||||||
main_scene_.setCloudVisible(iter->first, iter->second.visible);
|
main_scene_.setCloudVisible(iter->first, iter->second.visible);
|
||||||
|
|
||||||
long estimateGPUMem = 0;
|
|
||||||
estimateGPUMem += iter->second.cloud->size()*16; // 3*float + 1 float rgb
|
|
||||||
estimateGPUMem += iter->second.indices->size()*4; // int
|
|
||||||
estimateGPUMem += iter->second.polygons.size()*4*3; // 3 indices per polygon
|
|
||||||
estimateGPUMem += iter->second.polygonsLowRes.size()*4*3; // 3 indices per polygon
|
|
||||||
|
|
||||||
processGPUMemoryUsedBytes += estimateGPUMem + (iter->second.texture.empty()?0:iter->second.polygons.size()*3*8+iter->second.texture.total());
|
|
||||||
|
|
||||||
iter->second.texture = cv::Mat(); // don't keep textures in memory
|
iter->second.texture = cv::Mat(); // don't keep textures in memory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1237,7 +1324,7 @@ int RTABMapApp::Render()
|
|||||||
|
|
||||||
// update buffered signatures
|
// update buffered signatures
|
||||||
std::map<int, rtabmap::SensorData> bufferedSensorData;
|
std::map<int, rtabmap::SensorData> bufferedSensorData;
|
||||||
if(!trajectoryMode_ && !dataRecorderMode_)
|
if(!dataRecorderMode_)
|
||||||
{
|
{
|
||||||
for(std::list<rtabmap::RtabmapEvent*>::iterator iter=rtabmapEvents.begin(); iter!=rtabmapEvents.end(); ++iter)
|
for(std::list<rtabmap::RtabmapEvent*>::iterator iter=rtabmapEvents.begin(); iter!=rtabmapEvents.end(); ++iter)
|
||||||
{
|
{
|
||||||
@@ -1245,42 +1332,29 @@ int RTABMapApp::Render()
|
|||||||
|
|
||||||
// Don't create mesh for the last node added if rehearsal happened or if discarded (small movement)
|
// Don't create mesh for the last node added if rehearsal happened or if discarded (small movement)
|
||||||
int smallMovement = (int)uValue(stats.data(), rtabmap::Statistics::kMemorySmall_movement(), 0.0f);
|
int smallMovement = (int)uValue(stats.data(), rtabmap::Statistics::kMemorySmall_movement(), 0.0f);
|
||||||
|
int fastMovement = (int)uValue(stats.data(), rtabmap::Statistics::kMemoryFast_movement(), 0.0f);
|
||||||
int rehearsalMerged = (int)uValue(stats.data(), rtabmap::Statistics::kMemoryRehearsal_merged(), 0.0f);
|
int rehearsalMerged = (int)uValue(stats.data(), rtabmap::Statistics::kMemoryRehearsal_merged(), 0.0f);
|
||||||
if(smallMovement == 0 && rehearsalMerged == 0)
|
if(!localizationMode_ && stats.getSignatures().size() &&
|
||||||
|
smallMovement == 0 && rehearsalMerged == 0 && fastMovement == 0)
|
||||||
{
|
{
|
||||||
for(std::map<int, rtabmap::Signature>::const_iterator jter=stats.getSignatures().begin(); jter!=stats.getSignatures().end(); ++jter)
|
int id = stats.getSignatures().rbegin()->first;
|
||||||
|
const rtabmap::Signature & s = stats.getSignatures().rbegin()->second;
|
||||||
|
|
||||||
|
if(!trajectoryMode_ &&
|
||||||
|
!s.sensorData().imageRaw().empty() &&
|
||||||
|
!s.sensorData().depthRaw().empty())
|
||||||
{
|
{
|
||||||
bool dataDetected = false;
|
uInsert(bufferedSensorData, std::make_pair(id, s.sensorData()));
|
||||||
if(!jter->second.sensorData().imageRaw().empty() &&
|
|
||||||
!jter->second.sensorData().depthRaw().empty())
|
|
||||||
{
|
|
||||||
if(!localizationMode_)
|
|
||||||
{
|
|
||||||
uInsert(bufferedSensorData, std::make_pair(jter->first, jter->second.sensorData()));
|
|
||||||
uInsert(rawPoses_, std::make_pair(jter->first, jter->second.getPose()));
|
|
||||||
dataDetected = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(dataDetected)
|
|
||||||
{
|
|
||||||
processMemoryUsedBytes += jter->second.sensorData().imageCompressed().total();
|
|
||||||
processMemoryUsedBytes += jter->second.sensorData().depthOrRightCompressed().total();
|
|
||||||
processMemoryUsedBytes += jter->second.sensorData().laserScanCompressed().total();
|
|
||||||
processMemoryUsedBytes += jter->second.getWords().size()*4*8;
|
|
||||||
processMemoryUsedBytes += jter->second.getWords3().size()*4*4;
|
|
||||||
if(!jter->second.getWordsDescriptors().empty())
|
|
||||||
{
|
|
||||||
processMemoryUsedBytes += jter->second.getWordsDescriptors().size()*(4+jter->second.getWordsDescriptors().begin()->second.total());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uInsert(rawPoses_, std::make_pair(id, s.getPose()));
|
||||||
}
|
}
|
||||||
|
|
||||||
int loopClosure = (int)uValue(stats.data(), rtabmap::Statistics::kLoopAccepted_hypothesis_id(), 0.0f);
|
int loopClosure = (int)uValue(stats.data(), rtabmap::Statistics::kLoopAccepted_hypothesis_id(), 0.0f);
|
||||||
int rejected = (int)uValue(stats.data(), rtabmap::Statistics::kLoopRejectedHypothesis(), 0.0f);
|
int rejected = (int)uValue(stats.data(), rtabmap::Statistics::kLoopRejectedHypothesis(), 0.0f);
|
||||||
if(!paused_ && loopClosure>0)
|
if(!paused_ && loopClosure>0)
|
||||||
{
|
{
|
||||||
main_scene_.setBackgroundColor(0, 0.7f, 0); // green
|
main_scene_.setBackgroundColor(0, 0.5f, 0); // green
|
||||||
}
|
}
|
||||||
else if(!paused_ && rejected>0)
|
else if(!paused_ && rejected>0)
|
||||||
{
|
{
|
||||||
@@ -1290,12 +1364,17 @@ int RTABMapApp::Render()
|
|||||||
{
|
{
|
||||||
main_scene_.setBackgroundColor(0, 0, 0.2f); // blue
|
main_scene_.setBackgroundColor(0, 0, 0.2f); // blue
|
||||||
}
|
}
|
||||||
|
else if(!paused_ && fastMovement)
|
||||||
|
{
|
||||||
|
main_scene_.setBackgroundColor(0.2f, 0, 0.2f); // dark magenta
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
main_scene_.setBackgroundColor(backgroundColor_, backgroundColor_, backgroundColor_);
|
main_scene_.setBackgroundColor(backgroundColor_, backgroundColor_, backgroundColor_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_RENDERING_PERFORMANCE
|
#ifdef DEBUG_RENDERING_PERFORMANCE
|
||||||
LOGW("Looking fo data to load (%d) %fs", bufferedSensorData.size(), time.ticks());
|
LOGW("Looking fo data to load (%d) %fs", bufferedSensorData.size(), time.ticks());
|
||||||
#endif
|
#endif
|
||||||
@@ -1431,13 +1510,6 @@ int RTABMapApp::Render()
|
|||||||
#ifdef DEBUG_RENDERING_PERFORMANCE
|
#ifdef DEBUG_RENDERING_PERFORMANCE
|
||||||
LOGW("Adding mesh to scene: %fs", time.ticks());
|
LOGW("Adding mesh to scene: %fs", time.ticks());
|
||||||
#endif
|
#endif
|
||||||
long estimateCPUMem = 0;
|
|
||||||
estimateCPUMem += mesh.cloud->size()*16; // 3*float + 1 float rgb
|
|
||||||
estimateCPUMem += mesh.indices->size()*4; // int
|
|
||||||
estimateCPUMem += mesh.polygons.size()*4*3; // 3 indices per polygon
|
|
||||||
|
|
||||||
processMemoryUsedBytes += estimateCPUMem;
|
|
||||||
processGPUMemoryUsedBytes += estimateCPUMem + (mesh.texture.empty()?0:mesh.polygons.size()*3*8+mesh.texture.total());
|
|
||||||
mesh.texture = cv::Mat(); // don't keep textures in memory
|
mesh.texture = cv::Mat(); // don't keep textures in memory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1500,7 +1572,7 @@ int RTABMapApp::Render()
|
|||||||
odomEvent.data().imageRaw().cols, odomEvent.data().imageRaw().rows,
|
odomEvent.data().imageRaw().cols, odomEvent.data().imageRaw().rows,
|
||||||
odomEvent.data().depthRaw().cols, odomEvent.data().depthRaw().rows,
|
odomEvent.data().depthRaw().cols, odomEvent.data().depthRaw().rows,
|
||||||
(int)cloud->width, (int)cloud->height);
|
(int)cloud->width, (int)cloud->height);
|
||||||
main_scene_.addCloud(-1, cloud, indices, opengl_world_T_rtabmap_world*mapOdom*odomEvent.pose());
|
main_scene_.addCloud(-1, cloud, indices, opengl_world_T_rtabmap_world*mapToOdom_*odomEvent.pose());
|
||||||
main_scene_.setCloudVisible(-1, true);
|
main_scene_.setCloudVisible(-1, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1584,6 +1656,12 @@ int RTABMapApp::Render()
|
|||||||
rtabmapEvents.clear();
|
rtabmapEvents.clear();
|
||||||
|
|
||||||
lastPostRenderEventTime_ = UTimer::now();
|
lastPostRenderEventTime_ = UTimer::now();
|
||||||
|
|
||||||
|
if(lastPoseEventTime_>0.0 && UTimer::now()-lastPoseEventTime_ > 1.0)
|
||||||
|
{
|
||||||
|
UERROR("TangoPoseEventNotReceived");
|
||||||
|
UEventsManager::post(new rtabmap::CameraTangoEvent(10, "TangoPoseEventNotReceived", uNumber2Str(UTimer::now()-lastPoseEventTime_)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1697,7 +1775,10 @@ void RTABMapApp::setPausedMapping(bool paused)
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(renderingMutex_);
|
boost::mutex::scoped_lock lock(renderingMutex_);
|
||||||
visualizingMesh_ = false;
|
if(!localizationMode_)
|
||||||
|
{
|
||||||
|
visualizingMesh_ = false;
|
||||||
|
}
|
||||||
main_scene_.setBackgroundColor(backgroundColor_, backgroundColor_, backgroundColor_);
|
main_scene_.setBackgroundColor(backgroundColor_, backgroundColor_, backgroundColor_);
|
||||||
}
|
}
|
||||||
paused_ = paused;
|
paused_ = paused;
|
||||||
@@ -1975,6 +2056,14 @@ int RTABMapApp::setMappingParameter(const std::string & key, const std::string &
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RTABMapApp::setGPS(const rtabmap::GPS & gps)
|
||||||
|
{
|
||||||
|
if(camera_)
|
||||||
|
{
|
||||||
|
camera_->setGPS(gps);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RTABMapApp::resetMapping()
|
void RTABMapApp::resetMapping()
|
||||||
{
|
{
|
||||||
LOGW("Reset!");
|
LOGW("Reset!");
|
||||||
@@ -1984,6 +2073,11 @@ void RTABMapApp::resetMapping()
|
|||||||
mapToOdom_.setIdentity();
|
mapToOdom_.setIdentity();
|
||||||
clearSceneOnNextRender_ = true;
|
clearSceneOnNextRender_ = true;
|
||||||
|
|
||||||
|
if(camera_)
|
||||||
|
{
|
||||||
|
camera_->resetOrigin();
|
||||||
|
}
|
||||||
|
|
||||||
UEventsManager::post(new rtabmap::RtabmapEventCmd(rtabmap::RtabmapEventCmd::kCmdResetMemory));
|
UEventsManager::post(new rtabmap::RtabmapEventCmd(rtabmap::RtabmapEventCmd::kCmdResetMemory));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2012,12 +2106,19 @@ void RTABMapApp::save(const std::string & databasePath)
|
|||||||
dataRecorderMode_ = false;
|
dataRecorderMode_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(appendModeBackup || dataRecorderModeBackup)
|
bool localizationModeBackup = localizationMode_;
|
||||||
|
if(localizationMode_)
|
||||||
|
{
|
||||||
|
localizationMode_ = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(appendModeBackup || dataRecorderModeBackup || localizationModeBackup)
|
||||||
{
|
{
|
||||||
rtabmap::ParametersMap parameters = getRtabmapParameters();
|
rtabmap::ParametersMap parameters = getRtabmapParameters();
|
||||||
rtabmap_->parseParameters(parameters);
|
rtabmap_->parseParameters(parameters);
|
||||||
appendMode_ = appendModeBackup;
|
appendMode_ = appendModeBackup;
|
||||||
dataRecorderMode_ = dataRecorderModeBackup;
|
dataRecorderMode_ = dataRecorderModeBackup;
|
||||||
|
localizationMode_ = localizationModeBackup;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<int, rtabmap::Transform> poses = rtabmap_->getLocalOptimizedPoses();
|
std::map<int, rtabmap::Transform> poses = rtabmap_->getLocalOptimizedPoses();
|
||||||
@@ -2149,11 +2250,12 @@ bool RTABMapApp::exportMesh(
|
|||||||
++iter)
|
++iter)
|
||||||
{
|
{
|
||||||
std::map<int, Mesh>::iterator jter = createdMeshes_.find(iter->first);
|
std::map<int, Mesh>::iterator jter = createdMeshes_.find(iter->first);
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||||
pcl::IndicesPtr indices(new std::vector<int>);
|
pcl::IndicesPtr indices(new std::vector<int>);
|
||||||
rtabmap::CameraModel model;
|
rtabmap::CameraModel model;
|
||||||
cv::Mat depth;
|
cv::Mat depth;
|
||||||
float gains[3] = {1.0f};
|
float gains[3];
|
||||||
|
gains[0] = gains[1] = gains[2] = 1.0f;
|
||||||
if(jter != createdMeshes_.end())
|
if(jter != createdMeshes_.end())
|
||||||
{
|
{
|
||||||
cloud = jter->second.cloud;
|
cloud = jter->second.cloud;
|
||||||
@@ -2193,7 +2295,7 @@ bool RTABMapApp::exportMesh(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Eigen::Vector3f viewpoint( iter->second.x(), iter->second.y(), iter->second.z());
|
Eigen::Vector3f viewpoint( iter->second.x(), iter->second.y(), iter->second.z());
|
||||||
pcl::PointCloud<pcl::Normal>::Ptr normals = rtabmap::util3d::computeNormals(transformedCloud, normalK, viewpoint);
|
pcl::PointCloud<pcl::Normal>::Ptr normals = rtabmap::util3d::computeNormals(transformedCloud, normalK, 0.0f, viewpoint);
|
||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr cloudWithNormals(new pcl::PointCloud<pcl::PointXYZRGBNormal>);
|
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr cloudWithNormals(new pcl::PointCloud<pcl::PointXYZRGBNormal>);
|
||||||
pcl::concatenateFields(*transformedCloud, *normals, *cloudWithNormals);
|
pcl::concatenateFields(*transformedCloud, *normals, *cloudWithNormals);
|
||||||
@@ -2272,7 +2374,7 @@ bool RTABMapApp::exportMesh(
|
|||||||
poisson.setDepth(optimizedDepth);
|
poisson.setDepth(optimizedDepth);
|
||||||
poisson.setInputCloud(mergedClouds);
|
poisson.setInputCloud(mergedClouds);
|
||||||
poisson.reconstruct(*mesh);
|
poisson.reconstruct(*mesh);
|
||||||
LOGI("Mesh reconstruction... done! %fs (%d polygons)", timer.ticks(), mesh->polygons.size());
|
LOGI("Mesh reconstruction... done! %fs (%d polygons)", timer.ticks(), (int)mesh->polygons.size());
|
||||||
|
|
||||||
if(progressionStatus_.isCanceled())
|
if(progressionStatus_.isCanceled())
|
||||||
{
|
{
|
||||||
@@ -2603,7 +2705,7 @@ bool RTABMapApp::exportMesh(
|
|||||||
// save in database
|
// save in database
|
||||||
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGBNormal>);
|
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGBNormal>);
|
||||||
pcl::fromPCLPointCloud2(polygonMesh->cloud, *cloud);
|
pcl::fromPCLPointCloud2(polygonMesh->cloud, *cloud);
|
||||||
cv::Mat cloudMat = rtabmap::compressData2(rtabmap::util3d::laserScanFromPointCloud(*cloud)); // for database
|
cv::Mat cloudMat = rtabmap::compressData2(rtabmap::util3d::laserScanFromPointCloud(*cloud, rtabmap::Transform(), false)); // for database
|
||||||
std::vector<std::vector<std::vector<unsigned int> > > polygons(1);
|
std::vector<std::vector<std::vector<unsigned int> > > polygons(1);
|
||||||
polygons[0].resize(polygonMesh->polygons.size());
|
polygons[0].resize(polygonMesh->polygons.size());
|
||||||
for(unsigned int p=0; p<polygonMesh->polygons.size(); ++p)
|
for(unsigned int p=0; p<polygonMesh->polygons.size(); ++p)
|
||||||
@@ -2611,7 +2713,8 @@ bool RTABMapApp::exportMesh(
|
|||||||
polygons[0][p] = polygonMesh->polygons[p].vertices;
|
polygons[0][p] = polygonMesh->polygons[p].vertices;
|
||||||
}
|
}
|
||||||
boost::mutex::scoped_lock lock(rtabmapMutex_);
|
boost::mutex::scoped_lock lock(rtabmapMutex_);
|
||||||
rtabmap_->getMemory()->saveOptimizedMesh(cloudMat, poses, polygons);
|
|
||||||
|
rtabmap_->getMemory()->saveOptimizedMesh(cloudMat, polygons);
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2619,7 +2722,7 @@ bool RTABMapApp::exportMesh(
|
|||||||
{
|
{
|
||||||
pcl::PointCloud<pcl::PointNormal>::Ptr cloud(new pcl::PointCloud<pcl::PointNormal>);
|
pcl::PointCloud<pcl::PointNormal>::Ptr cloud(new pcl::PointCloud<pcl::PointNormal>);
|
||||||
pcl::fromPCLPointCloud2(textureMesh->cloud, *cloud);
|
pcl::fromPCLPointCloud2(textureMesh->cloud, *cloud);
|
||||||
cv::Mat cloudMat = rtabmap::compressData2(rtabmap::util3d::laserScanFromPointCloud(*cloud)); // for database
|
cv::Mat cloudMat = rtabmap::compressData2(rtabmap::util3d::laserScanFromPointCloud(*cloud, rtabmap::Transform(), false)); // for database
|
||||||
|
|
||||||
// save in database
|
// save in database
|
||||||
std::vector<std::vector<std::vector<unsigned int> > > polygons(textureMesh->tex_polygons.size());
|
std::vector<std::vector<std::vector<unsigned int> > > polygons(textureMesh->tex_polygons.size());
|
||||||
@@ -2632,7 +2735,7 @@ bool RTABMapApp::exportMesh(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
boost::mutex::scoped_lock lock(rtabmapMutex_);
|
boost::mutex::scoped_lock lock(rtabmapMutex_);
|
||||||
rtabmap_->getMemory()->saveOptimizedMesh(cloudMat, poses, polygons, textureMesh->tex_coordinates, globalTextures);
|
rtabmap_->getMemory()->saveOptimizedMesh(cloudMat, polygons, textureMesh->tex_coordinates, globalTextures);
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2655,7 +2758,8 @@ bool RTABMapApp::exportMesh(
|
|||||||
std::map<int, Mesh>::iterator jter=createdMeshes_.find(iter->first);
|
std::map<int, Mesh>::iterator jter=createdMeshes_.find(iter->first);
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||||
pcl::IndicesPtr indices(new std::vector<int>);
|
pcl::IndicesPtr indices(new std::vector<int>);
|
||||||
float gains[3] = {1.0f};
|
float gains[3];
|
||||||
|
gains[0] = gains[1] = gains[2] = 1.0f;
|
||||||
if(regenerateCloud)
|
if(regenerateCloud)
|
||||||
{
|
{
|
||||||
if(jter != createdMeshes_.end())
|
if(jter != createdMeshes_.end())
|
||||||
@@ -2754,7 +2858,7 @@ bool RTABMapApp::exportMesh(
|
|||||||
{
|
{
|
||||||
cv::Mat cloudMat = rtabmap::compressData2(rtabmap::util3d::laserScanFromPointCloud(*mergedClouds)); // for database
|
cv::Mat cloudMat = rtabmap::compressData2(rtabmap::util3d::laserScanFromPointCloud(*mergedClouds)); // for database
|
||||||
boost::mutex::scoped_lock lock(rtabmapMutex_);
|
boost::mutex::scoped_lock lock(rtabmapMutex_);
|
||||||
rtabmap_->getMemory()->saveOptimizedMesh(cloudMat, poses);
|
rtabmap_->getMemory()->saveOptimizedMesh(cloudMat);
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2784,6 +2888,20 @@ bool RTABMapApp::exportMesh(
|
|||||||
}
|
}
|
||||||
exporting_ = false;
|
exporting_ = false;
|
||||||
|
|
||||||
|
optRefId_ = 0;
|
||||||
|
if(optRefPose_)
|
||||||
|
{
|
||||||
|
delete optRefPose_;
|
||||||
|
optRefPose_ = 0;
|
||||||
|
}
|
||||||
|
if(success && poses.size())
|
||||||
|
{
|
||||||
|
// for optimized mesh
|
||||||
|
// just take the last as reference
|
||||||
|
optRefId_ = poses.rbegin()->first;
|
||||||
|
optRefPose_ = new rtabmap::Transform(poses.rbegin()->second);
|
||||||
|
}
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2793,10 +2911,10 @@ bool RTABMapApp::postExportation(bool visualize)
|
|||||||
optMesh_.reset(new pcl::TextureMesh);
|
optMesh_.reset(new pcl::TextureMesh);
|
||||||
optTexture_ = cv::Mat();
|
optTexture_ = cv::Mat();
|
||||||
exportedMeshUpdated_ = false;
|
exportedMeshUpdated_ = false;
|
||||||
visualizingMesh_ = false;
|
|
||||||
|
|
||||||
if(visualize)
|
if(visualize)
|
||||||
{
|
{
|
||||||
|
visualizingMesh_ = false;
|
||||||
cv::Mat cloudMat;
|
cv::Mat cloudMat;
|
||||||
std::vector<std::vector<std::vector<unsigned int> > > polygons;
|
std::vector<std::vector<std::vector<unsigned int> > > polygons;
|
||||||
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
||||||
@@ -2805,10 +2923,9 @@ bool RTABMapApp::postExportation(bool visualize)
|
|||||||
std::vector<std::vector<Eigen::Vector2f> > texCoords;
|
std::vector<std::vector<Eigen::Vector2f> > texCoords;
|
||||||
#endif
|
#endif
|
||||||
cv::Mat textures;
|
cv::Mat textures;
|
||||||
std::map<int, rtabmap::Transform> optPoses;
|
|
||||||
if(rtabmap_ && rtabmap_->getMemory())
|
if(rtabmap_ && rtabmap_->getMemory())
|
||||||
{
|
{
|
||||||
cloudMat = rtabmap_->getMemory()->loadOptimizedMesh(&optPoses, &polygons, &texCoords, &textures);
|
cloudMat = rtabmap_->getMemory()->loadOptimizedMesh(&polygons, &texCoords, &textures);
|
||||||
if(!cloudMat.empty())
|
if(!cloudMat.empty())
|
||||||
{
|
{
|
||||||
LOGI("postExportation: Found optimized mesh! Visualizing it.");
|
LOGI("postExportation: Found optimized mesh! Visualizing it.");
|
||||||
@@ -2825,6 +2942,19 @@ bool RTABMapApp::postExportation(bool visualize)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(visualizingMesh_)
|
||||||
|
{
|
||||||
|
rtabmapMutex_.lock();
|
||||||
|
if(!rtabmap_->getLocalOptimizedPoses().empty())
|
||||||
|
{
|
||||||
|
rtabmap::Statistics stats;
|
||||||
|
stats.setPoses(rtabmap_->getLocalOptimizedPoses());
|
||||||
|
rtabmapEvents_.push_back(new rtabmap::RtabmapEvent(stats));
|
||||||
|
}
|
||||||
|
rtabmapMutex_.unlock();
|
||||||
|
|
||||||
|
visualizingMesh_ = false;
|
||||||
|
}
|
||||||
|
|
||||||
return visualizingMesh_;
|
return visualizingMesh_;
|
||||||
}
|
}
|
||||||
@@ -2846,10 +2976,9 @@ bool RTABMapApp::writeExportedMesh(const std::string & directory, const std::str
|
|||||||
std::vector<std::vector<Eigen::Vector2f> > texCoords;
|
std::vector<std::vector<Eigen::Vector2f> > texCoords;
|
||||||
#endif
|
#endif
|
||||||
cv::Mat textures;
|
cv::Mat textures;
|
||||||
std::map<int, rtabmap::Transform> optPoses;
|
|
||||||
if(rtabmap_ && rtabmap_->getMemory())
|
if(rtabmap_ && rtabmap_->getMemory())
|
||||||
{
|
{
|
||||||
cloudMat = rtabmap_->getMemory()->loadOptimizedMesh(&optPoses, &polygons, &texCoords, &textures);
|
cloudMat = rtabmap_->getMemory()->loadOptimizedMesh(&polygons, &texCoords, &textures);
|
||||||
if(!cloudMat.empty())
|
if(!cloudMat.empty())
|
||||||
{
|
{
|
||||||
LOGI("writeExportedMesh: Found optimized mesh!");
|
LOGI("writeExportedMesh: Found optimized mesh!");
|
||||||
@@ -3062,8 +3191,16 @@ bool RTABMapApp::handleEvent(UEvent * event)
|
|||||||
LOGI("Received RtabmapEvent event!");
|
LOGI("Received RtabmapEvent event!");
|
||||||
if(camera_->isRunning())
|
if(camera_->isRunning())
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(rtabmapMutex_);
|
if(visualizingMesh_)
|
||||||
rtabmapEvents_.push_back((rtabmap::RtabmapEvent*)event);
|
{
|
||||||
|
boost::mutex::scoped_lock lock(visLocalizationMutex_);
|
||||||
|
visLocalizationEvents_.push_back((rtabmap::RtabmapEvent*)event);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
boost::mutex::scoped_lock lock(rtabmapMutex_);
|
||||||
|
rtabmapEvents_.push_back((rtabmap::RtabmapEvent*)event);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3170,8 +3307,11 @@ bool RTABMapApp::handleEvent(UEvent * event)
|
|||||||
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kLoopVisual_matches(), uValue(stats.data(), rtabmap::Statistics::kLoopVisual_matches(), 0.0f)));
|
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kLoopVisual_matches(), uValue(stats.data(), rtabmap::Statistics::kLoopVisual_matches(), 0.0f)));
|
||||||
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kLoopRejectedHypothesis(), uValue(stats.data(), rtabmap::Statistics::kLoopRejectedHypothesis(), 0.0f)));
|
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kLoopRejectedHypothesis(), uValue(stats.data(), rtabmap::Statistics::kLoopRejectedHypothesis(), 0.0f)));
|
||||||
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kLoopOptimization_max_error(), uValue(stats.data(), rtabmap::Statistics::kLoopOptimization_max_error(), 0.0f)));
|
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kLoopOptimization_max_error(), uValue(stats.data(), rtabmap::Statistics::kLoopOptimization_max_error(), 0.0f)));
|
||||||
|
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kLoopOptimization_max_error_ratio(), uValue(stats.data(), rtabmap::Statistics::kLoopOptimization_max_error_ratio(), 0.0f)));
|
||||||
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kMemoryRehearsal_sim(), uValue(stats.data(), rtabmap::Statistics::kMemoryRehearsal_sim(), 0.0f)));
|
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kMemoryRehearsal_sim(), uValue(stats.data(), rtabmap::Statistics::kMemoryRehearsal_sim(), 0.0f)));
|
||||||
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kLoopHighest_hypothesis_value(), uValue(stats.data(), rtabmap::Statistics::kLoopHighest_hypothesis_value(), 0.0f)));
|
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kLoopHighest_hypothesis_value(), uValue(stats.data(), rtabmap::Statistics::kLoopHighest_hypothesis_value(), 0.0f)));
|
||||||
|
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kMemoryDistance_travelled(), uValue(stats.data(), rtabmap::Statistics::kMemoryDistance_travelled(), 0.0f)));
|
||||||
|
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kMemoryFast_movement(), uValue(stats.data(), rtabmap::Statistics::kMemoryFast_movement(), 0.0f)));
|
||||||
}
|
}
|
||||||
// else use last data
|
// else use last data
|
||||||
|
|
||||||
@@ -3185,8 +3325,17 @@ bool RTABMapApp::handleEvent(UEvent * event)
|
|||||||
int matches = (int)uValue(bufferedStatsData_, rtabmap::Statistics::kLoopVisual_matches(), 0.0f);
|
int matches = (int)uValue(bufferedStatsData_, rtabmap::Statistics::kLoopVisual_matches(), 0.0f);
|
||||||
int rejected = (int)uValue(bufferedStatsData_, rtabmap::Statistics::kLoopRejectedHypothesis(), 0.0f);
|
int rejected = (int)uValue(bufferedStatsData_, rtabmap::Statistics::kLoopRejectedHypothesis(), 0.0f);
|
||||||
float optimizationMaxError = uValue(bufferedStatsData_, rtabmap::Statistics::kLoopOptimization_max_error(), 0.0f);
|
float optimizationMaxError = uValue(bufferedStatsData_, rtabmap::Statistics::kLoopOptimization_max_error(), 0.0f);
|
||||||
|
float optimizationMaxErrorRatio = uValue(bufferedStatsData_, rtabmap::Statistics::kLoopOptimization_max_error_ratio(), 0.0f);
|
||||||
float rehearsalValue = uValue(bufferedStatsData_, rtabmap::Statistics::kMemoryRehearsal_sim(), 0.0f);
|
float rehearsalValue = uValue(bufferedStatsData_, rtabmap::Statistics::kMemoryRehearsal_sim(), 0.0f);
|
||||||
float hypothesis = uValue(bufferedStatsData_, rtabmap::Statistics::kLoopHighest_hypothesis_value(), 0.0f);
|
float hypothesis = uValue(bufferedStatsData_, rtabmap::Statistics::kLoopHighest_hypothesis_value(), 0.0f);
|
||||||
|
float distanceTravelled = uValue(bufferedStatsData_, rtabmap::Statistics::kMemoryDistance_travelled(), 0.0f);
|
||||||
|
int fastMovement = (int)uValue(bufferedStatsData_, rtabmap::Statistics::kMemoryFast_movement(), 0.0f);
|
||||||
|
rtabmap::Transform currentPose = main_scene_.GetCameraPose();
|
||||||
|
float x=0.0f,y=0.0f,z=0.0f,roll=0.0f,pitch=0.0f,yaw=0.0f;
|
||||||
|
if(!currentPose.isNull())
|
||||||
|
{
|
||||||
|
currentPose.getTranslationAndEulerAngles(x,y,z,roll,pitch,yaw);
|
||||||
|
}
|
||||||
|
|
||||||
// Call JAVA callback with some stats
|
// Call JAVA callback with some stats
|
||||||
UINFO("Send statistics to GUI");
|
UINFO("Send statistics to GUI");
|
||||||
@@ -3200,7 +3349,7 @@ bool RTABMapApp::handleEvent(UEvent * event)
|
|||||||
jclass clazz = env->GetObjectClass(RTABMapActivity);
|
jclass clazz = env->GetObjectClass(RTABMapActivity);
|
||||||
if(clazz)
|
if(clazz)
|
||||||
{
|
{
|
||||||
jmethodID methodID = env->GetMethodID(clazz, "updateStatsCallback", "(IIIIFIIIIIIIFIFIFF)V" );
|
jmethodID methodID = env->GetMethodID(clazz, "updateStatsCallback", "(IIIIFIIIIIIFIFIFFFFIFFFFFF)V" );
|
||||||
if(methodID)
|
if(methodID)
|
||||||
{
|
{
|
||||||
env->CallVoidMethod(RTABMapActivity, methodID,
|
env->CallVoidMethod(RTABMapActivity, methodID,
|
||||||
@@ -3211,7 +3360,6 @@ bool RTABMapApp::handleEvent(UEvent * event)
|
|||||||
updateTime,
|
updateTime,
|
||||||
loopClosureId,
|
loopClosureId,
|
||||||
highestHypId,
|
highestHypId,
|
||||||
(int)((processMemoryUsedBytes+processGPUMemoryUsedBytes)/(1024*1024)),
|
|
||||||
databaseMemoryUsed,
|
databaseMemoryUsed,
|
||||||
inliers,
|
inliers,
|
||||||
matches,
|
matches,
|
||||||
@@ -3221,7 +3369,16 @@ bool RTABMapApp::handleEvent(UEvent * event)
|
|||||||
renderingTime_>0.0f?1.0f/renderingTime_:0.0f,
|
renderingTime_>0.0f?1.0f/renderingTime_:0.0f,
|
||||||
rejected,
|
rejected,
|
||||||
rehearsalValue,
|
rehearsalValue,
|
||||||
optimizationMaxError);
|
optimizationMaxError,
|
||||||
|
optimizationMaxErrorRatio,
|
||||||
|
distanceTravelled,
|
||||||
|
fastMovement,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
z,
|
||||||
|
roll,
|
||||||
|
pitch,
|
||||||
|
yaw);
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ class RTABMapApp : public UEventsHandler {
|
|||||||
void setRenderingTextureDecimation(int value);
|
void setRenderingTextureDecimation(int value);
|
||||||
void setBackgroundColor(float gray);
|
void setBackgroundColor(float gray);
|
||||||
int setMappingParameter(const std::string & key, const std::string & value);
|
int setMappingParameter(const std::string & key, const std::string & value);
|
||||||
|
void setGPS(const rtabmap::GPS & gps);
|
||||||
|
|
||||||
void resetMapping();
|
void resetMapping();
|
||||||
void save(const std::string & databasePath);
|
void save(const std::string & databasePath);
|
||||||
@@ -227,26 +228,29 @@ class RTABMapApp : public UEventsHandler {
|
|||||||
int lastDrawnCloudsCount_;
|
int lastDrawnCloudsCount_;
|
||||||
float renderingTime_;
|
float renderingTime_;
|
||||||
double lastPostRenderEventTime_;
|
double lastPostRenderEventTime_;
|
||||||
long processMemoryUsedBytes;
|
double lastPoseEventTime_;
|
||||||
long processGPUMemoryUsedBytes;
|
|
||||||
std::map<std::string, float> bufferedStatsData_;
|
std::map<std::string, float> bufferedStatsData_;
|
||||||
|
|
||||||
bool visualizingMesh_;
|
bool visualizingMesh_;
|
||||||
bool exportedMeshUpdated_;
|
bool exportedMeshUpdated_;
|
||||||
pcl::TextureMesh::Ptr optMesh_;
|
pcl::TextureMesh::Ptr optMesh_;
|
||||||
cv::Mat optTexture_;
|
cv::Mat optTexture_;
|
||||||
|
int optRefId_;
|
||||||
|
rtabmap::Transform * optRefPose_; // App crashes when loading native library if not dynamic
|
||||||
|
|
||||||
// main_scene_ includes all drawable object for visualizing Tango device's
|
// main_scene_ includes all drawable object for visualizing Tango device's
|
||||||
// movement and point cloud.
|
// movement and point cloud.
|
||||||
Scene main_scene_;
|
Scene main_scene_;
|
||||||
|
|
||||||
std::list<rtabmap::RtabmapEvent*> rtabmapEvents_;
|
std::list<rtabmap::RtabmapEvent*> rtabmapEvents_;
|
||||||
|
std::list<rtabmap::RtabmapEvent*> visLocalizationEvents_;
|
||||||
std::list<rtabmap::OdometryEvent> odomEvents_;
|
std::list<rtabmap::OdometryEvent> odomEvents_;
|
||||||
std::list<rtabmap::Transform> poseEvents_;
|
std::list<rtabmap::Transform> poseEvents_;
|
||||||
|
|
||||||
rtabmap::Transform mapToOdom_;
|
rtabmap::Transform mapToOdom_;
|
||||||
|
|
||||||
boost::mutex rtabmapMutex_;
|
boost::mutex rtabmapMutex_;
|
||||||
|
boost::mutex visLocalizationMutex_;
|
||||||
boost::mutex meshesMutex_;
|
boost::mutex meshesMutex_;
|
||||||
boost::mutex odomMutex_;
|
boost::mutex odomMutex_;
|
||||||
boost::mutex poseMutex_;
|
boost::mutex poseMutex_;
|
||||||
|
|||||||
@@ -339,6 +339,24 @@ Java_com_introlab_rtabmap_RTABMapLib_setMappingParameter(
|
|||||||
return app.setMappingParameter(keyC, valueC);
|
return app.setMappingParameter(keyC, valueC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_com_introlab_rtabmap_RTABMapLib_setGPS(
|
||||||
|
JNIEnv*, jobject,
|
||||||
|
double stamp,
|
||||||
|
double longitude,
|
||||||
|
double latitude,
|
||||||
|
double altitude,
|
||||||
|
double accuracy,
|
||||||
|
double bearing)
|
||||||
|
{
|
||||||
|
return app.setGPS(rtabmap::GPS(stamp,
|
||||||
|
longitude,
|
||||||
|
latitude,
|
||||||
|
altitude,
|
||||||
|
accuracy,
|
||||||
|
bearing));
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
Java_com_introlab_rtabmap_RTABMapLib_resetMapping(
|
Java_com_introlab_rtabmap_RTABMapLib_resetMapping(
|
||||||
JNIEnv*, jobject)
|
JNIEnv*, jobject)
|
||||||
|
|||||||
@@ -96,9 +96,9 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="5dp"
|
android:layout_marginRight="5dp"
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_below="@+id/pause_button"
|
||||||
android:text="@string/share_to_sketchfab" />
|
android:text="@string/share_to_sketchfab" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -58,12 +58,12 @@
|
|||||||
android:entries="@array/pref_background_color_keys"
|
android:entries="@array/pref_background_color_keys"
|
||||||
android:entryValues="@array/pref_background_color_values"
|
android:entryValues="@array/pref_background_color_values"
|
||||||
android:defaultValue="@string/pref_default_background_color"/>
|
android:defaultValue="@string/pref_default_background_color"/>
|
||||||
<SwitchPreference
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
android:key="@string/pref_key_blending"
|
android:key="@string/pref_key_blending"
|
||||||
android:title="@string/pref_title_blending"
|
android:title="@string/pref_title_blending"
|
||||||
android:summary="@string/pref_summary_blending"
|
android:summary="@string/pref_summary_blending"
|
||||||
android:defaultValue="@string/pref_default_blending"/>
|
android:defaultValue="@string/pref_default_blending"/>
|
||||||
<SwitchPreference
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
android:key="@string/pref_key_nodes_filtering"
|
android:key="@string/pref_key_nodes_filtering"
|
||||||
android:title="@string/pref_title_nodes_filtering"
|
android:title="@string/pref_title_nodes_filtering"
|
||||||
android:summary="@string/pref_summary_nodes_filtering"
|
android:summary="@string/pref_summary_nodes_filtering"
|
||||||
@@ -79,22 +79,22 @@
|
|||||||
android:summary="@string/pref_summary_mapping"
|
android:summary="@string/pref_summary_mapping"
|
||||||
android:persistent="false">
|
android:persistent="false">
|
||||||
|
|
||||||
<SwitchPreference
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
android:key="@string/pref_key_append"
|
android:key="@string/pref_key_append"
|
||||||
android:title="@string/pref_title_append"
|
android:title="@string/pref_title_append"
|
||||||
android:summary="@string/pref_summary_append"
|
android:summary="@string/pref_summary_append"
|
||||||
android:defaultValue="@string/pref_default_append"/>
|
android:defaultValue="@string/pref_default_append"/>
|
||||||
<SwitchPreference
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
android:key="@string/pref_key_resolution"
|
android:key="@string/pref_key_resolution"
|
||||||
android:title="@string/pref_title_resolution"
|
android:title="@string/pref_title_resolution"
|
||||||
android:summary="@string/pref_summary_resolution"
|
android:summary="@string/pref_summary_resolution"
|
||||||
android:defaultValue="@string/pref_default_resolution"/>
|
android:defaultValue="@string/pref_default_resolution"/>
|
||||||
<SwitchPreference
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
android:key="@string/pref_key_smoothing"
|
android:key="@string/pref_key_smoothing"
|
||||||
android:title="@string/pref_title_smoothing"
|
android:title="@string/pref_title_smoothing"
|
||||||
android:summary="@string/pref_summary_smoothing"
|
android:summary="@string/pref_summary_smoothing"
|
||||||
android:defaultValue="@string/pref_default_smoothing"/>
|
android:defaultValue="@string/pref_default_smoothing"/>
|
||||||
<SwitchPreference
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
android:key="@string/pref_key_fisheye"
|
android:key="@string/pref_key_fisheye"
|
||||||
android:title="@string/pref_title_fisheye"
|
android:title="@string/pref_title_fisheye"
|
||||||
android:summary="@string/pref_summary_fisheye"
|
android:summary="@string/pref_summary_fisheye"
|
||||||
@@ -109,6 +109,13 @@
|
|||||||
android:entries="@array/pref_update_rate_keys"
|
android:entries="@array/pref_update_rate_keys"
|
||||||
android:entryValues="@array/pref_update_rate_values"
|
android:entryValues="@array/pref_update_rate_values"
|
||||||
android:defaultValue="@string/pref_default_update_rate"/>
|
android:defaultValue="@string/pref_default_update_rate"/>
|
||||||
|
<ListPreference
|
||||||
|
android:key="@string/pref_key_max_speed"
|
||||||
|
android:title="@string/pref_title_max_speed"
|
||||||
|
android:summary="@string/pref_summary_max_speed"
|
||||||
|
android:entries="@array/pref_max_speed_keys"
|
||||||
|
android:entryValues="@array/pref_max_speed_values"
|
||||||
|
android:defaultValue="@string/pref_default_max_speed"/>
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:key="@string/pref_key_time_thr"
|
android:key="@string/pref_key_time_thr"
|
||||||
android:title="@string/pref_title_time_thr"
|
android:title="@string/pref_title_time_thr"
|
||||||
@@ -179,7 +186,7 @@
|
|||||||
android:entries="@array/pref_optimizer_keys"
|
android:entries="@array/pref_optimizer_keys"
|
||||||
android:entryValues="@array/pref_optimizer_values"
|
android:entryValues="@array/pref_optimizer_values"
|
||||||
android:defaultValue="@string/pref_default_optimizer"/>
|
android:defaultValue="@string/pref_default_optimizer"/>
|
||||||
<SwitchPreference
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
android:key="@string/pref_key_optimize_end"
|
android:key="@string/pref_key_optimize_end"
|
||||||
android:title="@string/pref_title_optimize_end"
|
android:title="@string/pref_title_optimize_end"
|
||||||
android:summary="@string/pref_summary_optimize_end"
|
android:summary="@string/pref_summary_optimize_end"
|
||||||
@@ -187,17 +194,22 @@
|
|||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:title="@string/pref_title_mapping_database">
|
android:title="@string/pref_title_mapping_database">
|
||||||
<SwitchPreference
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
android:key="@string/pref_key_keep_all_db"
|
android:key="@string/pref_key_keep_all_db"
|
||||||
android:title="@string/pref_title_keep_all_db"
|
android:title="@string/pref_title_keep_all_db"
|
||||||
android:summary="@string/pref_summary_keep_all_db"
|
android:summary="@string/pref_summary_keep_all_db"
|
||||||
android:defaultValue="@string/pref_default_keep_all_db"/>
|
android:defaultValue="@string/pref_default_keep_all_db"/>
|
||||||
<SwitchPreference
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
android:key="@string/pref_key_raw_scan_saved"
|
android:key="@string/pref_key_raw_scan_saved"
|
||||||
android:title="@string/pref_title_raw_scan_saved"
|
android:title="@string/pref_title_raw_scan_saved"
|
||||||
android:summary="@string/pref_summary_raw_scan_saved"
|
android:summary="@string/pref_summary_raw_scan_saved"
|
||||||
android:defaultValue="@string/pref_default_raw_scan_saved"/>
|
android:defaultValue="@string/pref_default_raw_scan_saved"/>
|
||||||
<SwitchPreference
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
|
android:key="@string/pref_key_gps_saved"
|
||||||
|
android:title="@string/pref_title_gps_saved"
|
||||||
|
android:summary="@string/pref_summary_gps_saved"
|
||||||
|
android:defaultValue="@string/pref_default_gps_saved"/>
|
||||||
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
android:key="@string/pref_key_db_in_memory"
|
android:key="@string/pref_key_db_in_memory"
|
||||||
android:title="@string/pref_title_db_in_memory"
|
android:title="@string/pref_title_db_in_memory"
|
||||||
android:summary="@string/pref_summary_db_in_memory"
|
android:summary="@string/pref_summary_db_in_memory"
|
||||||
@@ -259,7 +271,7 @@
|
|||||||
android:entryValues="@array/pref_min_texture_cluster_size_values"
|
android:entryValues="@array/pref_min_texture_cluster_size_values"
|
||||||
android:defaultValue="@string/pref_default_min_texture_cluster_size"/>
|
android:defaultValue="@string/pref_default_min_texture_cluster_size"/>
|
||||||
|
|
||||||
<SwitchPreference
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
android:key="@string/pref_key_block_render"
|
android:key="@string/pref_key_block_render"
|
||||||
android:title="@string/pref_title_block_render"
|
android:title="@string/pref_title_block_render"
|
||||||
android:summary="@string/pref_summary_block_render"
|
android:summary="@string/pref_summary_block_render"
|
||||||
@@ -286,7 +298,7 @@
|
|||||||
android:entryValues="@array/pref_opt_color_radius_values"
|
android:entryValues="@array/pref_opt_color_radius_values"
|
||||||
android:defaultValue="@string/pref_default_opt_color_radius"/>
|
android:defaultValue="@string/pref_default_opt_color_radius"/>
|
||||||
|
|
||||||
<SwitchPreference
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
android:key="@string/pref_key_opt_clean_white"
|
android:key="@string/pref_key_opt_clean_white"
|
||||||
android:title="@string/pref_title_opt_clean_white"
|
android:title="@string/pref_title_opt_clean_white"
|
||||||
android:summary="@string/pref_summary_opt_clean_white"
|
android:summary="@string/pref_summary_opt_clean_white"
|
||||||
@@ -316,7 +328,7 @@
|
|||||||
android:entries="@array/pref_cluster_ratio_keys"
|
android:entries="@array/pref_cluster_ratio_keys"
|
||||||
android:entryValues="@array/pref_cluster_ratio_values"
|
android:entryValues="@array/pref_cluster_ratio_values"
|
||||||
android:defaultValue="@string/pref_default_cluster_ratio"/>
|
android:defaultValue="@string/pref_default_cluster_ratio"/>
|
||||||
<SwitchPreference
|
<com.introlab.rtabmap.CustomSwitchPreference
|
||||||
android:key="@string/pref_key_notification_sound"
|
android:key="@string/pref_key_notification_sound"
|
||||||
android:title="@string/pref_title_notification_sound"
|
android:title="@string/pref_title_notification_sound"
|
||||||
android:summary="@string/pref_summary_notification_sound"
|
android:summary="@string/pref_summary_notification_sound"
|
||||||
|
|||||||
@@ -34,6 +34,9 @@
|
|||||||
<string name="memory">"Used Memory (MB): "</string>
|
<string name="memory">"Used Memory (MB): "</string>
|
||||||
<string name="hypothesis">"Hypothesis (%): "</string>
|
<string name="hypothesis">"Hypothesis (%): "</string>
|
||||||
<string name="fps">"FPS (rendering): "</string>
|
<string name="fps">"FPS (rendering): "</string>
|
||||||
|
<string name="distance">"Distance travelled: "</string>
|
||||||
|
<string name="gps">"GPS (long,lat,alt,bearing,err): "</string>
|
||||||
|
<string name="time">"Time: "</string>
|
||||||
|
|
||||||
<!-- Preference keys: BEGIN -->
|
<!-- Preference keys: BEGIN -->
|
||||||
<string name="pref_key_tags">pref_key_tags</string>
|
<string name="pref_key_tags">pref_key_tags</string>
|
||||||
@@ -51,7 +54,7 @@
|
|||||||
<string name="pref_key_depth">pref_key_depth</string>
|
<string name="pref_key_depth">pref_key_depth</string>
|
||||||
<string name="pref_default_depth">2.5</string>
|
<string name="pref_default_depth">2.5</string>
|
||||||
<string name="pref_key_point_size">pref_key_point_size</string>
|
<string name="pref_key_point_size">pref_key_point_size</string>
|
||||||
<string name="pref_default_point_size">5</string>
|
<string name="pref_default_point_size">10</string>
|
||||||
<string name="pref_key_angle">pref_key_angle</string>
|
<string name="pref_key_angle">pref_key_angle</string>
|
||||||
<string name="pref_default_angle">20</string>
|
<string name="pref_default_angle">20</string>
|
||||||
<string name="pref_key_triangle">pref_key_triangle</string>
|
<string name="pref_key_triangle">pref_key_triangle</string>
|
||||||
@@ -75,6 +78,8 @@
|
|||||||
|
|
||||||
<string name="pref_key_update_rate">pref_key_update_rate</string>
|
<string name="pref_key_update_rate">pref_key_update_rate</string>
|
||||||
<string name="pref_default_update_rate">1</string>
|
<string name="pref_default_update_rate">1</string>
|
||||||
|
<string name="pref_key_max_speed">pref_key_max_speed</string>
|
||||||
|
<string name="pref_default_max_speed">0</string>
|
||||||
<string name="pref_key_time_thr">pref_key_time_thr</string>
|
<string name="pref_key_time_thr">pref_key_time_thr</string>
|
||||||
<string name="pref_default_time_thr">1000</string>
|
<string name="pref_default_time_thr">1000</string>
|
||||||
<string name="pref_key_mem_thr">pref_key_mem_thr</string>
|
<string name="pref_key_mem_thr">pref_key_mem_thr</string>
|
||||||
@@ -86,7 +91,7 @@
|
|||||||
<string name="pref_key_min_inliers">pref_key_min_inliers</string>
|
<string name="pref_key_min_inliers">pref_key_min_inliers</string>
|
||||||
<string name="pref_default_min_inliers">25</string>
|
<string name="pref_default_min_inliers">25</string>
|
||||||
<string name="pref_key_opt_error">pref_key_opt_error</string>
|
<string name="pref_key_opt_error">pref_key_opt_error</string>
|
||||||
<string name="pref_default_opt_error">0.1</string>
|
<string name="pref_default_opt_error">2</string>
|
||||||
<string name="pref_key_features_voc">pref_key_features_voc</string>
|
<string name="pref_key_features_voc">pref_key_features_voc</string>
|
||||||
<string name="pref_default_features_voc">200</string>
|
<string name="pref_default_features_voc">200</string>
|
||||||
<string name="pref_key_features">pref_key_features</string>
|
<string name="pref_key_features">pref_key_features</string>
|
||||||
@@ -101,8 +106,10 @@
|
|||||||
<string name="pref_default_keep_all_db">true</string>
|
<string name="pref_default_keep_all_db">true</string>
|
||||||
<string name="pref_key_raw_scan_saved">pref_key_raw_scan_saved</string>
|
<string name="pref_key_raw_scan_saved">pref_key_raw_scan_saved</string>
|
||||||
<string name="pref_default_raw_scan_saved">false</string>
|
<string name="pref_default_raw_scan_saved">false</string>
|
||||||
|
<string name="pref_key_gps_saved">pref_key_gps_saved</string>
|
||||||
|
<string name="pref_default_gps_saved">false</string>
|
||||||
<string name="pref_key_db_in_memory">pref_key_db_in_memory</string>
|
<string name="pref_key_db_in_memory">pref_key_db_in_memory</string>
|
||||||
<string name="pref_default_db_in_memory">true</string>
|
<string name="pref_default_db_in_memory">false</string>
|
||||||
|
|
||||||
<string name="pref_key_cloud_voxel">pref_key_cloud_voxel</string>
|
<string name="pref_key_cloud_voxel">pref_key_cloud_voxel</string>
|
||||||
<string name="pref_default_cloud_voxel">0.01</string>
|
<string name="pref_default_cloud_voxel">0.01</string>
|
||||||
@@ -313,6 +320,8 @@
|
|||||||
<string name="pref_summary_fisheye">Use fish eye camera instead of the color camera. May not work on some devices.</string>
|
<string name="pref_summary_fisheye">Use fish eye camera instead of the color camera. May not work on some devices.</string>
|
||||||
<string name="pref_title_update_rate">Update Rate</string>
|
<string name="pref_title_update_rate">Update Rate</string>
|
||||||
<string name="pref_summary_update_rate">Rate at which a new node is added to map.</string>
|
<string name="pref_summary_update_rate">Rate at which a new node is added to map.</string>
|
||||||
|
<string name="pref_title_max_speed">Maximum Motion Speed</string>
|
||||||
|
<string name="pref_summary_max_speed">Images taken when the camera is moving too fast are ignored to avoid blurry textures.</string>
|
||||||
<string name="pref_title_time_thr">Time Limit</string>
|
<string name="pref_title_time_thr">Time Limit</string>
|
||||||
<string name="pref_summary_time_thr">Maximum time allowed for map updates. If time to add a new node is above this theshold, some old parts of the map are temporarly forgotten to reduce time of next updates.</string>
|
<string name="pref_summary_time_thr">Maximum time allowed for map updates. If time to add a new node is above this theshold, some old parts of the map are temporarly forgotten to reduce time of next updates.</string>
|
||||||
<string name="pref_title_mem_thr">Memory Limit</string>
|
<string name="pref_title_mem_thr">Memory Limit</string>
|
||||||
@@ -324,7 +333,7 @@
|
|||||||
<string name="pref_title_min_inliers">Min Inliers</string>
|
<string name="pref_title_min_inliers">Min Inliers</string>
|
||||||
<string name="pref_summary_min_inliers">Minimum visual inliers to accept a loop closure.</string>
|
<string name="pref_summary_min_inliers">Minimum visual inliers to accept a loop closure.</string>
|
||||||
<string name="pref_title_opt_error">Max Optimization Error</string>
|
<string name="pref_title_opt_error">Max Optimization Error</string>
|
||||||
<string name="pref_summary_opt_error">Reject any loop closures causing error corrections in the map higher than this threshold.</string>
|
<string name="pref_summary_opt_error">Reject any loop closures causing error corrections in the map higher than this factor of the link\'s variance.</string>
|
||||||
<string name="pref_title_features_voc">Max Features Extracted (Vocabulary)</string>
|
<string name="pref_title_features_voc">Max Features Extracted (Vocabulary)</string>
|
||||||
<string name="pref_summary_features_voc">Extracting more features per image would result in better loop closure hypotheses but more processing time is required.</string>
|
<string name="pref_summary_features_voc">Extracting more features per image would result in better loop closure hypotheses but more processing time is required.</string>
|
||||||
<string name="pref_title_features">Max Features Extracted (Loop Closure)</string>
|
<string name="pref_title_features">Max Features Extracted (Loop Closure)</string>
|
||||||
@@ -339,6 +348,8 @@
|
|||||||
<string name="pref_summary_keep_all_db">Discarded frames while not moving are still saved in database. Useful to replay exactly the scanning on RTAB-Map Desktop.</string>
|
<string name="pref_summary_keep_all_db">Discarded frames while not moving are still saved in database. Useful to replay exactly the scanning on RTAB-Map Desktop.</string>
|
||||||
<string name="pref_title_raw_scan_saved">Save Raw Scan</string>
|
<string name="pref_title_raw_scan_saved">Save Raw Scan</string>
|
||||||
<string name="pref_summary_raw_scan_saved">Save raw point clouds in database.</string>
|
<string name="pref_summary_raw_scan_saved">Save raw point clouds in database.</string>
|
||||||
|
<string name="pref_title_gps_saved">Save GPS</string>
|
||||||
|
<string name="pref_summary_gps_saved">Save GPS in database.</string>
|
||||||
<string name="pref_title_db_in_memory">Database In Memory</string>
|
<string name="pref_title_db_in_memory">Database In Memory</string>
|
||||||
<string name="pref_summary_db_in_memory">The database is kept in RAM for fast access. Set to false to reduce RAM used at the cost of slower access. This parameter is applied on reset or when a database is opened.</string>
|
<string name="pref_summary_db_in_memory">The database is kept in RAM for fast access. Set to false to reduce RAM used at the cost of slower access. This parameter is applied on reset or when a database is opened.</string>
|
||||||
|
|
||||||
@@ -360,6 +371,20 @@
|
|||||||
<item>"1"</item>
|
<item>"1"</item>
|
||||||
<item>"0.5"</item>
|
<item>"0.5"</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
<string-array name="pref_max_speed_keys">
|
||||||
|
<item>"No Limit"</item>
|
||||||
|
<item>"High"</item>
|
||||||
|
<item>"Medium"</item>
|
||||||
|
<item>"Low"</item>
|
||||||
|
<item>"Very Low"</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="pref_max_speed_values">
|
||||||
|
<item>"0"</item>
|
||||||
|
<item>"0.4"</item>
|
||||||
|
<item>"0.3"</item>
|
||||||
|
<item>"0.2"</item>
|
||||||
|
<item>"0.1"</item>
|
||||||
|
</string-array>
|
||||||
<string-array name="pref_time_thr_keys">
|
<string-array name="pref_time_thr_keys">
|
||||||
<item>"No Limit"</item>
|
<item>"No Limit"</item>
|
||||||
<item>"1500 ms"</item>
|
<item>"1500 ms"</item>
|
||||||
@@ -469,25 +494,29 @@
|
|||||||
<item>"10"</item>
|
<item>"10"</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="pref_opt_error_keys">
|
<string-array name="pref_opt_error_keys">
|
||||||
<item>"1.0 m"</item>
|
<item>"10x"</item>
|
||||||
<item>"0.5 m"</item>
|
<item>"9x"</item>
|
||||||
<item>"0.35 m"</item>
|
<item>"8x"</item>
|
||||||
<item>"0.2 m"</item>
|
<item>"7x"</item>
|
||||||
<item>"0.1 m"</item>
|
<item>"6x"</item>
|
||||||
<item>"0.05 m"</item>
|
<item>"5x"</item>
|
||||||
<item>"0.025 m"</item>
|
<item>"4x"</item>
|
||||||
<item>"0.01 m"</item>
|
<item>"3x"</item>
|
||||||
|
<item>"2x"</item>
|
||||||
|
<item>"1x"</item>
|
||||||
<item>"Disabled"</item>
|
<item>"Disabled"</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="pref_opt_error_values">
|
<string-array name="pref_opt_error_values">
|
||||||
<item>"1.0"</item>
|
<item>"10"</item>
|
||||||
<item>"0.5"</item>
|
<item>"9"</item>
|
||||||
<item>"0.35"</item>
|
<item>"8"</item>
|
||||||
<item>"0.2"</item>
|
<item>"7"</item>
|
||||||
<item>"0.1"</item>
|
<item>"6"</item>
|
||||||
<item>"0.05"</item>
|
<item>"5"</item>
|
||||||
<item>"0.025"</item>
|
<item>"4"</item>
|
||||||
<item>"0.01"</item>
|
<item>"3"</item>
|
||||||
|
<item>"2"</item>
|
||||||
|
<item>"1"</item>
|
||||||
<item>"0"</item>
|
<item>"0"</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="pref_features_voc_keys">
|
<string-array name="pref_features_voc_keys">
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package com.introlab.rtabmap;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.preference.SwitchPreference;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Switch;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author mathieu
|
||||||
|
* Bug fix of switch preferences changing states
|
||||||
|
* when scrolling on Jelly Bean:
|
||||||
|
* https://issuetracker.google.com/issues/36941388#comment4
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CustomSwitchPreference extends SwitchPreference {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a new SwitchPreference with the given style options.
|
||||||
|
*
|
||||||
|
* @param context The Context that will style this preference
|
||||||
|
* @param attrs Style attributes that differ from the default
|
||||||
|
* @param defStyle Theme attribute defining the default style options
|
||||||
|
*/
|
||||||
|
public CustomSwitchPreference(Context context, AttributeSet attrs, int defStyle) {
|
||||||
|
super(context, attrs, defStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a new SwitchPreference with the given style options.
|
||||||
|
*
|
||||||
|
* @param context The Context that will style this preference
|
||||||
|
* @param attrs Style attributes that differ from the default
|
||||||
|
*/
|
||||||
|
public CustomSwitchPreference(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a new SwitchPreference with default style options.
|
||||||
|
*
|
||||||
|
* @param context The Context that will style this preference
|
||||||
|
*/
|
||||||
|
public CustomSwitchPreference(Context context) {
|
||||||
|
super(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onBindView(View view) {
|
||||||
|
// Clean listener before invoke SwitchPreference.onBindView
|
||||||
|
ViewGroup viewGroup= (ViewGroup)view;
|
||||||
|
clearListenerInViewGroup(viewGroup);
|
||||||
|
super.onBindView(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear listener in Switch for specify ViewGroup.
|
||||||
|
*
|
||||||
|
* @param viewGroup The ViewGroup that will need to clear the listener.
|
||||||
|
*/
|
||||||
|
private void clearListenerInViewGroup(ViewGroup viewGroup) {
|
||||||
|
if (null == viewGroup) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int count = viewGroup.getChildCount();
|
||||||
|
for(int n = 0; n < count; ++n) {
|
||||||
|
View childView = viewGroup.getChildAt(n);
|
||||||
|
if(childView instanceof Switch) {
|
||||||
|
final Switch switchView = (Switch) childView;
|
||||||
|
switchView.setOnCheckedChangeListener(null);
|
||||||
|
return;
|
||||||
|
} else if (childView instanceof ViewGroup){
|
||||||
|
ViewGroup childGroup = (ViewGroup)childView;
|
||||||
|
clearListenerInViewGroup(childGroup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -92,6 +92,13 @@ public class RTABMapLib
|
|||||||
public static native void setRenderingTextureDecimation(int value);
|
public static native void setRenderingTextureDecimation(int value);
|
||||||
public static native void setBackgroundColor(float gray);
|
public static native void setBackgroundColor(float gray);
|
||||||
public static native int setMappingParameter(String key, String value);
|
public static native int setMappingParameter(String key, String value);
|
||||||
|
public static native void setGPS(
|
||||||
|
double stamp,
|
||||||
|
double longitude,
|
||||||
|
double latitude,
|
||||||
|
double altitude,
|
||||||
|
double accuracy,
|
||||||
|
double bearing);
|
||||||
|
|
||||||
public static native void resetMapping();
|
public static native void resetMapping();
|
||||||
public static native void save(String outputDatabasePath);
|
public static native void save(String outputDatabasePath);
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ public class SettingsActivity extends PreferenceActivity implements OnSharedPref
|
|||||||
((Preference)findPreference(getString(R.string.pref_key_rendering_texture_decimation))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_rendering_texture_decimation))).getEntry() + ") "+getString(R.string.pref_summary_rendering_texture_decimation));
|
((Preference)findPreference(getString(R.string.pref_key_rendering_texture_decimation))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_rendering_texture_decimation))).getEntry() + ") "+getString(R.string.pref_summary_rendering_texture_decimation));
|
||||||
|
|
||||||
((Preference)findPreference(getString(R.string.pref_key_update_rate))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_update_rate))).getEntry() + ") "+getString(R.string.pref_summary_update_rate));
|
((Preference)findPreference(getString(R.string.pref_key_update_rate))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_update_rate))).getEntry() + ") "+getString(R.string.pref_summary_update_rate));
|
||||||
|
((Preference)findPreference(getString(R.string.pref_key_max_speed))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_max_speed))).getEntry() + ") "+getString(R.string.pref_summary_max_speed));
|
||||||
((Preference)findPreference(getString(R.string.pref_key_time_thr))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_time_thr))).getEntry() + ") "+getString(R.string.pref_summary_time_thr));
|
((Preference)findPreference(getString(R.string.pref_key_time_thr))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_time_thr))).getEntry() + ") "+getString(R.string.pref_summary_time_thr));
|
||||||
((Preference)findPreference(getString(R.string.pref_key_mem_thr))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_mem_thr))).getEntry() + ") "+getString(R.string.pref_summary_mem_thr));
|
((Preference)findPreference(getString(R.string.pref_key_mem_thr))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_mem_thr))).getEntry() + ") "+getString(R.string.pref_summary_mem_thr));
|
||||||
((Preference)findPreference(getString(R.string.pref_key_loop_thr))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_loop_thr))).getEntry() + ") "+getString(R.string.pref_summary_loop_thr));
|
((Preference)findPreference(getString(R.string.pref_key_loop_thr))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_loop_thr))).getEntry() + ") "+getString(R.string.pref_summary_loop_thr));
|
||||||
@@ -253,6 +254,7 @@ public class SettingsActivity extends PreferenceActivity implements OnSharedPref
|
|||||||
if(key.compareTo(getString(R.string.pref_key_rendering_texture_decimation))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_rendering_texture_decimation));
|
if(key.compareTo(getString(R.string.pref_key_rendering_texture_decimation))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_rendering_texture_decimation));
|
||||||
|
|
||||||
if(key.compareTo(getString(R.string.pref_key_update_rate))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_update_rate));
|
if(key.compareTo(getString(R.string.pref_key_update_rate))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_update_rate));
|
||||||
|
if(key.compareTo(getString(R.string.pref_key_max_speed))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_max_speed));
|
||||||
if(key.compareTo(getString(R.string.pref_key_time_thr))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_time_thr));
|
if(key.compareTo(getString(R.string.pref_key_time_thr))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_time_thr));
|
||||||
if(key.compareTo(getString(R.string.pref_key_mem_thr))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_mem_thr));
|
if(key.compareTo(getString(R.string.pref_key_mem_thr))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_mem_thr));
|
||||||
if(key.compareTo(getString(R.string.pref_key_loop_thr))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_loop_thr));
|
if(key.compareTo(getString(R.string.pref_key_loop_thr))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_loop_thr));
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ INSTALL(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" ${
|
|||||||
WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)")
|
WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)")
|
||||||
ENDIF(APPLE AND BUILD_AS_BUNDLE)
|
ENDIF(APPLE AND BUILD_AS_BUNDLE)
|
||||||
|
|
||||||
IF((APPLE AND BUILD_AS_BUNDLE) OR WIN32)
|
IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
||||||
SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
|
SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
|
||||||
SET(plugin_dest_dir bin)
|
SET(plugin_dest_dir bin)
|
||||||
SET(qtconf_dest_dir bin)
|
SET(qtconf_dest_dir bin)
|
||||||
@@ -189,5 +189,5 @@ IF((APPLE AND BUILD_AS_BUNDLE) OR WIN32)
|
|||||||
include(\"BundleUtilities\")
|
include(\"BundleUtilities\")
|
||||||
fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
|
fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
|
||||||
" COMPONENT runtime)
|
" COMPONENT runtime)
|
||||||
ENDIF((APPLE AND BUILD_AS_BUNDLE) OR WIN32)
|
ENDIF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
}
|
}
|
||||||
virtual ~ObjDeletionHandler() {}
|
virtual ~ObjDeletionHandler() {}
|
||||||
|
|
||||||
signals:
|
Q_SIGNALS:
|
||||||
void objDeletionEventReceived(int);
|
void objDeletionEventReceived(int);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -55,7 +55,7 @@ protected:
|
|||||||
if(event->getClassName().compare("UObjDeletedEvent") == 0 &&
|
if(event->getClassName().compare("UObjDeletedEvent") == 0 &&
|
||||||
event->getCode() == _watchedId)
|
event->getCode() == _watchedId)
|
||||||
{
|
{
|
||||||
emit objDeletionEventReceived(_watchedId);
|
Q_EMIT objDeletionEventReceived(_watchedId);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -49,7 +49,7 @@ int main(int argc, char* argv[])
|
|||||||
QApplication * app = new QApplication(argc, argv);
|
QApplication * app = new QApplication(argc, argv);
|
||||||
app->setStyleSheet("QMessageBox { messagebox-text-interaction-flags: 5; }"); // selectable message box
|
app->setStyleSheet("QMessageBox { messagebox-text-interaction-flags: 5; }"); // selectable message box
|
||||||
|
|
||||||
ParametersMap parameters = Parameters::parseArguments(argc, argv, true);
|
ParametersMap parameters = Parameters::parseArguments(argc, argv, false);
|
||||||
MainWindow * mainWindow = new MainWindow();
|
MainWindow * mainWindow = new MainWindow();
|
||||||
app->installEventFilter(mainWindow); // to catch FileOpen events.
|
app->installEventFilter(mainWindow); // to catch FileOpen events.
|
||||||
|
|
||||||
@@ -85,9 +85,9 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
if(!database.empty())
|
if(!database.empty())
|
||||||
{
|
{
|
||||||
mainWindow->openDatabase(database.c_str());
|
mainWindow->openDatabase(database.c_str(), parameters);
|
||||||
}
|
}
|
||||||
if(parameters.size())
|
else if(parameters.size())
|
||||||
{
|
{
|
||||||
mainWindow->updateParameters(parameters);
|
mainWindow->updateParameters(parameters);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ set(Triclops_LIBDIR $ENV{Triclops_ROOT_DIR}/lib)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
#FlyCapture2 SDK
|
#FlyCapture2 SDK
|
||||||
find_path(FlyCapture2_INCLUDE_DIR NAMES FlyCapture2.h PATHS $ENV{FlyCapture2_ROOT_DIR}/include)
|
find_path(FlyCapture2_INCLUDE_DIR NAMES FlyCapture2.h PATHS $ENV{FlyCapture2_ROOT_DIR}/include $ENV{FlyCapture2_ROOT_DIR}/include/flycapture)
|
||||||
find_library(FlyCapture2_LIBRARY NAMES FlyCapture2_v100 FlyCapture2 flycapture2 NO_DEFAULT_PATH PATHS ${FlyCapture2_LIBDIR})
|
find_library(FlyCapture2_LIBRARY NAMES FlyCapture2_v100 FlyCapture2 flycapture2 flycapture NO_DEFAULT_PATH PATHS ${FlyCapture2_LIBDIR})
|
||||||
|
|
||||||
# Triclops SDK
|
# Triclops SDK
|
||||||
find_path(Triclops_INCLUDE_DIR NAMES triclops.h PATHS $ENV{Triclops_ROOT_DIR}/include)
|
find_path(Triclops_INCLUDE_DIR NAMES triclops.h PATHS $ENV{Triclops_ROOT_DIR}/include $ENV{Triclops_ROOT_DIR}/include/triclops)
|
||||||
find_library(Triclops_LIBRARY NAMES triclops triclops_v100 NO_DEFAULT_PATH PATHS ${Triclops_LIBDIR})
|
find_library(Triclops_LIBRARY NAMES triclops triclops_v100 libtriclops.so.3 NO_DEFAULT_PATH PATHS ${Triclops_LIBDIR})
|
||||||
find_library(FlyCaptureBridge_LIBRARY NAMES flycapture2bridge flycapture2bridge_v100 NO_DEFAULT_PATH PATHS ${Triclops_LIBDIR})
|
find_library(FlyCaptureBridge_LIBRARY NAMES flycapture2bridge flycapture2bridge_v100 libflycapture2bridge.so.3 NO_DEFAULT_PATH PATHS ${Triclops_LIBDIR})
|
||||||
find_library(pnmutils_LIBRARY NAMES pnmutils pnmutils_v100 NO_DEFAULT_PATH PATHS ${Triclops_LIBDIR})
|
find_library(pnmutils_LIBRARY NAMES pnmutils pnmutils_v100 NO_DEFAULT_PATH PATHS ${Triclops_LIBDIR})
|
||||||
|
|
||||||
IF (FlyCapture2_INCLUDE_DIR AND Triclops_INCLUDE_DIR AND FlyCapture2_LIBRARY AND Triclops_LIBRARY AND FlyCaptureBridge_LIBRARY AND pnmutils_LIBRARY)
|
IF (FlyCapture2_INCLUDE_DIR AND Triclops_INCLUDE_DIR AND FlyCapture2_LIBRARY AND Triclops_LIBRARY AND FlyCaptureBridge_LIBRARY AND pnmutils_LIBRARY)
|
||||||
|
|||||||
@@ -17,6 +17,14 @@ FIND_LIBRARY(CHOLMOD_LIB cholmod)
|
|||||||
FIND_PATH(G2O_INCLUDE_DIR g2o/core/base_vertex.h
|
FIND_PATH(G2O_INCLUDE_DIR g2o/core/base_vertex.h
|
||||||
PATHS "C:\\Program Files\\g2o\\include")
|
PATHS "C:\\Program Files\\g2o\\include")
|
||||||
|
|
||||||
|
FIND_FILE(G2O_CONFIG_FILE g2o/config.h
|
||||||
|
PATHS ${G2O_INCLUDE_DIR}
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
|
||||||
|
#ifdef G2O_NUMBER_FORMAT_STR
|
||||||
|
#define G2O_CPP11 // we assume that if G2O_NUMBER_FORMAT_STR is defined, this is the new g2o code with c++11 interface
|
||||||
|
#endif
|
||||||
|
|
||||||
# Macro to unify finding both the debug and release versions of the
|
# Macro to unify finding both the debug and release versions of the
|
||||||
# libraries; this is adapted from the rtabmap config
|
# libraries; this is adapted from the rtabmap config
|
||||||
|
|
||||||
@@ -75,7 +83,7 @@ ENDIF(G2O_SOLVER_CHOLMOD OR G2O_SOLVER_CSPARSE OR G2O_SOLVER_DENSE OR G2O_SOLVER
|
|||||||
|
|
||||||
# G2O itself declared found if we found the core libraries and at least one solver
|
# G2O itself declared found if we found the core libraries and at least one solver
|
||||||
SET(G2O_FOUND "NO")
|
SET(G2O_FOUND "NO")
|
||||||
IF(G2O_STUFF_LIBRARY AND G2O_CORE_LIBRARY AND G2O_INCLUDE_DIR AND G2O_SOLVERS_FOUND)
|
IF(G2O_STUFF_LIBRARY AND G2O_CORE_LIBRARY AND G2O_INCLUDE_DIR AND G2O_CONFIG_FILE AND G2O_SOLVERS_FOUND)
|
||||||
SET(G2O_INCLUDE_DIRS ${G2O_INCLUDE_DIR})
|
SET(G2O_INCLUDE_DIRS ${G2O_INCLUDE_DIR})
|
||||||
SET(G2O_LIBRARIES
|
SET(G2O_LIBRARIES
|
||||||
${G2O_CORE_LIBRARY}
|
${G2O_CORE_LIBRARY}
|
||||||
@@ -105,5 +113,15 @@ IF(G2O_STUFF_LIBRARY AND G2O_CORE_LIBRARY AND G2O_INCLUDE_DIR AND G2O_SOLVERS_FO
|
|||||||
${CHOLMOD_LIB})
|
${CHOLMOD_LIB})
|
||||||
ENDIF(G2O_SOLVER_CHOLMOD)
|
ENDIF(G2O_SOLVER_CHOLMOD)
|
||||||
|
|
||||||
|
FILE(READ ${G2O_CONFIG_FILE} TMPTXT)
|
||||||
|
STRING(FIND "${TMPTXT}" "G2O_NUMBER_FORMAT_STR" matchres)
|
||||||
|
IF(${matchres} EQUAL -1)
|
||||||
|
MESSAGE(STATUS "Old g2o version detected with c++03 interface (config file: ${G2O_CONFIG_FILE}).")
|
||||||
|
SET(G2O_CPP11 0)
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(WARNING "Latest g2o version detected with c++11 interface (config file: ${G2O_CONFIG_FILE}). Make sure g2o is built with \"-DBUILD_WITH_MARCH_NATIVE=OFF\" to avoid segmentation faults caused by Eigen.")
|
||||||
|
SET(G2O_CPP11 1)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
SET(G2O_FOUND "YES")
|
SET(G2O_FOUND "YES")
|
||||||
ENDIF(G2O_STUFF_LIBRARY AND G2O_CORE_LIBRARY AND G2O_INCLUDE_DIR AND G2O_SOLVERS_FOUND)
|
ENDIF(G2O_STUFF_LIBRARY AND G2O_CORE_LIBRARY AND G2O_INCLUDE_DIR AND G2O_CONFIG_FILE AND G2O_SOLVERS_FOUND)
|
||||||
|
|||||||
@@ -0,0 +1,183 @@
|
|||||||
|
#.rst:
|
||||||
|
# FindKinectSDK2
|
||||||
|
# --------------
|
||||||
|
#
|
||||||
|
# Find Kinect for Windows SDK v2 (Kinect SDK v2) include dirs, library dirs, libraries
|
||||||
|
#
|
||||||
|
# Use this module by invoking find_package with the form::
|
||||||
|
#
|
||||||
|
# find_package( KinectSDK2 [REQUIRED] )
|
||||||
|
#
|
||||||
|
# Results for users are reported in following variables::
|
||||||
|
#
|
||||||
|
# KinectSDK2_FOUND - Return "TRUE" when Kinect SDK v2 found. Otherwise, Return "FALSE".
|
||||||
|
# KinectSDK2_INCLUDE_DIRS - Kinect SDK v2 include directories. (${KinectSDK2_DIR}/inc)
|
||||||
|
# KinectSDK2_LIBRARY_DIRS - Kinect SDK v2 library directories. (${KinectSDK2_DIR}/Lib/x86 or ${KinectSDK2_DIR}/Lib/x64)
|
||||||
|
# KinectSDK2_LIBRARIES - Kinect SDK v2 library files. (${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib (If check the box of any application festures, corresponding library will be added.))
|
||||||
|
# KinectSDK2_COMMANDS - Copy commands of redist files for application functions of Kinect SDK v2. (If uncheck the box of all application features, this variable has defined empty command.)
|
||||||
|
#
|
||||||
|
# This module reads hints about search locations from following environment variables::
|
||||||
|
#
|
||||||
|
# KINECTSDK20_DIR - Kinect SDK v2 root directory. (This environment variable has been set by installer of Kinect SDK v2.)
|
||||||
|
#
|
||||||
|
# CMake entries::
|
||||||
|
#
|
||||||
|
# KinectSDK2_DIR - Kinect SDK v2 root directory. (Default $ENV{KINECTSDK20_DIR})
|
||||||
|
# KinectSDK2_FACE - Check the box when using Face or HDFace features. (Default uncheck)
|
||||||
|
# KinectSDK2_FUSION - Check the box when using Fusion features. (Default uncheck)
|
||||||
|
# KinectSDK2_VGB - Check the box when using Visual Gesture Builder features. (Default uncheck)
|
||||||
|
#
|
||||||
|
# Example to find Kinect SDK v2::
|
||||||
|
#
|
||||||
|
# cmake_minimum_required( VERSION 2.8 )
|
||||||
|
#
|
||||||
|
# project( project )
|
||||||
|
# add_executable( project main.cpp )
|
||||||
|
# set_property( DIRECTORY PROPERTY VS_STARTUP_PROJECT "project" )
|
||||||
|
#
|
||||||
|
# # Find package using this module.
|
||||||
|
# find_package( KinectSDK2 REQUIRED )
|
||||||
|
#
|
||||||
|
# if(KinectSDK2_FOUND)
|
||||||
|
# # [C/C++]>[General]>[Additional Include Directories]
|
||||||
|
# include_directories( ${KinectSDK2_INCLUDE_DIRS} )
|
||||||
|
#
|
||||||
|
# # [Linker]>[General]>[Additional Library Directories]
|
||||||
|
# link_directories( ${KinectSDK2_LIBRARY_DIRS} )
|
||||||
|
#
|
||||||
|
# # [Linker]>[Input]>[Additional Dependencies]
|
||||||
|
# target_link_libraries( project ${KinectSDK2_LIBRARIES} )
|
||||||
|
#
|
||||||
|
# # [Build Events]>[Post-Build Event]>[Command Line]
|
||||||
|
# add_custom_command( TARGET project POST_BUILD ${KinectSDK2_COMMANDS} )
|
||||||
|
# endif()
|
||||||
|
#
|
||||||
|
# =============================================================================
|
||||||
|
#
|
||||||
|
# Copyright (c) 2016 Tsukasa SUGIURA
|
||||||
|
# Distributed under the MIT License.
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
#
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
##### Utility #####
|
||||||
|
|
||||||
|
# Check Directory Macro
|
||||||
|
macro(CHECK_DIR _DIR)
|
||||||
|
if(NOT EXISTS "${${_DIR}}")
|
||||||
|
message(WARNING "Directory \"${${_DIR}}\" not found.")
|
||||||
|
set(KinectSDK2_FOUND FALSE)
|
||||||
|
unset(_DIR)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# Check Files Macro
|
||||||
|
macro(CHECK_FILES _FILES _DIR)
|
||||||
|
set(_MISSING_FILES)
|
||||||
|
foreach(_FILE ${${_FILES}})
|
||||||
|
if(NOT EXISTS "${_FILE}")
|
||||||
|
get_filename_component(_FILE ${_FILE} NAME)
|
||||||
|
set(_MISSING_FILES "${_MISSING_FILES}${_FILE}, ")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
if(_MISSING_FILES)
|
||||||
|
message(WARNING "In directory \"${${_DIR}}\" not found files: ${_MISSING_FILES}")
|
||||||
|
set(KinectSDK2_FOUND FALSE)
|
||||||
|
unset(_FILES)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# Target Platform
|
||||||
|
set(TARGET_PLATFORM)
|
||||||
|
if(NOT CMAKE_CL_64)
|
||||||
|
set(TARGET_PLATFORM x86)
|
||||||
|
else()
|
||||||
|
set(TARGET_PLATFORM x64)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
##### Find Kinect SDK v2 #####
|
||||||
|
|
||||||
|
# Found
|
||||||
|
set(KinectSDK2_FOUND TRUE)
|
||||||
|
if(MSVC_VERSION LESS 1700)
|
||||||
|
message(WARNING "Kinect for Windows SDK v2 supported Visual Studio 2012 or later.")
|
||||||
|
set(KinectSDK2_FOUND FALSE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Options
|
||||||
|
option(KinectSDK2_FACE "Face and HDFace features" FALSE)
|
||||||
|
option(KinectSDK2_FUSION "Fusion features" FALSE)
|
||||||
|
option(KinectSDK2_VGB "Visual Gesture Builder features" FALSE)
|
||||||
|
|
||||||
|
# Root Directoty
|
||||||
|
set(KinectSDK2_DIR)
|
||||||
|
if(KinectSDK2_FOUND)
|
||||||
|
set(KinectSDK2_DIR $ENV{KINECTSDK20_DIR} CACHE PATH "Kinect for Windows SDK v2 Install Path." FORCE)
|
||||||
|
check_dir(KinectSDK2_DIR)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Include Directories
|
||||||
|
set(KinectSDK2_INCLUDE_DIRS)
|
||||||
|
if(KinectSDK2_FOUND)
|
||||||
|
set(KinectSDK2_INCLUDE_DIRS ${KinectSDK2_DIR}/inc)
|
||||||
|
check_dir(KinectSDK2_INCLUDE_DIRS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Library Directories
|
||||||
|
set(KinectSDK2_LIBRARY_DIRS)
|
||||||
|
if(KinectSDK2_FOUND)
|
||||||
|
set(KinectSDK2_LIBRARY_DIRS ${KinectSDK2_DIR}/Lib/${TARGET_PLATFORM})
|
||||||
|
check_dir(KinectSDK2_LIBRARY_DIRS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
set(KinectSDK2_LIBRARIES)
|
||||||
|
if(KinectSDK2_FOUND)
|
||||||
|
set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARY_DIRS}/Kinect20.lib)
|
||||||
|
|
||||||
|
if(KinectSDK2_FACE)
|
||||||
|
set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Face.lib)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(KinectSDK2_FUSION)
|
||||||
|
set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.Fusion.lib)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(KinectSDK2_VGB)
|
||||||
|
set(KinectSDK2_LIBRARIES ${KinectSDK2_LIBRARIES};${KinectSDK2_LIBRARY_DIRS}/Kinect20.VisualGestureBuilder.lib)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
check_files(KinectSDK2_LIBRARIES KinectSDK2_LIBRARY_DIRS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Custom Commands
|
||||||
|
set(KinectSDK2_COMMANDS)
|
||||||
|
if(KinectSDK2_FOUND)
|
||||||
|
if(KinectSDK2_FACE)
|
||||||
|
set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Face/${TARGET_PLATFORM})
|
||||||
|
check_dir(KinectSDK2_REDIST_DIR)
|
||||||
|
list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(KinectSDK2_FUSION)
|
||||||
|
set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/Fusion/${TARGET_PLATFORM})
|
||||||
|
check_dir(KinectSDK2_REDIST_DIR)
|
||||||
|
list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(KinectSDK2_VGB)
|
||||||
|
set(KinectSDK2_REDIST_DIR ${KinectSDK2_DIR}/Redist/VGB/${TARGET_PLATFORM})
|
||||||
|
check_dir(KinectSDK2_REDIST_DIR)
|
||||||
|
list(APPEND KinectSDK2_COMMANDS COMMAND xcopy "${KinectSDK2_REDIST_DIR}" "$(OutDir)" /e /y /i /r > NUL)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Empty Commands
|
||||||
|
if(NOT KinectSDK2_COMMANDS)
|
||||||
|
set(KinectSDK2_COMMANDS COMMAND)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "KinectSDK2_FOUND : ${KinectSDK2_FOUND}")
|
||||||
@@ -9,13 +9,15 @@
|
|||||||
|
|
||||||
find_path(ORB_SLAM2_INCLUDE_DIR NAMES System.h PATHS $ENV{ORB_SLAM2_ROOT_DIR}/include)
|
find_path(ORB_SLAM2_INCLUDE_DIR NAMES System.h PATHS $ENV{ORB_SLAM2_ROOT_DIR}/include)
|
||||||
find_library(ORB_SLAM2_LIBRARY NAMES ORB_SLAM2 PATHS $ENV{ORB_SLAM2_ROOT_DIR}/lib)
|
find_library(ORB_SLAM2_LIBRARY NAMES ORB_SLAM2 PATHS $ENV{ORB_SLAM2_ROOT_DIR}/lib)
|
||||||
find_library(g2o_LIBRARY NAMES g2o PATHS $ENV{ORB_SLAM2_ROOT_DIR}/Thirdparty/g2o/lib)
|
find_path(g2o_INCLUDE_DIR NAMES g2o/core/sparse_optimizer.h PATHS $ENV{ORB_SLAM2_ROOT_DIR}/Thirdparty/g2o NO_DEFAULT_PATH)
|
||||||
|
find_library(g2o_LIBRARY NAMES g2o PATHS $ENV{ORB_SLAM2_ROOT_DIR}/Thirdparty/g2o/lib NO_DEFAULT_PATH)
|
||||||
|
find_library(DBoW2_LIBRARY NAMES DBoW2 PATHS $ENV{ORB_SLAM2_ROOT_DIR}/Thirdparty/DBoW2/lib NO_DEFAULT_PATH)
|
||||||
|
|
||||||
IF (ORB_SLAM2_INCLUDE_DIR AND ORB_SLAM2_LIBRARY AND g2o_LIBRARY)
|
IF (ORB_SLAM2_INCLUDE_DIR AND ORB_SLAM2_LIBRARY AND DBoW2_LIBRARY AND g2o_INCLUDE_DIR AND g2o_LIBRARY)
|
||||||
SET(ORB_SLAM2_FOUND TRUE)
|
SET(ORB_SLAM2_FOUND TRUE)
|
||||||
SET(ORB_SLAM2_INCLUDE_DIRS ${ORB_SLAM2_INCLUDE_DIR} $ENV{ORB_SLAM2_ROOT_DIR})
|
SET(ORB_SLAM2_INCLUDE_DIRS ${ORB_SLAM2_INCLUDE_DIR} ${g2o_INCLUDE_DIR} $ENV{ORB_SLAM2_ROOT_DIR})
|
||||||
SET(ORB_SLAM2_LIBRARIES ${g2o_LIBRARY} ${ORB_SLAM2_LIBRARY})
|
SET(ORB_SLAM2_LIBRARIES ${g2o_LIBRARY} ${ORB_SLAM2_LIBRARY} ${DBoW2_LIBRARY})
|
||||||
ENDIF (ORB_SLAM2_INCLUDE_DIR AND ORB_SLAM2_LIBRARY AND g2o_LIBRARY)
|
ENDIF (ORB_SLAM2_INCLUDE_DIR AND ORB_SLAM2_LIBRARY AND DBoW2_LIBRARY AND g2o_INCLUDE_DIR AND g2o_LIBRARY)
|
||||||
|
|
||||||
IF (ORB_SLAM2_FOUND)
|
IF (ORB_SLAM2_FOUND)
|
||||||
# show which ORB_SLAM2 was found only if not quiet
|
# show which ORB_SLAM2 was found only if not quiet
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
# - Find librealsense (https://github.com/IntelRealSense/librealsense)
|
||||||
|
#
|
||||||
|
# RealSense2_ROOT_DIR environment variable can be set to find the library.
|
||||||
|
#
|
||||||
|
# It sets the following variables:
|
||||||
|
# RealSense2_FOUND - Set to false, or undefined, if RealSense2 isn't found.
|
||||||
|
# RealSense2_INCLUDE_DIRS - The RealSense2 include directory.
|
||||||
|
# RealSense2_LIBRARIES - The RealSense2 library to link against.
|
||||||
|
|
||||||
|
#RealSense library
|
||||||
|
|
||||||
|
find_path(RealSense2_INCLUDE_DIRS NAMES librealsense2/rs.hpp PATHS $ENV{RealSense2_ROOT_DIR}/include)
|
||||||
|
if(CMAKE_CL_64)
|
||||||
|
find_library(RealSense2_LIBRARY NAMES realsense2 PATHS $ENV{RealSense2_ROOT_DIR}/lib $ENV{RealSense2_ROOT_DIR}/lib/x64 $ENV{RealSense2_ROOT_DIR}/bin $ENV{RealSense2_ROOT_DIR}/bin/x64)
|
||||||
|
else()
|
||||||
|
find_library(RealSense2_LIBRARY NAMES realsense2 PATHS $ENV{RealSense2_ROOT_DIR}/lib $ENV{RealSense2_ROOT_DIR}/lib/x86 $ENV{RealSense2_ROOT_DIR}/bin $ENV{RealSense2_ROOT_DIR}/bin/x86)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
IF (RealSense2_INCLUDE_DIRS AND RealSense2_LIBRARY)
|
||||||
|
SET(RealSense2_FOUND TRUE)
|
||||||
|
ENDIF (RealSense2_INCLUDE_DIRS AND RealSense2_LIBRARY)
|
||||||
|
|
||||||
|
IF (RealSense2_FOUND)
|
||||||
|
SET(RealSense2_LIBRARIES ${RealSense2_LIBRARY})
|
||||||
|
|
||||||
|
# Compatibility with linux names
|
||||||
|
SET(realsense2_LIBRARIES ${RealSense2_LIBRARIES})
|
||||||
|
SET(realsense2_INCLUDE_DIRS ${RealSense2_INCLUDE_DIRS})
|
||||||
|
SET(realsense2_FOUND ${RealSense2_FOUND})
|
||||||
|
|
||||||
|
# show which RealSense was found only if not quiet
|
||||||
|
IF (NOT RealSense2_FIND_QUIETLY)
|
||||||
|
MESSAGE(STATUS "Found RealSense: ${RealSense2_LIBRARIES}")
|
||||||
|
ENDIF (NOT RealSense2_FIND_QUIETLY)
|
||||||
|
ELSE (RealSense2_FOUND)
|
||||||
|
# fatal error if RealSense is required but not found
|
||||||
|
IF (RealSense2_FIND_REQUIRED)
|
||||||
|
MESSAGE(FATAL_ERROR "Could not find RealSense2 (librealsense2)")
|
||||||
|
ENDIF (RealSense2_FIND_REQUIRED)
|
||||||
|
ENDIF (RealSense2_FOUND)
|
||||||
|
|
||||||
@@ -2,46 +2,29 @@
|
|||||||
# This module finds an installed Sqlite3 package.
|
# This module finds an installed Sqlite3 package.
|
||||||
#
|
#
|
||||||
# It sets the following variables:
|
# It sets the following variables:
|
||||||
# SQLITE3_FOUND - Set to false, or undefined, if Sqlite3 isn't found.
|
# Sqlite3_FOUND - Set to false, or undefined, if Sqlite3 isn't found.
|
||||||
# SQLITE3_INCLUDE_DIR - The Sqlite3 include directory.
|
# Sqlite3_INCLUDE_DIR - The Sqlite3 include directory.
|
||||||
# SQLITE3_LIBRARY - The Sqlite3 library to link against.
|
# Sqlite3_LIBRARY - The Sqlite3 library to link against.
|
||||||
|
|
||||||
SET(SQLITE3_VERSION_REQUIRED "3.6.0")
|
FIND_PATH(Sqlite3_INCLUDE_DIR sqlite3.h PATHS $ENV{Sqlite3_ROOT_DIR}/include $ENV{Sqlite3_ROOT_DIR})
|
||||||
|
|
||||||
IF(UNIX)
|
FIND_LIBRARY(Sqlite3_LIBRARY NAMES sqlite3 PATHS $ENV{Sqlite3_ROOT_DIR}/lib $ENV{Sqlite3_ROOT_DIR})
|
||||||
FIND_PROGRAM(SQLITE3_EXEC NAME sqlite3 PATHS)
|
|
||||||
IF(SQLITE3_EXEC)
|
|
||||||
MESSAGE(STATUS "Found Sqlite3 executable : ${SQLITE3_EXEC}")
|
|
||||||
EXECUTE_PROCESS(COMMAND ${SQLITE3_EXEC} --version
|
|
||||||
OUTPUT_VARIABLE SQLITE3_VERSION
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
WORKING_DIRECTORY "./"
|
|
||||||
)
|
|
||||||
IF(SQLITE3_VERSION VERSION_LESS SQLITE3_VERSION_REQUIRED)
|
|
||||||
MESSAGE(FATAL_ERROR "Sqlite ${SQLITE3_VERSION} found, but version ${SQLITE3_VERSION_REQUIRED} minimum is required")
|
|
||||||
ENDIF(SQLITE3_VERSION VERSION_LESS SQLITE3_VERSION_REQUIRED)
|
|
||||||
ELSE(SQLITE3_EXEC)
|
|
||||||
MESSAGE(FATAL_ERROR "Could not find Sqlite3 executable")
|
|
||||||
ENDIF(SQLITE3_EXEC)
|
|
||||||
ENDIF(UNIX)
|
|
||||||
|
|
||||||
FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h)
|
IF (Sqlite3_INCLUDE_DIR AND Sqlite3_LIBRARY)
|
||||||
|
SET(Sqlite3_FOUND TRUE)
|
||||||
|
SET(Sqlite3_INCLUDE_DIRS ${Sqlite3_INCLUDE_DIR})
|
||||||
|
SET(Sqlite3_LIBRARIES ${Sqlite3_LIBRARY})
|
||||||
|
ENDIF (Sqlite3_INCLUDE_DIR AND Sqlite3_LIBRARY)
|
||||||
|
|
||||||
FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3.dll sqlite3)
|
IF (Sqlite3_FOUND)
|
||||||
|
|
||||||
IF (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
|
|
||||||
SET(SQLITE3_FOUND TRUE)
|
|
||||||
ENDIF (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
|
|
||||||
|
|
||||||
IF (SQLITE3_FOUND)
|
|
||||||
# show which Sqlite3 was found only if not quiet
|
# show which Sqlite3 was found only if not quiet
|
||||||
IF (NOT Sqlite3_FIND_QUIETLY)
|
IF (NOT Sqlite3_FIND_QUIETLY)
|
||||||
MESSAGE(STATUS "Found Sqlite3")
|
MESSAGE(STATUS "Found Sqlite3: ${Sqlite3_INCLUDE_DIRS} ${Sqlite3_LIBRARIES}")
|
||||||
ENDIF (NOT Sqlite3_FIND_QUIETLY)
|
ENDIF (NOT Sqlite3_FIND_QUIETLY)
|
||||||
ELSE (SQLITE3_FOUND)
|
ELSE (Sqlite3_FOUND)
|
||||||
# fatal error if Sqlite3 is required but not found
|
# fatal error if Sqlite3 is required but not found
|
||||||
IF (Sqlite3_FIND_REQUIRED)
|
IF (Sqlite3_FIND_REQUIRED)
|
||||||
MESSAGE(FATAL_ERROR "Could not find Sqlite3")
|
MESSAGE(FATAL_ERROR "Could not find Sqlite3")
|
||||||
ENDIF (Sqlite3_FIND_REQUIRED)
|
ENDIF (Sqlite3_FIND_REQUIRED)
|
||||||
ENDIF (SQLITE3_FOUND)
|
ENDIF (Sqlite3_FOUND)
|
||||||
|
|
||||||
|
|||||||
@@ -59,18 +59,14 @@ public:
|
|||||||
const std::vector<double> & getPredictionLC() const; // {Vp, Lc, l1, l2, l3, l4...}
|
const std::vector<double> & getPredictionLC() const; // {Vp, Lc, l1, l2, l3, l4...}
|
||||||
std::string getPredictionLCStr() const; // for convenience {Vp, Lc, l1, l2, l3, l4...}
|
std::string getPredictionLCStr() const; // for convenience {Vp, Lc, l1, l2, l3, l4...}
|
||||||
|
|
||||||
cv::Mat generatePrediction(const Memory * memory, const std::vector<int> & ids) const;
|
cv::Mat generatePrediction(const Memory * memory, const std::vector<int> & ids);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cv::Mat updatePrediction(const cv::Mat & oldPrediction,
|
cv::Mat updatePrediction(const cv::Mat & oldPrediction,
|
||||||
const Memory * memory,
|
const Memory * memory,
|
||||||
const std::vector<int> & oldIds,
|
const std::vector<int> & oldIds,
|
||||||
const std::vector<int> & newIds) const;
|
const std::vector<int> & newIds);
|
||||||
void updatePosterior(const Memory * memory, const std::vector<int> & likelihoodIds);
|
void updatePosterior(const Memory * memory, const std::vector<int> & likelihoodIds);
|
||||||
float addNeighborProb(cv::Mat & prediction,
|
|
||||||
unsigned int col,
|
|
||||||
const std::map<int, int> & neighbors,
|
|
||||||
const std::map<int, int> & idToIndexMap) const;
|
|
||||||
void normalize(cv::Mat & prediction, unsigned int index, float addedProbabilitiesSum, bool virtualPlaceUsed) const;
|
void normalize(cv::Mat & prediction, unsigned int index, float addedProbabilitiesSum, bool virtualPlaceUsed) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -80,6 +76,7 @@ private:
|
|||||||
std::vector<double> _predictionLC; // {Vp, Lc, l1, l2, l3, l4...}
|
std::vector<double> _predictionLC; // {Vp, Lc, l1, l2, l3, l4...}
|
||||||
bool _fullPredictionUpdate;
|
bool _fullPredictionUpdate;
|
||||||
float _totalPredictionLCValues;
|
float _totalPredictionLCValues;
|
||||||
|
std::map<int, std::map<int, int> > _neighborsIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rtabmap
|
} // namespace rtabmap
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ public:
|
|||||||
void setImageRate(float imageRate) {_imageRate = imageRate;}
|
void setImageRate(float imageRate) {_imageRate = imageRate;}
|
||||||
void setLocalTransform(const Transform & localTransform) {_localTransform= localTransform;}
|
void setLocalTransform(const Transform & localTransform) {_localTransform= localTransform;}
|
||||||
|
|
||||||
|
void resetTimer();
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ public:
|
|||||||
float timeCapture;
|
float timeCapture;
|
||||||
float timeDisparity;
|
float timeDisparity;
|
||||||
float timeMirroring;
|
float timeMirroring;
|
||||||
|
float timeStereoExposureCompensation;
|
||||||
float timeImageDecimation;
|
float timeImageDecimation;
|
||||||
float timeScanFromDepth;
|
float timeScanFromDepth;
|
||||||
float timeUndistortDepth;
|
float timeUndistortDepth;
|
||||||
@@ -66,6 +67,7 @@ public:
|
|||||||
float timeTotal;
|
float timeTotal;
|
||||||
Transform odomPose;
|
Transform odomPose;
|
||||||
cv::Mat odomCovariance;
|
cv::Mat odomCovariance;
|
||||||
|
std::vector<float> odomVelocity;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rtabmap
|
} // namespace rtabmap
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ public:
|
|||||||
virtual ~CameraModel() {}
|
virtual ~CameraModel() {}
|
||||||
|
|
||||||
void initRectificationMap();
|
void initRectificationMap();
|
||||||
|
bool isRectificationMapInitialized() {return !mapX_.empty() && !mapY_.empty();}
|
||||||
|
|
||||||
bool isValidForProjection() const {return fx()>0.0 && fy()>0.0 && cx()>0.0 && cy()>0.0;}
|
bool isValidForProjection() const {return fx()>0.0 && fy()>0.0 && cx()>0.0 && cy()>0.0;}
|
||||||
bool isValidForReprojection() const {return fx()>0.0 && fy()>0.0 && cx()>0.0 && cy()>0.0 && imageWidth()>0 && imageHeight()>0;}
|
bool isValidForReprojection() const {return fx()>0.0 && fy()>0.0 && cx()>0.0 && cy()>0.0 && imageWidth()>0 && imageHeight()>0;}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public:
|
|||||||
const CameraModel & cameraModel() const {return _model;}
|
const CameraModel & cameraModel() const {return _model;}
|
||||||
|
|
||||||
void setPath(const std::string & dir) {_path=dir;}
|
void setPath(const std::string & dir) {_path=dir;}
|
||||||
void setStartIndex(int index) {_startAt = index;} // negative means last
|
virtual void setStartIndex(int index) {_startAt = index;} // negative means last
|
||||||
void setDirRefreshed(bool enabled) {_refreshDir = enabled;}
|
void setDirRefreshed(bool enabled) {_refreshDir = enabled;}
|
||||||
void setImagesRectified(bool enabled) {_rectifyImages = enabled;}
|
void setImagesRectified(bool enabled) {_rectifyImages = enabled;}
|
||||||
void setBayerMode(int mode) {_bayerMode = mode;} // -1=disabled (default) 0=BayerBG, 1=BayerGB, 2=BayerRG, 3=BayerGR
|
void setBayerMode(int mode) {_bayerMode = mode;} // -1=disabled (default) 0=BayerBG, 1=BayerGB, 2=BayerRG, 3=BayerGR
|
||||||
@@ -85,19 +85,19 @@ public:
|
|||||||
int maxScanPts = 0,
|
int maxScanPts = 0,
|
||||||
int downsampleStep = 1,
|
int downsampleStep = 1,
|
||||||
float voxelSize = 0.0f,
|
float voxelSize = 0.0f,
|
||||||
int normalsK = 0, // compute normals if > 0
|
int normalsK = 0, // compute normals if > 0
|
||||||
const Transform & localTransform=Transform::getIdentity())
|
float normalsRadius = 0, // compute normals if > 0
|
||||||
|
const Transform & localTransform=Transform::getIdentity(),
|
||||||
|
bool forceGroundNormalsUp = false)
|
||||||
{
|
{
|
||||||
_scanPath = dir;
|
_scanPath = dir;
|
||||||
_scanLocalTransform = localTransform;
|
_scanLocalTransform = localTransform;
|
||||||
_scanMaxPts = maxScanPts;
|
_scanMaxPts = maxScanPts;
|
||||||
_scanDownsampleStep = downsampleStep;
|
_scanDownsampleStep = downsampleStep;
|
||||||
_scanNormalsK = normalsK;
|
_scanNormalsK = normalsK;
|
||||||
|
_scanNormalsRadius = normalsRadius;
|
||||||
_scanVoxelSize = voxelSize;
|
_scanVoxelSize = voxelSize;
|
||||||
if(_scanDownsampleStep>1)
|
_scanForceGroundNormalsUp = forceGroundNormalsUp;
|
||||||
{
|
|
||||||
_scanMaxPts /= _scanDownsampleStep;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDepthFromScan(bool enabled, int fillHoles = 1, bool fillHolesFromBorder = false)
|
void setDepthFromScan(bool enabled, int fillHoles = 1, bool fillHolesFromBorder = false)
|
||||||
@@ -121,6 +121,9 @@ public:
|
|||||||
_groundTruthFormat = format;
|
_groundTruthFormat = format;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setMaxPoseTimeDiff(double diff) {_maxPoseTimeDiff = diff;}
|
||||||
|
double getMaxPoseTimeDiff() const {return _maxPoseTimeDiff;}
|
||||||
|
|
||||||
void setDepth(bool isDepth, float depthScaleFactor = 1.0f)
|
void setDepth(bool isDepth, float depthScaleFactor = 1.0f)
|
||||||
{
|
{
|
||||||
_isDepth = isDepth;
|
_isDepth = isDepth;
|
||||||
@@ -133,7 +136,8 @@ protected:
|
|||||||
std::list<Transform> & outputPoses,
|
std::list<Transform> & outputPoses,
|
||||||
std::list<double> & stamps,
|
std::list<double> & stamps,
|
||||||
const std::string & filePath,
|
const std::string & filePath,
|
||||||
int format) const;
|
int format,
|
||||||
|
double maxTimeDiff) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string _path;
|
std::string _path;
|
||||||
@@ -158,6 +162,8 @@ private:
|
|||||||
int _scanDownsampleStep;
|
int _scanDownsampleStep;
|
||||||
float _scanVoxelSize;
|
float _scanVoxelSize;
|
||||||
int _scanNormalsK;
|
int _scanNormalsK;
|
||||||
|
float _scanNormalsRadius;
|
||||||
|
bool _scanForceGroundNormalsUp;
|
||||||
|
|
||||||
bool _depthFromScan;
|
bool _depthFromScan;
|
||||||
int _depthFromScanFillHoles; // <0:horizontal 0:disabled >0:vertical
|
int _depthFromScanFillHoles; // <0:horizontal 0:disabled >0:vertical
|
||||||
@@ -169,9 +175,9 @@ private:
|
|||||||
|
|
||||||
std::string _odometryPath;
|
std::string _odometryPath;
|
||||||
int _odometryFormat;
|
int _odometryFormat;
|
||||||
|
|
||||||
std::string _groundTruthPath;
|
std::string _groundTruthPath;
|
||||||
int _groundTruthFormat;
|
int _groundTruthFormat;
|
||||||
|
double _maxPoseTimeDiff;
|
||||||
|
|
||||||
std::list<double> _stamps;
|
std::list<double> _stamps;
|
||||||
std::list<Transform> odometry_;
|
std::list<Transform> odometry_;
|
||||||
|
|||||||
@@ -39,9 +39,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <pcl/pcl_config.h>
|
#include <pcl/pcl_config.h>
|
||||||
|
|
||||||
#ifdef HAVE_OPENNI
|
#ifdef HAVE_OPENNI
|
||||||
|
#if __linux__ && __i386__ && __cplusplus >= 201103L
|
||||||
|
#warning "Openni driver is not available on i386 when building with c++11 support"
|
||||||
|
#else
|
||||||
|
#define RTABMAP_OPENNI
|
||||||
#include <pcl/io/openni_camera/openni_depth_image.h>
|
#include <pcl/io/openni_camera/openni_depth_image.h>
|
||||||
#include <pcl/io/openni_camera/openni_image.h>
|
#include <pcl/io/openni_camera/openni_image.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <boost/signals2/connection.hpp>
|
#include <boost/signals2/connection.hpp>
|
||||||
|
|
||||||
@@ -74,9 +79,25 @@ namespace rs
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace rs2
|
||||||
|
{
|
||||||
|
class context;
|
||||||
|
class device;
|
||||||
|
class syncer;
|
||||||
|
}
|
||||||
|
struct rs2_intrinsics;
|
||||||
|
struct rs2_extrinsics;
|
||||||
|
|
||||||
typedef struct _freenect_context freenect_context;
|
typedef struct _freenect_context freenect_context;
|
||||||
typedef struct _freenect_device freenect_device;
|
typedef struct _freenect_device freenect_device;
|
||||||
|
|
||||||
|
typedef struct IKinectSensor IKinectSensor;
|
||||||
|
typedef struct ICoordinateMapper ICoordinateMapper;
|
||||||
|
typedef struct _DepthSpacePoint DepthSpacePoint;
|
||||||
|
typedef struct _ColorSpacePoint ColorSpacePoint;
|
||||||
|
typedef struct tagRGBQUAD RGBQUAD;
|
||||||
|
typedef struct IMultiSourceFrameReader IMultiSourceFrameReader;
|
||||||
|
|
||||||
namespace rtabmap
|
namespace rtabmap
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -95,7 +116,7 @@ public:
|
|||||||
float imageRate = 0,
|
float imageRate = 0,
|
||||||
const Transform & localTransform = Transform::getIdentity());
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
virtual ~CameraOpenni();
|
virtual ~CameraOpenni();
|
||||||
#ifdef HAVE_OPENNI
|
#ifdef RTABMAP_OPENNI
|
||||||
void image_cb (
|
void image_cb (
|
||||||
const boost::shared_ptr<openni_wrapper::Image>& rgb,
|
const boost::shared_ptr<openni_wrapper::Image>& rgb,
|
||||||
const boost::shared_ptr<openni_wrapper::DepthImage>& depth,
|
const boost::shared_ptr<openni_wrapper::DepthImage>& depth,
|
||||||
@@ -178,6 +199,7 @@ public:
|
|||||||
bool setGain(int value);
|
bool setGain(int value);
|
||||||
bool setMirroring(bool enabled);
|
bool setMirroring(bool enabled);
|
||||||
void setOpenNI2StampsAndIDsUsed(bool used);
|
void setOpenNI2StampsAndIDsUsed(bool used);
|
||||||
|
void setIRDepthShift(int horizontal, int vertical);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual SensorData captureImage(CameraInfo * info = 0);
|
virtual SensorData captureImage(CameraInfo * info = 0);
|
||||||
@@ -193,6 +215,8 @@ private:
|
|||||||
std::string _deviceId;
|
std::string _deviceId;
|
||||||
bool _openNI2StampsAndIDsUsed;
|
bool _openNI2StampsAndIDsUsed;
|
||||||
StereoCameraModel _stereoModel;
|
StereoCameraModel _stereoModel;
|
||||||
|
int _depthHShift;
|
||||||
|
int _depthVShift;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -256,14 +280,15 @@ public:
|
|||||||
public:
|
public:
|
||||||
// default local transform z in, x right, y down));
|
// default local transform z in, x right, y down));
|
||||||
CameraFreenect2(int deviceId= 0,
|
CameraFreenect2(int deviceId= 0,
|
||||||
Type type = kTypeColor2DepthSD,
|
Type type = kTypeDepth2ColorSD,
|
||||||
float imageRate=0.0f,
|
float imageRate=0.0f,
|
||||||
const Transform & localTransform = Transform::getIdentity(),
|
const Transform & localTransform = Transform::getIdentity(),
|
||||||
float minDepth = 0.3f,
|
float minDepth = 0.3f,
|
||||||
float maxDepth = 12.0f,
|
float maxDepth = 12.0f,
|
||||||
bool bilateralFiltering = true,
|
bool bilateralFiltering = true,
|
||||||
bool edgeAwareFiltering = true,
|
bool edgeAwareFiltering = true,
|
||||||
bool noiseFiltering = true);
|
bool noiseFiltering = true,
|
||||||
|
const std::string & pipelineName = "");
|
||||||
virtual ~CameraFreenect2();
|
virtual ~CameraFreenect2();
|
||||||
|
|
||||||
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
||||||
@@ -287,6 +312,61 @@ private:
|
|||||||
bool bilateralFiltering_;
|
bool bilateralFiltering_;
|
||||||
bool edgeAwareFiltering_;
|
bool edgeAwareFiltering_;
|
||||||
bool noiseFiltering_;
|
bool noiseFiltering_;
|
||||||
|
std::string pipelineName_;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
/////////////////////////
|
||||||
|
// CameraK4W2
|
||||||
|
/////////////////////////
|
||||||
|
|
||||||
|
class RTABMAP_EXP CameraK4W2 :
|
||||||
|
public Camera
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static bool available();
|
||||||
|
|
||||||
|
enum Type {
|
||||||
|
kTypeColor2DepthSD,
|
||||||
|
kTypeDepth2ColorSD,
|
||||||
|
kTypeDepth2ColorHD
|
||||||
|
};
|
||||||
|
|
||||||
|
public:
|
||||||
|
static const int cDepthWidth = 512;
|
||||||
|
static const int cDepthHeight = 424;
|
||||||
|
static const int cColorWidth = 1920;
|
||||||
|
static const int cColorHeight = 1080;
|
||||||
|
|
||||||
|
public:
|
||||||
|
// default local transform z in, x right, y down));
|
||||||
|
CameraK4W2(int deviceId = 0, // not used
|
||||||
|
Type type = kTypeDepth2ColorSD,
|
||||||
|
float imageRate = 0.0f,
|
||||||
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
|
virtual ~CameraK4W2();
|
||||||
|
|
||||||
|
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
||||||
|
virtual bool isCalibrated() const;
|
||||||
|
virtual std::string getSerial() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual SensorData captureImage(CameraInfo * info = 0);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void close();
|
||||||
|
|
||||||
|
private:
|
||||||
|
#ifdef RTABMAP_K4W2
|
||||||
|
Type type_;
|
||||||
|
IKinectSensor* pKinectSensor_;
|
||||||
|
ICoordinateMapper* pCoordinateMapper_;
|
||||||
|
DepthSpacePoint* pDepthCoordinates_;
|
||||||
|
ColorSpacePoint* pColorCoordinates_;
|
||||||
|
IMultiSourceFrameReader* pMultiSourceFrameReader_;
|
||||||
|
RGBQUAD * pColorRGBX_;
|
||||||
|
INT_PTR hMSEvent;
|
||||||
|
CameraModel colorCameraModel_;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -299,6 +379,7 @@ class RTABMAP_EXP CameraRealSense :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static bool available();
|
static bool available();
|
||||||
|
enum RGBSource {kColor, kInfrared, kFishEye};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// default local transform z in, x right, y down));
|
// default local transform z in, x right, y down));
|
||||||
@@ -311,6 +392,8 @@ public:
|
|||||||
const Transform & localTransform = Transform::getIdentity());
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
virtual ~CameraRealSense();
|
virtual ~CameraRealSense();
|
||||||
|
|
||||||
|
void setDepthScaledToRGBSize(bool enabled);
|
||||||
|
void setRGBSource(RGBSource source);
|
||||||
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
||||||
virtual bool isCalibrated() const;
|
virtual bool isCalibrated() const;
|
||||||
virtual std::string getSerial() const;
|
virtual std::string getSerial() const;
|
||||||
@@ -327,6 +410,10 @@ private:
|
|||||||
int presetRGB_;
|
int presetRGB_;
|
||||||
int presetDepth_;
|
int presetDepth_;
|
||||||
bool computeOdometry_;
|
bool computeOdometry_;
|
||||||
|
bool depthScaledToRGBSize_;
|
||||||
|
RGBSource rgbSource_;
|
||||||
|
CameraModel cameraModel_;
|
||||||
|
std::vector<int> rsRectificationTable_;
|
||||||
|
|
||||||
int motionSeq_[2];
|
int motionSeq_[2];
|
||||||
rs::slam::slam * slam_;
|
rs::slam::slam * slam_;
|
||||||
@@ -338,6 +425,53 @@ private:
|
|||||||
USemaphore dataReady_;
|
USemaphore dataReady_;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
/////////////////////////
|
||||||
|
// CameraRealSense2
|
||||||
|
/////////////////////////
|
||||||
|
class slam_event_handler;
|
||||||
|
class RTABMAP_EXP CameraRealSense2 :
|
||||||
|
public Camera
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static bool available();
|
||||||
|
|
||||||
|
public:
|
||||||
|
// default local transform z in, x right, y down));
|
||||||
|
CameraRealSense2(
|
||||||
|
const std::string & deviceId = "",
|
||||||
|
float imageRate = 0,
|
||||||
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
|
virtual ~CameraRealSense2();
|
||||||
|
|
||||||
|
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
||||||
|
virtual bool isCalibrated() const;
|
||||||
|
virtual std::string getSerial() const;
|
||||||
|
|
||||||
|
// parameters are set during initialization
|
||||||
|
void setEmitterEnabled(bool enabled);
|
||||||
|
void setIRDepthFormat(bool enabled);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual SensorData captureImage(CameraInfo * info = 0);
|
||||||
|
|
||||||
|
private:
|
||||||
|
#ifdef RTABMAP_REALSENSE2
|
||||||
|
rs2::context * ctx_;
|
||||||
|
rs2::device * dev_;
|
||||||
|
std::string deviceId_;
|
||||||
|
rs2::syncer * syncer_;
|
||||||
|
float depth_scale_meters_;
|
||||||
|
rs2_intrinsics * depthIntrinsics_;
|
||||||
|
rs2_intrinsics * rgbIntrinsics_;
|
||||||
|
rs2_extrinsics * depthToRGBExtrinsics_;
|
||||||
|
cv::Mat depthBuffer_;
|
||||||
|
cv::Mat rgbBuffer_;
|
||||||
|
CameraModel model_;
|
||||||
|
|
||||||
|
bool emitterEnabled_;
|
||||||
|
bool irDepth_;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
@@ -363,6 +497,8 @@ public:
|
|||||||
virtual bool isCalibrated() const;
|
virtual bool isCalibrated() const;
|
||||||
virtual std::string getSerial() const;
|
virtual std::string getSerial() const;
|
||||||
|
|
||||||
|
virtual void setStartIndex(int index) {CameraImages::setStartIndex(index);cameraDepth_.setStartIndex(index);} // negative means last
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual SensorData captureImage(CameraInfo * info = 0);
|
virtual SensorData captureImage(CameraInfo * info = 0);
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ public:
|
|||||||
bool computeOdometry = false,
|
bool computeOdometry = false,
|
||||||
float imageRate=0.0f,
|
float imageRate=0.0f,
|
||||||
const Transform & localTransform = Transform::getIdentity(),
|
const Transform & localTransform = Transform::getIdentity(),
|
||||||
bool selfCalibration = false);
|
bool selfCalibration = true);
|
||||||
CameraStereoZed(
|
CameraStereoZed(
|
||||||
const std::string & svoFilePath,
|
const std::string & svoFilePath,
|
||||||
int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY
|
int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY
|
||||||
@@ -132,7 +132,7 @@ public:
|
|||||||
bool computeOdometry = false,
|
bool computeOdometry = false,
|
||||||
float imageRate=0.0f,
|
float imageRate=0.0f,
|
||||||
const Transform & localTransform = Transform::getIdentity(),
|
const Transform & localTransform = Transform::getIdentity(),
|
||||||
bool selfCalibration = false);
|
bool selfCalibration = true);
|
||||||
virtual ~CameraStereoZed();
|
virtual ~CameraStereoZed();
|
||||||
|
|
||||||
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
||||||
@@ -188,6 +188,8 @@ public:
|
|||||||
virtual bool isCalibrated() const;
|
virtual bool isCalibrated() const;
|
||||||
virtual std::string getSerial() const;
|
virtual std::string getSerial() const;
|
||||||
|
|
||||||
|
virtual void setStartIndex(int index) {CameraImages::setStartIndex(index);camera2_->setStartIndex(index);} // negative means last
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual SensorData captureImage(CameraInfo * info = 0);
|
virtual SensorData captureImage(CameraInfo * info = 0);
|
||||||
|
|
||||||
@@ -224,6 +226,12 @@ public:
|
|||||||
bool rectifyImages = false,
|
bool rectifyImages = false,
|
||||||
float imageRate = 0.0f,
|
float imageRate = 0.0f,
|
||||||
const Transform & localTransform = Transform::getIdentity());
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
|
CameraStereoVideo(
|
||||||
|
int deviceLeft,
|
||||||
|
int deviceRight,
|
||||||
|
bool rectifyImages = false,
|
||||||
|
float imageRate = 0.0f,
|
||||||
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
virtual ~CameraStereoVideo();
|
virtual ~CameraStereoVideo();
|
||||||
|
|
||||||
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
||||||
@@ -243,6 +251,7 @@ private:
|
|||||||
std::string cameraName_;
|
std::string cameraName_;
|
||||||
CameraVideo::Source src_;
|
CameraVideo::Source src_;
|
||||||
int usbDevice_;
|
int usbDevice_;
|
||||||
|
int usbDevice2_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rtabmap
|
} // namespace rtabmap
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ public:
|
|||||||
virtual ~CameraThread();
|
virtual ~CameraThread();
|
||||||
|
|
||||||
void setMirroringEnabled(bool enabled) {_mirroring = enabled;}
|
void setMirroringEnabled(bool enabled) {_mirroring = enabled;}
|
||||||
|
void setStereoExposureCompensation(bool enabled) {_stereoExposureCompensation = enabled;}
|
||||||
void setColorOnly(bool colorOnly) {_colorOnly = colorOnly;}
|
void setColorOnly(bool colorOnly) {_colorOnly = colorOnly;}
|
||||||
void setImageDecimation(int decimation) {_imageDecimation = decimation;}
|
void setImageDecimation(int decimation) {_imageDecimation = decimation;}
|
||||||
void setStereoToDepth(bool enabled) {_stereoToDepth = enabled;}
|
void setStereoToDepth(bool enabled) {_stereoToDepth = enabled;}
|
||||||
@@ -73,13 +74,15 @@ public:
|
|||||||
int decimation=4,
|
int decimation=4,
|
||||||
float maxDepth=4.0f,
|
float maxDepth=4.0f,
|
||||||
float voxelSize = 0.0f,
|
float voxelSize = 0.0f,
|
||||||
int normalsK = 0)
|
int normalsK = 0,
|
||||||
|
int normalsRadius = 0.0f)
|
||||||
{
|
{
|
||||||
_scanFromDepth = enabled;
|
_scanFromDepth = enabled;
|
||||||
_scanDecimation=decimation;
|
_scanDecimation=decimation;
|
||||||
_scanMaxDepth = maxDepth;
|
_scanMaxDepth = maxDepth;
|
||||||
_scanVoxelSize = voxelSize;
|
_scanVoxelSize = voxelSize;
|
||||||
_scanNormalsK = normalsK;
|
_scanNormalsK = normalsK;
|
||||||
|
_scanNormalsRadius = normalsRadius;
|
||||||
}
|
}
|
||||||
|
|
||||||
void postUpdate(SensorData * data, CameraInfo * info = 0) const;
|
void postUpdate(SensorData * data, CameraInfo * info = 0) const;
|
||||||
@@ -98,6 +101,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
Camera * _camera;
|
Camera * _camera;
|
||||||
bool _mirroring;
|
bool _mirroring;
|
||||||
|
bool _stereoExposureCompensation;
|
||||||
bool _colorOnly;
|
bool _colorOnly;
|
||||||
int _imageDecimation;
|
int _imageDecimation;
|
||||||
bool _stereoToDepth;
|
bool _stereoToDepth;
|
||||||
@@ -107,6 +111,7 @@ private:
|
|||||||
float _scanMinDepth;
|
float _scanMinDepth;
|
||||||
float _scanVoxelSize;
|
float _scanVoxelSize;
|
||||||
int _scanNormalsK;
|
int _scanNormalsK;
|
||||||
|
float _scanNormalsRadius;
|
||||||
StereoDense * _stereoDense;
|
StereoDense * _stereoDense;
|
||||||
clams::DiscreteDepthDistortionModel * _distortionModel;
|
clams::DiscreteDepthDistortionModel * _distortionModel;
|
||||||
bool _bilateralFiltering;
|
bool _bilateralFiltering;
|
||||||
|
|||||||
@@ -83,5 +83,8 @@ cv::Mat RTABMAP_EXP uncompressData(const cv::Mat & bytes);
|
|||||||
cv::Mat RTABMAP_EXP uncompressData(const std::vector<unsigned char> & bytes);
|
cv::Mat RTABMAP_EXP uncompressData(const std::vector<unsigned char> & bytes);
|
||||||
cv::Mat RTABMAP_EXP uncompressData(const unsigned char * bytes, unsigned long size);
|
cv::Mat RTABMAP_EXP uncompressData(const unsigned char * bytes, unsigned long size);
|
||||||
|
|
||||||
|
cv::Mat RTABMAP_EXP compressString(const std::string & str);
|
||||||
|
std::string RTABMAP_EXP uncompressString(const cv::Mat & bytes);
|
||||||
|
|
||||||
} /* namespace rtabmap */
|
} /* namespace rtabmap */
|
||||||
#endif /* COMPRESSION_H_ */
|
#endif /* COMPRESSION_H_ */
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public:
|
|||||||
virtual ~DBDriver();
|
virtual ~DBDriver();
|
||||||
|
|
||||||
virtual void parseParameters(const ParametersMap & parameters);
|
virtual void parseParameters(const ParametersMap & parameters);
|
||||||
|
virtual bool isInMemory() const {return _url.empty();}
|
||||||
const std::string & getUrl() const {return _url;}
|
const std::string & getUrl() const {return _url;}
|
||||||
|
|
||||||
void beginTransaction() const;
|
void beginTransaction() const;
|
||||||
@@ -91,6 +92,7 @@ public:
|
|||||||
int nodeId,
|
int nodeId,
|
||||||
const cv::Mat & ground,
|
const cv::Mat & ground,
|
||||||
const cv::Mat & obstacles,
|
const cv::Mat & obstacles,
|
||||||
|
const cv::Mat & empty,
|
||||||
float cellSize,
|
float cellSize,
|
||||||
const cv::Point3f & viewpoint);
|
const cv::Point3f & viewpoint);
|
||||||
void updateDepthImage(int nodeId, const cv::Mat & image);
|
void updateDepthImage(int nodeId, const cv::Mat & image);
|
||||||
@@ -100,9 +102,12 @@ public:
|
|||||||
void addStatistics(const Statistics & statistics) const;
|
void addStatistics(const Statistics & statistics) const;
|
||||||
void savePreviewImage(const cv::Mat & image) const;
|
void savePreviewImage(const cv::Mat & image) const;
|
||||||
cv::Mat loadPreviewImage() const;
|
cv::Mat loadPreviewImage() const;
|
||||||
|
void saveOptimizedPoses(const std::map<int, Transform> & optimizedPoses, const Transform & lastlocalizationPose) const;
|
||||||
|
std::map<int, Transform> loadOptimizedPoses(Transform * lastlocalizationPose) const;
|
||||||
|
void save2DMap(const cv::Mat & map, float xMin, float yMin, float cellSize) const;
|
||||||
|
cv::Mat load2DMap(float & xMin, float & yMin, float & cellSize) const;
|
||||||
void saveOptimizedMesh(
|
void saveOptimizedMesh(
|
||||||
const cv::Mat & cloud,
|
const cv::Mat & cloud,
|
||||||
const std::map<int, Transform> & poses = std::map<int, Transform>(), // if we want to do localization afterward using optimized mesh
|
|
||||||
const std::vector<std::vector<std::vector<unsigned int> > > & polygons = std::vector<std::vector<std::vector<unsigned int> > >(), // Textures -> polygons -> vertices
|
const std::vector<std::vector<std::vector<unsigned int> > > & polygons = std::vector<std::vector<std::vector<unsigned int> > >(), // Textures -> polygons -> vertices
|
||||||
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
||||||
const std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > & texCoords = std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > >(), // Textures -> uv coords for each vertex of the polygons
|
const std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > & texCoords = std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > >(), // Textures -> uv coords for each vertex of the polygons
|
||||||
@@ -111,7 +116,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
const cv::Mat & textures = cv::Mat()) const; // concatenated textures (assuming square textures with all same size);
|
const cv::Mat & textures = cv::Mat()) const; // concatenated textures (assuming square textures with all same size);
|
||||||
cv::Mat loadOptimizedMesh(
|
cv::Mat loadOptimizedMesh(
|
||||||
std::map<int, Transform> * poses = 0,
|
|
||||||
std::vector<std::vector<std::vector<unsigned int> > > * polygons = 0,
|
std::vector<std::vector<std::vector<unsigned int> > > * polygons = 0,
|
||||||
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
||||||
std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > * texCoords = 0,
|
std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > * texCoords = 0,
|
||||||
@@ -144,12 +148,14 @@ public:
|
|||||||
int getTotalNodesSize() const;
|
int getTotalNodesSize() const;
|
||||||
int getTotalDictionarySize() const;
|
int getTotalDictionarySize() const;
|
||||||
ParametersMap getLastParameters() const;
|
ParametersMap getLastParameters() const;
|
||||||
std::map<std::string, float> getStatistics(int nodeId, double & stamp) const;
|
std::map<std::string, float> getStatistics(int nodeId, double & stamp, std::vector<int> * wmState=0) const;
|
||||||
|
std::map<int, std::pair<std::map<std::string, float>, double> > getAllStatistics() const;
|
||||||
|
std::map<int, std::vector<int> > getAllStatisticsWmStates() const;
|
||||||
|
|
||||||
void executeNoResult(const std::string & sql) const;
|
void executeNoResult(const std::string & sql) const;
|
||||||
|
|
||||||
// Load objects
|
// Load objects
|
||||||
void load(VWDictionary * dictionary) const;
|
void load(VWDictionary * dictionary, bool lastStateOnly = true) const;
|
||||||
void loadLastNodes(std::list<Signature *> & signatures) const;
|
void loadLastNodes(std::list<Signature *> & signatures) const;
|
||||||
void loadSignatures(const std::list<int> & ids, std::list<Signature *> & signatures, std::set<int> * loadedFromTrash = 0);
|
void loadSignatures(const std::list<int> & ids, std::list<Signature *> & signatures, std::set<int> * loadedFromTrash = 0);
|
||||||
void loadWords(const std::set<int> & wordIds, std::list<VisualWord *> & vws);
|
void loadWords(const std::set<int> & wordIds, std::list<VisualWord *> & vws);
|
||||||
@@ -158,8 +164,8 @@ public:
|
|||||||
void loadNodeData(std::list<Signature *> & signatures, bool images = true, bool scan = true, bool userData = true, bool occupancyGrid = true) const;
|
void loadNodeData(std::list<Signature *> & signatures, bool images = true, bool scan = true, bool userData = true, bool occupancyGrid = true) const;
|
||||||
void getNodeData(int signatureId, SensorData & data, bool images = true, bool scan = true, bool userData = true, bool occupancyGrid = true) const;
|
void getNodeData(int signatureId, SensorData & data, bool images = true, bool scan = true, bool userData = true, bool occupancyGrid = true) const;
|
||||||
bool getCalibration(int signatureId, std::vector<CameraModel> & models, StereoCameraModel & stereoModel) const;
|
bool getCalibration(int signatureId, std::vector<CameraModel> & models, StereoCameraModel & stereoModel) const;
|
||||||
bool getLaserScanInfo(int signatureId, LaserScanInfo & info) const;
|
bool getLaserScanInfo(int signatureId, LaserScan & info) const;
|
||||||
bool getNodeInfo(int signatureId, Transform & pose, int & mapId, int & weight, std::string & label, double & stamp, Transform & groundTruthPose, std::vector<float> & velocity) const;
|
bool getNodeInfo(int signatureId, Transform & pose, int & mapId, int & weight, std::string & label, double & stamp, Transform & groundTruthPose, std::vector<float> & velocity, GPS & gps) const;
|
||||||
void loadLinks(int signatureId, std::map<int, Link> & links, Link::Type type = Link::kUndef) const;
|
void loadLinks(int signatureId, std::map<int, Link> & links, Link::Type type = Link::kUndef) const;
|
||||||
void getWeight(int signatureId, int & weight) const;
|
void getWeight(int signatureId, int & weight) const;
|
||||||
void getAllNodeIds(std::set<int> & ids, bool ignoreChildren = false, bool ignoreBadSignatures = false) const;
|
void getAllNodeIds(std::set<int> & ids, bool ignoreChildren = false, bool ignoreBadSignatures = false) const;
|
||||||
@@ -173,7 +179,6 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
DBDriver(const ParametersMap & parameters = ParametersMap());
|
DBDriver(const ParametersMap & parameters = ParametersMap());
|
||||||
|
|
||||||
private:
|
|
||||||
virtual bool connectDatabaseQuery(const std::string & url, bool overwritten = false) = 0;
|
virtual bool connectDatabaseQuery(const std::string & url, bool overwritten = false) = 0;
|
||||||
virtual void disconnectDatabaseQuery(bool save = true, const std::string & outputUrl = "") = 0;
|
virtual void disconnectDatabaseQuery(bool save = true, const std::string & outputUrl = "") = 0;
|
||||||
virtual bool isConnectedQuery() const = 0;
|
virtual bool isConnectedQuery() const = 0;
|
||||||
@@ -195,13 +200,15 @@ private:
|
|||||||
virtual int getTotalNodesSizeQuery() const = 0;
|
virtual int getTotalNodesSizeQuery() const = 0;
|
||||||
virtual int getTotalDictionarySizeQuery() const = 0;
|
virtual int getTotalDictionarySizeQuery() const = 0;
|
||||||
virtual ParametersMap getLastParametersQuery() const = 0;
|
virtual ParametersMap getLastParametersQuery() const = 0;
|
||||||
virtual std::map<std::string, float> getStatisticsQuery(int nodeId, double & stamp) const = 0;
|
virtual std::map<std::string, float> getStatisticsQuery(int nodeId, double & stamp, std::vector<int> * wmState) const = 0;
|
||||||
|
virtual std::map<int, std::pair<std::map<std::string, float>, double> > getAllStatisticsQuery() const = 0;
|
||||||
|
virtual std::map<int, std::vector<int> > getAllStatisticsWmStatesQuery() const = 0;
|
||||||
|
|
||||||
virtual void executeNoResultQuery(const std::string & sql) const = 0;
|
virtual void executeNoResultQuery(const std::string & sql) const = 0;
|
||||||
|
|
||||||
virtual void getWeightQuery(int signatureId, int & weight) const = 0;
|
virtual void getWeightQuery(int signatureId, int & weight) const = 0;
|
||||||
|
|
||||||
virtual void saveQuery(const std::list<Signature *> & signatures) const = 0;
|
virtual void saveQuery(const std::list<Signature *> & signatures) = 0;
|
||||||
virtual void saveQuery(const std::list<VisualWord *> & words) const = 0;
|
virtual void saveQuery(const std::list<VisualWord *> & words) const = 0;
|
||||||
virtual void updateQuery(const std::list<Signature *> & signatures, bool updateTimestamp) const = 0;
|
virtual void updateQuery(const std::list<Signature *> & signatures, bool updateTimestamp) const = 0;
|
||||||
virtual void updateQuery(const std::list<VisualWord *> & words, bool updateTimestamp) const = 0;
|
virtual void updateQuery(const std::list<VisualWord *> & words, bool updateTimestamp) const = 0;
|
||||||
@@ -213,6 +220,7 @@ private:
|
|||||||
int nodeId,
|
int nodeId,
|
||||||
const cv::Mat & ground,
|
const cv::Mat & ground,
|
||||||
const cv::Mat & obstacles,
|
const cv::Mat & obstacles,
|
||||||
|
const cv::Mat & empty,
|
||||||
float cellSize,
|
float cellSize,
|
||||||
const cv::Point3f & viewpoint) const = 0;
|
const cv::Point3f & viewpoint) const = 0;
|
||||||
|
|
||||||
@@ -223,9 +231,12 @@ private:
|
|||||||
virtual void addStatisticsQuery(const Statistics & statistics) const = 0;
|
virtual void addStatisticsQuery(const Statistics & statistics) const = 0;
|
||||||
virtual void savePreviewImageQuery(const cv::Mat & image) const = 0;
|
virtual void savePreviewImageQuery(const cv::Mat & image) const = 0;
|
||||||
virtual cv::Mat loadPreviewImageQuery() const = 0;
|
virtual cv::Mat loadPreviewImageQuery() const = 0;
|
||||||
|
virtual void saveOptimizedPosesQuery(const std::map<int, Transform> & optimizedPoses, const Transform & lastlocalizationPose) const = 0;
|
||||||
|
virtual std::map<int, Transform> loadOptimizedPosesQuery(Transform * lastlocalizationPose) const = 0;
|
||||||
|
virtual void save2DMapQuery(const cv::Mat & map, float xMin, float yMin, float cellSize) const = 0;
|
||||||
|
virtual cv::Mat load2DMapQuery(float & xMin, float & yMin, float & cellSize) const = 0;
|
||||||
virtual void saveOptimizedMeshQuery(
|
virtual void saveOptimizedMeshQuery(
|
||||||
const cv::Mat & cloud,
|
const cv::Mat & cloud,
|
||||||
const std::map<int, Transform> & poses,
|
|
||||||
const std::vector<std::vector<std::vector<unsigned int> > > & polygons,
|
const std::vector<std::vector<std::vector<unsigned int> > > & polygons,
|
||||||
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
||||||
const std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > & texCoords,
|
const std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > & texCoords,
|
||||||
@@ -234,7 +245,6 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
const cv::Mat & textures) const = 0;
|
const cv::Mat & textures) const = 0;
|
||||||
virtual cv::Mat loadOptimizedMeshQuery(
|
virtual cv::Mat loadOptimizedMeshQuery(
|
||||||
std::map<int, Transform> * poses,
|
|
||||||
std::vector<std::vector<std::vector<unsigned int> > > * polygons,
|
std::vector<std::vector<std::vector<unsigned int> > > * polygons,
|
||||||
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
||||||
std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > * texCoords,
|
std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > * texCoords,
|
||||||
@@ -244,7 +254,7 @@ private:
|
|||||||
cv::Mat * textures) const = 0;
|
cv::Mat * textures) const = 0;
|
||||||
|
|
||||||
// Load objects
|
// Load objects
|
||||||
virtual void loadQuery(VWDictionary * dictionary) const = 0;
|
virtual void loadQuery(VWDictionary * dictionary, bool lastStateOnly = true) const = 0;
|
||||||
virtual void loadLastNodesQuery(std::list<Signature *> & signatures) const = 0;
|
virtual void loadLastNodesQuery(std::list<Signature *> & signatures) const = 0;
|
||||||
virtual void loadSignaturesQuery(const std::list<int> & ids, std::list<Signature *> & signatures) const = 0;
|
virtual void loadSignaturesQuery(const std::list<int> & ids, std::list<Signature *> & signatures) const = 0;
|
||||||
virtual void loadWordsQuery(const std::set<int> & wordIds, std::list<VisualWord *> & vws) const = 0;
|
virtual void loadWordsQuery(const std::set<int> & wordIds, std::list<VisualWord *> & vws) const = 0;
|
||||||
@@ -252,8 +262,8 @@ private:
|
|||||||
|
|
||||||
virtual void loadNodeDataQuery(std::list<Signature *> & signatures, bool images=true, bool scan=true, bool userData=true, bool occupancyGrid=true) const = 0;
|
virtual void loadNodeDataQuery(std::list<Signature *> & signatures, bool images=true, bool scan=true, bool userData=true, bool occupancyGrid=true) const = 0;
|
||||||
virtual bool getCalibrationQuery(int signatureId, std::vector<CameraModel> & models, StereoCameraModel & stereoModel) const = 0;
|
virtual bool getCalibrationQuery(int signatureId, std::vector<CameraModel> & models, StereoCameraModel & stereoModel) const = 0;
|
||||||
virtual bool getLaserScanInfoQuery(int signatureId, LaserScanInfo & info) const = 0;
|
virtual bool getLaserScanInfoQuery(int signatureId, LaserScan & info) const = 0;
|
||||||
virtual bool getNodeInfoQuery(int signatureId, Transform & pose, int & mapId, int & weight, std::string & label, double & stamp, Transform & groundTruthPose, std::vector<float> & velocity) const = 0;
|
virtual bool getNodeInfoQuery(int signatureId, Transform & pose, int & mapId, int & weight, std::string & label, double & stamp, Transform & groundTruthPose, std::vector<float> & velocity, GPS & gps) const = 0;
|
||||||
virtual void getAllNodeIdsQuery(std::set<int> & ids, bool ignoreChildren, bool ignoreBadSignatures) const = 0;
|
virtual void getAllNodeIdsQuery(std::set<int> & ids, bool ignoreChildren, bool ignoreBadSignatures) const = 0;
|
||||||
virtual void getAllLinksQuery(std::multimap<int, Link> & links, bool ignoreNullLinks) const = 0;
|
virtual void getAllLinksQuery(std::multimap<int, Link> & links, bool ignoreNullLinks) const = 0;
|
||||||
virtual void getLastIdQuery(const std::string & tableName, int & id) const = 0;
|
virtual void getLastIdQuery(const std::string & tableName, int & id) const = 0;
|
||||||
@@ -263,7 +273,7 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
//non-abstract methods
|
//non-abstract methods
|
||||||
void saveOrUpdate(const std::vector<Signature *> & signatures) const;
|
void saveOrUpdate(const std::vector<Signature *> & signatures);
|
||||||
void saveOrUpdate(const std::vector<VisualWord *> & words) const;
|
void saveOrUpdate(const std::vector<VisualWord *> & words) const;
|
||||||
|
|
||||||
//thread stuff
|
//thread stuff
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
||||||
#include "rtabmap/core/DBDriver.h"
|
#include "rtabmap/core/DBDriver.h"
|
||||||
#include <opencv2/features2d/features2d.hpp>
|
#include <opencv2/features2d/features2d.hpp>
|
||||||
#include "sqlite3/sqlite3.h"
|
|
||||||
|
typedef struct sqlite3_stmt sqlite3_stmt;
|
||||||
|
typedef struct sqlite3 sqlite3;
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
@@ -41,13 +43,14 @@ public:
|
|||||||
virtual ~DBDriverSqlite3();
|
virtual ~DBDriverSqlite3();
|
||||||
|
|
||||||
virtual void parseParameters(const ParametersMap & parameters);
|
virtual void parseParameters(const ParametersMap & parameters);
|
||||||
|
virtual bool isInMemory() const {return getUrl().empty() || _dbInMemory;}
|
||||||
void setDbInMemory(bool dbInMemory);
|
void setDbInMemory(bool dbInMemory);
|
||||||
void setJournalMode(int journalMode);
|
void setJournalMode(int journalMode);
|
||||||
void setCacheSize(unsigned int cacheSize);
|
void setCacheSize(unsigned int cacheSize);
|
||||||
void setSynchronous(int synchronous);
|
void setSynchronous(int synchronous);
|
||||||
void setTempStore(int tempStore);
|
void setTempStore(int tempStore);
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
virtual bool connectDatabaseQuery(const std::string & url, bool overwritten = false);
|
virtual bool connectDatabaseQuery(const std::string & url, bool overwritten = false);
|
||||||
virtual void disconnectDatabaseQuery(bool save = true, const std::string & outputUrl = "");
|
virtual void disconnectDatabaseQuery(bool save = true, const std::string & outputUrl = "");
|
||||||
virtual bool isConnectedQuery() const;
|
virtual bool isConnectedQuery() const;
|
||||||
@@ -69,13 +72,15 @@ private:
|
|||||||
virtual int getTotalNodesSizeQuery() const;
|
virtual int getTotalNodesSizeQuery() const;
|
||||||
virtual int getTotalDictionarySizeQuery() const;
|
virtual int getTotalDictionarySizeQuery() const;
|
||||||
virtual ParametersMap getLastParametersQuery() const;
|
virtual ParametersMap getLastParametersQuery() const;
|
||||||
virtual std::map<std::string, float> getStatisticsQuery(int nodeId, double & stamp) const;
|
virtual std::map<std::string, float> getStatisticsQuery(int nodeId, double & stamp, std::vector<int> * wmState) const;
|
||||||
|
virtual std::map<int, std::pair<std::map<std::string, float>, double> > getAllStatisticsQuery() const;
|
||||||
|
virtual std::map<int, std::vector<int> > getAllStatisticsWmStatesQuery() const;
|
||||||
|
|
||||||
virtual void executeNoResultQuery(const std::string & sql) const;
|
virtual void executeNoResultQuery(const std::string & sql) const;
|
||||||
|
|
||||||
virtual void getWeightQuery(int signatureId, int & weight) const;
|
virtual void getWeightQuery(int signatureId, int & weight) const;
|
||||||
|
|
||||||
virtual void saveQuery(const std::list<Signature *> & signatures) const;
|
virtual void saveQuery(const std::list<Signature *> & signatures);
|
||||||
virtual void saveQuery(const std::list<VisualWord *> & words) const;
|
virtual void saveQuery(const std::list<VisualWord *> & words) const;
|
||||||
virtual void updateQuery(const std::list<Signature *> & signatures, bool updateTimestamp) const;
|
virtual void updateQuery(const std::list<Signature *> & signatures, bool updateTimestamp) const;
|
||||||
virtual void updateQuery(const std::list<VisualWord *> & words, bool updateTimestamp) const;
|
virtual void updateQuery(const std::list<VisualWord *> & words, bool updateTimestamp) const;
|
||||||
@@ -87,6 +92,7 @@ private:
|
|||||||
int nodeId,
|
int nodeId,
|
||||||
const cv::Mat & ground,
|
const cv::Mat & ground,
|
||||||
const cv::Mat & obstacles,
|
const cv::Mat & obstacles,
|
||||||
|
const cv::Mat & empty,
|
||||||
float cellSize,
|
float cellSize,
|
||||||
const cv::Point3f & viewpoint) const;
|
const cv::Point3f & viewpoint) const;
|
||||||
|
|
||||||
@@ -97,9 +103,12 @@ private:
|
|||||||
virtual void addStatisticsQuery(const Statistics & statistics) const;
|
virtual void addStatisticsQuery(const Statistics & statistics) const;
|
||||||
virtual void savePreviewImageQuery(const cv::Mat & image) const;
|
virtual void savePreviewImageQuery(const cv::Mat & image) const;
|
||||||
virtual cv::Mat loadPreviewImageQuery() const;
|
virtual cv::Mat loadPreviewImageQuery() const;
|
||||||
|
virtual void saveOptimizedPosesQuery(const std::map<int, Transform> & optimizedPoses, const Transform & lastlocalizationPose) const;
|
||||||
|
virtual std::map<int, Transform> loadOptimizedPosesQuery(Transform * lastlocalizationPose) const;
|
||||||
|
virtual void save2DMapQuery(const cv::Mat & map, float xMin, float yMin, float cellSize) const;
|
||||||
|
virtual cv::Mat load2DMapQuery(float & xMin, float & yMin, float & cellSize) const;
|
||||||
virtual void saveOptimizedMeshQuery(
|
virtual void saveOptimizedMeshQuery(
|
||||||
const cv::Mat & cloud,
|
const cv::Mat & cloud,
|
||||||
const std::map<int, Transform> & poses,
|
|
||||||
const std::vector<std::vector<std::vector<unsigned int> > > & polygons,
|
const std::vector<std::vector<std::vector<unsigned int> > > & polygons,
|
||||||
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
||||||
const std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > & texCoords,
|
const std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > & texCoords,
|
||||||
@@ -108,7 +117,6 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
const cv::Mat & textures) const;
|
const cv::Mat & textures) const;
|
||||||
virtual cv::Mat loadOptimizedMeshQuery(
|
virtual cv::Mat loadOptimizedMeshQuery(
|
||||||
std::map<int, Transform> * poses,
|
|
||||||
std::vector<std::vector<std::vector<unsigned int> > > * polygons,
|
std::vector<std::vector<std::vector<unsigned int> > > * polygons,
|
||||||
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
||||||
std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > * texCoords,
|
std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > * texCoords,
|
||||||
@@ -118,7 +126,7 @@ private:
|
|||||||
cv::Mat * textures) const;
|
cv::Mat * textures) const;
|
||||||
|
|
||||||
// Load objects
|
// Load objects
|
||||||
virtual void loadQuery(VWDictionary * dictionary) const;
|
virtual void loadQuery(VWDictionary * dictionary, bool lastStateOnly = true) const;
|
||||||
virtual void loadLastNodesQuery(std::list<Signature *> & signatures) const;
|
virtual void loadLastNodesQuery(std::list<Signature *> & signatures) const;
|
||||||
virtual void loadSignaturesQuery(const std::list<int> & ids, std::list<Signature *> & signatures) const;
|
virtual void loadSignaturesQuery(const std::list<int> & ids, std::list<Signature *> & signatures) const;
|
||||||
virtual void loadWordsQuery(const std::set<int> & wordIds, std::list<VisualWord *> & vws) const;
|
virtual void loadWordsQuery(const std::set<int> & wordIds, std::list<VisualWord *> & vws) const;
|
||||||
@@ -126,8 +134,8 @@ private:
|
|||||||
|
|
||||||
virtual void loadNodeDataQuery(std::list<Signature *> & signatures, bool images=true, bool scan=true, bool userData=true, bool occupancyGrid=true) const;
|
virtual void loadNodeDataQuery(std::list<Signature *> & signatures, bool images=true, bool scan=true, bool userData=true, bool occupancyGrid=true) const;
|
||||||
virtual bool getCalibrationQuery(int signatureId, std::vector<CameraModel> & models, StereoCameraModel & stereoModel) const;
|
virtual bool getCalibrationQuery(int signatureId, std::vector<CameraModel> & models, StereoCameraModel & stereoModel) const;
|
||||||
virtual bool getLaserScanInfoQuery(int signatureId, LaserScanInfo & info) const;
|
virtual bool getLaserScanInfoQuery(int signatureId, LaserScan & info) const;
|
||||||
virtual bool getNodeInfoQuery(int signatureId, Transform & pose, int & mapId, int & weight, std::string & label, double & stamp, Transform & groundTruthPose, std::vector<float> & velocity) const;
|
virtual bool getNodeInfoQuery(int signatureId, Transform & pose, int & mapId, int & weight, std::string & label, double & stamp, Transform & groundTruthPose, std::vector<float> & velocity, GPS & gps) const;
|
||||||
virtual void getAllNodeIdsQuery(std::set<int> & ids, bool ignoreChildren, bool ignoreBadSignatures) const;
|
virtual void getAllNodeIdsQuery(std::set<int> & ids, bool ignoreChildren, bool ignoreBadSignatures) const;
|
||||||
virtual void getAllLinksQuery(std::multimap<int, Link> & links, bool ignoreNullLinks) const;
|
virtual void getAllLinksQuery(std::multimap<int, Link> & links, bool ignoreNullLinks) const;
|
||||||
virtual void getLastIdQuery(const std::string & tableName, int & id) const;
|
virtual void getLastIdQuery(const std::string & tableName, int & id) const;
|
||||||
@@ -161,6 +169,7 @@ private:
|
|||||||
int nodeId,
|
int nodeId,
|
||||||
const cv::Mat & ground,
|
const cv::Mat & ground,
|
||||||
const cv::Mat & obstacles,
|
const cv::Mat & obstacles,
|
||||||
|
const cv::Mat & empty,
|
||||||
float cellSize,
|
float cellSize,
|
||||||
const cv::Point3f & viewpoint) const;
|
const cv::Point3f & viewpoint) const;
|
||||||
|
|
||||||
@@ -168,9 +177,12 @@ private:
|
|||||||
void loadLinksQuery(std::list<Signature *> & signatures) const;
|
void loadLinksQuery(std::list<Signature *> & signatures) const;
|
||||||
int loadOrSaveDb(sqlite3 *pInMemory, const std::string & fileName, int isSave) const;
|
int loadOrSaveDb(sqlite3 *pInMemory, const std::string & fileName, int isSave) const;
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
sqlite3 * _ppDb;
|
sqlite3 * _ppDb;
|
||||||
std::string _version;
|
std::string _version;
|
||||||
|
|
||||||
|
private:
|
||||||
|
long _memoryUsedEstimate;
|
||||||
bool _dbInMemory;
|
bool _dbInMemory;
|
||||||
unsigned int _cacheSize;
|
unsigned int _cacheSize;
|
||||||
int _journalMode;
|
int _journalMode;
|
||||||
@@ -177,6 +177,8 @@ private:
|
|||||||
int _subPixWinSize;
|
int _subPixWinSize;
|
||||||
int _subPixIterations;
|
int _subPixIterations;
|
||||||
double _subPixEps;
|
double _subPixEps;
|
||||||
|
int gridRows_;
|
||||||
|
int gridCols_;
|
||||||
// Stereo stuff
|
// Stereo stuff
|
||||||
Stereo * _stereo;
|
Stereo * _stereo;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -49,21 +49,25 @@ public:
|
|||||||
// Note that useDistanceL1 doesn't have any effect if LSH is used
|
// Note that useDistanceL1 doesn't have any effect if LSH is used
|
||||||
void buildLinearIndex(
|
void buildLinearIndex(
|
||||||
const cv::Mat & features,
|
const cv::Mat & features,
|
||||||
bool useDistanceL1 = false);
|
bool useDistanceL1 = false,
|
||||||
|
float rebalancingFactor = 2.0f);
|
||||||
void buildKDTreeIndex(
|
void buildKDTreeIndex(
|
||||||
const cv::Mat & features,
|
const cv::Mat & features,
|
||||||
int trees = 4,
|
int trees = 4,
|
||||||
bool useDistanceL1 = false);
|
bool useDistanceL1 = false,
|
||||||
|
float rebalancingFactor = 2.0f);
|
||||||
void buildKDTreeSingleIndex(
|
void buildKDTreeSingleIndex(
|
||||||
const cv::Mat & features,
|
const cv::Mat & features,
|
||||||
int leafMaxSize = 10,
|
int leafMaxSize = 10,
|
||||||
bool reorder = true,
|
bool reorder = true,
|
||||||
bool useDistanceL1 = false);
|
bool useDistanceL1 = false,
|
||||||
|
float rebalancingFactor = 2.0f);
|
||||||
void buildLSHIndex(
|
void buildLSHIndex(
|
||||||
const cv::Mat & features,
|
const cv::Mat & features,
|
||||||
unsigned int table_number = 12,
|
unsigned int table_number = 12,
|
||||||
unsigned int key_size = 20,
|
unsigned int key_size = 20,
|
||||||
unsigned int multi_probe_level = 2);
|
unsigned int multi_probe_level = 2,
|
||||||
|
float rebalancingFactor = 2.0f);
|
||||||
|
|
||||||
bool isBuilt();
|
bool isBuilt();
|
||||||
|
|
||||||
@@ -74,7 +78,7 @@ public:
|
|||||||
|
|
||||||
void removePoint(unsigned int index);
|
void removePoint(unsigned int index);
|
||||||
|
|
||||||
// return squared distances
|
// return squared distances (indices should be casted in size_t)
|
||||||
void knnSearch(
|
void knnSearch(
|
||||||
const cv::Mat & query,
|
const cv::Mat & query,
|
||||||
cv::Mat & indices,
|
cv::Mat & indices,
|
||||||
@@ -102,6 +106,7 @@ private:
|
|||||||
int featuresDim_;
|
int featuresDim_;
|
||||||
bool isLSH_;
|
bool isLSH_;
|
||||||
bool useDistanceL1_; // true=EUCLEDIAN_L2 false=MANHATTAN_L1
|
bool useDistanceL1_; // true=EUCLEDIAN_L2 false=MANHATTAN_L1
|
||||||
|
float rebalancingFactor_;
|
||||||
|
|
||||||
// keep feature in memory until the tree is rebuilt
|
// keep feature in memory until the tree is rebuilt
|
||||||
// (in case the word is deleted when removed from the VWDictionary)
|
// (in case the word is deleted when removed from the VWDictionary)
|
||||||
|
|||||||
@@ -25,6 +25,20 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The methods in this file were modified from the originals of the MRPT toolkit (see notice below):
|
||||||
|
* https://github.com/MRPT/mrpt/blob/master/libs/topography/src/conversions.cpp
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* +---------------------------------------------------------------------------+
|
||||||
|
| Mobile Robot Programming Toolkit (MRPT) |
|
||||||
|
| http://www.mrpt.org/ |
|
||||||
|
| |
|
||||||
|
| Copyright (c) 2005-2016, Individual contributors, see AUTHORS file |
|
||||||
|
| See: http://www.mrpt.org/Authors - All rights reserved. |
|
||||||
|
| Released under BSD License. See details in http://www.mrpt.org/License |
|
||||||
|
+---------------------------------------------------------------------------+ */
|
||||||
|
|
||||||
|
|
||||||
#ifndef GEODETICCOORDS_H_
|
#ifndef GEODETICCOORDS_H_
|
||||||
#define GEODETICCOORDS_H_
|
#define GEODETICCOORDS_H_
|
||||||
@@ -52,12 +66,58 @@ public:
|
|||||||
cv::Point3d toGeocentric_WGS84() const;
|
cv::Point3d toGeocentric_WGS84() const;
|
||||||
cv::Point3d toENU_WGS84(const GeodeticCoords & origin) const; // East=X, North=Y
|
cv::Point3d toENU_WGS84(const GeodeticCoords & origin) const; // East=X, North=Y
|
||||||
|
|
||||||
|
void fromGeocentric_WGS84(const cv::Point3d& geocentric);
|
||||||
|
void fromENU_WGS84(const cv::Point3d & enu, const GeodeticCoords & origin);
|
||||||
|
|
||||||
|
static cv::Point3d ENU_WGS84ToGeocentric_WGS84(const cv::Point3d & enu, const GeodeticCoords & origin);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double latitude_; // deg
|
double latitude_; // deg
|
||||||
double longitude_; // deg
|
double longitude_; // deg
|
||||||
double altitude_; // m
|
double altitude_; // m
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class GPS
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GPS():
|
||||||
|
stamp_(0.0),
|
||||||
|
longitude_(0.0),
|
||||||
|
latitude_(0.0),
|
||||||
|
altitude_(0.0),
|
||||||
|
error_(0.0),
|
||||||
|
bearing_(0.0)
|
||||||
|
{}
|
||||||
|
GPS(const double & stamp,
|
||||||
|
const double & longitude,
|
||||||
|
const double & latitude,
|
||||||
|
const double & altitude,
|
||||||
|
const double & error,
|
||||||
|
const double & bearing):
|
||||||
|
stamp_(stamp),
|
||||||
|
longitude_(longitude),
|
||||||
|
latitude_(latitude),
|
||||||
|
altitude_(altitude),
|
||||||
|
error_(error),
|
||||||
|
bearing_(bearing)
|
||||||
|
{}
|
||||||
|
const double & stamp() const {return stamp_;}
|
||||||
|
const double & longitude() const {return longitude_;}
|
||||||
|
const double & latitude() const {return latitude_;}
|
||||||
|
const double & altitude() const {return altitude_;}
|
||||||
|
const double & error() const {return error_;}
|
||||||
|
const double & bearing() const {return bearing_;}
|
||||||
|
|
||||||
|
GeodeticCoords toGeodeticCoords() const {return GeodeticCoords(latitude_, longitude_, altitude_);}
|
||||||
|
private:
|
||||||
|
double stamp_; // in sec
|
||||||
|
double longitude_; // DD
|
||||||
|
double latitude_; // DD
|
||||||
|
double altitude_; // m
|
||||||
|
double error_; // m
|
||||||
|
double bearing_; // deg (North 0->360 clockwise)
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* GEODETICCOORDS_H_ */
|
#endif /* GEODETICCOORDS_H_ */
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <rtabmap/core/Link.h>
|
#include <rtabmap/core/Link.h>
|
||||||
|
#include <rtabmap/core/GeodeticCoords.h>
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
class Memory;
|
class Memory;
|
||||||
@@ -58,6 +59,11 @@ bool RTABMAP_EXP importPoses(
|
|||||||
std::multimap<int, Link> * constraints = 0, // optional for formats 3 and 4
|
std::multimap<int, Link> * constraints = 0, // optional for formats 3 and 4
|
||||||
std::map<int, double> * stamps = 0); // optional for format 1
|
std::map<int, double> * stamps = 0); // optional for format 1
|
||||||
|
|
||||||
|
bool RTABMAP_EXP exportGPS(
|
||||||
|
const std::string & filePath,
|
||||||
|
const std::map<int, GPS> & gpsValues,
|
||||||
|
unsigned int rgba = 0xFFFFFFFF);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compute translation and rotation errors for KITTI datasets.
|
* Compute translation and rotation errors for KITTI datasets.
|
||||||
* See http://www.cvlibs.net/datasets/kitti/eval_odometry.php.
|
* See http://www.cvlibs.net/datasets/kitti/eval_odometry.php.
|
||||||
@@ -72,6 +78,30 @@ void RTABMAP_EXP calcKittiSequenceErrors(
|
|||||||
float & t_err,
|
float & t_err,
|
||||||
float & r_err);
|
float & r_err);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compute root-mean-square error (RMSE) like the TUM RGBD
|
||||||
|
* dataset's evaluation tool (absolute trajectory error).
|
||||||
|
* See https://vision.in.tum.de/data/datasets/rgbd-dataset
|
||||||
|
* @param groundTruth, Ground Truth poses
|
||||||
|
* @param poses, Estimated poses
|
||||||
|
* @return Gt to Map transform
|
||||||
|
*/
|
||||||
|
Transform RTABMAP_EXP calcRMSE(
|
||||||
|
const std::map<int, Transform> &groundTruth,
|
||||||
|
const std::map<int, Transform> &poses,
|
||||||
|
float & translational_rmse,
|
||||||
|
float & translational_mean,
|
||||||
|
float & translational_median,
|
||||||
|
float & translational_std,
|
||||||
|
float & translational_min,
|
||||||
|
float & translational_max,
|
||||||
|
float & rotational_rmse,
|
||||||
|
float & rotational_mean,
|
||||||
|
float & rotational_median,
|
||||||
|
float & rotational_std,
|
||||||
|
float & rotational_min,
|
||||||
|
float & rotational_max);
|
||||||
|
|
||||||
std::multimap<int, Link>::iterator RTABMAP_EXP findLink(
|
std::multimap<int, Link>::iterator RTABMAP_EXP findLink(
|
||||||
std::multimap<int, Link> & links,
|
std::multimap<int, Link> & links,
|
||||||
int from,
|
int from,
|
||||||
@@ -93,6 +123,8 @@ std::multimap<int, int>::const_iterator RTABMAP_EXP findLink(
|
|||||||
int to,
|
int to,
|
||||||
bool checkBothWays = true);
|
bool checkBothWays = true);
|
||||||
|
|
||||||
|
std::multimap<int, Link> RTABMAP_EXP filterDuplicateLinks(
|
||||||
|
const std::multimap<int, Link> & links);
|
||||||
std::multimap<int, Link> RTABMAP_EXP filterLinks(
|
std::multimap<int, Link> RTABMAP_EXP filterLinks(
|
||||||
const std::multimap<int, Link> & links,
|
const std::multimap<int, Link> & links,
|
||||||
Link::Type filteredType);
|
Link::Type filteredType);
|
||||||
@@ -197,6 +229,11 @@ int RTABMAP_EXP findNearestNode(
|
|||||||
const std::map<int, rtabmap::Transform> & nodes,
|
const std::map<int, rtabmap::Transform> & nodes,
|
||||||
const rtabmap::Transform & targetPose);
|
const rtabmap::Transform & targetPose);
|
||||||
|
|
||||||
|
std::vector<int> RTABMAP_EXP findNearestNodes(
|
||||||
|
const std::map<int, rtabmap::Transform> & nodes,
|
||||||
|
const rtabmap::Transform & targetPose,
|
||||||
|
int k);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get nodes near the query
|
* Get nodes near the query
|
||||||
* @param nodeId the query id
|
* @param nodeId the query id
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
/*
|
||||||
|
* IMU.h
|
||||||
|
*
|
||||||
|
* Created on: 2018-03-05
|
||||||
|
* Author: mathieu
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef IMU_H_
|
||||||
|
#define IMU_H_
|
||||||
|
|
||||||
|
#include <opencv2/core/core.hpp>
|
||||||
|
#include <rtabmap/utilite/ULogger.h>
|
||||||
|
|
||||||
|
namespace rtabmap {
|
||||||
|
|
||||||
|
|
||||||
|
// Correspondence class to sensor_msgs/IMU
|
||||||
|
class IMU
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IMU() {}
|
||||||
|
IMU(const cv::Vec4d & orientation,
|
||||||
|
const cv::Mat & orientationCovariance,
|
||||||
|
const cv::Vec3d & angularVelocity,
|
||||||
|
const cv::Mat & angularVelocityCovariance,
|
||||||
|
const cv::Vec3d & linearAcceleration,
|
||||||
|
const cv::Mat & linearAccelerationCovariance,
|
||||||
|
const Transform & localTransform = Transform::getIdentity()) :
|
||||||
|
orientation_(orientation),
|
||||||
|
orientationCovariance_(orientationCovariance),
|
||||||
|
angularVelocity_(angularVelocity),
|
||||||
|
angularVelocityCovariance_(angularVelocityCovariance),
|
||||||
|
linearAcceleration_(linearAcceleration),
|
||||||
|
linearAccelerationCovariance_(linearAccelerationCovariance),
|
||||||
|
localTransform_(localTransform)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
IMU(const cv::Vec3d & angularVelocity,
|
||||||
|
const cv::Mat & angularVelocityCovariance,
|
||||||
|
const cv::Vec3d & linearAcceleration,
|
||||||
|
const cv::Mat & linearAccelerationCovariance,
|
||||||
|
const Transform & localTransform = Transform::getIdentity()) :
|
||||||
|
angularVelocity_(angularVelocity),
|
||||||
|
angularVelocityCovariance_(angularVelocityCovariance),
|
||||||
|
linearAcceleration_(linearAcceleration),
|
||||||
|
linearAccelerationCovariance_(linearAccelerationCovariance),
|
||||||
|
localTransform_(localTransform)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
const cv::Vec4d & orientation() const {return orientation_;}
|
||||||
|
const cv::Mat & orientationCovariance() const {return orientationCovariance_;} // 3x3 double Row major about x, y, z axes, empty if orientation is not set
|
||||||
|
|
||||||
|
const cv::Vec3d & angularVelocity() const {return angularVelocity_;}
|
||||||
|
const cv::Mat & angularVelocityCovariance() const {return angularVelocityCovariance_;} // 3x3 double Row major about x, y, z axes, empty if angularVelocity is not set
|
||||||
|
|
||||||
|
const cv::Vec3d linearAcceleration() const {return linearAcceleration_;}
|
||||||
|
const cv::Mat & linearAccelerationCovariance() const {return linearAccelerationCovariance_;} // 3x3 double Row major x, y z, empty if linearAcceleration is not set
|
||||||
|
|
||||||
|
const Transform & localTransform() const {return localTransform_;}
|
||||||
|
|
||||||
|
bool empty() const
|
||||||
|
{
|
||||||
|
return localTransform_.isNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
cv::Vec4d orientation_;
|
||||||
|
cv::Mat orientationCovariance_; // 3x3 double Row major about x, y, z axes, empty if orientation is not set
|
||||||
|
|
||||||
|
cv::Vec3d angularVelocity_;
|
||||||
|
cv::Mat angularVelocityCovariance_; // 3x3 double Row major about x, y, z axes, empty if angularVelocity is not set
|
||||||
|
|
||||||
|
cv::Vec3d linearAcceleration_;
|
||||||
|
cv::Mat linearAccelerationCovariance_; // 3x3 double Row major x, y z, empty if linearAcceleration is not set
|
||||||
|
|
||||||
|
Transform localTransform_;
|
||||||
|
};
|
||||||
|
|
||||||
|
class IMUEvent : public UEvent
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IMUEvent() :
|
||||||
|
stamp_(0.0)
|
||||||
|
{}
|
||||||
|
IMUEvent(const IMU & data, double stamp) :
|
||||||
|
data_(data),
|
||||||
|
stamp_(stamp)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
virtual std::string getClassName() const {return "IMUEvent";}
|
||||||
|
const IMU & getData() const {return data_;}
|
||||||
|
double getStamp() const {return stamp_;}
|
||||||
|
|
||||||
|
private:
|
||||||
|
IMU data_;
|
||||||
|
double stamp_;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* IMU_H_ */
|
||||||
+70
-65
@@ -1,65 +1,70 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
* Redistributions of source code must retain the above copyright
|
* Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
* Neither the name of the Universite de Sherbrooke nor the
|
* Neither the name of the Universite de Sherbrooke nor the
|
||||||
names of its contributors may be used to endorse or promote products
|
names of its contributors may be used to endorse or promote products
|
||||||
derived from this software without specific prior written permission.
|
derived from this software without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CORELIB_INCLUDE_RTABMAP_CORE_LASERSCANINFO_H_
|
#pragma once
|
||||||
#define CORELIB_INCLUDE_RTABMAP_CORE_LASERSCANINFO_H_
|
|
||||||
|
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
||||||
#include <rtabmap/utilite/ULogger.h>
|
|
||||||
|
#include <rtabmap/core/Transform.h>
|
||||||
namespace rtabmap {
|
#include <rtabmap/utilite/UThread.h>
|
||||||
|
#include <rtabmap/utilite/UEventsSender.h>
|
||||||
class LaserScanInfo
|
#include <rtabmap/utilite/UTimer.h>
|
||||||
{
|
|
||||||
public:
|
#include <fstream>
|
||||||
LaserScanInfo() :
|
|
||||||
maxPoints_(0),
|
namespace rtabmap
|
||||||
maxRange_(0),
|
{
|
||||||
localTransform_(Transform::getIdentity())
|
|
||||||
{
|
/**
|
||||||
}
|
* Class IMUThread
|
||||||
|
*
|
||||||
LaserScanInfo(int maxPoints, float maxRange, const Transform & localTransform = Transform::getIdentity()) :
|
*/
|
||||||
maxPoints_(maxPoints),
|
class RTABMAP_EXP IMUThread :
|
||||||
maxRange_(maxRange),
|
public UThread,
|
||||||
localTransform_(localTransform)
|
public UEventsSender
|
||||||
{
|
{
|
||||||
UASSERT(!localTransform.isNull());
|
public:
|
||||||
}
|
IMUThread(int rate, const Transform & localTransform);
|
||||||
|
virtual ~IMUThread();
|
||||||
int maxPoints() const {return maxPoints_;}
|
|
||||||
float maxRange() const {return maxRange_;}
|
bool init(const std::string & path);
|
||||||
Transform localTransform() const {return localTransform_;}
|
void setRate(int rate);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int maxPoints_;
|
virtual void mainLoopBegin();
|
||||||
float maxRange_;
|
virtual void mainLoop();
|
||||||
Transform localTransform_;
|
|
||||||
};
|
private:
|
||||||
|
int rate_;
|
||||||
}
|
Transform localTransform_;
|
||||||
|
std::ifstream imuFile_;
|
||||||
#endif /* CORELIB_INCLUDE_RTABMAP_CORE_LASERSCANINFO_H_ */
|
UTimer frameRateTimer_;
|
||||||
|
double captureDelay_;
|
||||||
|
double previousStamp_;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace rtabmap
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of the Universite de Sherbrooke nor the
|
||||||
|
names of its contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CORELIB_INCLUDE_RTABMAP_CORE_LASERSCAN_H_
|
||||||
|
#define CORELIB_INCLUDE_RTABMAP_CORE_LASERSCAN_H_
|
||||||
|
|
||||||
|
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
||||||
|
|
||||||
|
#include <rtabmap/core/Transform.h>
|
||||||
|
|
||||||
|
namespace rtabmap {
|
||||||
|
|
||||||
|
class RTABMAP_EXP LaserScan
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum Format{kUnknown=0,
|
||||||
|
kXY=1,
|
||||||
|
kXYI=2,
|
||||||
|
kXYNormal=3,
|
||||||
|
kXYINormal=4,
|
||||||
|
kXYZ=5,
|
||||||
|
kXYZI=6,
|
||||||
|
kXYZRGB=7,
|
||||||
|
kXYZNormal=8,
|
||||||
|
kXYZINormal=9,
|
||||||
|
kXYZRGBNormal=10};
|
||||||
|
|
||||||
|
static int channels(Format format);
|
||||||
|
static bool isScan2d(const Format & format);
|
||||||
|
static bool isScanHasNormals(const Format & format);
|
||||||
|
static bool isScanHasRGB(const Format & format);
|
||||||
|
static bool isScanHasIntensity(const Format & format);
|
||||||
|
static LaserScan backwardCompatibility(const cv::Mat & oldScanFormat, int maxPoints = 0, int maxRange = 0, const Transform & localTransform = Transform::getIdentity());
|
||||||
|
|
||||||
|
public:
|
||||||
|
LaserScan();
|
||||||
|
LaserScan(const cv::Mat & data, int maxPoints, float maxRange, Format format, const Transform & localTransform = Transform::getIdentity());
|
||||||
|
|
||||||
|
const cv::Mat & data() const {return data_;}
|
||||||
|
int maxPoints() const {return maxPoints_;}
|
||||||
|
float maxRange() const {return maxRange_;}
|
||||||
|
Format format() const {return format_;}
|
||||||
|
Transform localTransform() const {return localTransform_;}
|
||||||
|
|
||||||
|
bool isEmpty() const {return data_.empty();}
|
||||||
|
int size() const {return data_.cols;}
|
||||||
|
int dataType() const {return data_.type();}
|
||||||
|
bool is2d() const {return isScan2d(format_);}
|
||||||
|
bool hasNormals() const {return isScanHasNormals(format_);}
|
||||||
|
bool hasRGB() const {return isScanHasRGB(format_);}
|
||||||
|
bool hasIntensity() const {return isScanHasIntensity(format_);}
|
||||||
|
bool isCompressed() const {return !data_.empty() && data_.type()==CV_8UC1;}
|
||||||
|
LaserScan clone() const {return LaserScan(data_.clone(), maxPoints_, maxRange_, format_, localTransform_.clone());}
|
||||||
|
|
||||||
|
int getIntensityOffset() const {return hasIntensity()?(is2d()?2:3):-1;}
|
||||||
|
int getRGBOffset() const {return hasRGB()?(is2d()?2:3):-1;}
|
||||||
|
int getNormalsOffset() const {return hasNormals()?(2 + (is2d()?0:1) + ((hasRGB() || hasIntensity())?1:0)):-1;}
|
||||||
|
|
||||||
|
void clear() {data_ = cv::Mat();}
|
||||||
|
|
||||||
|
private:
|
||||||
|
cv::Mat data_;
|
||||||
|
int maxPoints_;
|
||||||
|
float maxRange_;
|
||||||
|
Format format_;
|
||||||
|
Transform localTransform_;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CORELIB_INCLUDE_RTABMAP_CORE_LASERSCAN_H_ */
|
||||||
@@ -95,9 +95,12 @@ public:
|
|||||||
void saveStatistics(const Statistics & statistics);
|
void saveStatistics(const Statistics & statistics);
|
||||||
void savePreviewImage(const cv::Mat & image) const;
|
void savePreviewImage(const cv::Mat & image) const;
|
||||||
cv::Mat loadPreviewImage() const;
|
cv::Mat loadPreviewImage() const;
|
||||||
|
void saveOptimizedPoses(const std::map<int, Transform> & optimizedPoses, const Transform & lastlocalizationPose) const;
|
||||||
|
std::map<int, Transform> loadOptimizedPoses(Transform * lastlocalizationPose) const;
|
||||||
|
void save2DMap(const cv::Mat & map, float xMin, float yMin, float cellSize) const;
|
||||||
|
cv::Mat load2DMap(float & xMin, float & yMin, float & cellSize) const;
|
||||||
void saveOptimizedMesh(
|
void saveOptimizedMesh(
|
||||||
const cv::Mat & cloud,
|
const cv::Mat & cloud,
|
||||||
const std::map<int, Transform> & poses = std::map<int, Transform>(), // if we want to do localization afterward using optimized mesh
|
|
||||||
const std::vector<std::vector<std::vector<unsigned int> > > & polygons = std::vector<std::vector<std::vector<unsigned int> > >(), // Textures -> polygons -> vertices
|
const std::vector<std::vector<std::vector<unsigned int> > > & polygons = std::vector<std::vector<std::vector<unsigned int> > >(), // Textures -> polygons -> vertices
|
||||||
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
||||||
const std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > & texCoords = std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > >(), // Textures -> uv coords for each vertex of the polygons
|
const std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > & texCoords = std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > >(), // Textures -> uv coords for each vertex of the polygons
|
||||||
@@ -106,7 +109,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
const cv::Mat & textures = cv::Mat()) const; // concatenated textures (assuming square textures with all same size)
|
const cv::Mat & textures = cv::Mat()) const; // concatenated textures (assuming square textures with all same size)
|
||||||
cv::Mat loadOptimizedMesh(
|
cv::Mat loadOptimizedMesh(
|
||||||
std::map<int, Transform> * poses = 0,
|
|
||||||
std::vector<std::vector<std::vector<unsigned int> > > * polygons = 0,
|
std::vector<std::vector<std::vector<unsigned int> > > * polygons = 0,
|
||||||
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
#if PCL_VERSION_COMPARE(>=, 1, 8, 0)
|
||||||
std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > * texCoords = 0,
|
std::vector<std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> > > * texCoords = 0,
|
||||||
@@ -127,6 +129,8 @@ public:
|
|||||||
bool incrementMarginOnLoop = false,
|
bool incrementMarginOnLoop = false,
|
||||||
bool ignoreLoopIds = false,
|
bool ignoreLoopIds = false,
|
||||||
bool ignoreIntermediateNodes = false,
|
bool ignoreIntermediateNodes = false,
|
||||||
|
bool ignoreLocalSpaceLoopIds = false,
|
||||||
|
const std::set<int> & nodesSet = std::set<int>(),
|
||||||
double * dbAccessTime = 0) const;
|
double * dbAccessTime = 0) const;
|
||||||
std::map<int, float> getNeighborsIdRadius(
|
std::map<int, float> getNeighborsIdRadius(
|
||||||
int signatureId,
|
int signatureId,
|
||||||
@@ -134,6 +138,7 @@ public:
|
|||||||
const std::map<int, Transform> & optimizedPoses,
|
const std::map<int, Transform> & optimizedPoses,
|
||||||
int maxGraphDepth) const;
|
int maxGraphDepth) const;
|
||||||
void deleteLocation(int locationId, std::list<int> * deletedWords = 0);
|
void deleteLocation(int locationId, std::list<int> * deletedWords = 0);
|
||||||
|
void saveLocationData(int locationId);
|
||||||
void removeLink(int idA, int idB);
|
void removeLink(int idA, int idB);
|
||||||
void removeRawData(int id, bool image = true, bool scan = true, bool userData = true);
|
void removeRawData(int id, bool image = true, bool scan = true, bool userData = true);
|
||||||
|
|
||||||
@@ -166,6 +171,7 @@ public:
|
|||||||
bool setUserData(int id, const cv::Mat & data);
|
bool setUserData(int id, const cv::Mat & data);
|
||||||
int getDatabaseMemoryUsed() const; // in bytes
|
int getDatabaseMemoryUsed() const; // in bytes
|
||||||
std::string getDatabaseVersion() const;
|
std::string getDatabaseVersion() const;
|
||||||
|
std::string getDatabaseUrl() const;
|
||||||
double getDbSavingTime() const;
|
double getDbSavingTime() const;
|
||||||
Transform getOdomPose(int signatureId, bool lookInDatabase = false) const;
|
Transform getOdomPose(int signatureId, bool lookInDatabase = false) const;
|
||||||
Transform getGroundTruthPose(int signatureId, bool lookInDatabase = false) const;
|
Transform getGroundTruthPose(int signatureId, bool lookInDatabase = false) const;
|
||||||
@@ -177,6 +183,7 @@ public:
|
|||||||
double & stamp,
|
double & stamp,
|
||||||
Transform & groundTruth,
|
Transform & groundTruth,
|
||||||
std::vector<float> & velocity,
|
std::vector<float> & velocity,
|
||||||
|
GPS & gps,
|
||||||
bool lookInDatabase = false) const;
|
bool lookInDatabase = false) const;
|
||||||
cv::Mat getImageCompressed(int signatureId) const;
|
cv::Mat getImageCompressed(int signatureId) const;
|
||||||
SensorData getNodeData(int nodeId, bool uncompressedData = false) const;
|
SensorData getNodeData(int nodeId, bool uncompressedData = false) const;
|
||||||
@@ -219,7 +226,6 @@ public:
|
|||||||
|
|
||||||
Transform computeTransform(Signature & fromS, Signature & toS, Transform guess, RegistrationInfo * info = 0, bool useKnownCorrespondencesIfPossible = false) const;
|
Transform computeTransform(Signature & fromS, Signature & toS, Transform guess, RegistrationInfo * info = 0, bool useKnownCorrespondencesIfPossible = false) const;
|
||||||
Transform computeTransform(int fromId, int toId, Transform guess, RegistrationInfo * info = 0, bool useKnownCorrespondencesIfPossible = false);
|
Transform computeTransform(int fromId, int toId, Transform guess, RegistrationInfo * info = 0, bool useKnownCorrespondencesIfPossible = false);
|
||||||
Transform computeIcpTransform(int fromId, int toId, Transform guess, RegistrationInfo * info = 0);
|
|
||||||
Transform computeIcpTransformMulti(
|
Transform computeIcpTransformMulti(
|
||||||
int newId,
|
int newId,
|
||||||
int oldId,
|
int oldId,
|
||||||
@@ -278,18 +284,26 @@ private:
|
|||||||
bool _generateIds;
|
bool _generateIds;
|
||||||
bool _badSignaturesIgnored;
|
bool _badSignaturesIgnored;
|
||||||
bool _mapLabelsAdded;
|
bool _mapLabelsAdded;
|
||||||
|
bool _depthAsMask;
|
||||||
int _imagePreDecimation;
|
int _imagePreDecimation;
|
||||||
int _imagePostDecimation;
|
int _imagePostDecimation;
|
||||||
bool _compressionParallelized;
|
bool _compressionParallelized;
|
||||||
float _laserScanDownsampleStepSize;
|
float _laserScanDownsampleStepSize;
|
||||||
|
float _laserScanVoxelSize;
|
||||||
int _laserScanNormalK;
|
int _laserScanNormalK;
|
||||||
|
float _laserScanNormalRadius;
|
||||||
bool _reextractLoopClosureFeatures;
|
bool _reextractLoopClosureFeatures;
|
||||||
|
bool _localBundleOnLoopClosure;
|
||||||
float _rehearsalMaxDistance;
|
float _rehearsalMaxDistance;
|
||||||
float _rehearsalMaxAngle;
|
float _rehearsalMaxAngle;
|
||||||
bool _rehearsalWeightIgnoredWhileMoving;
|
bool _rehearsalWeightIgnoredWhileMoving;
|
||||||
bool _useOdometryFeatures;
|
bool _useOdometryFeatures;
|
||||||
bool _createOccupancyGrid;
|
bool _createOccupancyGrid;
|
||||||
int _visMaxFeatures;
|
int _visMaxFeatures;
|
||||||
|
int _visCorType;
|
||||||
|
bool _imagesAlreadyRectified;
|
||||||
|
bool _rectifyOnlyFeatures;
|
||||||
|
bool _covOffDiagonalIgnored;
|
||||||
|
|
||||||
int _idCount;
|
int _idCount;
|
||||||
int _idMapCount;
|
int _idMapCount;
|
||||||
@@ -298,6 +312,9 @@ private:
|
|||||||
bool _memoryChanged; // False by default, become true only when Memory::update() is called.
|
bool _memoryChanged; // False by default, become true only when Memory::update() is called.
|
||||||
bool _linksChanged; // False by default, become true when links are modified.
|
bool _linksChanged; // False by default, become true when links are modified.
|
||||||
int _signaturesAdded;
|
int _signaturesAdded;
|
||||||
|
GPS _gpsOrigin;
|
||||||
|
std::vector<CameraModel> _rectCameraModels;
|
||||||
|
StereoCameraModel _rectStereoCameraModel;
|
||||||
|
|
||||||
std::map<int, Signature *> _signatures; // TODO : check if a signature is already added? although it is not supposed to occur...
|
std::map<int, Signature *> _signatures; // TODO : check if a signature is already added? although it is not supposed to occur...
|
||||||
std::set<int> _stMem; // id
|
std::set<int> _stMem; // id
|
||||||
@@ -311,7 +328,7 @@ private:
|
|||||||
bool _parallelized;
|
bool _parallelized;
|
||||||
|
|
||||||
Registration * _registrationPipeline;
|
Registration * _registrationPipeline;
|
||||||
RegistrationIcp * _registrationIcp;
|
RegistrationIcp * _registrationIcpMulti;
|
||||||
|
|
||||||
OccupancyGrid * _occupancy;
|
OccupancyGrid * _occupancy;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -39,17 +39,32 @@ namespace rtabmap {
|
|||||||
|
|
||||||
class RTABMAP_EXP OccupancyGrid
|
class RTABMAP_EXP OccupancyGrid
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
inline static float logodds(double probability)
|
||||||
|
{
|
||||||
|
return (float) log(probability/(1-probability));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static double probability(double logodds)
|
||||||
|
{
|
||||||
|
return 1. - ( 1. / (1. + exp(logodds)));
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OccupancyGrid(const ParametersMap & parameters = ParametersMap());
|
OccupancyGrid(const ParametersMap & parameters = ParametersMap());
|
||||||
void parseParameters(const ParametersMap & parameters);
|
void parseParameters(const ParametersMap & parameters);
|
||||||
|
void setMap(const cv::Mat & map, float xMin, float yMin, float cellSize, const std::map<int, Transform> & poses);
|
||||||
void setCellSize(float cellSize);
|
void setCellSize(float cellSize);
|
||||||
float getCellSize() const {return cellSize_;}
|
float getCellSize() const {return cellSize_;}
|
||||||
|
void setCloudAssembling(bool enabled);
|
||||||
float getMinMapSize() const {return minMapSize_;}
|
float getMinMapSize() const {return minMapSize_;}
|
||||||
bool isGridFromDepth() const {return occupancyFromCloud_;}
|
bool isGridFromDepth() const {return occupancyFromDepth_;}
|
||||||
bool isFullUpdate() const {return fullUpdate_;}
|
bool isFullUpdate() const {return fullUpdate_;}
|
||||||
|
float getUpdateError() const {return updateError_;}
|
||||||
bool isMapFrameProjection() const {return projMapFrame_;}
|
bool isMapFrameProjection() const {return projMapFrame_;}
|
||||||
const std::map<int, Transform> & addedNodes() const {return addedNodes_;}
|
const std::map<int, Transform> & addedNodes() const {return addedNodes_;}
|
||||||
int cacheSize() const {return (int)cache_.size();}
|
int cacheSize() const {return (int)cache_.size();}
|
||||||
|
const std::map<int, std::pair<std::pair<cv::Mat, cv::Mat>, cv::Mat> > & getCache() const {return cache_;}
|
||||||
|
|
||||||
template<typename PointT>
|
template<typename PointT>
|
||||||
typename pcl::PointCloud<PointT>::Ptr segmentCloud(
|
typename pcl::PointCloud<PointT>::Ptr segmentCloud(
|
||||||
@@ -63,17 +78,31 @@ public:
|
|||||||
|
|
||||||
void createLocalMap(
|
void createLocalMap(
|
||||||
const Signature & node,
|
const Signature & node,
|
||||||
cv::Mat & ground,
|
cv::Mat & groundCells,
|
||||||
cv::Mat & obstacles,
|
cv::Mat & obstacleCells,
|
||||||
|
cv::Mat & emptyCells,
|
||||||
cv::Point3f & viewPoint) const;
|
cv::Point3f & viewPoint) const;
|
||||||
|
|
||||||
|
void createLocalMap(
|
||||||
|
const LaserScan & cloud,
|
||||||
|
const Transform & pose,
|
||||||
|
cv::Mat & groundCells,
|
||||||
|
cv::Mat & obstacleCells,
|
||||||
|
cv::Mat & emptyCells,
|
||||||
|
cv::Point3f & viewPointInOut) const;
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
void addToCache(
|
void addToCache(
|
||||||
int nodeId,
|
int nodeId,
|
||||||
const cv::Mat & ground,
|
const cv::Mat & ground,
|
||||||
const cv::Mat & obstacles);
|
const cv::Mat & obstacles,
|
||||||
|
const cv::Mat & empty);
|
||||||
void update(const std::map<int, Transform> & poses);
|
void update(const std::map<int, Transform> & poses);
|
||||||
const cv::Mat getMap(float & xMin, float & yMin) const;
|
cv::Mat getMap(float & xMin, float & yMin) const;
|
||||||
|
cv::Mat getProbMap(float & xMin, float & yMin) const;
|
||||||
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & getMapGround() const {return assembledGround_;}
|
||||||
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & getMapObstacles() const {return assembledObstacles_;}
|
||||||
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & getMapEmptyCells() const {return assembledEmptyCells_;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ParametersMap parameters_;
|
ParametersMap parameters_;
|
||||||
@@ -86,7 +115,8 @@ private:
|
|||||||
float footprintHeight_;
|
float footprintHeight_;
|
||||||
int scanDecimation_;
|
int scanDecimation_;
|
||||||
float cellSize_;
|
float cellSize_;
|
||||||
bool occupancyFromCloud_;
|
bool preVoxelFiltering_;
|
||||||
|
bool occupancyFromDepth_;
|
||||||
bool projMapFrame_;
|
bool projMapFrame_;
|
||||||
float maxObstacleHeight_;
|
float maxObstacleHeight_;
|
||||||
int normalKSearch_;
|
int normalKSearch_;
|
||||||
@@ -102,20 +132,30 @@ private:
|
|||||||
float noiseFilteringRadius_;
|
float noiseFilteringRadius_;
|
||||||
int noiseFilteringMinNeighbors_;
|
int noiseFilteringMinNeighbors_;
|
||||||
bool scan2dUnknownSpaceFilled_;
|
bool scan2dUnknownSpaceFilled_;
|
||||||
double scan2dMaxUnknownSpaceFilledRange_;
|
bool rayTracing_;
|
||||||
bool projRayTracing_;
|
|
||||||
bool fullUpdate_;
|
bool fullUpdate_;
|
||||||
float minMapSize_;
|
float minMapSize_;
|
||||||
bool erode_;
|
bool erode_;
|
||||||
float footprintRadius_;
|
float footprintRadius_;
|
||||||
|
float updateError_;
|
||||||
|
float occupancyThr_;
|
||||||
|
float probHit_;
|
||||||
|
float probMiss_;
|
||||||
|
float probClampingMin_;
|
||||||
|
float probClampingMax_;
|
||||||
|
|
||||||
std::map<int, std::pair<cv::Mat, cv::Mat> > cache_;
|
std::map<int, std::pair<std::pair<cv::Mat, cv::Mat>, cv::Mat> > cache_; //<node id, < <ground, obstacles>, empty> >
|
||||||
cv::Mat map_;
|
cv::Mat map_;
|
||||||
cv::Mat mapInfo_;
|
cv::Mat mapInfo_;
|
||||||
std::map<int, std::pair<int, int> > cellCount_; //<node Id, cells>
|
std::map<int, std::pair<int, int> > cellCount_; //<node Id, cells>
|
||||||
float xMin_;
|
float xMin_;
|
||||||
float yMin_;
|
float yMin_;
|
||||||
std::map<int, Transform> addedNodes_;
|
std::map<int, Transform> addedNodes_;
|
||||||
|
|
||||||
|
bool cloudAssembling_;
|
||||||
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr assembledGround_;
|
||||||
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr assembledObstacles_;
|
||||||
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr assembledEmptyCells_;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,45 +37,163 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <pcl/point_types.h>
|
#include <pcl/point_types.h>
|
||||||
|
|
||||||
#include <rtabmap/core/Transform.h>
|
#include <rtabmap/core/Transform.h>
|
||||||
|
#include <rtabmap/core/Parameters.h>
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
class OcTreeNodeInfo
|
// forward declaraton for "friend"
|
||||||
|
class RtabmapColorOcTree;
|
||||||
|
|
||||||
|
class RtabmapColorOcTreeNode : public octomap::ColorOcTreeNode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OcTreeNodeInfo(int nodeRefId, const octomap::OcTreeKey & key, bool isObstacle) :
|
enum OccupancyType {kTypeUnknown=-1, kTypeEmpty=0, kTypeGround=1, kTypeObstacle=100};
|
||||||
nodeRefId_(nodeRefId),
|
|
||||||
key_(key),
|
public:
|
||||||
isObstacle_(isObstacle) {}
|
friend class RtabmapColorOcTree; // needs access to node children (inherited)
|
||||||
|
|
||||||
|
RtabmapColorOcTreeNode() : ColorOcTreeNode(), nodeRefId_(0), type_(kTypeUnknown) {}
|
||||||
|
RtabmapColorOcTreeNode(const RtabmapColorOcTreeNode& rhs) : ColorOcTreeNode(rhs), nodeRefId_(rhs.nodeRefId_), type_(rhs.type_) {}
|
||||||
|
|
||||||
|
void setNodeRefId(int nodeRefId) {nodeRefId_ = nodeRefId;}
|
||||||
|
void setOccupancyType(char type) {type_=type;}
|
||||||
|
void setPointRef(const octomap::point3d & point) {pointRef_ = point;}
|
||||||
|
int getNodeRefId() const {return nodeRefId_;}
|
||||||
|
int getOccupancyType() const {return type_;}
|
||||||
|
const octomap::point3d & getPointRef() const {return pointRef_;}
|
||||||
|
|
||||||
|
// following methods defined for octomap < 1.8 compatibility
|
||||||
|
RtabmapColorOcTreeNode* getChild(unsigned int i);
|
||||||
|
const RtabmapColorOcTreeNode* getChild(unsigned int i) const;
|
||||||
|
bool pruneNode();
|
||||||
|
void expandNode();
|
||||||
|
bool createChild(unsigned int i);
|
||||||
|
|
||||||
|
private:
|
||||||
int nodeRefId_;
|
int nodeRefId_;
|
||||||
octomap::OcTreeKey key_;
|
int type_; // -1=undefined, 0=empty, 100=obstacle, 1=ground
|
||||||
bool isObstacle_;
|
octomap::point3d pointRef_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Same as official ColorOctree but using RtabmapColorOcTreeNode, which is inheriting ColorOcTreeNode
|
||||||
|
class RtabmapColorOcTree : public octomap::OccupancyOcTreeBase <RtabmapColorOcTreeNode> {
|
||||||
|
|
||||||
|
public:
|
||||||
|
/// Default constructor, sets resolution of leafs
|
||||||
|
RtabmapColorOcTree(double resolution);
|
||||||
|
|
||||||
|
/// virtual constructor: creates a new object of same type
|
||||||
|
/// (Covariant return type requires an up-to-date compiler)
|
||||||
|
RtabmapColorOcTree* create() const {return new RtabmapColorOcTree(resolution); }
|
||||||
|
|
||||||
|
std::string getTreeType() const {return "ColorOcTree";} // same type as ColorOcTree to be compatible with ROS OctoMap msg
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prunes a node when it is collapsible. This overloaded
|
||||||
|
* version only considers the node occupancy for pruning,
|
||||||
|
* different colors of child nodes are ignored.
|
||||||
|
* @return true if pruning was successful
|
||||||
|
*/
|
||||||
|
virtual bool pruneNode(RtabmapColorOcTreeNode* node);
|
||||||
|
|
||||||
|
virtual bool isNodeCollapsible(const RtabmapColorOcTreeNode* node) const;
|
||||||
|
|
||||||
|
// set node color at given key or coordinate. Replaces previous color.
|
||||||
|
RtabmapColorOcTreeNode* setNodeColor(const octomap::OcTreeKey& key, uint8_t r,
|
||||||
|
uint8_t g, uint8_t b);
|
||||||
|
|
||||||
|
RtabmapColorOcTreeNode* setNodeColor(float x, float y,
|
||||||
|
float z, uint8_t r,
|
||||||
|
uint8_t g, uint8_t b) {
|
||||||
|
octomap::OcTreeKey key;
|
||||||
|
if (!this->coordToKeyChecked(octomap::point3d(x,y,z), key)) return NULL;
|
||||||
|
return setNodeColor(key,r,g,b);
|
||||||
|
}
|
||||||
|
|
||||||
|
// integrate color measurement at given key or coordinate. Average with previous color
|
||||||
|
RtabmapColorOcTreeNode* averageNodeColor(const octomap::OcTreeKey& key, uint8_t r,
|
||||||
|
uint8_t g, uint8_t b);
|
||||||
|
|
||||||
|
RtabmapColorOcTreeNode* averageNodeColor(float x, float y,
|
||||||
|
float z, uint8_t r,
|
||||||
|
uint8_t g, uint8_t b) {
|
||||||
|
octomap:: OcTreeKey key;
|
||||||
|
if (!this->coordToKeyChecked(octomap::point3d(x,y,z), key)) return NULL;
|
||||||
|
return averageNodeColor(key,r,g,b);
|
||||||
|
}
|
||||||
|
|
||||||
|
// integrate color measurement at given key or coordinate. Average with previous color
|
||||||
|
RtabmapColorOcTreeNode* integrateNodeColor(const octomap::OcTreeKey& key, uint8_t r,
|
||||||
|
uint8_t g, uint8_t b);
|
||||||
|
|
||||||
|
RtabmapColorOcTreeNode* integrateNodeColor(float x, float y,
|
||||||
|
float z, uint8_t r,
|
||||||
|
uint8_t g, uint8_t b) {
|
||||||
|
octomap::OcTreeKey key;
|
||||||
|
if (!this->coordToKeyChecked(octomap::point3d(x,y,z), key)) return NULL;
|
||||||
|
return integrateNodeColor(key,r,g,b);
|
||||||
|
}
|
||||||
|
|
||||||
|
// update inner nodes, sets color to average child color
|
||||||
|
void updateInnerOccupancy();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void updateInnerOccupancyRecurs(RtabmapColorOcTreeNode* node, unsigned int depth);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static member object which ensures that this OcTree's prototype
|
||||||
|
* ends up in the classIDMapping only once. You need this as a
|
||||||
|
* static member in any derived octree class in order to read .ot
|
||||||
|
* files through the AbstractOcTree factory. You should also call
|
||||||
|
* ensureLinking() once from the constructor.
|
||||||
|
*/
|
||||||
|
class StaticMemberInitializer{
|
||||||
|
public:
|
||||||
|
StaticMemberInitializer();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dummy function to ensure that MSVC does not drop the
|
||||||
|
* StaticMemberInitializer, causing this tree failing to register.
|
||||||
|
* Needs to be called from the constructor of this octree.
|
||||||
|
*/
|
||||||
|
void ensureLinking() {};
|
||||||
|
};
|
||||||
|
/// static member to ensure static initialization (only once)
|
||||||
|
static StaticMemberInitializer RtabmapColorOcTreeMemberInit;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
class RTABMAP_EXP OctoMap {
|
class RTABMAP_EXP OctoMap {
|
||||||
public:
|
public:
|
||||||
OctoMap(float voxelSize = 0.1f, float occupancyThr = 0.5f, bool fullUpdate = false);
|
static void HSVtoRGB(float *r, float *g, float *b, float h, float s, float v);
|
||||||
|
|
||||||
|
public:
|
||||||
|
OctoMap(const ParametersMap & parameters);
|
||||||
|
OctoMap(float cellSize = 0.1f, float occupancyThr = 0.5f, bool fullUpdate = false, float updateError=0.01f);
|
||||||
|
|
||||||
const std::map<int, Transform> & addedNodes() const {return addedNodes_;}
|
const std::map<int, Transform> & addedNodes() const {return addedNodes_;}
|
||||||
void addToCache(int nodeId,
|
void addToCache(int nodeId,
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr & ground,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & ground,
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr & obstacles,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & obstacles,
|
||||||
const pcl::PointXYZ & viewPoint);
|
const pcl::PointXYZ & viewPoint);
|
||||||
void addToCache(int nodeId,
|
void addToCache(int nodeId,
|
||||||
const cv::Mat & ground,
|
const cv::Mat & ground,
|
||||||
const cv::Mat & obstacles,
|
const cv::Mat & obstacles,
|
||||||
|
const cv::Mat & empty,
|
||||||
const cv::Point3f & viewPoint);
|
const cv::Point3f & viewPoint);
|
||||||
void update(const std::map<int, Transform> & poses);
|
void update(const std::map<int, Transform> & poses);
|
||||||
|
|
||||||
const octomap::ColorOcTree * octree() const {return octree_;}
|
const RtabmapColorOcTree * octree() const {return octree_;}
|
||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr createCloud(
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr createCloud(
|
||||||
unsigned int treeDepth = 0,
|
unsigned int treeDepth = 0,
|
||||||
std::vector<int> * obstacleIndices = 0,
|
std::vector<int> * obstacleIndices = 0,
|
||||||
std::vector<int> * emptyIndices = 0) const;
|
std::vector<int> * emptyIndices = 0,
|
||||||
|
std::vector<int> * groundIndices = 0,
|
||||||
|
bool originalRefPoints = true) const;
|
||||||
|
|
||||||
cv::Mat createProjectionMap(
|
cv::Mat createProjectionMap(
|
||||||
float & xMin,
|
float & xMin,
|
||||||
@@ -89,16 +207,30 @@ public:
|
|||||||
virtual ~OctoMap();
|
virtual ~OctoMap();
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
void getGridMin(double & x, double & y, double & z) const {x=minValues_[0];y=minValues_[1];z=minValues_[2];}
|
||||||
|
void getGridMax(double & x, double & y, double & z) const {x=maxValues_[0];y=maxValues_[1];z=maxValues_[2];}
|
||||||
|
|
||||||
|
void setMaxRange(float value) {rangeMax_ = value;}
|
||||||
|
void setRayTracing(bool enabled) {rayTracing_ = enabled;}
|
||||||
|
bool hasColor() const {return hasColor_;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::map<int, std::pair<cv::Mat, cv::Mat> > cache_;
|
void updateMinMax(const octomap::point3d & point);
|
||||||
std::map<int, std::pair<pcl::PointCloud<pcl::PointXYZRGB>::Ptr, pcl::PointCloud<pcl::PointXYZRGB>::Ptr> > cacheClouds_;
|
|
||||||
|
private:
|
||||||
|
std::map<int, std::pair<std::pair<cv::Mat, cv::Mat>, cv::Mat> > cache_; // [id: < <ground, obstacles>, empty>]
|
||||||
|
std::map<int, std::pair<const pcl::PointCloud<pcl::PointXYZRGB>::Ptr, const pcl::PointCloud<pcl::PointXYZRGB>::Ptr> > cacheClouds_; // [id: <ground, obstacles>]
|
||||||
std::map<int, cv::Point3f> cacheViewPoints_;
|
std::map<int, cv::Point3f> cacheViewPoints_;
|
||||||
octomap::ColorOcTree * octree_;
|
RtabmapColorOcTree * octree_;
|
||||||
std::map<octomap::ColorOcTreeNode*, OcTreeNodeInfo> occupiedCells_;
|
|
||||||
std::map<int, Transform> addedNodes_;
|
std::map<int, Transform> addedNodes_;
|
||||||
octomap::KeyRay keyRay_;
|
octomap::KeyRay keyRay_;
|
||||||
bool hasColor_;
|
bool hasColor_;
|
||||||
bool fullUpdate_;
|
bool fullUpdate_;
|
||||||
|
float updateError_;
|
||||||
|
float rangeMax_;
|
||||||
|
bool rayTracing_;
|
||||||
|
double minValues_[3];
|
||||||
|
double maxValues_[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace rtabmap */
|
} /* namespace rtabmap */
|
||||||
|
|||||||
@@ -49,7 +49,10 @@ public:
|
|||||||
kTypeFovis = 2,
|
kTypeFovis = 2,
|
||||||
kTypeViso2 = 3,
|
kTypeViso2 = 3,
|
||||||
kTypeDVO = 4,
|
kTypeDVO = 4,
|
||||||
kTypeORBSLAM2 = 5
|
kTypeORBSLAM2 = 5,
|
||||||
|
kTypeOkvis = 6,
|
||||||
|
kTypeLOAM = 7,
|
||||||
|
kTypeMSCKF = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -62,12 +65,15 @@ public:
|
|||||||
Transform process(SensorData & data, const Transform & guess, OdometryInfo * info = 0);
|
Transform process(SensorData & data, const Transform & guess, OdometryInfo * info = 0);
|
||||||
virtual void reset(const Transform & initialPose = Transform::getIdentity());
|
virtual void reset(const Transform & initialPose = Transform::getIdentity());
|
||||||
virtual Odometry::Type getType() = 0;
|
virtual Odometry::Type getType() = 0;
|
||||||
|
virtual bool canProcessRawImages() const {return false;}
|
||||||
|
|
||||||
//getters
|
//getters
|
||||||
const Transform & getPose() const {return _pose;}
|
const Transform & getPose() const {return _pose;}
|
||||||
bool isInfoDataFilled() const {return _fillInfoData;}
|
bool isInfoDataFilled() const {return _fillInfoData;}
|
||||||
const Transform & previousVelocityTransform() const {return previousVelocityTransform_;}
|
const Transform & previousVelocityTransform() const {return previousVelocityTransform_;}
|
||||||
double previousStamp() const {return previousStamp_;}
|
double previousStamp() const {return previousStamp_;}
|
||||||
|
unsigned int framesProcessed() const {return framesProcessed_;}
|
||||||
|
bool imagesAlreadyRectified() const {return _imagesAlreadyRectified;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual Transform computeTransform(SensorData & data, const Transform & guess = Transform(), OdometryInfo * info = 0) = 0;
|
virtual Transform computeTransform(SensorData & data, const Transform & guess = Transform(), OdometryInfo * info = 0) = 0;
|
||||||
@@ -92,12 +98,15 @@ private:
|
|||||||
float _kalmanMeasurementNoise;
|
float _kalmanMeasurementNoise;
|
||||||
int _imageDecimation;
|
int _imageDecimation;
|
||||||
bool _alignWithGround;
|
bool _alignWithGround;
|
||||||
|
bool _publishRAMUsage;
|
||||||
|
bool _imagesAlreadyRectified;
|
||||||
Transform _pose;
|
Transform _pose;
|
||||||
int _resetCurrentCount;
|
int _resetCurrentCount;
|
||||||
double previousStamp_;
|
double previousStamp_;
|
||||||
Transform previousVelocityTransform_;
|
Transform previousVelocityTransform_;
|
||||||
Transform previousGroundTruthPose_;
|
Transform previousGroundTruthPose_;
|
||||||
float distanceTravelled_;
|
float distanceTravelled_;
|
||||||
|
unsigned int framesProcessed_;
|
||||||
|
|
||||||
std::vector<ParticleFilter *> particleFilters_;
|
std::vector<ParticleFilter *> particleFilters_;
|
||||||
cv::KalmanFilter kalmanFilter_;
|
cv::KalmanFilter kalmanFilter_;
|
||||||
|
|||||||
@@ -53,10 +53,12 @@ private:
|
|||||||
virtual Transform computeTransform(SensorData & image, const Transform & guess = Transform(), OdometryInfo * info = 0);
|
virtual Transform computeTransform(SensorData & image, const Transform & guess = Transform(), OdometryInfo * info = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#ifdef RTABMAP_DVO
|
||||||
dvo::DenseTracker * dvo_;
|
dvo::DenseTracker * dvo_;
|
||||||
dvo::core::RgbdImagePyramid * reference_;
|
dvo::core::RgbdImagePyramid * reference_;
|
||||||
dvo::core::RgbdCameraPyramid * camera_;
|
dvo::core::RgbdCameraPyramid * camera_;
|
||||||
bool lost_;
|
bool lost_;
|
||||||
|
#endif
|
||||||
Transform motionFromKeyFrame_;
|
Transform motionFromKeyFrame_;
|
||||||
Transform previousLocalTransform_;
|
Transform previousLocalTransform_;
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class OdometryEvent : public UEvent
|
|||||||
public:
|
public:
|
||||||
OdometryEvent()
|
OdometryEvent()
|
||||||
{
|
{
|
||||||
_info.covariance = cv::Mat::eye(6,6,CV_64FC1);
|
_info.reg.covariance = cv::Mat::eye(6,6,CV_64FC1);
|
||||||
}
|
}
|
||||||
OdometryEvent(
|
OdometryEvent(
|
||||||
const SensorData & data,
|
const SensorData & data,
|
||||||
@@ -51,17 +51,17 @@ public:
|
|||||||
_pose(pose),
|
_pose(pose),
|
||||||
_info(info)
|
_info(info)
|
||||||
{
|
{
|
||||||
if(_info.covariance.empty())
|
if(_info.reg.covariance.empty())
|
||||||
{
|
{
|
||||||
_info.covariance = cv::Mat::eye(6,6,CV_64FC1);
|
_info.reg.covariance = cv::Mat::eye(6,6,CV_64FC1);
|
||||||
}
|
}
|
||||||
UASSERT(_info.covariance.cols == 6 && _info.covariance.rows == 6 && _info.covariance.type() == CV_64FC1);
|
UASSERT(_info.reg.covariance.cols == 6 && _info.reg.covariance.rows == 6 && _info.reg.covariance.type() == CV_64FC1);
|
||||||
UASSERT_MSG(uIsFinite(_info.covariance.at<double>(0,0)) && _info.covariance.at<double>(0,0)>0, "Transitional variance should not be null! (set to 1 if unknown)");
|
UASSERT_MSG(uIsFinite(_info.reg.covariance.at<double>(0,0)) && _info.reg.covariance.at<double>(0,0)>0, "Transitional variance should not be null! (set to 1 if unknown)");
|
||||||
UASSERT_MSG(uIsFinite(_info.covariance.at<double>(1,1)) && _info.covariance.at<double>(1,1)>0, "Transitional variance should not be null! (set to 1 if unknown)");
|
UASSERT_MSG(uIsFinite(_info.reg.covariance.at<double>(1,1)) && _info.reg.covariance.at<double>(1,1)>0, "Transitional variance should not be null! (set to 1 if unknown)");
|
||||||
UASSERT_MSG(uIsFinite(_info.covariance.at<double>(2,2)) && _info.covariance.at<double>(2,2)>0, "Transitional variance should not be null! (set to 1 if unknown)");
|
UASSERT_MSG(uIsFinite(_info.reg.covariance.at<double>(2,2)) && _info.reg.covariance.at<double>(2,2)>0, "Transitional variance should not be null! (set to 1 if unknown)");
|
||||||
UASSERT_MSG(uIsFinite(_info.covariance.at<double>(3,3)) && _info.covariance.at<double>(3,3)>0, "Rotational variance should not be null! (set to 1 if unknown)");
|
UASSERT_MSG(uIsFinite(_info.reg.covariance.at<double>(3,3)) && _info.reg.covariance.at<double>(3,3)>0, "Rotational variance should not be null! (set to 1 if unknown)");
|
||||||
UASSERT_MSG(uIsFinite(_info.covariance.at<double>(4,4)) && _info.covariance.at<double>(4,4)>0, "Rotational variance should not be null! (set to 1 if unknown)");
|
UASSERT_MSG(uIsFinite(_info.reg.covariance.at<double>(4,4)) && _info.reg.covariance.at<double>(4,4)>0, "Rotational variance should not be null! (set to 1 if unknown)");
|
||||||
UASSERT_MSG(uIsFinite(_info.covariance.at<double>(5,5)) && _info.covariance.at<double>(5,5)>0, "Rotational variance should not be null! (set to 1 if unknown)");
|
UASSERT_MSG(uIsFinite(_info.reg.covariance.at<double>(5,5)) && _info.reg.covariance.at<double>(5,5)>0, "Rotational variance should not be null! (set to 1 if unknown)");
|
||||||
}
|
}
|
||||||
virtual ~OdometryEvent() {}
|
virtual ~OdometryEvent() {}
|
||||||
virtual std::string getClassName() const {return "OdometryEvent";}
|
virtual std::string getClassName() const {return "OdometryEvent";}
|
||||||
@@ -69,7 +69,7 @@ public:
|
|||||||
SensorData & data() {return _data;}
|
SensorData & data() {return _data;}
|
||||||
const SensorData & data() const {return _data;}
|
const SensorData & data() const {return _data;}
|
||||||
const Transform & pose() const {return _pose;}
|
const Transform & pose() const {return _pose;}
|
||||||
const cv::Mat & covariance() const {return _info.covariance;}
|
const cv::Mat & covariance() const {return _info.reg.covariance;}
|
||||||
std::vector<float> velocity() const {
|
std::vector<float> velocity() const {
|
||||||
if(_info.interval>0.0)
|
if(_info.interval>0.0)
|
||||||
{
|
{
|
||||||
@@ -82,6 +82,7 @@ public:
|
|||||||
velocity[3] = roll/_info.interval;
|
velocity[3] = roll/_info.interval;
|
||||||
velocity[4] = pitch/_info.interval;
|
velocity[4] = pitch/_info.interval;
|
||||||
velocity[5] = yaw/_info.interval;
|
velocity[5] = yaw/_info.interval;
|
||||||
|
return velocity;
|
||||||
}
|
}
|
||||||
return std::vector<float>();
|
return std::vector<float>();
|
||||||
}
|
}
|
||||||
@@ -96,9 +97,12 @@ private:
|
|||||||
class OdometryResetEvent : public UEvent
|
class OdometryResetEvent : public UEvent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OdometryResetEvent(){}
|
OdometryResetEvent(const Transform & pose = Transform::getIdentity()){_pose = pose;}
|
||||||
virtual ~OdometryResetEvent() {}
|
virtual ~OdometryResetEvent() {}
|
||||||
virtual std::string getClassName() const {return "OdometryResetEvent";}
|
virtual std::string getClassName() const {return "OdometryResetEvent";}
|
||||||
|
const Transform & getPose() const {return _pose;}
|
||||||
|
private:
|
||||||
|
Transform _pose;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ private:
|
|||||||
Registration * registrationPipeline_;
|
Registration * registrationPipeline_;
|
||||||
Signature refFrame_;
|
Signature refFrame_;
|
||||||
Transform lastKeyFramePose_;
|
Transform lastKeyFramePose_;
|
||||||
|
ParametersMap parameters_;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,12 +64,14 @@ private:
|
|||||||
float scanKeyFrameThr_;
|
float scanKeyFrameThr_;
|
||||||
int scanMaximumMapSize_;
|
int scanMaximumMapSize_;
|
||||||
float scanSubtractRadius_;
|
float scanSubtractRadius_;
|
||||||
|
float scanSubtractAngle_;
|
||||||
int bundleAdjustment_;
|
int bundleAdjustment_;
|
||||||
int bundleMaxFrames_;
|
int bundleMaxFrames_;
|
||||||
|
|
||||||
Registration * regPipeline_;
|
Registration * regPipeline_;
|
||||||
Signature * map_;
|
Signature * map_;
|
||||||
Signature * lastFrame_;
|
Signature * lastFrame_;
|
||||||
|
int lastFrameOldestNewId_;
|
||||||
std::vector<std::pair<pcl::PointCloud<pcl::PointNormal>::Ptr, pcl::IndicesPtr> > scansBuffer_;
|
std::vector<std::pair<pcl::PointCloud<pcl::PointNormal>::Ptr, pcl::IndicesPtr> > scansBuffer_;
|
||||||
|
|
||||||
std::map<int, std::map<int, cv::Point3f> > bundleWordReferences_; //<WordId, <FrameId, pt2D+depth>>
|
std::map<int, std::map<int, cv::Point3f> > bundleWordReferences_; //<WordId, <FrameId, pt2D+depth>>
|
||||||
@@ -79,6 +81,7 @@ private:
|
|||||||
std::map<int, int> bundlePoseReferences_;
|
std::map<int, int> bundlePoseReferences_;
|
||||||
int bundleSeq_;
|
int bundleSeq_;
|
||||||
Optimizer * sba_;
|
Optimizer * sba_;
|
||||||
|
ParametersMap parameters_;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,13 +53,15 @@ private:
|
|||||||
virtual Transform computeTransform(SensorData & image, const Transform & guess = Transform(), OdometryInfo * info = 0);
|
virtual Transform computeTransform(SensorData & image, const Transform & guess = Transform(), OdometryInfo * info = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#ifdef RTABMAP_FOVIS
|
||||||
fovis::VisualOdometry * fovis_;
|
fovis::VisualOdometry * fovis_;
|
||||||
fovis::Rectification * rect_;
|
fovis::Rectification * rect_;
|
||||||
fovis::StereoCalibration * stereoCalib_;
|
fovis::StereoCalibration * stereoCalib_;
|
||||||
fovis::DepthImage * depthImage_;
|
fovis::DepthImage * depthImage_;
|
||||||
fovis::StereoDepth * stereoDepth_;
|
fovis::StereoDepth * stereoDepth_;
|
||||||
ParametersMap fovisParameters_;
|
|
||||||
bool lost_;
|
bool lost_;
|
||||||
|
#endif
|
||||||
|
ParametersMap fovisParameters_;
|
||||||
Transform previousLocalTransform_;
|
Transform previousLocalTransform_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include "rtabmap/core/Transform.h"
|
#include "rtabmap/core/Transform.h"
|
||||||
|
#include "rtabmap/core/RegistrationInfo.h"
|
||||||
|
#include "rtabmap/core/CameraModel.h"
|
||||||
|
#include "rtabmap/core/LaserScan.h"
|
||||||
#include <opencv2/features2d/features2d.hpp>
|
#include <opencv2/features2d/features2d.hpp>
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
@@ -39,9 +42,6 @@ class OdometryInfo
|
|||||||
public:
|
public:
|
||||||
OdometryInfo() :
|
OdometryInfo() :
|
||||||
lost(true),
|
lost(true),
|
||||||
matches(0),
|
|
||||||
inliers(0),
|
|
||||||
icpInliersRatio(0.0f),
|
|
||||||
features(0),
|
features(0),
|
||||||
localMapSize(0),
|
localMapSize(0),
|
||||||
localScanMapSize(0),
|
localScanMapSize(0),
|
||||||
@@ -55,6 +55,7 @@ public:
|
|||||||
stamp(0),
|
stamp(0),
|
||||||
interval(0),
|
interval(0),
|
||||||
distanceTravelled(0.0f),
|
distanceTravelled(0.0f),
|
||||||
|
memoryUsage(0),
|
||||||
type(0)
|
type(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@@ -62,10 +63,7 @@ public:
|
|||||||
{
|
{
|
||||||
OdometryInfo output;
|
OdometryInfo output;
|
||||||
output.lost = lost;
|
output.lost = lost;
|
||||||
output.matches = matches;
|
output.reg = reg.copyWithoutData();
|
||||||
output.inliers = inliers;
|
|
||||||
output.icpInliersRatio = icpInliersRatio;
|
|
||||||
output.covariance = covariance.clone();
|
|
||||||
output.features = features;
|
output.features = features;
|
||||||
output.localMapSize = localMapSize;
|
output.localMapSize = localMapSize;
|
||||||
output.localScanMapSize = localScanMapSize;
|
output.localScanMapSize = localScanMapSize;
|
||||||
@@ -73,6 +71,8 @@ public:
|
|||||||
output.localBundleOutliers = localBundleOutliers;
|
output.localBundleOutliers = localBundleOutliers;
|
||||||
output.localBundleConstraints = localBundleConstraints;
|
output.localBundleConstraints = localBundleConstraints;
|
||||||
output.localBundleTime = localBundleTime;
|
output.localBundleTime = localBundleTime;
|
||||||
|
output.localBundlePoses = localBundlePoses;
|
||||||
|
output.localBundleModels = localBundleModels;
|
||||||
output.keyFrameAdded = keyFrameAdded;
|
output.keyFrameAdded = keyFrameAdded;
|
||||||
output.timeEstimation = timeEstimation;
|
output.timeEstimation = timeEstimation;
|
||||||
output.timeParticleFiltering = timeParticleFiltering;
|
output.timeParticleFiltering = timeParticleFiltering;
|
||||||
@@ -82,15 +82,13 @@ public:
|
|||||||
output.transformFiltered = transformFiltered;
|
output.transformFiltered = transformFiltered;
|
||||||
output.transformGroundTruth = transformGroundTruth;
|
output.transformGroundTruth = transformGroundTruth;
|
||||||
output.distanceTravelled = distanceTravelled;
|
output.distanceTravelled = distanceTravelled;
|
||||||
|
output.memoryUsage = memoryUsage;
|
||||||
output.type = type;
|
output.type = type;
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lost;
|
bool lost;
|
||||||
int matches;
|
RegistrationInfo reg;
|
||||||
int inliers;
|
|
||||||
float icpInliersRatio;
|
|
||||||
cv::Mat covariance;
|
|
||||||
int features;
|
int features;
|
||||||
int localMapSize;
|
int localMapSize;
|
||||||
int localScanMapSize;
|
int localScanMapSize;
|
||||||
@@ -98,6 +96,8 @@ public:
|
|||||||
int localBundleOutliers;
|
int localBundleOutliers;
|
||||||
int localBundleConstraints;
|
int localBundleConstraints;
|
||||||
float localBundleTime;
|
float localBundleTime;
|
||||||
|
std::map<int, Transform> localBundlePoses;
|
||||||
|
std::map<int, CameraModel> localBundleModels;
|
||||||
bool keyFrameAdded;
|
bool keyFrameAdded;
|
||||||
float timeEstimation;
|
float timeEstimation;
|
||||||
float timeParticleFiltering;
|
float timeParticleFiltering;
|
||||||
@@ -107,15 +107,14 @@ public:
|
|||||||
Transform transformFiltered;
|
Transform transformFiltered;
|
||||||
Transform transformGroundTruth;
|
Transform transformGroundTruth;
|
||||||
float distanceTravelled;
|
float distanceTravelled;
|
||||||
|
int memoryUsage; //MB
|
||||||
|
|
||||||
int type; // 0=F2M, 1=F2F
|
int type;
|
||||||
|
|
||||||
// F2M
|
// F2M
|
||||||
std::multimap<int, cv::KeyPoint> words;
|
std::multimap<int, cv::KeyPoint> words;
|
||||||
std::vector<int> wordMatches;
|
|
||||||
std::vector<int> wordInliers;
|
|
||||||
std::map<int, cv::Point3f> localMap;
|
std::map<int, cv::Point3f> localMap;
|
||||||
cv::Mat localScanMap;
|
LaserScan localScanMap;
|
||||||
|
|
||||||
// F2F
|
// F2F
|
||||||
std::vector<cv::Point2f> refCorners;
|
std::vector<cv::Point2f> refCorners;
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of the Universite de Sherbrooke nor the
|
||||||
|
names of its contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ODOMETRYLOAM_H_
|
||||||
|
#define ODOMETRYLOAM_H_
|
||||||
|
|
||||||
|
#include <rtabmap/core/Odometry.h>
|
||||||
|
|
||||||
|
#ifdef RTABMAP_LOAM
|
||||||
|
#include <loam_velodyne/BasicScanRegistration.h>
|
||||||
|
#include <loam_velodyne/BasicLaserOdometry.h>
|
||||||
|
#include <loam_velodyne/BasicLaserMapping.h>
|
||||||
|
#include <loam_velodyne/BasicTransformMaintenance.h>
|
||||||
|
#include <loam_velodyne/MultiScanRegistration.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace rtabmap {
|
||||||
|
|
||||||
|
class RTABMAP_EXP OdometryLOAM : public Odometry
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OdometryLOAM(const rtabmap::ParametersMap & parameters = rtabmap::ParametersMap());
|
||||||
|
virtual ~OdometryLOAM();
|
||||||
|
|
||||||
|
virtual void reset(const Transform & initialPose = Transform::getIdentity());
|
||||||
|
virtual Odometry::Type getType() {return Odometry::kTypeLOAM;}
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual Transform computeTransform(SensorData & image, const Transform & guess = Transform(), OdometryInfo * info = 0);
|
||||||
|
|
||||||
|
private:
|
||||||
|
#ifdef RTABMAP_LOAM
|
||||||
|
std::vector<pcl::PointCloud<pcl::PointXYZI> > segmentScanRings(const pcl::PointCloud<pcl::PointXYZ> & laserCloudIn);
|
||||||
|
|
||||||
|
loam::BasicScanRegistration scanRegistration_;
|
||||||
|
loam::MultiScanMapper scanMapper_;
|
||||||
|
loam::BasicLaserOdometry * laserOdometry_;
|
||||||
|
loam::BasicLaserMapping * laserMapping_;
|
||||||
|
loam::BasicTransformMaintenance transformMaintenance_;
|
||||||
|
Transform lastPose_;
|
||||||
|
float scanPeriod_;
|
||||||
|
float linVar_;
|
||||||
|
float angVar_;
|
||||||
|
bool localMapping_;
|
||||||
|
bool lost_;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* ODOMETRYLOAM_H_ */
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of the Universite de Sherbrooke nor the
|
||||||
|
names of its contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ODOMETRYMSCKF_H_
|
||||||
|
#define ODOMETRYMSCKF_H_
|
||||||
|
|
||||||
|
#include <rtabmap/core/Odometry.h>
|
||||||
|
|
||||||
|
namespace rtabmap {
|
||||||
|
|
||||||
|
class ImageProcessorNoROS;
|
||||||
|
class MsckfVioNoROS;
|
||||||
|
|
||||||
|
class RTABMAP_EXP OdometryMSCKF : public Odometry
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OdometryMSCKF(const rtabmap::ParametersMap & parameters = rtabmap::ParametersMap());
|
||||||
|
virtual ~OdometryMSCKF();
|
||||||
|
|
||||||
|
virtual void reset(const Transform & initialPose = Transform::getIdentity());
|
||||||
|
virtual Odometry::Type getType() {return Odometry::kTypeMSCKF;}
|
||||||
|
virtual bool canProcessRawImages() const {return true;}
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual Transform computeTransform(SensorData & image, const Transform & guess = Transform(), OdometryInfo * info = 0);
|
||||||
|
|
||||||
|
private:
|
||||||
|
#ifdef RTABMAP_MSCKF_VIO
|
||||||
|
ImageProcessorNoROS * imageProcessor_;
|
||||||
|
MsckfVioNoROS * msckf_;
|
||||||
|
IMU lastImu_;
|
||||||
|
ParametersMap parameters_;
|
||||||
|
Transform flipXY_;
|
||||||
|
Transform previousPose_;
|
||||||
|
bool initGravity_;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* ODOMETRYMSCKF_H_ */
|
||||||
@@ -51,10 +51,12 @@ private:
|
|||||||
virtual Transform computeTransform(SensorData & image, const Transform & guess = Transform(), OdometryInfo * info = 0);
|
virtual Transform computeTransform(SensorData & image, const Transform & guess = Transform(), OdometryInfo * info = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#ifdef RTABMAP_ORB_SLAM2
|
||||||
ORBSLAM2System * orbslam2_;
|
ORBSLAM2System * orbslam2_;
|
||||||
ORB_SLAM2::System * system_;
|
|
||||||
bool firstFrame_;
|
bool firstFrame_;
|
||||||
Transform originLocalTransform_;
|
Transform originLocalTransform_;
|
||||||
|
Transform previousPose_;
|
||||||
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of the Universite de Sherbrooke nor the
|
||||||
|
names of its contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ODOMETRYOKVIS_H_
|
||||||
|
#define ODOMETRYOKVIS_H_
|
||||||
|
|
||||||
|
#include <rtabmap/core/Odometry.h>
|
||||||
|
|
||||||
|
namespace okvis {
|
||||||
|
class ThreadedKFVio;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace rtabmap {
|
||||||
|
|
||||||
|
class OkvisCallbackHandler;
|
||||||
|
class RTABMAP_EXP OdometryOkvis : public Odometry
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OdometryOkvis(const rtabmap::ParametersMap & parameters = rtabmap::ParametersMap());
|
||||||
|
virtual ~OdometryOkvis();
|
||||||
|
|
||||||
|
virtual void reset(const Transform & initialPose = Transform::getIdentity());
|
||||||
|
virtual Odometry::Type getType() {return Odometry::kTypeOkvis;}
|
||||||
|
virtual bool canProcessRawImages() const {return true;}
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual Transform computeTransform(SensorData & image, const Transform & guess = Transform(), OdometryInfo * info = 0);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string configFilename_;
|
||||||
|
#ifdef RTABMAP_OKVIS
|
||||||
|
OkvisCallbackHandler * okvisCallbackHandler_;
|
||||||
|
okvis::ThreadedKFVio * okvisEstimator_;
|
||||||
|
int imagesProcessed_;
|
||||||
|
bool initGravity_;
|
||||||
|
#endif
|
||||||
|
ParametersMap okvisParameters_;
|
||||||
|
IMU lastImu_; // only used for initialization
|
||||||
|
Transform previousPose_;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* ODOMETRYOKVIS_H_ */
|
||||||
@@ -62,9 +62,13 @@ private:
|
|||||||
USemaphore _dataAdded;
|
USemaphore _dataAdded;
|
||||||
UMutex _dataMutex;
|
UMutex _dataMutex;
|
||||||
std::list<SensorData> _dataBuffer;
|
std::list<SensorData> _dataBuffer;
|
||||||
|
std::list<SensorData> _imuBuffer;
|
||||||
Odometry * _odometry;
|
Odometry * _odometry;
|
||||||
unsigned int _dataBufferMaxSize;
|
unsigned int _dataBufferMaxSize;
|
||||||
bool _resetOdometry;
|
bool _resetOdometry;
|
||||||
|
Transform _resetPose;
|
||||||
|
double _lastImuStamp;
|
||||||
|
double _imuEstimatedDelay;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rtabmap
|
} // namespace rtabmap
|
||||||
|
|||||||
@@ -47,12 +47,14 @@ private:
|
|||||||
virtual Transform computeTransform(SensorData & image, const Transform & guess = Transform(), OdometryInfo * info = 0);
|
virtual Transform computeTransform(SensorData & image, const Transform & guess = Transform(), OdometryInfo * info = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#ifdef RTABMAP_VISO2
|
||||||
VisualOdometryStereo * viso2_;
|
VisualOdometryStereo * viso2_;
|
||||||
int ref_frame_change_method_; // Reference frame method (defautl 0): 0=under inliers threshold, 1=min pixel motion,
|
int ref_frame_change_method_; // Reference frame method (defautl 0): 0=under inliers threshold, 1=min pixel motion,
|
||||||
int ref_frame_inlier_threshold_; // method 0. Change the reference frame if the number of inliers is low
|
int ref_frame_inlier_threshold_; // method 0. Change the reference frame if the number of inliers is low
|
||||||
double ref_frame_motion_threshold_; // method 1. Change the reference frame if last motion is small
|
double ref_frame_motion_threshold_; // method 1. Change the reference frame if last motion is small
|
||||||
bool lost_;
|
bool lost_;
|
||||||
bool keep_reference_frame_;
|
bool keep_reference_frame_;
|
||||||
|
#endif
|
||||||
Transform reference_motion_;
|
Transform reference_motion_;
|
||||||
Transform previousLocalTransform_;
|
Transform previousLocalTransform_;
|
||||||
ParametersMap viso2Parameters_;
|
ParametersMap viso2Parameters_;
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ public:
|
|||||||
bool isCovarianceIgnored() const {return covarianceIgnored_;}
|
bool isCovarianceIgnored() const {return covarianceIgnored_;}
|
||||||
double epsilon() const {return epsilon_;}
|
double epsilon() const {return epsilon_;}
|
||||||
bool isRobust() const {return robust_;}
|
bool isRobust() const {return robust_;}
|
||||||
|
bool priorsIgnored() const {return priorsIgnored_;}
|
||||||
|
|
||||||
// setters
|
// setters
|
||||||
void setIterations(int iterations) {iterations_ = iterations;}
|
void setIterations(int iterations) {iterations_ = iterations;}
|
||||||
@@ -82,17 +83,35 @@ public:
|
|||||||
void setCovarianceIgnored(bool enabled) {covarianceIgnored_ = enabled;}
|
void setCovarianceIgnored(bool enabled) {covarianceIgnored_ = enabled;}
|
||||||
void setEpsilon(double epsilon) {epsilon_ = epsilon;}
|
void setEpsilon(double epsilon) {epsilon_ = epsilon;}
|
||||||
void setRobust(bool enabled) {robust_ = enabled;}
|
void setRobust(bool enabled) {robust_ = enabled;}
|
||||||
|
void setPriorsIgnored(bool enabled) {priorsIgnored_ = enabled;}
|
||||||
|
|
||||||
virtual void parseParameters(const ParametersMap & parameters);
|
virtual void parseParameters(const ParametersMap & parameters);
|
||||||
|
|
||||||
// inherited classes should implement one of these methods
|
std::map<int, Transform> optimizeIncremental(
|
||||||
virtual std::map<int, Transform> optimize(
|
|
||||||
int rootId,
|
int rootId,
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
const std::multimap<int, Link> & constraints,
|
const std::multimap<int, Link> & constraints,
|
||||||
std::list<std::map<int, Transform> > * intermediateGraphes = 0,
|
std::list<std::map<int, Transform> > * intermediateGraphes = 0,
|
||||||
double * finalError = 0,
|
double * finalError = 0,
|
||||||
int * iterationsDone = 0);
|
int * iterationsDone = 0);
|
||||||
|
|
||||||
|
std::map<int, Transform> optimize(
|
||||||
|
int rootId,
|
||||||
|
const std::map<int, Transform> & poses,
|
||||||
|
const std::multimap<int, Link> & constraints,
|
||||||
|
std::list<std::map<int, Transform> > * intermediateGraphes = 0,
|
||||||
|
double * finalError = 0,
|
||||||
|
int * iterationsDone = 0);
|
||||||
|
|
||||||
|
// inherited classes should implement one of these methods
|
||||||
|
virtual std::map<int, Transform> optimize(
|
||||||
|
int rootId,
|
||||||
|
const std::map<int, Transform> & poses,
|
||||||
|
const std::multimap<int, Link> & constraints,
|
||||||
|
cv::Mat & outputCovariance,
|
||||||
|
std::list<std::map<int, Transform> > * intermediateGraphes = 0,
|
||||||
|
double * finalError = 0,
|
||||||
|
int * iterationsDone = 0);
|
||||||
virtual std::map<int, Transform> optimizeBA(
|
virtual std::map<int, Transform> optimizeBA(
|
||||||
int rootId, // if negative, all other poses are fixed
|
int rootId, // if negative, all other poses are fixed
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
@@ -128,7 +147,8 @@ protected:
|
|||||||
bool slam2d = Parameters::defaultRegForce3DoF(),
|
bool slam2d = Parameters::defaultRegForce3DoF(),
|
||||||
bool covarianceIgnored = Parameters::defaultOptimizerVarianceIgnored(),
|
bool covarianceIgnored = Parameters::defaultOptimizerVarianceIgnored(),
|
||||||
double epsilon = Parameters::defaultOptimizerEpsilon(),
|
double epsilon = Parameters::defaultOptimizerEpsilon(),
|
||||||
bool robust = Parameters::defaultOptimizerRobust());
|
bool robust = Parameters::defaultOptimizerRobust(),
|
||||||
|
bool priorsIgnored = Parameters::defaultOptimizerPriorsIgnored());
|
||||||
Optimizer(const ParametersMap & parameters);
|
Optimizer(const ParametersMap & parameters);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -137,6 +157,7 @@ private:
|
|||||||
bool covarianceIgnored_;
|
bool covarianceIgnored_;
|
||||||
double epsilon_;
|
double epsilon_;
|
||||||
bool robust_;
|
bool robust_;
|
||||||
|
bool priorsIgnored_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace rtabmap */
|
} /* namespace rtabmap */
|
||||||
|
|||||||
@@ -64,12 +64,13 @@ public:
|
|||||||
virtual void parseParameters(const ParametersMap & parameters);
|
virtual void parseParameters(const ParametersMap & parameters);
|
||||||
|
|
||||||
virtual std::map<int, Transform> optimize(
|
virtual std::map<int, Transform> optimize(
|
||||||
int rootId,
|
int rootId,
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
const std::multimap<int, Link> & edgeConstraints,
|
const std::multimap<int, Link> & edgeConstraints,
|
||||||
std::list<std::map<int, Transform> > * intermediateGraphes = 0,
|
cv::Mat & outputCovariance,
|
||||||
double * finalError = 0,
|
std::list<std::map<int, Transform> > * intermediateGraphes = 0,
|
||||||
int * iterationsDone = 0);
|
double * finalError = 0,
|
||||||
|
int * iterationsDone = 0);
|
||||||
|
|
||||||
virtual std::map<int, Transform> optimizeBA(
|
virtual std::map<int, Transform> optimizeBA(
|
||||||
int rootId,
|
int rootId,
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public:
|
|||||||
int rootId,
|
int rootId,
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
const std::multimap<int, Link> & edgeConstraints,
|
const std::multimap<int, Link> & edgeConstraints,
|
||||||
|
cv::Mat & outputCovariance,
|
||||||
std::list<std::map<int, Transform> > * intermediateGraphes = 0,
|
std::list<std::map<int, Transform> > * intermediateGraphes = 0,
|
||||||
double * finalError = 0,
|
double * finalError = 0,
|
||||||
int * iterationsDone = 0);
|
int * iterationsDone = 0);
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ public:
|
|||||||
int rootId,
|
int rootId,
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
const std::multimap<int, Link> & edgeConstraints,
|
const std::multimap<int, Link> & edgeConstraints,
|
||||||
|
cv::Mat & outputCovariance,
|
||||||
std::list<std::map<int, Transform> > * intermediateGraphes = 0,
|
std::list<std::map<int, Transform> > * intermediateGraphes = 0,
|
||||||
double * finalError = 0,
|
double * finalError = 0,
|
||||||
int * iterationsDone = 0);
|
int * iterationsDone = 0);
|
||||||
|
|||||||
@@ -172,8 +172,11 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(Rtabmap, PublishLastSignature, bool, true, "Publishing last signature.");
|
RTABMAP_PARAM(Rtabmap, PublishLastSignature, bool, true, "Publishing last signature.");
|
||||||
RTABMAP_PARAM(Rtabmap, PublishPdf, bool, true, "Publishing pdf.");
|
RTABMAP_PARAM(Rtabmap, PublishPdf, bool, true, "Publishing pdf.");
|
||||||
RTABMAP_PARAM(Rtabmap, PublishLikelihood, bool, true, "Publishing likelihood.");
|
RTABMAP_PARAM(Rtabmap, PublishLikelihood, bool, true, "Publishing likelihood.");
|
||||||
RTABMAP_PARAM(Rtabmap, TimeThr, float, 0, "Maximum time allowed for the detector (ms) (0 means infinity).");
|
RTABMAP_PARAM(Rtabmap, PublishRAMUsage, bool, false, "Publishing RAM usage in statistics (may add a small overhead to get info from the system).");
|
||||||
RTABMAP_PARAM(Rtabmap, MemoryThr, int, 0, "Maximum signatures in the Working Memory (ms) (0 means infinity).");
|
RTABMAP_PARAM(Rtabmap, ComputeRMSE, bool, true, "Compute root mean square error (RMSE) and publish it in statistics, if ground truth is provided.");
|
||||||
|
RTABMAP_PARAM(Rtabmap, SaveWMState, bool, false, "Save working memory state after each update in statistics.");
|
||||||
|
RTABMAP_PARAM(Rtabmap, TimeThr, float, 0, "Maximum time allowed for map update (ms) (0 means infinity). When map update time exceeds this fixed time threshold, some nodes in Working Memory (WM) are transferred to Long-Term Memory to limit the size of the WM and decrease the update time.");
|
||||||
|
RTABMAP_PARAM(Rtabmap, MemoryThr, int, 0, uFormat("Maximum nodes in the Working Memory (0 means infinity). Similar to \"%s\", when the number of nodes in Working Memory (WM) exceeds this treshold, some nodes are transferred to Long-Term Memory to keep WM size fixed.", kRtabmapTimeThr().c_str()));
|
||||||
RTABMAP_PARAM(Rtabmap, DetectionRate, float, 1, "Detection rate (Hz). RTAB-Map will filter input images to satisfy this rate.");
|
RTABMAP_PARAM(Rtabmap, DetectionRate, float, 1, "Detection rate (Hz). RTAB-Map will filter input images to satisfy this rate.");
|
||||||
RTABMAP_PARAM(Rtabmap, ImageBufferSize, unsigned int, 1, "Data buffer size (0 min inf).");
|
RTABMAP_PARAM(Rtabmap, ImageBufferSize, unsigned int, 1, "Data buffer size (0 min inf).");
|
||||||
RTABMAP_PARAM(Rtabmap, CreateIntermediateNodes, bool, false, uFormat("Create intermediate nodes between loop closure detection. Only used when %s>0.", kRtabmapDetectionRate().c_str()));
|
RTABMAP_PARAM(Rtabmap, CreateIntermediateNodes, bool, false, uFormat("Create intermediate nodes between loop closure detection. Only used when %s>0.", kRtabmapDetectionRate().c_str()));
|
||||||
@@ -183,6 +186,9 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(Rtabmap, StatisticLogged, bool, false, "Logging enabled.");
|
RTABMAP_PARAM(Rtabmap, StatisticLogged, bool, false, "Logging enabled.");
|
||||||
RTABMAP_PARAM(Rtabmap, StatisticLoggedHeaders, bool, true, "Add column header description to log files.");
|
RTABMAP_PARAM(Rtabmap, StatisticLoggedHeaders, bool, true, "Add column header description to log files.");
|
||||||
RTABMAP_PARAM(Rtabmap, StartNewMapOnLoopClosure, bool, false, "Start a new map only if there is a global loop closure with a previous map.");
|
RTABMAP_PARAM(Rtabmap, StartNewMapOnLoopClosure, bool, false, "Start a new map only if there is a global loop closure with a previous map.");
|
||||||
|
RTABMAP_PARAM(Rtabmap, StartNewMapOnGoodSignature, bool, false, uFormat("Start a new map only if the first signature is not bad (i.e., has enough features, see %s).", kKpBadSignRatio().c_str()));
|
||||||
|
RTABMAP_PARAM(Rtabmap, ImagesAlreadyRectified, bool, true, "Images are already rectified. By default RTAB-Map assumes that received images are rectified. If they are not, they can be rectified by RTAB-Map if this parameter is false.");
|
||||||
|
RTABMAP_PARAM(Rtabmap, RectifyOnlyFeatures, bool, false, uFormat("If \"%s\" is false and this parameter is true, the whole RGB image will not be rectified, only the features. Warning: As projection of RGB-D image to point cloud is assuming that images are rectified, the generated point cloud map will have wrong colors if this parameter is true.", kRtabmapImagesAlreadyRectified().c_str()));
|
||||||
|
|
||||||
// Hypotheses selection
|
// Hypotheses selection
|
||||||
RTABMAP_PARAM(Rtabmap, LoopThr, float, 0.11, "Loop closing threshold.");
|
RTABMAP_PARAM(Rtabmap, LoopThr, float, 0.11, "Loop closing threshold.");
|
||||||
@@ -207,26 +213,36 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(Mem, GenerateIds, bool, true, "True=Generate location IDs, False=use input image IDs.");
|
RTABMAP_PARAM(Mem, GenerateIds, bool, true, "True=Generate location IDs, False=use input image IDs.");
|
||||||
RTABMAP_PARAM(Mem, BadSignaturesIgnored, bool, false, "Bad signatures are ignored.");
|
RTABMAP_PARAM(Mem, BadSignaturesIgnored, bool, false, "Bad signatures are ignored.");
|
||||||
RTABMAP_PARAM(Mem, InitWMWithAllNodes, bool, false, "Initialize the Working Memory with all nodes in Long-Term Memory. When false, it is initialized with nodes of the previous session.");
|
RTABMAP_PARAM(Mem, InitWMWithAllNodes, bool, false, "Initialize the Working Memory with all nodes in Long-Term Memory. When false, it is initialized with nodes of the previous session.");
|
||||||
|
RTABMAP_PARAM(Mem, DepthAsMask, bool, true, "Use depth image as mask when extracting features for vocabulary.");
|
||||||
RTABMAP_PARAM(Mem, ImagePreDecimation, int, 1, "Image decimation (>=1) before features extraction. Negative decimation is done from RGB size instead of depth size (if depth is smaller than RGB, it may be interpolated depending of the decimation value).");
|
RTABMAP_PARAM(Mem, ImagePreDecimation, int, 1, "Image decimation (>=1) before features extraction. Negative decimation is done from RGB size instead of depth size (if depth is smaller than RGB, it may be interpolated depending of the decimation value).");
|
||||||
RTABMAP_PARAM(Mem, ImagePostDecimation, int, 1, "Image decimation (>=1) of saved data in created signatures (after features extraction). Decimation is done from the original image. Negative decimation is done from RGB size instead of depth size (if depth is smaller than RGB, it may be interpolated depending of the decimation value).");
|
RTABMAP_PARAM(Mem, ImagePostDecimation, int, 1, "Image decimation (>=1) of saved data in created signatures (after features extraction). Decimation is done from the original image. Negative decimation is done from RGB size instead of depth size (if depth is smaller than RGB, it may be interpolated depending of the decimation value).");
|
||||||
RTABMAP_PARAM(Mem, CompressionParallelized, bool, true, "Compression of sensor data is multi-threaded.");
|
RTABMAP_PARAM(Mem, CompressionParallelized, bool, true, "Compression of sensor data is multi-threaded.");
|
||||||
RTABMAP_PARAM(Mem, LaserScanDownsampleStepSize, int, 1, "If > 1, downsample the laser scans when creating a signature.");
|
RTABMAP_PARAM(Mem, LaserScanDownsampleStepSize, int, 1, "If > 1, downsample the laser scans when creating a signature.");
|
||||||
RTABMAP_PARAM(Mem, LaserScanNormalK, int, 0, "If > 0 and laser scans are 3D without normals, normals will be computed with K search neighbors when creating a signature.");
|
RTABMAP_PARAM(Mem, LaserScanVoxelSize, float, 0.0, uFormat("If > 0 m, voxel filtering is done on laser scans when creating a signature. If the laser scan had normals, they will be removed. To recompute the normals, make sure to use \"%s\" or \"%s\" parameters.", kMemLaserScanNormalK().c_str(), kMemLaserScanNormalRadius().c_str()).c_str());
|
||||||
RTABMAP_PARAM(Mem, UseOdomFeatures, bool, false, "Use odometry features.");
|
RTABMAP_PARAM(Mem, LaserScanNormalK, int, 0, "If > 0 and laser scans don't have normals, normals will be computed with K search neighbors when creating a signature.");
|
||||||
|
RTABMAP_PARAM(Mem, LaserScanNormalRadius, float, 0.0, "If > 0 m and laser scans don't have normals, normals will be computed with radius search neighbors when creating a signature.");
|
||||||
|
RTABMAP_PARAM(Mem, UseOdomFeatures, bool, true, "Use odometry features.");
|
||||||
|
RTABMAP_PARAM(Mem, CovOffDiagIgnored, bool, true, "Ignore off diagonal values of the covariance matrix.");
|
||||||
|
|
||||||
// KeypointMemory (Keypoint-based)
|
// KeypointMemory (Keypoint-based)
|
||||||
RTABMAP_PARAM(Kp, NNStrategy, int, 1, "kNNFlannNaive=0, kNNFlannKdTree=1, kNNFlannLSH=2, kNNBruteForce=3, kNNBruteForceGPU=4");
|
RTABMAP_PARAM(Kp, NNStrategy, int, 1, "kNNFlannNaive=0, kNNFlannKdTree=1, kNNFlannLSH=2, kNNBruteForce=3, kNNBruteForceGPU=4");
|
||||||
RTABMAP_PARAM(Kp, IncrementalDictionary, bool, true, "");
|
RTABMAP_PARAM(Kp, IncrementalDictionary, bool, true, "");
|
||||||
RTABMAP_PARAM(Kp, IncrementalFlann, bool, true, "When using FLANN based strategy, add/remove points to its index without always rebuilding the index (the index is built only when the dictionary doubles in size).");
|
RTABMAP_PARAM(Kp, IncrementalFlann, bool, true, uFormat("When using FLANN based strategy, add/remove points to its index without always rebuilding the index (the index is built only when the dictionary increases of the factor \"%s\" in size).", kKpFlannRebalancingFactor().c_str()));
|
||||||
|
RTABMAP_PARAM(Kp, FlannRebalancingFactor, float, 2.0, uFormat("Factor used when rebuilding the incremental FLANN index (see \"%s\"). Set <=1 to disable.", kKpIncrementalFlann().c_str()));
|
||||||
RTABMAP_PARAM(Kp, MaxDepth, float, 0, "Filter extracted keypoints by depth (0=inf).");
|
RTABMAP_PARAM(Kp, MaxDepth, float, 0, "Filter extracted keypoints by depth (0=inf).");
|
||||||
RTABMAP_PARAM(Kp, MinDepth, float, 0, "Filter extracted keypoints by depth.");
|
RTABMAP_PARAM(Kp, MinDepth, float, 0, "Filter extracted keypoints by depth.");
|
||||||
RTABMAP_PARAM(Kp, MaxFeatures, int, 400, "Maximum features extracted from the images (0 means not bounded, <0 means no extraction).");
|
RTABMAP_PARAM(Kp, MaxFeatures, int, 500, "Maximum features extracted from the images (0 means not bounded, <0 means no extraction).");
|
||||||
RTABMAP_PARAM(Kp, BadSignRatio, float, 0.5, "Bad signature ratio (less than Ratio x AverageWordsPerImage = bad).");
|
RTABMAP_PARAM(Kp, BadSignRatio, float, 0.5, "Bad signature ratio (less than Ratio x AverageWordsPerImage = bad).");
|
||||||
RTABMAP_PARAM(Kp, NndrRatio, float, 0.8, "NNDR ratio (A matching pair is detected, if its distance is closer than X times the distance of the second nearest neighbor.)");
|
RTABMAP_PARAM(Kp, NndrRatio, float, 0.8, "NNDR ratio (A matching pair is detected, if its distance is closer than X times the distance of the second nearest neighbor.)");
|
||||||
#ifdef RTABMAP_NONFREE
|
#ifndef RTABMAP_NONFREE
|
||||||
RTABMAP_PARAM(Kp, DetectorStrategy, int, 0, "0=SURF 1=SIFT 2=ORB 3=FAST/FREAK 4=FAST/BRIEF 5=GFTT/FREAK 6=GFTT/BRIEF 7=BRISK 8=GFTT/ORB 9=KAZE.");
|
#ifdef RTABMAP_OPENCV3
|
||||||
|
// OpenCV 3 without xFeatures2D module doesn't have BRIEF
|
||||||
|
RTABMAP_PARAM(Kp, DetectorStrategy, int, 8, "0=SURF 1=SIFT 2=ORB 3=FAST/FREAK 4=FAST/BRIEF 5=GFTT/FREAK 6=GFTT/BRIEF 7=BRISK 8=GFTT/ORB 9=KAZE.");
|
||||||
#else
|
#else
|
||||||
RTABMAP_PARAM(Kp, DetectorStrategy, int, 2, "0=SURF 1=SIFT 2=ORB 3=FAST/FREAK 4=FAST/BRIEF 5=GFTT/FREAK 6=GFTT/BRIEF 7=BRISK 8=GFTT/ORB 9=KAZE.");
|
RTABMAP_PARAM(Kp, DetectorStrategy, int, 6, "0=SURF 1=SIFT 2=ORB 3=FAST/FREAK 4=FAST/BRIEF 5=GFTT/FREAK 6=GFTT/BRIEF 7=BRISK 8=GFTT/ORB 9=KAZE.");
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
RTABMAP_PARAM(Kp, DetectorStrategy, int, 6, "0=SURF 1=SIFT 2=ORB 3=FAST/FREAK 4=FAST/BRIEF 5=GFTT/FREAK 6=GFTT/BRIEF 7=BRISK 8=GFTT/ORB 9=KAZE.");
|
||||||
#endif
|
#endif
|
||||||
RTABMAP_PARAM(Kp, TfIdfLikelihoodUsed, bool, true, "Use of the td-idf strategy to compute the likelihood.");
|
RTABMAP_PARAM(Kp, TfIdfLikelihoodUsed, bool, true, "Use of the td-idf strategy to compute the likelihood.");
|
||||||
RTABMAP_PARAM(Kp, Parallelized, bool, true, "If the dictionary update and signature creation were parallelized.");
|
RTABMAP_PARAM(Kp, Parallelized, bool, true, "If the dictionary update and signature creation were parallelized.");
|
||||||
@@ -236,6 +252,8 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(Kp, SubPixWinSize, int, 3, "See cv::cornerSubPix().");
|
RTABMAP_PARAM(Kp, SubPixWinSize, int, 3, "See cv::cornerSubPix().");
|
||||||
RTABMAP_PARAM(Kp, SubPixIterations, int, 0, "See cv::cornerSubPix(). 0 disables sub pixel refining.");
|
RTABMAP_PARAM(Kp, SubPixIterations, int, 0, "See cv::cornerSubPix(). 0 disables sub pixel refining.");
|
||||||
RTABMAP_PARAM(Kp, SubPixEps, double, 0.02, "See cv::cornerSubPix().");
|
RTABMAP_PARAM(Kp, SubPixEps, double, 0.02, "See cv::cornerSubPix().");
|
||||||
|
RTABMAP_PARAM(Kp, GridRows, int, 1, uFormat("Number of rows of the grid used to extract uniformly \"%s / grid cells\" features from each cell.", kKpMaxFeatures().c_str()));
|
||||||
|
RTABMAP_PARAM(Kp, GridCols, int, 1, uFormat("Number of columns of the grid used to extract uniformly \"%s / grid cells\" features from each cell.", kKpMaxFeatures().c_str()));
|
||||||
|
|
||||||
//Database
|
//Database
|
||||||
RTABMAP_PARAM(DbSqlite3, InMemory, bool, false, "Using database in the memory instead of a file on the hard disk.");
|
RTABMAP_PARAM(DbSqlite3, InMemory, bool, false, "Using database in the memory instead of a file on the hard disk.");
|
||||||
@@ -267,11 +285,11 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(FAST, GpuKeypointsRatio, double, 0.05, "Used with FAST GPU.");
|
RTABMAP_PARAM(FAST, GpuKeypointsRatio, double, 0.05, "Used with FAST GPU.");
|
||||||
RTABMAP_PARAM(FAST, MinThreshold, int, 7, "Minimum threshold. Used only when FAST/GridRows and FAST/GridCols are set.");
|
RTABMAP_PARAM(FAST, MinThreshold, int, 7, "Minimum threshold. Used only when FAST/GridRows and FAST/GridCols are set.");
|
||||||
RTABMAP_PARAM(FAST, MaxThreshold, int, 200, "Maximum threshold. Used only when FAST/GridRows and FAST/GridCols are set.");
|
RTABMAP_PARAM(FAST, MaxThreshold, int, 200, "Maximum threshold. Used only when FAST/GridRows and FAST/GridCols are set.");
|
||||||
RTABMAP_PARAM(FAST, GridRows, int, 4, "Grid rows (0 to disable). Adapts the detector to partition the source image into a grid and detect points in each cell.");
|
RTABMAP_PARAM(FAST, GridRows, int, 0, "Grid rows (0 to disable). Adapts the detector to partition the source image into a grid and detect points in each cell.");
|
||||||
RTABMAP_PARAM(FAST, GridCols, int, 4, "Grid cols (0 to disable). Adapts the detector to partition the source image into a grid and detect points in each cell.");
|
RTABMAP_PARAM(FAST, GridCols, int, 0, "Grid cols (0 to disable). Adapts the detector to partition the source image into a grid and detect points in each cell.");
|
||||||
|
|
||||||
RTABMAP_PARAM(GFTT, QualityLevel, double, 0.01, "");
|
RTABMAP_PARAM(GFTT, QualityLevel, double, 0.001, "");
|
||||||
RTABMAP_PARAM(GFTT, MinDistance, double, 5, "");
|
RTABMAP_PARAM(GFTT, MinDistance, double, 3, "");
|
||||||
RTABMAP_PARAM(GFTT, BlockSize, int, 3, "");
|
RTABMAP_PARAM(GFTT, BlockSize, int, 3, "");
|
||||||
RTABMAP_PARAM(GFTT, UseHarrisDetector, bool, false, "");
|
RTABMAP_PARAM(GFTT, UseHarrisDetector, bool, false, "");
|
||||||
RTABMAP_PARAM(GFTT, K, double, 0.04, "");
|
RTABMAP_PARAM(GFTT, K, double, 0.04, "");
|
||||||
@@ -314,11 +332,14 @@ class RTABMAP_EXP Parameters
|
|||||||
|
|
||||||
// RGB-D SLAM
|
// RGB-D SLAM
|
||||||
RTABMAP_PARAM(RGBD, Enabled, bool, true, "");
|
RTABMAP_PARAM(RGBD, Enabled, bool, true, "");
|
||||||
RTABMAP_PARAM(RGBD, LinearUpdate, float, 0.1, "Minimum linear displacement to update the map. Rehearsal is done prior to this, so weights are still updated.");
|
RTABMAP_PARAM(RGBD, LinearUpdate, float, 0.1, "Minimum linear displacement (m) to update the map. Rehearsal is done prior to this, so weights are still updated.");
|
||||||
RTABMAP_PARAM(RGBD, AngularUpdate, float, 0.1, "Minimum angular displacement to update the map. Rehearsal is done prior to this, so weights are still updated.");
|
RTABMAP_PARAM(RGBD, AngularUpdate, float, 0.1, "Minimum angular displacement (rad) to update the map. Rehearsal is done prior to this, so weights are still updated.");
|
||||||
|
RTABMAP_PARAM(RGBD, LinearSpeedUpdate, float, 0.0, "Maximum linear speed (m/s) to update the map (0 means not limit).");
|
||||||
|
RTABMAP_PARAM(RGBD, AngularSpeedUpdate, float, 0.0, "Maximum angular speed (rad/s) to update the map (0 means not limit).");
|
||||||
RTABMAP_PARAM(RGBD, NewMapOdomChangeDistance, float, 0, "A new map is created if a change of odometry translation greater than X m is detected (0 m = disabled).");
|
RTABMAP_PARAM(RGBD, NewMapOdomChangeDistance, float, 0, "A new map is created if a change of odometry translation greater than X m is detected (0 m = disabled).");
|
||||||
RTABMAP_PARAM(RGBD, OptimizeFromGraphEnd, bool, false, "Optimize graph from the newest node. If false, the graph is optimized from the oldest node of the current graph (this adds an overhead computation to detect to oldest node of the current graph, but it can be useful to preserve the map referential from the oldest node). Warning when set to false: when some nodes are transferred, the first referential of the local map may change, resulting in momentary changes in robot/map position (which are annoying in teleoperation).");
|
RTABMAP_PARAM(RGBD, OptimizeFromGraphEnd, bool, false, "Optimize graph from the newest node. If false, the graph is optimized from the oldest node of the current graph (this adds an overhead computation to detect to oldest node of the current graph, but it can be useful to preserve the map referential from the oldest node). Warning when set to false: when some nodes are transferred, the first referential of the local map may change, resulting in momentary changes in robot/map position (which are annoying in teleoperation).");
|
||||||
RTABMAP_PARAM(RGBD, OptimizeMaxError, float, 1, uFormat("Reject loop closures if optimization error is greater than this value (0=disabled). This will help to detect when a wrong loop closure is added to the graph. Not compatible with \"%s\" if enabled.", kOptimizerRobust().c_str()));
|
RTABMAP_PARAM(RGBD, OptimizeMaxError, float, 1.0, uFormat("Reject loop closures if optimization error ratio is greater than this value (0=disabled). Ratio is computed as absolute error over standard deviation of each link. This will help to detect when a wrong loop closure is added to the graph. Not compatible with \"%s\" if enabled.", kOptimizerRobust().c_str()));
|
||||||
|
RTABMAP_PARAM(RGBD, SavedLocalizationIgnored, bool, false, "Ignore last saved localization pose from previous session. If true, RTAB-Map won't assume it is restarting from the same place than where it shut down previously.");
|
||||||
RTABMAP_PARAM(RGBD, GoalReachedRadius, float, 0.5, "Goal reached radius (m).");
|
RTABMAP_PARAM(RGBD, GoalReachedRadius, float, 0.5, "Goal reached radius (m).");
|
||||||
RTABMAP_PARAM(RGBD, PlanStuckIterations, int, 0, "Mark the current goal node on the path as unreachable if it is not updated after X iterations (0=disabled). If all upcoming nodes on the path are unreachabled, the plan fails.");
|
RTABMAP_PARAM(RGBD, PlanStuckIterations, int, 0, "Mark the current goal node on the path as unreachable if it is not updated after X iterations (0=disabled). If all upcoming nodes on the path are unreachabled, the plan fails.");
|
||||||
RTABMAP_PARAM(RGBD, PlanLinearVelocity, float, 0, "Linear velocity (m/sec) used to compute path weights.");
|
RTABMAP_PARAM(RGBD, PlanLinearVelocity, float, 0, "Linear velocity (m/sec) used to compute path weights.");
|
||||||
@@ -330,6 +351,7 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(RGBD, ScanMatchingIdsSavedInLinks, bool, true, "Save scan matching IDs in link's user data.");
|
RTABMAP_PARAM(RGBD, ScanMatchingIdsSavedInLinks, bool, true, "Save scan matching IDs in link's user data.");
|
||||||
RTABMAP_PARAM(RGBD, NeighborLinkRefining, bool, false, uFormat("When a new node is added to the graph, the transformation of its neighbor link to the previous node is refined using registration approach selected (%s).", kRegStrategy().c_str()));
|
RTABMAP_PARAM(RGBD, NeighborLinkRefining, bool, false, uFormat("When a new node is added to the graph, the transformation of its neighbor link to the previous node is refined using registration approach selected (%s).", kRegStrategy().c_str()));
|
||||||
RTABMAP_PARAM(RGBD, LoopClosureReextractFeatures, bool, false, "Extract features even if there are some already in the nodes.");
|
RTABMAP_PARAM(RGBD, LoopClosureReextractFeatures, bool, false, "Extract features even if there are some already in the nodes.");
|
||||||
|
RTABMAP_PARAM(RGBD, LocalBundleOnLoopClosure, bool, false, "Do local bundle adjustment with neighborhood of the loop closure.");
|
||||||
RTABMAP_PARAM(RGBD, CreateOccupancyGrid, bool, false, "Create local occupancy grid maps. See \"Grid\" group for parameters.");
|
RTABMAP_PARAM(RGBD, CreateOccupancyGrid, bool, false, "Create local occupancy grid maps. See \"Grid\" group for parameters.");
|
||||||
|
|
||||||
// Local/Proximity loop closure detection
|
// Local/Proximity loop closure detection
|
||||||
@@ -337,7 +359,7 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(RGBD, ProximityBySpace, bool, true, "Detection over locations (in Working Memory) near in space.");
|
RTABMAP_PARAM(RGBD, ProximityBySpace, bool, true, "Detection over locations (in Working Memory) near in space.");
|
||||||
RTABMAP_PARAM(RGBD, ProximityMaxGraphDepth, int, 50, "Maximum depth from the current/last loop closure location and the local loop closure hypotheses. Set 0 to ignore.");
|
RTABMAP_PARAM(RGBD, ProximityMaxGraphDepth, int, 50, "Maximum depth from the current/last loop closure location and the local loop closure hypotheses. Set 0 to ignore.");
|
||||||
RTABMAP_PARAM(RGBD, ProximityMaxPaths, int, 3, "Maximum paths compared (from the most recent) for proximity detection by space. 0 means no limit.");
|
RTABMAP_PARAM(RGBD, ProximityMaxPaths, int, 3, "Maximum paths compared (from the most recent) for proximity detection by space. 0 means no limit.");
|
||||||
RTABMAP_PARAM(RGBD, ProximityPathFilteringRadius, float, 0.5, "Path filtering radius to reduce the number of nodes to compare in a path. A path should also be inside that radius to be considered for proximity detection.");
|
RTABMAP_PARAM(RGBD, ProximityPathFilteringRadius, float, 1, "Path filtering radius to reduce the number of nodes to compare in a path. A path should also be inside that radius to be considered for proximity detection.");
|
||||||
RTABMAP_PARAM(RGBD, ProximityPathMaxNeighbors, int, 0, "Maximum neighbor nodes compared on each path. Set to 0 to disable merging the laser scans.");
|
RTABMAP_PARAM(RGBD, ProximityPathMaxNeighbors, int, 0, "Maximum neighbor nodes compared on each path. Set to 0 to disable merging the laser scans.");
|
||||||
RTABMAP_PARAM(RGBD, ProximityPathRawPosesUsed, bool, true, "When comparing to a local path, merge the scan using the odometry poses (with neighbor link optimizations) instead of the ones in the optimized local graph.");
|
RTABMAP_PARAM(RGBD, ProximityPathRawPosesUsed, bool, true, "When comparing to a local path, merge the scan using the odometry poses (with neighbor link optimizations) instead of the ones in the optimized local graph.");
|
||||||
RTABMAP_PARAM(RGBD, ProximityAngle, float, 45, "Maximum angle (degrees) for visual proximity detection.");
|
RTABMAP_PARAM(RGBD, ProximityAngle, float, 45, "Maximum angle (degrees) for visual proximity detection.");
|
||||||
@@ -360,8 +382,13 @@ class RTABMAP_EXP Parameters
|
|||||||
#endif
|
#endif
|
||||||
RTABMAP_PARAM(Optimizer, VarianceIgnored, bool, false, "Ignore constraints' variance. If checked, identity information matrix is used for each constraint. Otherwise, an information matrix is generated from the variance saved in the links.");
|
RTABMAP_PARAM(Optimizer, VarianceIgnored, bool, false, "Ignore constraints' variance. If checked, identity information matrix is used for each constraint. Otherwise, an information matrix is generated from the variance saved in the links.");
|
||||||
RTABMAP_PARAM(Optimizer, Robust, bool, false, uFormat("Robust graph optimization using Vertigo (only work for g2o and GTSAM optimization strategies). Not compatible with \"%s\" if enabled.", kRGBDOptimizeMaxError().c_str()));
|
RTABMAP_PARAM(Optimizer, Robust, bool, false, uFormat("Robust graph optimization using Vertigo (only work for g2o and GTSAM optimization strategies). Not compatible with \"%s\" if enabled.", kRGBDOptimizeMaxError().c_str()));
|
||||||
|
RTABMAP_PARAM(Optimizer, PriorsIgnored, bool, true, "Ignore prior constraints (global pose or GPS) while optimizing. Currently only g2o and gtsam optimization supports this.");
|
||||||
|
|
||||||
|
#ifdef RTABMAP_ORB_SLAM2
|
||||||
|
RTABMAP_PARAM(g2o, Solver, int, 3, "0=csparse 1=pcg 2=cholmod 3=Eigen");
|
||||||
|
#else
|
||||||
RTABMAP_PARAM(g2o, Solver, int, 0, "0=csparse 1=pcg 2=cholmod 3=Eigen");
|
RTABMAP_PARAM(g2o, Solver, int, 0, "0=csparse 1=pcg 2=cholmod 3=Eigen");
|
||||||
|
#endif
|
||||||
RTABMAP_PARAM(g2o, Optimizer, int, 0, "0=Levenberg 1=GaussNewton");
|
RTABMAP_PARAM(g2o, Optimizer, int, 0, "0=Levenberg 1=GaussNewton");
|
||||||
RTABMAP_PARAM(g2o, PixelVariance, double, 1.0, "Pixel variance used for bundle adjustment.");
|
RTABMAP_PARAM(g2o, PixelVariance, double, 1.0, "Pixel variance used for bundle adjustment.");
|
||||||
RTABMAP_PARAM(g2o, RobustKernelDelta, double, 8, "Robust kernel delta used for bundle adjustment (0 means don't use robust kernel). Observations with chi2 over this threshold will be ignored in the second optimization pass.");
|
RTABMAP_PARAM(g2o, RobustKernelDelta, double, 8, "Robust kernel delta used for bundle adjustment (0 means don't use robust kernel). Observations with chi2 over this threshold will be ignored in the second optimization pass.");
|
||||||
@@ -370,7 +397,7 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(GTSAM, Optimizer, int, 1, "0=Levenberg 1=GaussNewton 2=Dogleg");
|
RTABMAP_PARAM(GTSAM, Optimizer, int, 1, "0=Levenberg 1=GaussNewton 2=Dogleg");
|
||||||
|
|
||||||
// Odometry
|
// Odometry
|
||||||
RTABMAP_PARAM(Odom, Strategy, int, 0, "0=Frame-to-Map (F2M) 1=Frame-to-Frame (F2F) 2=Fovis 3=viso2 4=DVO-SLAM 5=ORB_SLAM2");
|
RTABMAP_PARAM(Odom, Strategy, int, 0, "0=Frame-to-Map (F2M) 1=Frame-to-Frame (F2F) 2=Fovis 3=viso2 4=DVO-SLAM 5=ORB_SLAM2 6=OKVIS 7=LOAM 8=MSCKF_VIO");
|
||||||
RTABMAP_PARAM(Odom, ResetCountdown, int, 0, "Automatically reset odometry after X consecutive images on which odometry cannot be computed (value=0 disables auto-reset).");
|
RTABMAP_PARAM(Odom, ResetCountdown, int, 0, "Automatically reset odometry after X consecutive images on which odometry cannot be computed (value=0 disables auto-reset).");
|
||||||
RTABMAP_PARAM(Odom, Holonomic, bool, true, "If the robot is holonomic (strafing commands can be issued). If not, y value will be estimated from x and yaw values (y=x*tan(yaw)).");
|
RTABMAP_PARAM(Odom, Holonomic, bool, true, "If the robot is holonomic (strafing commands can be issued). If not, y value will be estimated from x and yaw values (y=x*tan(yaw)).");
|
||||||
RTABMAP_PARAM(Odom, FillInfoData, bool, true, "Fill info with data (inliers/outliers features).");
|
RTABMAP_PARAM(Odom, FillInfoData, bool, true, "Fill info with data (inliers/outliers features).");
|
||||||
@@ -383,10 +410,10 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(Odom, ParticleLambdaR, float, 100, "Lambda of rotational components (roll,pitch,yaw).");
|
RTABMAP_PARAM(Odom, ParticleLambdaR, float, 100, "Lambda of rotational components (roll,pitch,yaw).");
|
||||||
RTABMAP_PARAM(Odom, KalmanProcessNoise, float, 0.001, "Process noise covariance value.");
|
RTABMAP_PARAM(Odom, KalmanProcessNoise, float, 0.001, "Process noise covariance value.");
|
||||||
RTABMAP_PARAM(Odom, KalmanMeasurementNoise, float, 0.01, "Process measurement covariance value.");
|
RTABMAP_PARAM(Odom, KalmanMeasurementNoise, float, 0.01, "Process measurement covariance value.");
|
||||||
RTABMAP_PARAM(Odom, GuessMotion, bool, false, "Guess next transformation from the last motion computed.");
|
RTABMAP_PARAM(Odom, GuessMotion, bool, true, "Guess next transformation from the last motion computed.");
|
||||||
RTABMAP_PARAM(Odom, KeyFrameThr, float, 0.3, "[Visual] Create a new keyframe when the number of inliers drops under this ratio of features in last frame. Setting the value to 0 means that a keyframe is created for each processed frame.");
|
RTABMAP_PARAM(Odom, KeyFrameThr, float, 0.3, "[Visual] Create a new keyframe when the number of inliers drops under this ratio of features in last frame. Setting the value to 0 means that a keyframe is created for each processed frame.");
|
||||||
RTABMAP_PARAM(Odom, VisKeyFrameThr, int, 100, "[Visual] Create a new keyframe when the number of inliers drops under this threshold. Setting the value to 0 means that a keyframe is created for each processed frame.");
|
RTABMAP_PARAM(Odom, VisKeyFrameThr, int, 150, "[Visual] Create a new keyframe when the number of inliers drops under this threshold. Setting the value to 0 means that a keyframe is created for each processed frame.");
|
||||||
RTABMAP_PARAM(Odom, ScanKeyFrameThr, float, 0.7, "[Geometry] Create a new keyframe when the number of ICP inliers drops under this ratio of points in last frame's scan. Setting the value to 0 means that a keyframe is created for each processed frame.");
|
RTABMAP_PARAM(Odom, ScanKeyFrameThr, float, 0.9, "[Geometry] Create a new keyframe when the number of ICP inliers drops under this ratio of points in last frame's scan. Setting the value to 0 means that a keyframe is created for each processed frame.");
|
||||||
RTABMAP_PARAM(Odom, ImageDecimation, int, 1, "Decimation of the images before registration. Negative decimation is done from RGB size instead of depth size (if depth is smaller than RGB, it may be interpolated depending of the decimation value).");
|
RTABMAP_PARAM(Odom, ImageDecimation, int, 1, "Decimation of the images before registration. Negative decimation is done from RGB size instead of depth size (if depth is smaller than RGB, it may be interpolated depending of the decimation value).");
|
||||||
RTABMAP_PARAM(Odom, AlignWithGround, bool, false, "Align odometry with the ground on initialization.");
|
RTABMAP_PARAM(Odom, AlignWithGround, bool, false, "Align odometry with the ground on initialization.");
|
||||||
|
|
||||||
@@ -395,8 +422,13 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(OdomF2M, MaxNewFeatures, int, 0, "[Visual] Maximum features (sorted by keypoint response) added to local map from a new key-frame. 0 means no limit.");
|
RTABMAP_PARAM(OdomF2M, MaxNewFeatures, int, 0, "[Visual] Maximum features (sorted by keypoint response) added to local map from a new key-frame. 0 means no limit.");
|
||||||
RTABMAP_PARAM(OdomF2M, ScanMaxSize, int, 2000, "[Geometry] Maximum local scan map size.");
|
RTABMAP_PARAM(OdomF2M, ScanMaxSize, int, 2000, "[Geometry] Maximum local scan map size.");
|
||||||
RTABMAP_PARAM(OdomF2M, ScanSubtractRadius, float, 0.05, "[Geometry] Radius used to filter points of a new added scan to local map. This could match the voxel size of the scans.");
|
RTABMAP_PARAM(OdomF2M, ScanSubtractRadius, float, 0.05, "[Geometry] Radius used to filter points of a new added scan to local map. This could match the voxel size of the scans.");
|
||||||
|
RTABMAP_PARAM(OdomF2M, ScanSubtractAngle, float, 45, uFormat("[Geometry] Max angle (degrees) used to filter points of a new added scan to local map (when \"%s\">0). 0 means any angle.", kOdomF2MScanSubtractRadius().c_str()).c_str());
|
||||||
|
#if defined(RTABMAP_G2O) || defined(RTABMAP_ORB_SLAM2)
|
||||||
|
RTABMAP_PARAM(OdomF2M, BundleAdjustment, int, 1, "Local bundle adjustment: 0=disabled, 1=g2o, 2=cvsba.");
|
||||||
|
#else
|
||||||
RTABMAP_PARAM(OdomF2M, BundleAdjustment, int, 0, "Local bundle adjustment: 0=disabled, 1=g2o, 2=cvsba.");
|
RTABMAP_PARAM(OdomF2M, BundleAdjustment, int, 0, "Local bundle adjustment: 0=disabled, 1=g2o, 2=cvsba.");
|
||||||
RTABMAP_PARAM(OdomF2M, BundleAdjustmentMaxFrames, int, 0, "Maximum frames used for bundle adjustment (0=inf or all current frames in the local map).");
|
#endif
|
||||||
|
RTABMAP_PARAM(OdomF2M, BundleAdjustmentMaxFrames, int, 10, "Maximum frames used for bundle adjustment (0=inf or all current frames in the local map).");
|
||||||
|
|
||||||
// Odometry Mono
|
// Odometry Mono
|
||||||
RTABMAP_PARAM(OdomMono, InitMinFlow, float, 100, "Minimum optical flow required for the initialization step.");
|
RTABMAP_PARAM(OdomMono, InitMinFlow, float, 100, "Minimum optical flow required for the initialization step.");
|
||||||
@@ -422,7 +454,7 @@ class RTABMAP_EXP Parameters
|
|||||||
|
|
||||||
RTABMAP_PARAM(OdomFovis, InlierMaxReprojectionError, double, 1.5, "The maximum image-space reprojection error (in pixels) a feature match is allowed to have and still be considered an inlier in the set of features used for motion estimation.");
|
RTABMAP_PARAM(OdomFovis, InlierMaxReprojectionError, double, 1.5, "The maximum image-space reprojection error (in pixels) a feature match is allowed to have and still be considered an inlier in the set of features used for motion estimation.");
|
||||||
RTABMAP_PARAM(OdomFovis, CliqueInlierThreshold, double, 0.1, "See Howard's greedy max-clique algorithm for determining the maximum set of mutually consisten feature matches. This specifies the compatibility threshold, in meters.");
|
RTABMAP_PARAM(OdomFovis, CliqueInlierThreshold, double, 0.1, "See Howard's greedy max-clique algorithm for determining the maximum set of mutually consisten feature matches. This specifies the compatibility threshold, in meters.");
|
||||||
RTABMAP_PARAM(OdomFovis, MinFeaturesForEstimate, int, 10, "Minimum number of features in the inlier set for the motion estimate to be considered valid.");
|
RTABMAP_PARAM(OdomFovis, MinFeaturesForEstimate, int, 20, "Minimum number of features in the inlier set for the motion estimate to be considered valid.");
|
||||||
RTABMAP_PARAM(OdomFovis, MaxMeanReprojectionError, double, 10.0, "Maximum mean reprojection error over the inlier feature matches for the motion estimate to be considered valid.");
|
RTABMAP_PARAM(OdomFovis, MaxMeanReprojectionError, double, 10.0, "Maximum mean reprojection error over the inlier feature matches for the motion estimate to be considered valid.");
|
||||||
RTABMAP_PARAM(OdomFovis, UseSubpixelRefinement, bool, true, "Specifies whether or not to refine feature matches to subpixel resolution.");
|
RTABMAP_PARAM(OdomFovis, UseSubpixelRefinement, bool, true, "Specifies whether or not to refine feature matches to subpixel resolution.");
|
||||||
RTABMAP_PARAM(OdomFovis, FeatureSearchWindow, int, 25, "Specifies the size of the search window to apply when searching for feature matches across time frames. The search is conducted around the feature location predicted by the initial rotation estimate.");
|
RTABMAP_PARAM(OdomFovis, FeatureSearchWindow, int, 25, "Specifies the size of the search window to apply when searching for feature matches across time frames. The search is conducted around the feature location predicted by the initial rotation estimate.");
|
||||||
@@ -452,13 +484,54 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(OdomViso2, BucketHeight, double, 50, "Height of bucket.");
|
RTABMAP_PARAM(OdomViso2, BucketHeight, double, 50, "Height of bucket.");
|
||||||
|
|
||||||
// Odometry ORB_SLAM2
|
// Odometry ORB_SLAM2
|
||||||
RTABMAP_PARAM_STR(OdomORBSLAM2, VocPath, "", "Path to ORB vocabulary (*.txt).");
|
RTABMAP_PARAM_STR(OdomORBSLAM2, VocPath, "", "Path to ORB vocabulary (*.txt).");
|
||||||
RTABMAP_PARAM(OdomORBSLAM2, Bf, double, 0.076, "Fake IR projector baseline (m) used only when stereo is not used.");
|
RTABMAP_PARAM(OdomORBSLAM2, Bf, double, 0.076, "Fake IR projector baseline (m) used only when stereo is not used.");
|
||||||
RTABMAP_PARAM(OdomORBSLAM2, ThDepth, double, 40.0, "Close/Far threshold. Baseline times.");
|
RTABMAP_PARAM(OdomORBSLAM2, ThDepth, double, 40.0, "Close/Far threshold. Baseline times.");
|
||||||
|
RTABMAP_PARAM(OdomORBSLAM2, Fps, float, 0.0, "Camera FPS.");
|
||||||
|
RTABMAP_PARAM(OdomORBSLAM2, MaxFeatures, int, 1000, "Maximum ORB features extracted per frame.");
|
||||||
|
RTABMAP_PARAM(OdomORBSLAM2, MapSize, int, 3000, "Maximum size of the feature map (0 means infinite).");
|
||||||
|
|
||||||
|
// Odometry OKVIS
|
||||||
|
RTABMAP_PARAM_STR(OdomOKVIS, ConfigPath, "", "Path of OKVIS config file.");
|
||||||
|
|
||||||
|
// Odometry LOAM
|
||||||
|
RTABMAP_PARAM(OdomLOAM, Sensor, int, 2, "Velodyne sensor: 0=VLP-16, 1=HDL-32, 2=HDL-64E");
|
||||||
|
RTABMAP_PARAM(OdomLOAM, ScanPeriod, float, 0.1, "Scan period (s)");
|
||||||
|
RTABMAP_PARAM(OdomLOAM, LinVar, float, 0.01, "Linear output variance.");
|
||||||
|
RTABMAP_PARAM(OdomLOAM, AngVar, float, 0.01, "Angular output variance.");
|
||||||
|
RTABMAP_PARAM(OdomLOAM, LocalMapping, bool, true, "Local mapping. It adds more time to compute odometry, but accuracy is significantly improved.");
|
||||||
|
|
||||||
|
// Odometry MSCKF_VIO
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, GridRow, int, 4, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, GridCol, int, 5, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, GridMinFeatureNum, int, 3, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, GridMaxFeatureNum, int, 4, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, PyramidLevels, int, 3, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, PatchSize, int, 15, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, FastThreshold, int, 10, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, MaxIteration, int, 30, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, TrackPrecision, double, 0.01, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, RansacThreshold, double, 3, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, StereoThreshold, double, 5, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, PositionStdThreshold, double, 8.0, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, RotationThreshold, double, 0.2618, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, TranslationThreshold, double, 0.4, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, TrackingRateThreshold, double, 0.5, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, OptTranslationThreshold, double, 0, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, NoiseGyro, double, 0.005, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, NoiseAcc, double, 0.05, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, NoiseGyroBias, double, 0.001, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, NoiseAccBias, double, 0.01, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, NoiseFeature, double, 0.035, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, InitCovVel, double, 0.25, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, InitCovGyroBias, double, 0.01, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, InitCovAccBias, double, 0.01, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, InitCovExRot, double, 0.00030462, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, InitCovExTrans, double, 0.000025, "");
|
||||||
|
RTABMAP_PARAM(OdomMSCKF, MaxCamStateSize, int, 20, "");
|
||||||
|
|
||||||
// Common registration parameters
|
// Common registration parameters
|
||||||
RTABMAP_PARAM(Reg, VarianceFromInliersCount, bool, false, "Set variance as the inverse of the number of inliers. Otherwise, the variance is computed as the average 3D position error of the inliers.");
|
RTABMAP_PARAM(Reg, RepeatOnce, bool, true, "Do a second registration with the output of the first registration as guess. Only done if no guess was provided for the first registration (like on loop closure). It can be useful if the registration approach used can use a guess to get better matches.");
|
||||||
RTABMAP_PARAM(Reg, VarianceNormalized, bool, false, "Normalize covariance values. Position variances are multiplied by norm of the transform and orientation variances are multiplied by angle of the transform.");
|
|
||||||
RTABMAP_PARAM(Reg, Strategy, int, 0, "0=Vis, 1=Icp, 2=VisIcp");
|
RTABMAP_PARAM(Reg, Strategy, int, 0, "0=Vis, 1=Icp, 2=VisIcp");
|
||||||
RTABMAP_PARAM(Reg, Force3DoF, bool, false, "Force 3 degrees-of-freedom transform (3Dof: x,y and yaw). Parameters z, roll and pitch will be set to 0.");
|
RTABMAP_PARAM(Reg, Force3DoF, bool, false, "Force 3 degrees-of-freedom transform (3Dof: x,y and yaw). Parameters z, roll and pitch will be set to 0.");
|
||||||
|
|
||||||
@@ -469,10 +542,15 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(Vis, RefineIterations, int, 5, uFormat("[%s = 0] Number of iterations used to refine the transformation found by RANSAC. 0 means that the transformation is not refined.", kVisEstimationType().c_str()));
|
RTABMAP_PARAM(Vis, RefineIterations, int, 5, uFormat("[%s = 0] Number of iterations used to refine the transformation found by RANSAC. 0 means that the transformation is not refined.", kVisEstimationType().c_str()));
|
||||||
RTABMAP_PARAM(Vis, PnPReprojError, float, 2, uFormat("[%s = 1] PnP reprojection error.", kVisEstimationType().c_str()));
|
RTABMAP_PARAM(Vis, PnPReprojError, float, 2, uFormat("[%s = 1] PnP reprojection error.", kVisEstimationType().c_str()));
|
||||||
RTABMAP_PARAM(Vis, PnPFlags, int, 0, uFormat("[%s = 1] PnP flags: 0=Iterative, 1=EPNP, 2=P3P", kVisEstimationType().c_str()));
|
RTABMAP_PARAM(Vis, PnPFlags, int, 0, uFormat("[%s = 1] PnP flags: 0=Iterative, 1=EPNP, 2=P3P", kVisEstimationType().c_str()));
|
||||||
RTABMAP_PARAM(Vis, PnPRefineIterations, int, 1, uFormat("[%s = 1] Refine iterations.", kVisEstimationType().c_str()));
|
#if defined(RTABMAP_G2O) || defined(RTABMAP_ORB_SLAM2)
|
||||||
|
RTABMAP_PARAM(Vis, PnPRefineIterations, int, 0, uFormat("[%s = 1] Refine iterations. Set to 0 if \"%s\" is also used.", kVisEstimationType().c_str(), kVisBundleAdjustment().c_str()));
|
||||||
|
#else
|
||||||
|
RTABMAP_PARAM(Vis, PnPRefineIterations, int, 1, uFormat("[%s = 1] Refine iterations. Set to 0 if \"%s\" is also used.", kVisEstimationType().c_str(), kVisBundleAdjustment().c_str()));
|
||||||
|
#endif
|
||||||
|
|
||||||
RTABMAP_PARAM(Vis, EpipolarGeometryVar, float, 0.02, uFormat("[%s = 2] Epipolar geometry maximum variance to accept the transformation.", kVisEstimationType().c_str()));
|
RTABMAP_PARAM(Vis, EpipolarGeometryVar, float, 0.02, uFormat("[%s = 2] Epipolar geometry maximum variance to accept the transformation.", kVisEstimationType().c_str()));
|
||||||
RTABMAP_PARAM(Vis, MinInliers, int, 20, "Minimum feature correspondences to compute/accept the transformation.");
|
RTABMAP_PARAM(Vis, MinInliers, int, 20, "Minimum feature correspondences to compute/accept the transformation.");
|
||||||
RTABMAP_PARAM(Vis, Iterations, int, 100, "Maximum iterations to compute the transform.");
|
RTABMAP_PARAM(Vis, Iterations, int, 300, "Maximum iterations to compute the transform.");
|
||||||
#ifndef RTABMAP_NONFREE
|
#ifndef RTABMAP_NONFREE
|
||||||
#ifdef RTABMAP_OPENCV3
|
#ifdef RTABMAP_OPENCV3
|
||||||
// OpenCV 3 without xFeatures2D module doesn't have BRIEF
|
// OpenCV 3 without xFeatures2D module doesn't have BRIEF
|
||||||
@@ -486,39 +564,68 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(Vis, MaxFeatures, int, 1000, "0 no limits.");
|
RTABMAP_PARAM(Vis, MaxFeatures, int, 1000, "0 no limits.");
|
||||||
RTABMAP_PARAM(Vis, MaxDepth, float, 0, "Max depth of the features (0 means no limit).");
|
RTABMAP_PARAM(Vis, MaxDepth, float, 0, "Max depth of the features (0 means no limit).");
|
||||||
RTABMAP_PARAM(Vis, MinDepth, float, 0, "Min depth of the features (0 means no limit).");
|
RTABMAP_PARAM(Vis, MinDepth, float, 0, "Min depth of the features (0 means no limit).");
|
||||||
|
RTABMAP_PARAM(Vis, DepthAsMask, bool, true, "Use depth image as mask when extracting features.");
|
||||||
RTABMAP_PARAM_STR(Vis, RoiRatios, "0.0 0.0 0.0 0.0", "Region of interest ratios [left, right, top, bottom].");
|
RTABMAP_PARAM_STR(Vis, RoiRatios, "0.0 0.0 0.0 0.0", "Region of interest ratios [left, right, top, bottom].");
|
||||||
RTABMAP_PARAM(Vis, SubPixWinSize, int, 3, "See cv::cornerSubPix().");
|
RTABMAP_PARAM(Vis, SubPixWinSize, int, 3, "See cv::cornerSubPix().");
|
||||||
RTABMAP_PARAM(Vis, SubPixIterations, int, 0, "See cv::cornerSubPix(). 0 disables sub pixel refining.");
|
RTABMAP_PARAM(Vis, SubPixIterations, int, 0, "See cv::cornerSubPix(). 0 disables sub pixel refining.");
|
||||||
RTABMAP_PARAM(Vis, SubPixEps, float, 0.02, "See cv::cornerSubPix().");
|
RTABMAP_PARAM(Vis, SubPixEps, float, 0.02, "See cv::cornerSubPix().");
|
||||||
|
RTABMAP_PARAM(Vis, GridRows, int, 1, uFormat("Number of rows of the grid used to extract uniformly \"%s / grid cells\" features from each cell.", kVisMaxFeatures().c_str()));
|
||||||
|
RTABMAP_PARAM(Vis, GridCols, int, 1, uFormat("Number of columns of the grid used to extract uniformly \"%s / grid cells\" features from each cell.", kVisMaxFeatures().c_str()));
|
||||||
RTABMAP_PARAM(Vis, CorType, int, 0, "Correspondences computation approach: 0=Features Matching, 1=Optical Flow");
|
RTABMAP_PARAM(Vis, CorType, int, 0, "Correspondences computation approach: 0=Features Matching, 1=Optical Flow");
|
||||||
RTABMAP_PARAM(Vis, CorNNType, int, 1, uFormat("[%s=0] kNNFlannNaive=0, kNNFlannKdTree=1, kNNFlannLSH=2, kNNBruteForce=3, kNNBruteForceGPU=4. Used for features matching approach.", kVisCorType().c_str()));
|
RTABMAP_PARAM(Vis, CorNNType, int, 1, uFormat("[%s=0] kNNFlannNaive=0, kNNFlannKdTree=1, kNNFlannLSH=2, kNNBruteForce=3, kNNBruteForceGPU=4. Used for features matching approach.", kVisCorType().c_str()));
|
||||||
RTABMAP_PARAM(Vis, CorNNDR, float, 0.6, uFormat("[%s=0] NNDR: nearest neighbor distance ratio. Used for features matching approach.", kVisCorType().c_str()));
|
RTABMAP_PARAM(Vis, CorNNDR, float, 0.6, uFormat("[%s=0] NNDR: nearest neighbor distance ratio. Used for features matching approach.", kVisCorType().c_str()));
|
||||||
RTABMAP_PARAM(Vis, CorGuessWinSize, int, 20, uFormat("[%s=0] Matching window size (pixels) around projected points when a guess transform is provided to find correspondences. 0 means disabled.", kVisCorType().c_str()));
|
RTABMAP_PARAM(Vis, CorGuessWinSize, int, 20, uFormat("[%s=0] Matching window size (pixels) around projected points when a guess transform is provided to find correspondences. 0 means disabled.", kVisCorType().c_str()));
|
||||||
|
RTABMAP_PARAM(Vis, CorGuessMatchToProjection, bool, false, uFormat("[%s=0] Match frame's corners to source's projected points (when guess transform is provided) instead of projected points to frame's corners.", kVisCorType().c_str()));
|
||||||
RTABMAP_PARAM(Vis, CorFlowWinSize, int, 16, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
|
RTABMAP_PARAM(Vis, CorFlowWinSize, int, 16, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
|
||||||
RTABMAP_PARAM(Vis, CorFlowIterations, int, 30, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
|
RTABMAP_PARAM(Vis, CorFlowIterations, int, 30, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
|
||||||
RTABMAP_PARAM(Vis, CorFlowEps, float, 0.01, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
|
RTABMAP_PARAM(Vis, CorFlowEps, float, 0.01, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
|
||||||
RTABMAP_PARAM(Vis, CorFlowMaxLevel, int, 3, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
|
RTABMAP_PARAM(Vis, CorFlowMaxLevel, int, 3, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
|
||||||
|
#if defined(RTABMAP_G2O) || defined(RTABMAP_ORB_SLAM2)
|
||||||
|
RTABMAP_PARAM(Vis, BundleAdjustment, int, 1, "Optimization with bundle adjustment: 0=disabled, 1=g2o, 2=cvsba.");
|
||||||
|
#else
|
||||||
RTABMAP_PARAM(Vis, BundleAdjustment, int, 0, "Optimization with bundle adjustment: 0=disabled, 1=g2o, 2=cvsba.");
|
RTABMAP_PARAM(Vis, BundleAdjustment, int, 0, "Optimization with bundle adjustment: 0=disabled, 1=g2o, 2=cvsba.");
|
||||||
|
#endif
|
||||||
|
|
||||||
// ICP registration parameters
|
// ICP registration parameters
|
||||||
RTABMAP_PARAM(Icp, MaxTranslation, float, 0.2, "Maximum ICP translation correction accepted (m).");
|
RTABMAP_PARAM(Icp, MaxTranslation, float, 0.2, "Maximum ICP translation correction accepted (m).");
|
||||||
RTABMAP_PARAM(Icp, MaxRotation, float, 0.78, "Maximum ICP rotation correction accepted (rad).");
|
RTABMAP_PARAM(Icp, MaxRotation, float, 0.78, "Maximum ICP rotation correction accepted (rad).");
|
||||||
RTABMAP_PARAM(Icp, VoxelSize, float, 0.0, "Uniform sampling voxel size (0=disabled).");
|
RTABMAP_PARAM(Icp, VoxelSize, float, 0.0, "Uniform sampling voxel size (0=disabled).");
|
||||||
RTABMAP_PARAM(Icp, DownsamplingStep, int, 1, "Downsampling step size (1=no sampling). This is done before uniform sampling.");
|
RTABMAP_PARAM(Icp, DownsamplingStep, int, 1, "Downsampling step size (1=no sampling). This is done before uniform sampling.");
|
||||||
|
#ifdef RTABMAP_POINTMATCHER
|
||||||
|
RTABMAP_PARAM(Icp, MaxCorrespondenceDistance, float, 0.1, "Max distance for point correspondences.");
|
||||||
|
#else
|
||||||
RTABMAP_PARAM(Icp, MaxCorrespondenceDistance, float, 0.05, "Max distance for point correspondences.");
|
RTABMAP_PARAM(Icp, MaxCorrespondenceDistance, float, 0.05, "Max distance for point correspondences.");
|
||||||
|
#endif
|
||||||
RTABMAP_PARAM(Icp, Iterations, int, 30, "Max iterations.");
|
RTABMAP_PARAM(Icp, Iterations, int, 30, "Max iterations.");
|
||||||
RTABMAP_PARAM(Icp, Epsilon, float, 0, "Set the transformation epsilon (maximum allowable difference between two consecutive transformations) in order for an optimization to be considered as having converged to the final solution.");
|
RTABMAP_PARAM(Icp, Epsilon, float, 0, "Set the transformation epsilon (maximum allowable difference between two consecutive transformations) in order for an optimization to be considered as having converged to the final solution.");
|
||||||
RTABMAP_PARAM(Icp, CorrespondenceRatio, float, 0.2, "Ratio of matching correspondences to accept the transform.");
|
RTABMAP_PARAM(Icp, CorrespondenceRatio, float, 0.1, "Ratio of matching correspondences to accept the transform.");
|
||||||
|
#ifdef RTABMAP_POINTMATCHER
|
||||||
|
RTABMAP_PARAM(Icp, PointToPlane, bool, true, "Use point to plane ICP.");
|
||||||
|
#else
|
||||||
RTABMAP_PARAM(Icp, PointToPlane, bool, false, "Use point to plane ICP.");
|
RTABMAP_PARAM(Icp, PointToPlane, bool, false, "Use point to plane ICP.");
|
||||||
RTABMAP_PARAM(Icp, PointToPlaneNormalNeighbors, int, 20, "Number of neighbors to compute normals for point to plane.");
|
#endif
|
||||||
|
RTABMAP_PARAM(Icp, PointToPlaneK, int, 5, "Number of neighbors to compute normals for point to plane if the cloud doesn't have already normals.");
|
||||||
|
RTABMAP_PARAM(Icp, PointToPlaneRadius, float, 1.0, "Search radius to compute normals for point to plane if the cloud doesn't have already normals.");
|
||||||
|
RTABMAP_PARAM(Icp, PointToPlaneMinComplexity, float, 0.02, "Minimum structural complexity (0.0=low, 1.0=high) of the scan to do point to plane registration, otherwise point to point registration is done instead.");
|
||||||
|
|
||||||
|
// libpointmatcher
|
||||||
|
#ifdef RTABMAP_POINTMATCHER
|
||||||
|
RTABMAP_PARAM(Icp, PM, bool, true, "Use libpointmatcher for ICP registration instead of PCL's implementation.");
|
||||||
|
#else
|
||||||
|
RTABMAP_PARAM(Icp, PM, bool, false, "Use libpointmatcher for ICP registration instead of PCL's implementation.");
|
||||||
|
#endif
|
||||||
|
RTABMAP_PARAM_STR(Icp, PMConfig, "", uFormat("Configuration file (*.yaml) used by libpointmatcher. Note that data filters set for libpointmatcher are done after filtering done by rtabmap (i.e., %s, %s), so make sure to disable those in rtabmap if you want to use only those from libpointmatcher. Parameters %s, %s and %s are also ignored if configuration file is set.", kIcpVoxelSize().c_str(), kIcpDownsamplingStep().c_str(), kIcpIterations().c_str(), kIcpEpsilon().c_str(), kIcpMaxCorrespondenceDistance().c_str()).c_str());
|
||||||
|
RTABMAP_PARAM(Icp, PMMatcherKnn, int, 1, "KDTreeMatcher/knn: number of nearest neighbors to consider it the reference. For convenience when configuration file is not set.");
|
||||||
|
RTABMAP_PARAM(Icp, PMMatcherEpsilon, float, 0.0, "KDTreeMatcher/epsilon: approximation to use for the nearest-neighbor search. For convenience when configuration file is not set.");
|
||||||
|
RTABMAP_PARAM(Icp, PMOutlierRatio, float, 0.95, "TrimmedDistOutlierFilter/ratio: For convenience when configuration file is not set. For kinect-like point cloud, use 0.65.");
|
||||||
|
|
||||||
// Stereo disparity
|
// Stereo disparity
|
||||||
RTABMAP_PARAM(Stereo, WinWidth, int, 15, "Window width.");
|
RTABMAP_PARAM(Stereo, WinWidth, int, 15, "Window width.");
|
||||||
RTABMAP_PARAM(Stereo, WinHeight, int, 3, "Window height.");
|
RTABMAP_PARAM(Stereo, WinHeight, int, 3, "Window height.");
|
||||||
RTABMAP_PARAM(Stereo, Iterations, int, 30, "Maximum iterations.");
|
RTABMAP_PARAM(Stereo, Iterations, int, 30, "Maximum iterations.");
|
||||||
RTABMAP_PARAM(Stereo, MaxLevel, int, 3, "Maximum pyramid level.");
|
RTABMAP_PARAM(Stereo, MaxLevel, int, 5, "Maximum pyramid level.");
|
||||||
RTABMAP_PARAM(Stereo, MinDisparity, int, 1, "Minimum disparity.");
|
RTABMAP_PARAM(Stereo, MinDisparity, float, 0.5, "Minimum disparity.");
|
||||||
RTABMAP_PARAM(Stereo, MaxDisparity, int, 128, "Maximum disparity.");
|
RTABMAP_PARAM(Stereo, MaxDisparity, float, 128.0, "Maximum disparity.");
|
||||||
RTABMAP_PARAM(Stereo, OpticalFlow, bool, true, "Use optical flow to find stereo correspondences, otherwise a simple block matching approach is used.");
|
RTABMAP_PARAM(Stereo, OpticalFlow, bool, true, "Use optical flow to find stereo correspondences, otherwise a simple block matching approach is used.");
|
||||||
RTABMAP_PARAM(Stereo, SSD, bool, true, uFormat("[%s=false] Use Sum of Squared Differences (SSD) window, otherwise Sum of Absolute Differences (SAD) window is used.", kStereoOpticalFlow().c_str()));
|
RTABMAP_PARAM(Stereo, SSD, bool, true, uFormat("[%s=false] Use Sum of Squared Differences (SSD) window, otherwise Sum of Absolute Differences (SAD) window is used.", kStereoOpticalFlow().c_str()));
|
||||||
RTABMAP_PARAM(Stereo, Eps, double, 0.01, uFormat("[%s=true] Epsilon stop criterion.", kStereoOpticalFlow().c_str()));
|
RTABMAP_PARAM(Stereo, Eps, double, 0.01, uFormat("[%s=true] Epsilon stop criterion.", kStereoOpticalFlow().c_str()));
|
||||||
@@ -536,19 +643,20 @@ class RTABMAP_EXP Parameters
|
|||||||
// Occupancy Grid
|
// Occupancy Grid
|
||||||
RTABMAP_PARAM(Grid, FromDepth, bool, true, "Create occupancy grid from depth image(s), otherwise it is created from laser scan.");
|
RTABMAP_PARAM(Grid, FromDepth, bool, true, "Create occupancy grid from depth image(s), otherwise it is created from laser scan.");
|
||||||
RTABMAP_PARAM(Grid, DepthDecimation, int, 4, uFormat("[%s=true] Decimation of the depth image before creating cloud. Negative decimation is done from RGB size instead of depth size (if depth is smaller than RGB, it may be interpolated depending of the decimation value).", kGridDepthDecimation().c_str()));
|
RTABMAP_PARAM(Grid, DepthDecimation, int, 4, uFormat("[%s=true] Decimation of the depth image before creating cloud. Negative decimation is done from RGB size instead of depth size (if depth is smaller than RGB, it may be interpolated depending of the decimation value).", kGridDepthDecimation().c_str()));
|
||||||
RTABMAP_PARAM(Grid, DepthMin, float, 0.0, uFormat("[%s=true] Minimum cloud's depth from sensor.", kGridFromDepth().c_str()));
|
RTABMAP_PARAM(Grid, RangeMin, float, 0.0, "Minimum range from sensor.");
|
||||||
RTABMAP_PARAM(Grid, DepthMax, float, 4.0, uFormat("[%s=true] Maximum cloud's depth from sensor. 0=inf.", kGridFromDepth().c_str()));
|
RTABMAP_PARAM(Grid, RangeMax, float, 5.0, "Maximum range from sensor. 0=inf.");
|
||||||
RTABMAP_PARAM_STR(Grid, DepthRoiRatios, "0.0 0.0 0.0 0.0", uFormat("[%s=true] Region of interest ratios [left, right, top, bottom].", kGridFromDepth().c_str()));
|
RTABMAP_PARAM_STR(Grid, DepthRoiRatios, "0.0 0.0 0.0 0.0", uFormat("[%s=true] Region of interest ratios [left, right, top, bottom].", kGridFromDepth().c_str()));
|
||||||
RTABMAP_PARAM(Grid, FootprintLength, float, 0.0, "Footprint length used to filter points over the footprint of the robot.");
|
RTABMAP_PARAM(Grid, FootprintLength, float, 0.0, "Footprint length used to filter points over the footprint of the robot.");
|
||||||
RTABMAP_PARAM(Grid, FootprintWidth, float, 0.0, "Footprint width used to filter points over the footprint of the robot. Footprint length should be set.");
|
RTABMAP_PARAM(Grid, FootprintWidth, float, 0.0, "Footprint width used to filter points over the footprint of the robot. Footprint length should be set.");
|
||||||
RTABMAP_PARAM(Grid, FootprintHeight, float, 0.0, "Footprint height used to filter points over the footprint of the robot. Footprint length and width should be set.");
|
RTABMAP_PARAM(Grid, FootprintHeight, float, 0.0, "Footprint height used to filter points over the footprint of the robot. Footprint length and width should be set.");
|
||||||
RTABMAP_PARAM(Grid, ScanDecimation, int, 1, uFormat("[%s=false] Decimation of the laser scan before creating cloud.", kGridFromDepth().c_str()));
|
RTABMAP_PARAM(Grid, ScanDecimation, int, 1, uFormat("[%s=false] Decimation of the laser scan before creating cloud.", kGridFromDepth().c_str()));
|
||||||
RTABMAP_PARAM(Grid, CellSize, float, 0.05, "Resolution of the occupancy grid.");
|
RTABMAP_PARAM(Grid, CellSize, float, 0.05, "Resolution of the occupancy grid.");
|
||||||
|
RTABMAP_PARAM(Grid, PreVoxelFiltering, bool, true, uFormat("Input cloud is downsampled by voxel filter (voxel size is \"%s\") before doing segmentation of obstacles and ground.", kGridCellSize().c_str()));
|
||||||
RTABMAP_PARAM(Grid, MapFrameProjection, bool, false, "Projection in map frame. On a 3D terrain and a fixed local camera transform (the cloud is created relative to ground), you may want to disable this to do the projection in robot frame instead.");
|
RTABMAP_PARAM(Grid, MapFrameProjection, bool, false, "Projection in map frame. On a 3D terrain and a fixed local camera transform (the cloud is created relative to ground), you may want to disable this to do the projection in robot frame instead.");
|
||||||
RTABMAP_PARAM(Grid, NormalsSegmentation, bool, true, "Segment ground from obstacles using point normals, otherwise a fast passthrough is used.");
|
RTABMAP_PARAM(Grid, NormalsSegmentation, bool, true, "Segment ground from obstacles using point normals, otherwise a fast passthrough is used.");
|
||||||
RTABMAP_PARAM(Grid, MaxObstacleHeight, float, 0.0, "Maximum obstacles height (0=disabled).");
|
RTABMAP_PARAM(Grid, MaxObstacleHeight, float, 0.0, "Maximum obstacles height (0=disabled).");
|
||||||
RTABMAP_PARAM(Grid, MinGroundHeight, float, 0.0, "Minimum ground height (0=disabled).");
|
RTABMAP_PARAM(Grid, MinGroundHeight, float, 0.0, "Minimum ground height (0=disabled).");
|
||||||
RTABMAP_PARAM(Grid, MaxGroundHeight, float, 0.0, uFormat("Maximum ground height (0=disabled). Should be set if \"%s\" is true.", kGridNormalsSegmentation().c_str()));
|
RTABMAP_PARAM(Grid, MaxGroundHeight, float, 0.0, uFormat("Maximum ground height (0=disabled). Should be set if \"%s\" is false.", kGridNormalsSegmentation().c_str()));
|
||||||
RTABMAP_PARAM(Grid, MaxGroundAngle, float, 45, uFormat("[%s=true] Maximum angle (degrees) between point's normal to ground's normal to label it as ground. Points with higher angle difference are considered as obstacles.", kGridNormalsSegmentation().c_str()));
|
RTABMAP_PARAM(Grid, MaxGroundAngle, float, 45, uFormat("[%s=true] Maximum angle (degrees) between point's normal to ground's normal to label it as ground. Points with higher angle difference are considered as obstacles.", kGridNormalsSegmentation().c_str()));
|
||||||
RTABMAP_PARAM(Grid, NormalK, int, 20, uFormat("[%s=true] K neighbors to compute normals.", kGridNormalsSegmentation().c_str()));
|
RTABMAP_PARAM(Grid, NormalK, int, 20, uFormat("[%s=true] K neighbors to compute normals.", kGridNormalsSegmentation().c_str()));
|
||||||
RTABMAP_PARAM(Grid, ClusterRadius, float, 0.1, uFormat("[%s=true] Cluster maximum radius.", kGridNormalsSegmentation().c_str()));
|
RTABMAP_PARAM(Grid, ClusterRadius, float, 0.1, uFormat("[%s=true] Cluster maximum radius.", kGridNormalsSegmentation().c_str()));
|
||||||
@@ -562,14 +670,20 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(Grid, GroundIsObstacle, bool, false, uFormat("[%s=true] Ground segmentation (%s) is ignored, all points are obstacles. Use this only if you want an OctoMap with ground identified as an obstacle (e.g., with an UAV).", kGrid3D().c_str(), kGridNormalsSegmentation().c_str()));
|
RTABMAP_PARAM(Grid, GroundIsObstacle, bool, false, uFormat("[%s=true] Ground segmentation (%s) is ignored, all points are obstacles. Use this only if you want an OctoMap with ground identified as an obstacle (e.g., with an UAV).", kGrid3D().c_str(), kGridNormalsSegmentation().c_str()));
|
||||||
RTABMAP_PARAM(Grid, NoiseFilteringRadius, float, 0.0, "Noise filtering radius (0=disabled). Done after segmentation.");
|
RTABMAP_PARAM(Grid, NoiseFilteringRadius, float, 0.0, "Noise filtering radius (0=disabled). Done after segmentation.");
|
||||||
RTABMAP_PARAM(Grid, NoiseFilteringMinNeighbors, int, 5, "Noise filtering minimum neighbors.");
|
RTABMAP_PARAM(Grid, NoiseFilteringMinNeighbors, int, 5, "Noise filtering minimum neighbors.");
|
||||||
RTABMAP_PARAM(Grid, Scan2dUnknownSpaceFilled, bool, false, "Unknown space filled. Only used with 2D laser scans.");
|
RTABMAP_PARAM(Grid, Scan2dUnknownSpaceFilled, bool, false, uFormat("Unknown space filled. Only used with 2D laser scans. Use %s to set maximum range if laser scan max range is to set.", kGridRangeMax().c_str()));
|
||||||
RTABMAP_PARAM(Grid, Scan2dMaxFilledRange, float, 4.0, "Unknown space filled maximum range. If 0, the laser scan maximum range is used.");
|
RTABMAP_PARAM(Grid, RayTracing, bool, false, uFormat("Ray tracing is done for each occupied cell, filling unknown space between the sensor and occupied cells. If %s=true, RTAB-Map should be built with OctoMap support, otherwise 3D ray tracing is ignored.", kGrid3D().c_str()));
|
||||||
RTABMAP_PARAM(Grid, ProjRayTracing, bool, true, uFormat("[%s=false] 2D ray tracing is done for each projected obstacle, filling unknown space between the sensor and obstacles.", kGrid3D().c_str()));
|
|
||||||
|
|
||||||
RTABMAP_PARAM(GridGlobal, FullUpdate, bool, true, "When the graph is changed, the whole map will be reconstructed instead of moving individually each cells of the map. Also, data added to cache won't be released after updating the map. This process is longer but more robust to drift that would erase some parts of the map when it should not.");
|
RTABMAP_PARAM(GridGlobal, FullUpdate, bool, true, "When the graph is changed, the whole map will be reconstructed instead of moving individually each cells of the map. Also, data added to cache won't be released after updating the map. This process is longer but more robust to drift that would erase some parts of the map when it should not.");
|
||||||
|
RTABMAP_PARAM(GridGlobal, UpdateError, float, 0.01, "Graph changed detection error (m). Update map only if poses in new optimized graph have moved more than this value.");
|
||||||
RTABMAP_PARAM(GridGlobal, FootprintRadius, float, 0.0, "Footprint radius (m) used to clear all obstacles under the graph.");
|
RTABMAP_PARAM(GridGlobal, FootprintRadius, float, 0.0, "Footprint radius (m) used to clear all obstacles under the graph.");
|
||||||
RTABMAP_PARAM(GridGlobal, MinSize, float, 0.0, "Minimum map size (m).");
|
RTABMAP_PARAM(GridGlobal, MinSize, float, 0.0, "Minimum map size (m).");
|
||||||
RTABMAP_PARAM(GridGlobal, Eroded, bool, false, "Erode obstacle cells.");
|
RTABMAP_PARAM(GridGlobal, Eroded, bool, false, "Erode obstacle cells.");
|
||||||
|
RTABMAP_PARAM(GridGlobal, MaxNodes, int, 0, "Maximum nodes assembled in the map starting from the last node (0=unlimited).");
|
||||||
|
RTABMAP_PARAM(GridGlobal, OccupancyThr, float, 0.5, "Occupancy threshold (value between 0 and 1).");
|
||||||
|
RTABMAP_PARAM(GridGlobal, ProbHit, float, 0.7, "Probability of a hit (value between 0.5 and 1).");
|
||||||
|
RTABMAP_PARAM(GridGlobal, ProbMiss, float, 0.4, "Probability of a miss (value between 0 and 0.5).");
|
||||||
|
RTABMAP_PARAM(GridGlobal, ProbClampingMin, float, 0.1192, "Probability clamping minimum (value between 0 and 1).");
|
||||||
|
RTABMAP_PARAM(GridGlobal, ProbClampingMax, float, 0.971, "Probability clamping maximum (value between 0 and 1).");
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~Parameters();
|
virtual ~Parameters();
|
||||||
@@ -617,7 +731,7 @@ public:
|
|||||||
static ParametersMap getDefaultParameters(const std::string & group);
|
static ParametersMap getDefaultParameters(const std::string & group);
|
||||||
static ParametersMap filterParameters(const ParametersMap & parameters, const std::string & group);
|
static ParametersMap filterParameters(const ParametersMap & parameters, const std::string & group);
|
||||||
|
|
||||||
static void readINI(const std::string & configFile, ParametersMap & parameters);
|
static void readINI(const std::string & configFile, ParametersMap & parameters, bool modifiedOnly = false);
|
||||||
static void writeINI(const std::string & configFile, const ParametersMap & parameters);
|
static void writeINI(const std::string & configFile, const ParametersMap & parameters);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#include <rtabmap/utilite/ULogger.h>
|
#include <rtabmap/utilite/ULogger.h>
|
||||||
|
|
||||||
|
namespace rtabmap {
|
||||||
|
|
||||||
class ProgressState
|
class ProgressState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -55,5 +57,6 @@ private:
|
|||||||
bool canceled_;
|
bool canceled_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* CORELIB_INCLUDE_RTABMAP_CORE_PROGRESSSTATE_H_ */
|
#endif /* CORELIB_INCLUDE_RTABMAP_CORE_PROGRESSSTATE_H_ */
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2010-2017, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of the Universite de Sherbrooke nor the
|
||||||
|
names of its contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef RECOVERY_H_
|
||||||
|
#define RECOVERY_H_
|
||||||
|
|
||||||
|
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace rtabmap {
|
||||||
|
|
||||||
|
class ProgressState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true on success. The database is
|
||||||
|
* renamed to "*.backup.db" before recovering.
|
||||||
|
* @param corruptedDatabase database to recover
|
||||||
|
* @param keepCorruptedDatabase if false and on recovery success, the backup database is removed
|
||||||
|
* @param errorMsg error message if the function returns false
|
||||||
|
* @param progressState A ProgressState object used to get status of the recovery process
|
||||||
|
*/
|
||||||
|
bool RTABMAP_EXP databaseRecovery(
|
||||||
|
const std::string & corruptedDatabase,
|
||||||
|
bool keepCorruptedDatabase = true,
|
||||||
|
std::string * errorMsg = 0,
|
||||||
|
ProgressState * progressState = 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* RECOVERY_H_ */
|
||||||
@@ -45,6 +45,7 @@ public:
|
|||||||
kTypeIcp = 1,
|
kTypeIcp = 1,
|
||||||
kTypeVisIcp = 2
|
kTypeVisIcp = 2
|
||||||
};
|
};
|
||||||
|
static double COVARIANCE_EPSILON;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Registration * create(const ParametersMap & parameters);
|
static Registration * create(const ParametersMap & parameters);
|
||||||
@@ -58,12 +59,13 @@ public:
|
|||||||
bool isScanRequired() const;
|
bool isScanRequired() const;
|
||||||
bool isUserDataRequired() const;
|
bool isUserDataRequired() const;
|
||||||
|
|
||||||
|
bool canUseGuess() const;
|
||||||
|
|
||||||
int getMinVisualCorrespondences() const;
|
int getMinVisualCorrespondences() const;
|
||||||
float getMinGeometryCorrespondencesRatio() const;
|
float getMinGeometryCorrespondencesRatio() const;
|
||||||
|
|
||||||
bool varianceFromInliersCount() const {return varianceFromInliersCount_;}
|
bool repeatOnce() const {return repeatOnce_;}
|
||||||
bool force3DoF() const {return force3DoF_;}
|
bool force3DoF() const {return force3DoF_;}
|
||||||
bool covarianceNormalized() const {return covarianceNormalized_;}
|
|
||||||
|
|
||||||
// take ownership!
|
// take ownership!
|
||||||
void setChildRegistration(Registration * child);
|
void setChildRegistration(Registration * child);
|
||||||
@@ -85,8 +87,6 @@ public:
|
|||||||
Transform guess = Transform::getIdentity(),
|
Transform guess = Transform::getIdentity(),
|
||||||
RegistrationInfo * info = 0) const;
|
RegistrationInfo * info = 0) const;
|
||||||
|
|
||||||
void normalizeCovariance(cv::Mat & covariance, const Transform & transform) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// take ownership of child
|
// take ownership of child
|
||||||
Registration(const ParametersMap & parameters = ParametersMap(), Registration * child = 0);
|
Registration(const ParametersMap & parameters = ParametersMap(), Registration * child = 0);
|
||||||
@@ -102,12 +102,12 @@ protected:
|
|||||||
virtual bool isImageRequiredImpl() const {return false;}
|
virtual bool isImageRequiredImpl() const {return false;}
|
||||||
virtual bool isScanRequiredImpl() const {return false;}
|
virtual bool isScanRequiredImpl() const {return false;}
|
||||||
virtual bool isUserDataRequiredImpl() const {return false;}
|
virtual bool isUserDataRequiredImpl() const {return false;}
|
||||||
|
virtual bool canUseGuessImpl() const {return false;}
|
||||||
virtual int getMinVisualCorrespondencesImpl() const {return 0;}
|
virtual int getMinVisualCorrespondencesImpl() const {return 0;}
|
||||||
virtual float getMinGeometryCorrespondencesRatioImpl() const {return 0.0f;}
|
virtual float getMinGeometryCorrespondencesRatioImpl() const {return 0.0f;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool varianceFromInliersCount_;
|
bool repeatOnce_;
|
||||||
bool covarianceNormalized_;
|
|
||||||
bool force3DoF_;
|
bool force3DoF_;
|
||||||
Registration * child_;
|
Registration * child_;
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class RTABMAP_EXP RegistrationIcp : public Registration
|
|||||||
public:
|
public:
|
||||||
// take ownership of child
|
// take ownership of child
|
||||||
RegistrationIcp(const ParametersMap & parameters = ParametersMap(), Registration * child = 0);
|
RegistrationIcp(const ParametersMap & parameters = ParametersMap(), Registration * child = 0);
|
||||||
virtual ~RegistrationIcp() {}
|
virtual ~RegistrationIcp();
|
||||||
|
|
||||||
virtual void parseParameters(const ParametersMap & parameters);
|
virtual void parseParameters(const ParametersMap & parameters);
|
||||||
|
|
||||||
@@ -52,6 +52,7 @@ protected:
|
|||||||
Transform guess,
|
Transform guess,
|
||||||
RegistrationInfo & info) const;
|
RegistrationInfo & info) const;
|
||||||
virtual bool isScanRequiredImpl() const {return true;}
|
virtual bool isScanRequiredImpl() const {return true;}
|
||||||
|
virtual bool canUseGuessImpl() const {return true;}
|
||||||
virtual float getMinGeometryCorrespondencesRatioImpl() const {return _correspondenceRatio;}
|
virtual float getMinGeometryCorrespondencesRatioImpl() const {return _correspondenceRatio;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -64,7 +65,15 @@ private:
|
|||||||
float _epsilon;
|
float _epsilon;
|
||||||
float _correspondenceRatio;
|
float _correspondenceRatio;
|
||||||
bool _pointToPlane;
|
bool _pointToPlane;
|
||||||
int _pointToPlaneNormalNeighbors;
|
int _pointToPlaneK;
|
||||||
|
float _pointToPlaneRadius;
|
||||||
|
float _pointToPlaneMinComplexity;
|
||||||
|
bool _libpointmatcher;
|
||||||
|
std::string _libpointmatcherConfig;
|
||||||
|
int _libpointmatcherKnn;
|
||||||
|
float _libpointmatcherEpsilon;
|
||||||
|
float _libpointmatcherOutlierRatio;
|
||||||
|
void * _libpointmatcherICP;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,27 +35,48 @@ class RegistrationInfo
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RegistrationInfo() :
|
RegistrationInfo() :
|
||||||
|
totalTime(0.0),
|
||||||
inliers(0),
|
inliers(0),
|
||||||
matches(0),
|
matches(0),
|
||||||
icpInliersRatio(0),
|
icpInliersRatio(0),
|
||||||
icpTranslation(0.0f),
|
icpTranslation(0.0f),
|
||||||
icpRotation(0.0f)
|
icpRotation(0.0f),
|
||||||
|
icpStructuralComplexity(0.0f)
|
||||||
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RegistrationInfo copyWithoutData() const
|
||||||
|
{
|
||||||
|
RegistrationInfo output;
|
||||||
|
output.totalTime = totalTime;
|
||||||
|
output.covariance = covariance.clone();
|
||||||
|
output.rejectedMsg = rejectedMsg;
|
||||||
|
output.inliers = inliers;
|
||||||
|
output.matches = matches;
|
||||||
|
output.icpInliersRatio = icpInliersRatio;
|
||||||
|
output.icpTranslation = icpTranslation;
|
||||||
|
output.icpRotation = icpRotation;
|
||||||
|
output.icpStructuralComplexity = icpStructuralComplexity;
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
cv::Mat covariance;
|
cv::Mat covariance;
|
||||||
std::string rejectedMsg;
|
std::string rejectedMsg;
|
||||||
|
double totalTime;
|
||||||
|
|
||||||
// RegistrationVis
|
// RegistrationVis
|
||||||
int inliers;
|
int inliers;
|
||||||
std::vector<int> inliersIDs;
|
std::vector<int> inliersIDs;
|
||||||
int matches;
|
int matches;
|
||||||
std::vector<int> matchesIDs;
|
std::vector<int> matchesIDs;
|
||||||
|
std::vector<int> projectedIDs; // "From" IDs
|
||||||
|
|
||||||
// RegistrationIcp
|
// RegistrationIcp
|
||||||
float icpInliersRatio;
|
float icpInliersRatio;
|
||||||
float icpTranslation;
|
float icpTranslation;
|
||||||
float icpRotation;
|
float icpRotation;
|
||||||
|
float icpStructuralComplexity;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ protected:
|
|||||||
RegistrationInfo & info) const;
|
RegistrationInfo & info) const;
|
||||||
|
|
||||||
virtual bool isImageRequiredImpl() const {return true;}
|
virtual bool isImageRequiredImpl() const {return true;}
|
||||||
|
virtual bool canUseGuessImpl() const {return _correspondencesApproach != 0 || _guessWinSize>0;}
|
||||||
virtual int getMinVisualCorrespondencesImpl() const {return _minInliers;}
|
virtual int getMinVisualCorrespondencesImpl() const {return _minInliers;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -81,7 +82,9 @@ private:
|
|||||||
int _flowMaxLevel;
|
int _flowMaxLevel;
|
||||||
float _nndr;
|
float _nndr;
|
||||||
int _guessWinSize;
|
int _guessWinSize;
|
||||||
|
bool _guessMatchToProjection;
|
||||||
int _bundleAdjustment;
|
int _bundleAdjustment;
|
||||||
|
bool _depthAsMask;
|
||||||
|
|
||||||
ParametersMap _featureParameters;
|
ParametersMap _featureParameters;
|
||||||
ParametersMap _bundleParameters;
|
ParametersMap _bundleParameters;
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ public:
|
|||||||
const Statistics & getStatistics() const;
|
const Statistics & getStatistics() const;
|
||||||
//bool getMetricData(int locationId, cv::Mat & rgb, cv::Mat & depth, float & depthConstant, Transform & pose, Transform & localTransform) const;
|
//bool getMetricData(int locationId, cv::Mat & rgb, cv::Mat & depth, float & depthConstant, Transform & pose, Transform & localTransform) const;
|
||||||
const std::map<int, Transform> & getLocalOptimizedPoses() const {return _optimizedPoses;}
|
const std::map<int, Transform> & getLocalOptimizedPoses() const {return _optimizedPoses;}
|
||||||
|
const std::multimap<int, Link> & getLocalConstraints() const {return _constraints;}
|
||||||
Transform getPose(int locationId) const;
|
Transform getPose(int locationId) const;
|
||||||
Transform getMapCorrection() const {return _mapCorrection;}
|
Transform getMapCorrection() const {return _mapCorrection;}
|
||||||
const Memory * getMemory() const {return _memory;}
|
const Memory * getMemory() const {return _memory;}
|
||||||
@@ -128,6 +129,7 @@ public:
|
|||||||
float getTimeThreshold() const {return _maxTimeAllowed;} // in ms
|
float getTimeThreshold() const {return _maxTimeAllowed;} // in ms
|
||||||
void setTimeThreshold(float maxTimeAllowed); // in ms
|
void setTimeThreshold(float maxTimeAllowed); // in ms
|
||||||
|
|
||||||
|
void setInitialPose(const Transform & initialPose);
|
||||||
int triggerNewMap();
|
int triggerNewMap();
|
||||||
bool labelLocation(int id, const std::string & label);
|
bool labelLocation(int id, const std::string & label);
|
||||||
/**
|
/**
|
||||||
@@ -151,7 +153,8 @@ public:
|
|||||||
void parseParameters(const ParametersMap & parameters);
|
void parseParameters(const ParametersMap & parameters);
|
||||||
const ParametersMap & getParameters() const {return _parameters;}
|
const ParametersMap & getParameters() const {return _parameters;}
|
||||||
void setWorkingDirectory(std::string path);
|
void setWorkingDirectory(std::string path);
|
||||||
void rejectLoopClosure(int oldId, int newId);
|
void rejectLastLoopClosure();
|
||||||
|
void deleteLastLocation();
|
||||||
void setOptimizedPoses(const std::map<int, Transform> & poses);
|
void setOptimizedPoses(const std::map<int, Transform> & poses);
|
||||||
void get3DMap(std::map<int, Signature> & signatures,
|
void get3DMap(std::map<int, Signature> & signatures,
|
||||||
std::map<int, Transform> & poses,
|
std::map<int, Transform> & poses,
|
||||||
@@ -161,15 +164,15 @@ public:
|
|||||||
void getGraph(std::map<int, Transform> & poses,
|
void getGraph(std::map<int, Transform> & poses,
|
||||||
std::multimap<int, Link> & constraints,
|
std::multimap<int, Link> & constraints,
|
||||||
bool optimized,
|
bool optimized,
|
||||||
bool global,
|
bool global,
|
||||||
std::map<int, Signature> * signatures = 0);
|
std::map<int, Signature> * signatures = 0);
|
||||||
int detectMoreLoopClosures(float clusterRadius = 0.5f, float clusterAngle = M_PI/6.0f, int iterations = 1, const ProgressState * state = 0);
|
int detectMoreLoopClosures(float clusterRadius = 0.5f, float clusterAngle = M_PI/6.0f, int iterations = 1, const ProgressState * state = 0);
|
||||||
int refineLinks();
|
int refineLinks();
|
||||||
|
|
||||||
int getPathStatus() const {return _pathStatus;} // -1=failed 0=idle/executing 1=success
|
int getPathStatus() const {return _pathStatus;} // -1=failed 0=idle/executing 1=success
|
||||||
void clearPath(int status); // -1=failed 0=idle/executing 1=success
|
void clearPath(int status); // -1=failed 0=idle/executing 1=success
|
||||||
bool computePath(int targetNode, bool global);
|
bool computePath(int targetNode, bool global);
|
||||||
bool computePath(const Transform & targetPose); // only in current optimized map
|
bool computePath(const Transform & targetPose, float tolerance = -1.0f); // only in current optimized map, tolerance (m) < 0 means RGBD/LocalRadius, 0 means infinite
|
||||||
const std::vector<std::pair<int, Transform> > & getPath() const {return _path;}
|
const std::vector<std::pair<int, Transform> > & getPath() const {return _path;}
|
||||||
std::vector<std::pair<int, Transform> > getPathNextPoses() const;
|
std::vector<std::pair<int, Transform> > getPathNextPoses() const;
|
||||||
std::vector<int> getPathNextNodes() const;
|
std::vector<int> getPathNextNodes() const;
|
||||||
@@ -188,6 +191,7 @@ private:
|
|||||||
void optimizeCurrentMap(int id,
|
void optimizeCurrentMap(int id,
|
||||||
bool lookInDatabase,
|
bool lookInDatabase,
|
||||||
std::map<int, Transform> & optimizedPoses,
|
std::map<int, Transform> & optimizedPoses,
|
||||||
|
cv::Mat & covariance,
|
||||||
std::multimap<int, Link> * constraints = 0,
|
std::multimap<int, Link> * constraints = 0,
|
||||||
double * error = 0,
|
double * error = 0,
|
||||||
int * iterationsDone = 0) const;
|
int * iterationsDone = 0) const;
|
||||||
@@ -196,6 +200,7 @@ private:
|
|||||||
const std::set<int> & ids,
|
const std::set<int> & ids,
|
||||||
const std::map<int, Transform> & guessPoses,
|
const std::map<int, Transform> & guessPoses,
|
||||||
bool lookInDatabase,
|
bool lookInDatabase,
|
||||||
|
cv::Mat & covariance,
|
||||||
std::multimap<int, Link> * constraints = 0,
|
std::multimap<int, Link> * constraints = 0,
|
||||||
double * error = 0,
|
double * error = 0,
|
||||||
int * iterationsDone = 0) const;
|
int * iterationsDone = 0) const;
|
||||||
@@ -211,6 +216,9 @@ private:
|
|||||||
bool _publishLastSignatureData;
|
bool _publishLastSignatureData;
|
||||||
bool _publishPdf;
|
bool _publishPdf;
|
||||||
bool _publishLikelihood;
|
bool _publishLikelihood;
|
||||||
|
bool _publishRAMUsage;
|
||||||
|
bool _computeRMSE;
|
||||||
|
bool _saveWMState;
|
||||||
float _maxTimeAllowed; // in ms
|
float _maxTimeAllowed; // in ms
|
||||||
unsigned int _maxMemoryAllowed; // signatures count in WM
|
unsigned int _maxMemoryAllowed; // signatures count in WM
|
||||||
float _loopThr;
|
float _loopThr;
|
||||||
@@ -225,6 +233,8 @@ private:
|
|||||||
bool _rgbdSlamMode;
|
bool _rgbdSlamMode;
|
||||||
float _rgbdLinearUpdate;
|
float _rgbdLinearUpdate;
|
||||||
float _rgbdAngularUpdate;
|
float _rgbdAngularUpdate;
|
||||||
|
float _rgbdLinearSpeedUpdate;
|
||||||
|
float _rgbdAngularSpeedUpdate;
|
||||||
float _newMapOdomChangeDistance;
|
float _newMapOdomChangeDistance;
|
||||||
bool _neighborLinkRefining;
|
bool _neighborLinkRefining;
|
||||||
bool _proximityByTime;
|
bool _proximityByTime;
|
||||||
@@ -240,13 +250,15 @@ private:
|
|||||||
float _proximityAngle;
|
float _proximityAngle;
|
||||||
std::string _databasePath;
|
std::string _databasePath;
|
||||||
bool _optimizeFromGraphEnd;
|
bool _optimizeFromGraphEnd;
|
||||||
float _optimizationMaxLinearError;
|
float _optimizationMaxError;
|
||||||
bool _startNewMapOnLoopClosure;
|
bool _startNewMapOnLoopClosure;
|
||||||
|
bool _startNewMapOnGoodSignature;
|
||||||
float _goalReachedRadius; // meters
|
float _goalReachedRadius; // meters
|
||||||
bool _goalsSavedInUserData;
|
bool _goalsSavedInUserData;
|
||||||
int _pathStuckIterations;
|
int _pathStuckIterations;
|
||||||
float _pathLinearVelocity;
|
float _pathLinearVelocity;
|
||||||
float _pathAngularVelocity;
|
float _pathAngularVelocity;
|
||||||
|
bool _savedLocalizationIgnored;
|
||||||
|
|
||||||
std::pair<int, float> _loopClosureHypothesis;
|
std::pair<int, float> _loopClosureHypothesis;
|
||||||
std::pair<int, float> _highestHypothesis;
|
std::pair<int, float> _highestHypothesis;
|
||||||
@@ -291,6 +303,5 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* RTABMAP_H_ */
|
|
||||||
|
|
||||||
} // namespace rtabmap
|
} // namespace rtabmap
|
||||||
|
#endif /* RTABMAP_H_ */
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ public:
|
|||||||
kStateCleanDataBuffer,
|
kStateCleanDataBuffer,
|
||||||
kStatePublishingMap,
|
kStatePublishingMap,
|
||||||
kStateTriggeringMap,
|
kStateTriggeringMap,
|
||||||
kStateAddingUserData,
|
|
||||||
kStateSettingGoal,
|
kStateSettingGoal,
|
||||||
kStateCancellingGoal,
|
kStateCancellingGoal,
|
||||||
kStateLabelling
|
kStateLabelling
|
||||||
@@ -114,6 +113,7 @@ private:
|
|||||||
std::queue<ParametersMap> _stateParam;
|
std::queue<ParametersMap> _stateParam;
|
||||||
|
|
||||||
std::list<OdometryEvent> _dataBuffer;
|
std::list<OdometryEvent> _dataBuffer;
|
||||||
|
std::list<double> _newMapEvents;
|
||||||
UMutex _dataMutex;
|
UMutex _dataMutex;
|
||||||
USemaphore _dataAdded;
|
USemaphore _dataAdded;
|
||||||
unsigned int _dataBufferMaxSize;
|
unsigned int _dataBufferMaxSize;
|
||||||
|
|||||||
@@ -33,9 +33,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <rtabmap/core/CameraModel.h>
|
#include <rtabmap/core/CameraModel.h>
|
||||||
#include <rtabmap/core/StereoCameraModel.h>
|
#include <rtabmap/core/StereoCameraModel.h>
|
||||||
#include <rtabmap/core/Transform.h>
|
#include <rtabmap/core/Transform.h>
|
||||||
#include <rtabmap/core/LaserScanInfo.h>
|
#include <rtabmap/core/GeodeticCoords.h>
|
||||||
#include <opencv2/core/core.hpp>
|
#include <opencv2/core/core.hpp>
|
||||||
#include <opencv2/features2d/features2d.hpp>
|
#include <opencv2/features2d/features2d.hpp>
|
||||||
|
#include <rtabmap/core/LaserScan.h>
|
||||||
|
#include <rtabmap/core/IMU.h>
|
||||||
|
|
||||||
namespace rtabmap
|
namespace rtabmap
|
||||||
{
|
{
|
||||||
@@ -75,8 +77,7 @@ public:
|
|||||||
|
|
||||||
// RGB-D constructor + laser scan
|
// RGB-D constructor + laser scan
|
||||||
SensorData(
|
SensorData(
|
||||||
const cv::Mat & laserScan,
|
const LaserScan & laserScan,
|
||||||
const LaserScanInfo & laserScanInfo,
|
|
||||||
const cv::Mat & rgb,
|
const cv::Mat & rgb,
|
||||||
const cv::Mat & depth,
|
const cv::Mat & depth,
|
||||||
const CameraModel & cameraModel,
|
const CameraModel & cameraModel,
|
||||||
@@ -95,8 +96,7 @@ public:
|
|||||||
|
|
||||||
// Multi-cameras RGB-D constructor + laser scan
|
// Multi-cameras RGB-D constructor + laser scan
|
||||||
SensorData(
|
SensorData(
|
||||||
const cv::Mat & laserScan,
|
const LaserScan & laserScan,
|
||||||
const LaserScanInfo & laserScanInfo,
|
|
||||||
const cv::Mat & rgb,
|
const cv::Mat & rgb,
|
||||||
const cv::Mat & depth,
|
const cv::Mat & depth,
|
||||||
const std::vector<CameraModel> & cameraModels,
|
const std::vector<CameraModel> & cameraModels,
|
||||||
@@ -115,8 +115,7 @@ public:
|
|||||||
|
|
||||||
// Stereo constructor + laser scan
|
// Stereo constructor + laser scan
|
||||||
SensorData(
|
SensorData(
|
||||||
const cv::Mat & laserScan,
|
const LaserScan & laserScan,
|
||||||
const LaserScanInfo & laserScanInfo,
|
|
||||||
const cv::Mat & left,
|
const cv::Mat & left,
|
||||||
const cv::Mat & right,
|
const cv::Mat & right,
|
||||||
const StereoCameraModel & cameraModel,
|
const StereoCameraModel & cameraModel,
|
||||||
@@ -124,7 +123,13 @@ public:
|
|||||||
double stamp = 0.0,
|
double stamp = 0.0,
|
||||||
const cv::Mat & userData = cv::Mat());
|
const cv::Mat & userData = cv::Mat());
|
||||||
|
|
||||||
virtual ~SensorData() {}
|
// IMU constructor
|
||||||
|
SensorData(
|
||||||
|
const IMU & imu,
|
||||||
|
int id = 0,
|
||||||
|
double stamp = 0.0);
|
||||||
|
|
||||||
|
virtual ~SensorData();
|
||||||
|
|
||||||
bool isValid() const {
|
bool isValid() const {
|
||||||
return !(_id == 0 &&
|
return !(_id == 0 &&
|
||||||
@@ -133,32 +138,32 @@ public:
|
|||||||
_imageCompressed.empty() &&
|
_imageCompressed.empty() &&
|
||||||
_depthOrRightRaw.empty() &&
|
_depthOrRightRaw.empty() &&
|
||||||
_depthOrRightCompressed.empty() &&
|
_depthOrRightCompressed.empty() &&
|
||||||
_laserScanRaw.empty() &&
|
_laserScanRaw.isEmpty() &&
|
||||||
_laserScanCompressed.empty() &&
|
_laserScanCompressed.isEmpty() &&
|
||||||
_cameraModels.size() == 0 &&
|
_cameraModels.size() == 0 &&
|
||||||
!_stereoCameraModel.isValidForProjection() &&
|
!_stereoCameraModel.isValidForProjection() &&
|
||||||
_userDataRaw.empty() &&
|
_userDataRaw.empty() &&
|
||||||
_userDataCompressed.empty() &&
|
_userDataCompressed.empty() &&
|
||||||
_keypoints.size() == 0 &&
|
_keypoints.size() == 0 &&
|
||||||
_descriptors.empty());
|
_descriptors.empty() &&
|
||||||
|
imu_.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
int id() const {return _id;}
|
int id() const {return _id;}
|
||||||
void setId(int id) {_id = id;}
|
void setId(int id) {_id = id;}
|
||||||
double stamp() const {return _stamp;}
|
double stamp() const {return _stamp;}
|
||||||
void setStamp(double stamp) {_stamp = stamp;}
|
void setStamp(double stamp) {_stamp = stamp;}
|
||||||
const LaserScanInfo & laserScanInfo() const {return _laserScanInfo;}
|
|
||||||
|
|
||||||
const cv::Mat & imageCompressed() const {return _imageCompressed;}
|
const cv::Mat & imageCompressed() const {return _imageCompressed;}
|
||||||
const cv::Mat & depthOrRightCompressed() const {return _depthOrRightCompressed;}
|
const cv::Mat & depthOrRightCompressed() const {return _depthOrRightCompressed;}
|
||||||
const cv::Mat & laserScanCompressed() const {return _laserScanCompressed;}
|
const LaserScan & laserScanCompressed() const {return _laserScanCompressed;}
|
||||||
|
|
||||||
const cv::Mat & imageRaw() const {return _imageRaw;}
|
const cv::Mat & imageRaw() const {return _imageRaw;}
|
||||||
const cv::Mat & depthOrRightRaw() const {return _depthOrRightRaw;}
|
const cv::Mat & depthOrRightRaw() const {return _depthOrRightRaw;}
|
||||||
const cv::Mat & laserScanRaw() const {return _laserScanRaw;}
|
const LaserScan & laserScanRaw() const {return _laserScanRaw;}
|
||||||
void setImageRaw(const cv::Mat & imageRaw) {_imageRaw = imageRaw;}
|
void setImageRaw(const cv::Mat & imageRaw) {_imageRaw = imageRaw;}
|
||||||
void setDepthOrRightRaw(const cv::Mat & depthOrImageRaw) {_depthOrRightRaw =depthOrImageRaw;}
|
void setDepthOrRightRaw(const cv::Mat & depthOrImageRaw) {_depthOrRightRaw =depthOrImageRaw;}
|
||||||
void setLaserScanRaw(const cv::Mat & laserScanRaw, const LaserScanInfo & info) {_laserScanRaw =laserScanRaw;_laserScanInfo = info;}
|
void setLaserScanRaw(const LaserScan & laserScanRaw) {_laserScanRaw =laserScanRaw;}
|
||||||
void setCameraModel(const CameraModel & model) {_cameraModels.clear(); _cameraModels.push_back(model);}
|
void setCameraModel(const CameraModel & model) {_cameraModels.clear(); _cameraModels.push_back(model);}
|
||||||
void setCameraModels(const std::vector<CameraModel> & models) {_cameraModels = models;}
|
void setCameraModels(const std::vector<CameraModel> & models) {_cameraModels = models;}
|
||||||
void setStereoCameraModel(const StereoCameraModel & stereoCameraModel) {_stereoCameraModel = stereoCameraModel;}
|
void setStereoCameraModel(const StereoCameraModel & stereoCameraModel) {_stereoCameraModel = stereoCameraModel;}
|
||||||
@@ -171,17 +176,19 @@ public:
|
|||||||
void uncompressData(
|
void uncompressData(
|
||||||
cv::Mat * imageRaw,
|
cv::Mat * imageRaw,
|
||||||
cv::Mat * depthOrRightRaw,
|
cv::Mat * depthOrRightRaw,
|
||||||
cv::Mat * laserScanRaw = 0,
|
LaserScan * laserScanRaw = 0,
|
||||||
cv::Mat * userDataRaw = 0,
|
cv::Mat * userDataRaw = 0,
|
||||||
cv::Mat * groundCellsRaw = 0,
|
cv::Mat * groundCellsRaw = 0,
|
||||||
cv::Mat * obstacleCellsRaw = 0);
|
cv::Mat * obstacleCellsRaw = 0,
|
||||||
|
cv::Mat * emptyCellsRaw = 0);
|
||||||
void uncompressDataConst(
|
void uncompressDataConst(
|
||||||
cv::Mat * imageRaw,
|
cv::Mat * imageRaw,
|
||||||
cv::Mat * depthOrRightRaw,
|
cv::Mat * depthOrRightRaw,
|
||||||
cv::Mat * laserScanRaw = 0,
|
LaserScan * laserScanRaw = 0,
|
||||||
cv::Mat * userDataRaw = 0,
|
cv::Mat * userDataRaw = 0,
|
||||||
cv::Mat * groundCellsRaw = 0,
|
cv::Mat * groundCellsRaw = 0,
|
||||||
cv::Mat * obstacleCellsRaw = 0) const;
|
cv::Mat * obstacleCellsRaw = 0,
|
||||||
|
cv::Mat * emptyCellsRaw = 0) const;
|
||||||
|
|
||||||
const std::vector<CameraModel> & cameraModels() const {return _cameraModels;}
|
const std::vector<CameraModel> & cameraModels() const {return _cameraModels;}
|
||||||
const StereoCameraModel & stereoCameraModel() const {return _stereoCameraModel;}
|
const StereoCameraModel & stereoCameraModel() const {return _stereoCameraModel;}
|
||||||
@@ -202,6 +209,7 @@ public:
|
|||||||
void setOccupancyGrid(
|
void setOccupancyGrid(
|
||||||
const cv::Mat & ground,
|
const cv::Mat & ground,
|
||||||
const cv::Mat & obstacles,
|
const cv::Mat & obstacles,
|
||||||
|
const cv::Mat & empty,
|
||||||
float cellSize,
|
float cellSize,
|
||||||
const cv::Point3f & viewPoint);
|
const cv::Point3f & viewPoint);
|
||||||
// remove raw occupancy grids
|
// remove raw occupancy grids
|
||||||
@@ -210,6 +218,8 @@ public:
|
|||||||
const cv::Mat & gridGroundCellsCompressed() const {return _groundCellsCompressed;}
|
const cv::Mat & gridGroundCellsCompressed() const {return _groundCellsCompressed;}
|
||||||
const cv::Mat & gridObstacleCellsRaw() const {return _obstacleCellsRaw;}
|
const cv::Mat & gridObstacleCellsRaw() const {return _obstacleCellsRaw;}
|
||||||
const cv::Mat & gridObstacleCellsCompressed() const {return _obstacleCellsCompressed;}
|
const cv::Mat & gridObstacleCellsCompressed() const {return _obstacleCellsCompressed;}
|
||||||
|
const cv::Mat & gridEmptyCellsRaw() const {return _emptyCellsRaw;}
|
||||||
|
const cv::Mat & gridEmptyCellsCompressed() const {return _emptyCellsCompressed;}
|
||||||
float gridCellSize() const {return _cellSize;}
|
float gridCellSize() const {return _cellSize;}
|
||||||
const cv::Point3f & gridViewPoint() const {return _viewPoint;}
|
const cv::Point3f & gridViewPoint() const {return _viewPoint;}
|
||||||
|
|
||||||
@@ -225,7 +235,22 @@ public:
|
|||||||
const Transform & globalPose() const {return globalPose_;}
|
const Transform & globalPose() const {return globalPose_;}
|
||||||
const cv::Mat & globalPoseCovariance() const {return globalPoseCovariance_;}
|
const cv::Mat & globalPoseCovariance() const {return globalPoseCovariance_;}
|
||||||
|
|
||||||
|
void setGPS(const GPS & gps)
|
||||||
|
{
|
||||||
|
gps_ = gps;
|
||||||
|
}
|
||||||
|
const GPS & gps() const {return gps_;}
|
||||||
|
|
||||||
|
void setIMU(const IMU & imu)
|
||||||
|
{
|
||||||
|
imu_ = imu;
|
||||||
|
}
|
||||||
|
const IMU & imu() const {return imu_;}
|
||||||
|
|
||||||
long getMemoryUsed() const; // Return memory usage in Bytes
|
long getMemoryUsed() const; // Return memory usage in Bytes
|
||||||
|
void clearCompressedData() {_imageCompressed=cv::Mat(); _depthOrRightCompressed=cv::Mat(); _laserScanCompressed.clear(); _userDataCompressed=cv::Mat();}
|
||||||
|
|
||||||
|
bool isPointVisibleFromCameras(const cv::Point3f & pt) const; // assuming point is in robot frame
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _id;
|
int _id;
|
||||||
@@ -233,17 +258,15 @@ private:
|
|||||||
|
|
||||||
cv::Mat _imageCompressed; // compressed image
|
cv::Mat _imageCompressed; // compressed image
|
||||||
cv::Mat _depthOrRightCompressed; // compressed image
|
cv::Mat _depthOrRightCompressed; // compressed image
|
||||||
cv::Mat _laserScanCompressed; // compressed data
|
LaserScan _laserScanCompressed; // compressed data
|
||||||
|
|
||||||
cv::Mat _imageRaw; // CV_8UC1 or CV_8UC3
|
cv::Mat _imageRaw; // CV_8UC1 or CV_8UC3
|
||||||
cv::Mat _depthOrRightRaw; // depth CV_16UC1 or CV_32FC1, right image CV_8UC1
|
cv::Mat _depthOrRightRaw; // depth CV_16UC1 or CV_32FC1, right image CV_8UC1
|
||||||
cv::Mat _laserScanRaw; // CV_32FC2 or CV_32FC3
|
LaserScan _laserScanRaw;
|
||||||
|
|
||||||
std::vector<CameraModel> _cameraModels;
|
std::vector<CameraModel> _cameraModels;
|
||||||
StereoCameraModel _stereoCameraModel;
|
StereoCameraModel _stereoCameraModel;
|
||||||
|
|
||||||
LaserScanInfo _laserScanInfo;
|
|
||||||
|
|
||||||
// user data
|
// user data
|
||||||
cv::Mat _userDataCompressed; // compressed data
|
cv::Mat _userDataCompressed; // compressed data
|
||||||
cv::Mat _userDataRaw;
|
cv::Mat _userDataRaw;
|
||||||
@@ -251,8 +274,10 @@ private:
|
|||||||
// occupancy grid
|
// occupancy grid
|
||||||
cv::Mat _groundCellsCompressed;
|
cv::Mat _groundCellsCompressed;
|
||||||
cv::Mat _obstacleCellsCompressed;
|
cv::Mat _obstacleCellsCompressed;
|
||||||
|
cv::Mat _emptyCellsCompressed;
|
||||||
cv::Mat _groundCellsRaw;
|
cv::Mat _groundCellsRaw;
|
||||||
cv::Mat _obstacleCellsRaw;
|
cv::Mat _obstacleCellsRaw;
|
||||||
|
cv::Mat _emptyCellsRaw;
|
||||||
float _cellSize;
|
float _cellSize;
|
||||||
cv::Point3f _viewPoint;
|
cv::Point3f _viewPoint;
|
||||||
|
|
||||||
@@ -265,6 +290,10 @@ private:
|
|||||||
|
|
||||||
Transform globalPose_;
|
Transform globalPose_;
|
||||||
cv::Mat globalPoseCovariance_; // 6x6 double
|
cv::Mat globalPoseCovariance_; // 6x6 double
|
||||||
|
|
||||||
|
GPS gps_;
|
||||||
|
|
||||||
|
IMU imu_;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,6 +134,8 @@ public:
|
|||||||
SensorData & sensorData() {return _sensorData;}
|
SensorData & sensorData() {return _sensorData;}
|
||||||
const SensorData & sensorData() const {return _sensorData;}
|
const SensorData & sensorData() const {return _sensorData;}
|
||||||
|
|
||||||
|
long getMemoryUsed(bool withSensorData=true) const; // Return memory usage in Bytes
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _id;
|
int _id;
|
||||||
int _mapId;
|
int _mapId;
|
||||||
|
|||||||
@@ -64,8 +64,11 @@ class RTABMAP_EXP Statistics
|
|||||||
RTABMAP_STATS(Loop, Visual_matches,);
|
RTABMAP_STATS(Loop, Visual_matches,);
|
||||||
RTABMAP_STATS(Loop, Last_id,);
|
RTABMAP_STATS(Loop, Last_id,);
|
||||||
RTABMAP_STATS(Loop, Optimization_max_error, m);
|
RTABMAP_STATS(Loop, Optimization_max_error, m);
|
||||||
|
RTABMAP_STATS(Loop, Optimization_max_error_ratio, );
|
||||||
RTABMAP_STATS(Loop, Optimization_error, );
|
RTABMAP_STATS(Loop, Optimization_error, );
|
||||||
RTABMAP_STATS(Loop, Optimization_iterations, );
|
RTABMAP_STATS(Loop, Optimization_iterations, );
|
||||||
|
RTABMAP_STATS(Loop, Linear_variance,);
|
||||||
|
RTABMAP_STATS(Loop, Angular_variance,);
|
||||||
|
|
||||||
RTABMAP_STATS(Proximity, Time_detections,);
|
RTABMAP_STATS(Proximity, Time_detections,);
|
||||||
RTABMAP_STATS(Proximity, Space_last_detection_id,);
|
RTABMAP_STATS(Proximity, Space_last_detection_id,);
|
||||||
@@ -77,7 +80,10 @@ class RTABMAP_EXP Statistics
|
|||||||
|
|
||||||
RTABMAP_STATS(NeighborLinkRefining, Accepted,);
|
RTABMAP_STATS(NeighborLinkRefining, Accepted,);
|
||||||
RTABMAP_STATS(NeighborLinkRefining, Inliers,);
|
RTABMAP_STATS(NeighborLinkRefining, Inliers,);
|
||||||
RTABMAP_STATS(NeighborLinkRefining, Inliers_ratio,);
|
RTABMAP_STATS(NeighborLinkRefining, ICP_inliers_ratio,);
|
||||||
|
RTABMAP_STATS(NeighborLinkRefining, ICP_rotation, rad);
|
||||||
|
RTABMAP_STATS(NeighborLinkRefining, ICP_translation, m);
|
||||||
|
RTABMAP_STATS(NeighborLinkRefining, ICP_complexity,);
|
||||||
RTABMAP_STATS(NeighborLinkRefining, Variance,);
|
RTABMAP_STATS(NeighborLinkRefining, Variance,);
|
||||||
RTABMAP_STATS(NeighborLinkRefining, Pts,);
|
RTABMAP_STATS(NeighborLinkRefining, Pts,);
|
||||||
|
|
||||||
@@ -95,13 +101,17 @@ class RTABMAP_EXP Statistics
|
|||||||
RTABMAP_STATS(Memory, Rehearsal_merged,);
|
RTABMAP_STATS(Memory, Rehearsal_merged,);
|
||||||
RTABMAP_STATS(Memory, Local_graph_size,);
|
RTABMAP_STATS(Memory, Local_graph_size,);
|
||||||
RTABMAP_STATS(Memory, Small_movement,);
|
RTABMAP_STATS(Memory, Small_movement,);
|
||||||
|
RTABMAP_STATS(Memory, Fast_movement,);
|
||||||
RTABMAP_STATS(Memory, Odometry_variance_ang,);
|
RTABMAP_STATS(Memory, Odometry_variance_ang,);
|
||||||
RTABMAP_STATS(Memory, Odometry_variance_lin,);
|
RTABMAP_STATS(Memory, Odometry_variance_lin,);
|
||||||
RTABMAP_STATS(Memory, Distance_travelled, m);
|
RTABMAP_STATS(Memory, Distance_travelled, m);
|
||||||
|
RTABMAP_STATS(Memory, RAM_usage, MB);
|
||||||
|
RTABMAP_STATS(Memory, Triangulated_points, );
|
||||||
|
|
||||||
RTABMAP_STATS(Timing, Memory_update, ms);
|
RTABMAP_STATS(Timing, Memory_update, ms);
|
||||||
RTABMAP_STATS(Timing, Neighbor_link_refining, ms);
|
RTABMAP_STATS(Timing, Neighbor_link_refining, ms);
|
||||||
RTABMAP_STATS(Timing, Proximity_by_time, ms);
|
RTABMAP_STATS(Timing, Proximity_by_time, ms);
|
||||||
|
RTABMAP_STATS(Timing, Proximity_by_space_visual, ms);
|
||||||
RTABMAP_STATS(Timing, Proximity_by_space, ms);
|
RTABMAP_STATS(Timing, Proximity_by_space, ms);
|
||||||
RTABMAP_STATS(Timing, Cleaning_neighbors, ms);
|
RTABMAP_STATS(Timing, Cleaning_neighbors, ms);
|
||||||
RTABMAP_STATS(Timing, Reactivation, ms);
|
RTABMAP_STATS(Timing, Reactivation, ms);
|
||||||
@@ -125,19 +135,33 @@ class RTABMAP_EXP Statistics
|
|||||||
RTABMAP_STATS(TimingMem, Subpixel, ms);
|
RTABMAP_STATS(TimingMem, Subpixel, ms);
|
||||||
RTABMAP_STATS(TimingMem, Stereo_correspondences, ms);
|
RTABMAP_STATS(TimingMem, Stereo_correspondences, ms);
|
||||||
RTABMAP_STATS(TimingMem, Descriptors_extraction, ms);
|
RTABMAP_STATS(TimingMem, Descriptors_extraction, ms);
|
||||||
|
RTABMAP_STATS(TimingMem, Rectification, ms);
|
||||||
RTABMAP_STATS(TimingMem, Keypoints_3D, ms);
|
RTABMAP_STATS(TimingMem, Keypoints_3D, ms);
|
||||||
|
RTABMAP_STATS(TimingMem, Keypoints_3D_motion, ms);
|
||||||
RTABMAP_STATS(TimingMem, Joining_dictionary_update, ms);
|
RTABMAP_STATS(TimingMem, Joining_dictionary_update, ms);
|
||||||
RTABMAP_STATS(TimingMem, Add_new_words, ms);
|
RTABMAP_STATS(TimingMem, Add_new_words, ms);
|
||||||
RTABMAP_STATS(TimingMem, Compressing_data, ms);
|
RTABMAP_STATS(TimingMem, Compressing_data, ms);
|
||||||
RTABMAP_STATS(TimingMem, Post_decimation, ms);
|
RTABMAP_STATS(TimingMem, Post_decimation, ms);
|
||||||
RTABMAP_STATS(TimingMem, Scan_downsampling, ms);
|
RTABMAP_STATS(TimingMem, Scan_filtering, ms);
|
||||||
RTABMAP_STATS(TimingMem, Scan_normals, ms);
|
|
||||||
RTABMAP_STATS(TimingMem, Occupancy_grid, ms);
|
RTABMAP_STATS(TimingMem, Occupancy_grid, ms);
|
||||||
|
|
||||||
RTABMAP_STATS(Keypoint, Dictionary_size, words);
|
RTABMAP_STATS(Keypoint, Dictionary_size, words);
|
||||||
RTABMAP_STATS(Keypoint, Indexed_words, words);
|
RTABMAP_STATS(Keypoint, Indexed_words, words);
|
||||||
RTABMAP_STATS(Keypoint, Index_memory_usage, KB);
|
RTABMAP_STATS(Keypoint, Index_memory_usage, KB);
|
||||||
|
|
||||||
|
RTABMAP_STATS(Gt, Translational_rmse, m);
|
||||||
|
RTABMAP_STATS(Gt, Translational_mean, m);
|
||||||
|
RTABMAP_STATS(Gt, Translational_median, m);
|
||||||
|
RTABMAP_STATS(Gt, Translational_std, m);
|
||||||
|
RTABMAP_STATS(Gt, Translational_min, m);
|
||||||
|
RTABMAP_STATS(Gt, Translational_max, m);
|
||||||
|
RTABMAP_STATS(Gt, Rotational_rmse, deg);
|
||||||
|
RTABMAP_STATS(Gt, Rotational_mean, deg);
|
||||||
|
RTABMAP_STATS(Gt, Rotational_median, deg);
|
||||||
|
RTABMAP_STATS(Gt, Rotational_std, deg);
|
||||||
|
RTABMAP_STATS(Gt, Rotational_min, deg);
|
||||||
|
RTABMAP_STATS(Gt, Rotational_max, deg);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const std::map<std::string, float> & defaultData();
|
static const std::map<std::string, float> & defaultData();
|
||||||
static std::string serializeData(const std::map<std::string, float> & data);
|
static std::string serializeData(const std::map<std::string, float> & data);
|
||||||
@@ -163,6 +187,7 @@ public:
|
|||||||
void setConstraints(const std::multimap<int, Link> & constraints) {_constraints = constraints;}
|
void setConstraints(const std::multimap<int, Link> & constraints) {_constraints = constraints;}
|
||||||
void setMapCorrection(const Transform & mapCorrection) {_mapCorrection = mapCorrection;}
|
void setMapCorrection(const Transform & mapCorrection) {_mapCorrection = mapCorrection;}
|
||||||
void setLoopClosureTransform(const Transform & loopClosureTransform) {_loopClosureTransform = loopClosureTransform;}
|
void setLoopClosureTransform(const Transform & loopClosureTransform) {_loopClosureTransform = loopClosureTransform;}
|
||||||
|
void setLocalizationCovariance(const cv::Mat & covariance) {_localizationCovariance = covariance;}
|
||||||
void setWeights(const std::map<int, int> & weights) {_weights = weights;}
|
void setWeights(const std::map<int, int> & weights) {_weights = weights;}
|
||||||
void setPosterior(const std::map<int, float> & posterior) {_posterior = posterior;}
|
void setPosterior(const std::map<int, float> & posterior) {_posterior = posterior;}
|
||||||
void setLikelihood(const std::map<int, float> & likelihood) {_likelihood = likelihood;}
|
void setLikelihood(const std::map<int, float> & likelihood) {_likelihood = likelihood;}
|
||||||
@@ -170,6 +195,7 @@ public:
|
|||||||
void setLocalPath(const std::vector<int> & localPath) {_localPath=localPath;}
|
void setLocalPath(const std::vector<int> & localPath) {_localPath=localPath;}
|
||||||
void setCurrentGoalId(int goal) {_currentGoalId=goal;}
|
void setCurrentGoalId(int goal) {_currentGoalId=goal;}
|
||||||
void setReducedIds(const std::map<int, int> & reducedIds) {_reducedIds = reducedIds;}
|
void setReducedIds(const std::map<int, int> & reducedIds) {_reducedIds = reducedIds;}
|
||||||
|
void setWmState(const std::vector<int> & state) {_wmState = state;}
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
bool extended() const {return _extended;}
|
bool extended() const {return _extended;}
|
||||||
@@ -184,6 +210,7 @@ public:
|
|||||||
const std::multimap<int, Link> & constraints() const {return _constraints;}
|
const std::multimap<int, Link> & constraints() const {return _constraints;}
|
||||||
const Transform & mapCorrection() const {return _mapCorrection;}
|
const Transform & mapCorrection() const {return _mapCorrection;}
|
||||||
const Transform & loopClosureTransform() const {return _loopClosureTransform;}
|
const Transform & loopClosureTransform() const {return _loopClosureTransform;}
|
||||||
|
const cv::Mat & localizationCovariance() const {return _localizationCovariance;}
|
||||||
const std::map<int, int> & weights() const {return _weights;}
|
const std::map<int, int> & weights() const {return _weights;}
|
||||||
const std::map<int, float> & posterior() const {return _posterior;}
|
const std::map<int, float> & posterior() const {return _posterior;}
|
||||||
const std::map<int, float> & likelihood() const {return _likelihood;}
|
const std::map<int, float> & likelihood() const {return _likelihood;}
|
||||||
@@ -191,6 +218,7 @@ public:
|
|||||||
const std::vector<int> & localPath() const {return _localPath;}
|
const std::vector<int> & localPath() const {return _localPath;}
|
||||||
int currentGoalId() const {return _currentGoalId;}
|
int currentGoalId() const {return _currentGoalId;}
|
||||||
const std::map<int, int> & reducedIds() const {return _reducedIds;}
|
const std::map<int, int> & reducedIds() const {return _reducedIds;}
|
||||||
|
const std::vector<int> & wmState() const {return _wmState;}
|
||||||
|
|
||||||
const std::map<std::string, float> & data() const {return _data;}
|
const std::map<std::string, float> & data() const {return _data;}
|
||||||
|
|
||||||
@@ -208,6 +236,7 @@ private:
|
|||||||
std::multimap<int, Link> _constraints;
|
std::multimap<int, Link> _constraints;
|
||||||
Transform _mapCorrection;
|
Transform _mapCorrection;
|
||||||
Transform _loopClosureTransform;
|
Transform _loopClosureTransform;
|
||||||
|
cv::Mat _localizationCovariance;
|
||||||
|
|
||||||
std::map<int, int> _weights;
|
std::map<int, int> _weights;
|
||||||
std::map<int, float> _posterior;
|
std::map<int, float> _posterior;
|
||||||
@@ -219,6 +248,8 @@ private:
|
|||||||
|
|
||||||
std::map<int, int> _reducedIds;
|
std::map<int, int> _reducedIds;
|
||||||
|
|
||||||
|
std::vector<int> _wmState;
|
||||||
|
|
||||||
// Format for statistics (Plottable statistics must go in that map) :
|
// Format for statistics (Plottable statistics must go in that map) :
|
||||||
// {"Group/Name/Unit", value}
|
// {"Group/Name/Unit", value}
|
||||||
// Example : {"Timing/Total time/ms", 500.0f}
|
// Example : {"Timing/Total time/ms", 500.0f}
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ public:
|
|||||||
cv::Size winSize() const {return cv::Size(winWidth_, winHeight_);}
|
cv::Size winSize() const {return cv::Size(winWidth_, winHeight_);}
|
||||||
int iterations() const {return iterations_;}
|
int iterations() const {return iterations_;}
|
||||||
int maxLevel() const {return maxLevel_;}
|
int maxLevel() const {return maxLevel_;}
|
||||||
int minDisparity() const {return minDisparity_;}
|
float minDisparity() const {return minDisparity_;}
|
||||||
int maxDisparity() const {return maxDisparity_;}
|
float maxDisparity() const {return maxDisparity_;}
|
||||||
bool winSSD() const {return winSSD_;}
|
bool winSSD() const {return winSSD_;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -62,8 +62,8 @@ private:
|
|||||||
int winHeight_;
|
int winHeight_;
|
||||||
int iterations_;
|
int iterations_;
|
||||||
int maxLevel_;
|
int maxLevel_;
|
||||||
int minDisparity_;
|
float minDisparity_;
|
||||||
int maxDisparity_;
|
float maxDisparity_;
|
||||||
bool winSSD_;
|
bool winSSD_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public:
|
|||||||
bool isValidForRectification() const {return left_.isValidForRectification() && right_.isValidForRectification();}
|
bool isValidForRectification() const {return left_.isValidForRectification() && right_.isValidForRectification();}
|
||||||
|
|
||||||
void initRectificationMap() {left_.initRectificationMap(); right_.initRectificationMap();}
|
void initRectificationMap() {left_.initRectificationMap(); right_.initRectificationMap();}
|
||||||
|
bool isRectificationMapInitialized() {return left_.isRectificationMapInitialized() && right_.isRectificationMapInitialized();}
|
||||||
|
|
||||||
void setName(const std::string & name, const std::string & leftSuffix = "left", const std::string & rightSuffix = "right");
|
void setName(const std::string & name, const std::string & leftSuffix = "left", const std::string & rightSuffix = "right");
|
||||||
const std::string & name() const {return name_;}
|
const std::string & name() const {return name_;}
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ public:
|
|||||||
// x,y, theta
|
// x,y, theta
|
||||||
Transform(float x, float y, float theta);
|
Transform(float x, float y, float theta);
|
||||||
|
|
||||||
|
Transform clone() const;
|
||||||
|
|
||||||
float r11() const {return data()[0];}
|
float r11() const {return data()[0];}
|
||||||
float r12() const {return data()[1];}
|
float r12() const {return data()[1];}
|
||||||
float r13() const {return data()[2];}
|
float r13() const {return data()[2];}
|
||||||
@@ -112,6 +114,7 @@ public:
|
|||||||
float getDistance(const Transform & t) const;
|
float getDistance(const Transform & t) const;
|
||||||
float getDistanceSquared(const Transform & t) const;
|
float getDistanceSquared(const Transform & t) const;
|
||||||
Transform interpolate(float t, const Transform & other) const;
|
Transform interpolate(float t, const Transform & other) const;
|
||||||
|
void normalizeRotation();
|
||||||
std::string prettyPrint() const;
|
std::string prettyPrint() const;
|
||||||
|
|
||||||
Transform operator*(const Transform & t) const;
|
Transform operator*(const Transform & t) const;
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
bool _incrementalDictionary;
|
bool _incrementalDictionary;
|
||||||
bool _incrementalFlann;
|
bool _incrementalFlann;
|
||||||
|
float _rebalancingFactor;
|
||||||
float _nndrRatio;
|
float _nndrRatio;
|
||||||
std::string _dictionaryPath; // a pre-computed dictionary (.txt)
|
std::string _dictionaryPath; // a pre-computed dictionary (.txt)
|
||||||
bool _newWordsComparedTogether;
|
bool _newWordsComparedTogether;
|
||||||
|
|||||||
@@ -45,14 +45,34 @@ typename pcl::PointCloud<PointT>::Ptr OccupancyGrid::segmentCloud(
|
|||||||
pcl::IndicesPtr * flatObstacles) const
|
pcl::IndicesPtr * flatObstacles) const
|
||||||
{
|
{
|
||||||
typename pcl::PointCloud<PointT>::Ptr cloud(new pcl::PointCloud<PointT>);
|
typename pcl::PointCloud<PointT>::Ptr cloud(new pcl::PointCloud<PointT>);
|
||||||
|
|
||||||
// voxelize to grid cell size
|
|
||||||
cloud = util3d::voxelize(cloudIn, indicesIn, cellSize_);
|
|
||||||
pcl::IndicesPtr indices(new std::vector<int>);
|
pcl::IndicesPtr indices(new std::vector<int>);
|
||||||
indices->resize(cloud->size());
|
|
||||||
for(unsigned int i=0; i<indices->size(); ++i)
|
if(preVoxelFiltering_)
|
||||||
{
|
{
|
||||||
indices->at(i) = i;
|
// voxelize to grid cell size
|
||||||
|
cloud = util3d::voxelize(cloudIn, indicesIn, cellSize_);
|
||||||
|
|
||||||
|
indices->resize(cloud->size());
|
||||||
|
for(unsigned int i=0; i<indices->size(); ++i)
|
||||||
|
{
|
||||||
|
indices->at(i) = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cloud = cloudIn;
|
||||||
|
if(indicesIn->empty() && cloud->is_dense)
|
||||||
|
{
|
||||||
|
indices->resize(cloud->size());
|
||||||
|
for(unsigned int i=0; i<indices->size(); ++i)
|
||||||
|
{
|
||||||
|
indices->at(i) = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
indices = indicesIn;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// add pose rotation without yaw
|
// add pose rotation without yaw
|
||||||
|
|||||||
@@ -83,8 +83,6 @@ void segmentObstaclesFromGround(
|
|||||||
normalKSearch,
|
normalKSearch,
|
||||||
viewPoint);
|
viewPoint);
|
||||||
|
|
||||||
UDEBUG("cloud=%d, indices=%d flatSurfaces=%d", (int)cloud->size(), (int)indices->size(), (int)flatSurfaces->size());
|
|
||||||
|
|
||||||
if(segmentFlatObstacles && flatSurfaces->size())
|
if(segmentFlatObstacles && flatSurfaces->size())
|
||||||
{
|
{
|
||||||
int biggestFlatSurfaceIndex;
|
int biggestFlatSurfaceIndex;
|
||||||
@@ -95,7 +93,6 @@ void segmentObstaclesFromGround(
|
|||||||
minClusterSize,
|
minClusterSize,
|
||||||
std::numeric_limits<int>::max(),
|
std::numeric_limits<int>::max(),
|
||||||
&biggestFlatSurfaceIndex);
|
&biggestFlatSurfaceIndex);
|
||||||
UDEBUG("clusteredFlatSurfaces=%d", (int)clusteredFlatSurfaces.size());
|
|
||||||
|
|
||||||
// cluster all surfaces for which the centroid is in the Z-range of the bigger surface
|
// cluster all surfaces for which the centroid is in the Z-range of the bigger surface
|
||||||
if(clusteredFlatSurfaces.size())
|
if(clusteredFlatSurfaces.size())
|
||||||
@@ -112,8 +109,7 @@ void segmentObstaclesFromGround(
|
|||||||
{
|
{
|
||||||
Eigen::Vector4f centroid(0,0,0,1);
|
Eigen::Vector4f centroid(0,0,0,1);
|
||||||
pcl::compute3DCentroid(*cloud, *clusteredFlatSurfaces.at(i), centroid);
|
pcl::compute3DCentroid(*cloud, *clusteredFlatSurfaces.at(i), centroid);
|
||||||
if(centroid[2] >= min[2]-0.01 &&
|
if(maxGroundHeight==0.0f || centroid[2] <= maxGroundHeight || centroid[2] <= max[2]) // epsilon
|
||||||
(centroid[2] <= max[2]+0.01 || (maxGroundHeight!=0.0f && centroid[2] <= maxGroundHeight+0.01))) // epsilon
|
|
||||||
{
|
{
|
||||||
ground = util3d::concatenate(ground, clusteredFlatSurfaces.at(i));
|
ground = util3d::concatenate(ground, clusteredFlatSurfaces.at(i));
|
||||||
}
|
}
|
||||||
@@ -140,8 +136,6 @@ void segmentObstaclesFromGround(
|
|||||||
ground = flatSurfaces;
|
ground = flatSurfaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
UDEBUG("ground=%d", (int)ground->size());
|
|
||||||
|
|
||||||
if(ground->size() != cloud->size())
|
if(ground->size() != cloud->size())
|
||||||
{
|
{
|
||||||
// Remove ground
|
// Remove ground
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ std::vector<cv::Point2f> RTABMAP_EXP calcStereoCorrespondences(
|
|||||||
cv::Size winSize = cv::Size(6,3),
|
cv::Size winSize = cv::Size(6,3),
|
||||||
int maxLevel = 3,
|
int maxLevel = 3,
|
||||||
int iterations = 5,
|
int iterations = 5,
|
||||||
int minDisparity = 0,
|
float minDisparity = 0.0f,
|
||||||
int maxDisparity = 64,
|
float maxDisparity = 64.0f,
|
||||||
bool ssdApproach = true); // SSD by default, otherwise it is SAD
|
bool ssdApproach = true); // SSD by default, otherwise it is SAD
|
||||||
|
|
||||||
// exactly as cv::calcOpticalFlowPyrLK but it should be called with pyramid (from cv::buildOpticalFlowPyramid()) and delta drops the y error.
|
// exactly as cv::calcOpticalFlowPyrLK but it should be called with pyramid (from cv::buildOpticalFlowPyramid()) and delta drops the y error.
|
||||||
@@ -107,7 +107,7 @@ float RTABMAP_EXP getDepth(
|
|||||||
const cv::Mat & depthImage,
|
const cv::Mat & depthImage,
|
||||||
float x, float y,
|
float x, float y,
|
||||||
bool smoothing,
|
bool smoothing,
|
||||||
float maxZError = 0.02f,
|
float depthErrorRatio = 0.02f, //ratio
|
||||||
bool estWithNeighborsIfNull = false);
|
bool estWithNeighborsIfNull = false);
|
||||||
|
|
||||||
cv::Rect RTABMAP_EXP computeRoi(const cv::Mat & image, const std::string & roiRatios);
|
cv::Rect RTABMAP_EXP computeRoi(const cv::Mat & image, const std::string & roiRatios);
|
||||||
|
|||||||
@@ -72,7 +72,13 @@ pcl::PointXYZ RTABMAP_EXP projectDepthTo3D(
|
|||||||
float cx, float cy,
|
float cx, float cy,
|
||||||
float fx, float fy,
|
float fx, float fy,
|
||||||
bool smoothing,
|
bool smoothing,
|
||||||
float maxZError = 0.02f);
|
float depthErrorRatio = 0.02f);
|
||||||
|
|
||||||
|
Eigen::Vector3f RTABMAP_EXP projectDepthTo3DRay(
|
||||||
|
const cv::Size & imageSize,
|
||||||
|
float x, float y,
|
||||||
|
float cx, float cy,
|
||||||
|
float fx, float fy);
|
||||||
|
|
||||||
RTABMAP_DEPRECATED (pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP cloudFromDepth(
|
RTABMAP_DEPRECATED (pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP cloudFromDepth(
|
||||||
const cv::Mat & imageDepth,
|
const cv::Mat & imageDepth,
|
||||||
@@ -190,36 +196,68 @@ pcl::PointCloud<pcl::PointXYZ> RTABMAP_EXP laserScanFromDepthImages(
|
|||||||
float maxDepth,
|
float maxDepth,
|
||||||
float minDepth);
|
float minDepth);
|
||||||
|
|
||||||
|
LaserScan RTABMAP_EXP laserScanFromPointCloud(const pcl::PCLPointCloud2 & cloud, bool filterNaNs = true);
|
||||||
// return CV_32FC3 (x,y,z)
|
// return CV_32FC3 (x,y,z)
|
||||||
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZ> & cloud, const Transform & transform = Transform());
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZ> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
// return CV_32FC6 (x,y,z,normal_z,normal_y,normalz)
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZ> & cloud, const pcl::IndicesPtr & indices, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointNormal> & cloud, const Transform & transform = Transform());
|
// return CV_32FC6 (x,y,z,normal_x,normal_y,normal_z)
|
||||||
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZ> & cloud, const pcl::PointCloud<pcl::Normal> & normals, const Transform & transform = Transform());
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointNormal> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointNormal> & cloud, const pcl::IndicesPtr & indices, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZ> & cloud, const pcl::PointCloud<pcl::Normal> & normals, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
// return CV_32FC4 (x,y,z,rgb)
|
// return CV_32FC4 (x,y,z,rgb)
|
||||||
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZRGB> & cloud, const Transform & transform = Transform());
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZRGB> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
// return CV_32FC7 (x,y,z,rgb,normal_z,normal_y,normalz)
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZRGB> & cloud, const pcl::IndicesPtr & indices, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZRGBNormal> & cloud, const Transform & transform = Transform());
|
// return CV_32FC4 (x,y,z,I)
|
||||||
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZI> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZI> & cloud, const pcl::IndicesPtr & indices, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
|
// return CV_32FC7 (x,y,z,rgb,normal_x,normal_y,normal_z)
|
||||||
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZRGB> & cloud, const pcl::PointCloud<pcl::Normal> & normals, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZRGBNormal> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZRGBNormal> & cloud, const pcl::IndicesPtr & indices, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
|
// return CV_32FC7 (x,y,z,I,normal_x,normal_y,normal_z)
|
||||||
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZI> & cloud, const pcl::PointCloud<pcl::Normal> & normals, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
|
cv::Mat RTABMAP_EXP laserScanFromPointCloud(const pcl::PointCloud<pcl::PointXYZINormal> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
// return CV_32FC2 (x,y)
|
// return CV_32FC2 (x,y)
|
||||||
cv::Mat RTABMAP_EXP laserScan2dFromPointCloud(const pcl::PointCloud<pcl::PointXYZ> & cloud, const Transform & transform = Transform());
|
cv::Mat RTABMAP_EXP laserScan2dFromPointCloud(const pcl::PointCloud<pcl::PointXYZ> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
// For laserScan of type CV_32FC2, z is set to null.
|
// return CV_32FC3 (x,y,I)
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP laserScanToPointCloud(const cv::Mat & laserScan, const Transform & transform = Transform());
|
cv::Mat RTABMAP_EXP laserScan2dFromPointCloud(const pcl::PointCloud<pcl::PointXYZI> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
// For laserScan of type CV_32FC2, CV_32FC3 and CV_32FC4, normals are set to null.
|
// return CV_32FC5 (x,y,normal_x, normal_y, normal_z)
|
||||||
pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP laserScanToPointCloudNormal(const cv::Mat & laserScan, const Transform & transform = Transform());
|
cv::Mat RTABMAP_EXP laserScan2dFromPointCloud(const pcl::PointCloud<pcl::PointNormal> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
// For laserScan of type CV_32FC2, CV_32FC3 and CV_32FC6, rgb is set to default r,g,b parameters.
|
cv::Mat RTABMAP_EXP laserScan2dFromPointCloud(const pcl::PointCloud<pcl::PointXYZ> & cloud, const pcl::PointCloud<pcl::Normal> & normals, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP laserScanToPointCloudRGB(const cv::Mat & laserScan, const Transform & transform = Transform(), unsigned char r = 255, unsigned char g = 255, unsigned char b = 255);
|
// return CV_32FC6 (x,y,I,normal_x, normal_y, normal_z)
|
||||||
// For laserScan of type CV_32FC2, CV_32FC3 and CV_32FC6, rgb is set to default r,g,b parameters.
|
cv::Mat RTABMAP_EXP laserScan2dFromPointCloud(const pcl::PointCloud<pcl::PointXYZINormal> & cloud, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
// For laserScan of type CV_32FC2, CV_32FC3 and CV_32FC4, normals are set to null.
|
cv::Mat RTABMAP_EXP laserScan2dFromPointCloud(const pcl::PointCloud<pcl::PointXYZI> & cloud, const pcl::PointCloud<pcl::Normal> & normals, const Transform & transform = Transform(), bool filterNaNs = true);
|
||||||
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP laserScanToPointCloudRGBNormal(const cv::Mat & laserScan, const Transform & transform = Transform(), unsigned char r = 255, unsigned char g = 255, unsigned char b = 255);
|
|
||||||
|
|
||||||
// For laserScan of type CV_32FC2, z is set to null.
|
pcl::PCLPointCloud2::Ptr RTABMAP_EXP laserScanToPointCloud2(const LaserScan & laserScan, const Transform & transform = Transform());
|
||||||
pcl::PointXYZ RTABMAP_EXP laserScanToPoint(const cv::Mat & laserScan, int index);
|
// For 2d laserScan, z is set to null.
|
||||||
// For laserScan of type CV_32FC2, CV_32FC3 and CV_32FC4, normals are set to null.
|
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP laserScanToPointCloud(const LaserScan & laserScan, const Transform & transform = Transform());
|
||||||
pcl::PointNormal RTABMAP_EXP laserScanToPointNormal(const cv::Mat & laserScan, int index);
|
// For laserScan without normals, normals are set to null.
|
||||||
// For laserScan of type CV_32FC2, CV_32FC3 and CV_32FC6, rgb is set to default r,g,b parameters.
|
pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP laserScanToPointCloudNormal(const LaserScan & laserScan, const Transform & transform = Transform());
|
||||||
pcl::PointXYZRGB RTABMAP_EXP laserScanToPointRGB(const cv::Mat & laserScan, int index, unsigned char r = 255, unsigned char g = 255, unsigned char b = 255);
|
// For laserScan without rgb, rgb is set to default r,g,b parameters.
|
||||||
// For laserScan of type CV_32FC2, CV_32FC3 and CV_32FC6, rgb is set to default r,g,b parameters.
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP laserScanToPointCloudRGB(const LaserScan & laserScan, const Transform & transform = Transform(), unsigned char r = 255, unsigned char g = 255, unsigned char b = 255);
|
||||||
// For laserScan of type CV_32FC2, CV_32FC3 and CV_32FC4, normals are set to null.
|
// For laserScan without intensity, intensity is set to intensity parameter.
|
||||||
pcl::PointXYZRGBNormal RTABMAP_EXP laserScanToPointRGBNormal(const cv::Mat & laserScan, int index, unsigned char r, unsigned char g, unsigned char b);
|
pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP laserScanToPointCloudI(const LaserScan & laserScan, const Transform & transform = Transform(), float intensity = 0.0f);
|
||||||
|
// For laserScan without rgb, rgb is set to default r,g,b parameters.
|
||||||
|
// For laserScan without normals, normals are set to null.
|
||||||
|
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP laserScanToPointCloudRGBNormal(const LaserScan & laserScan, const Transform & transform = Transform(), unsigned char r = 255, unsigned char g = 255, unsigned char b = 255);
|
||||||
|
// For laserScan without intensity, intensity is set to default intensity parameter.
|
||||||
|
// For laserScan without normals, normals are set to null.
|
||||||
|
pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP laserScanToPointCloudINormal(const LaserScan & laserScan, const Transform & transform = Transform(), float intensity = 0.0f);
|
||||||
|
|
||||||
|
// For 2d laserScan, z is set to null.
|
||||||
|
pcl::PointXYZ RTABMAP_EXP laserScanToPoint(const LaserScan & laserScan, int index);
|
||||||
|
// For laserScan without normals, normals are set to null.
|
||||||
|
pcl::PointNormal RTABMAP_EXP laserScanToPointNormal(const LaserScan & laserScan, int index);
|
||||||
|
// For laserScan without rgb, rgb is set to default r,g,b parameters.
|
||||||
|
pcl::PointXYZRGB RTABMAP_EXP laserScanToPointRGB(const LaserScan & laserScan, int index, unsigned char r = 255, unsigned char g = 255, unsigned char b = 255);
|
||||||
|
// For laserScan without intensity, intensity is set to intensity parameter.
|
||||||
|
pcl::PointXYZI RTABMAP_EXP laserScanToPointI(const LaserScan & laserScan, int index, float intensity);
|
||||||
|
// For laserScan without rgb, rgb is set to default r,g,b parameters.
|
||||||
|
// For laserScan without normals, normals are set to null.
|
||||||
|
pcl::PointXYZRGBNormal RTABMAP_EXP laserScanToPointRGBNormal(const LaserScan & laserScan, int index, unsigned char r, unsigned char g, unsigned char b);
|
||||||
|
// For laserScan without intensity, intensity is set to default intensity parameter.
|
||||||
|
// For laserScan without normals, normals are set to null.
|
||||||
|
pcl::PointXYZINormal RTABMAP_EXP laserScanToPointINormal(const LaserScan & laserScan, int index, float intensity);
|
||||||
|
|
||||||
void RTABMAP_EXP getMinMax3D(const cv::Mat & laserScan, cv::Point3f & min, cv::Point3f & max);
|
void RTABMAP_EXP getMinMax3D(const cv::Mat & laserScan, cv::Point3f & min, cv::Point3f & max);
|
||||||
void RTABMAP_EXP getMinMax3D(const cv::Mat & laserScan, pcl::PointXYZ & min, pcl::PointXYZ & max);
|
void RTABMAP_EXP getMinMax3D(const cv::Mat & laserScan, pcl::PointXYZ & min, pcl::PointXYZ & max);
|
||||||
@@ -304,22 +342,22 @@ void RTABMAP_EXP savePCDWords(
|
|||||||
const std::multimap<int, cv::Point3f> & words,
|
const std::multimap<int, cv::Point3f> & words,
|
||||||
const Transform & transform = Transform::getIdentity());
|
const Transform & transform = Transform::getIdentity());
|
||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP loadBINCloud(const std::string & fileName, int dim);
|
/**
|
||||||
|
* Assume KITTI velodyne format
|
||||||
|
* Return scan 4 channels (format=XYZI).
|
||||||
|
*/
|
||||||
|
cv::Mat RTABMAP_EXP loadBINScan(const std::string & fileName);
|
||||||
|
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP loadBINCloud(const std::string & fileName);
|
||||||
|
RTABMAP_DEPRECATED(pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP loadBINCloud(const std::string & fileName, int dim), "Use interface without dim argument.");
|
||||||
|
|
||||||
// Load *.pcd, *.ply or *.bin (KITTI format) with optional filtering.
|
// Load *.pcd, *.ply or *.bin (KITTI format).
|
||||||
// If normals are computed (normalsK>0), the returned scan type is CV_32FC6 instead of CV_32FC3
|
LaserScan RTABMAP_EXP loadScan(const std::string & path);
|
||||||
cv::Mat RTABMAP_EXP loadScan(
|
|
||||||
|
RTABMAP_DEPRECATED(pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP loadCloud(
|
||||||
const std::string & path,
|
const std::string & path,
|
||||||
const Transform & transform = Transform::getIdentity(),
|
const Transform & transform = Transform::getIdentity(),
|
||||||
int downsampleStep = 1,
|
int downsampleStep = 1,
|
||||||
float voxelSize = 0.0f,
|
float voxelSize = 0.0f), "Use loadScan() instead.");
|
||||||
int normalsK = 0);
|
|
||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP loadCloud(
|
|
||||||
const std::string & path,
|
|
||||||
const Transform & transform = Transform::getIdentity(),
|
|
||||||
int downsampleStep = 1,
|
|
||||||
float voxelSize = 0.0f);
|
|
||||||
|
|
||||||
} // namespace util3d
|
} // namespace util3d
|
||||||
} // namespace rtabmap
|
} // namespace rtabmap
|
||||||
|
|||||||
@@ -30,11 +30,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#include <rtabmap/core/RtabmapExp.h>
|
#include <rtabmap/core/RtabmapExp.h>
|
||||||
#include <rtabmap/core/Transform.h>
|
#include <rtabmap/core/Transform.h>
|
||||||
|
|
||||||
#include <pcl/point_cloud.h>
|
#include <pcl/point_cloud.h>
|
||||||
#include <pcl/point_types.h>
|
#include <pcl/point_types.h>
|
||||||
#include <pcl/pcl_base.h>
|
#include <pcl/pcl_base.h>
|
||||||
#include <pcl/ModelCoefficients.h>
|
#include <pcl/ModelCoefficients.h>
|
||||||
|
#include <rtabmap/core/LaserScan.h>
|
||||||
|
|
||||||
namespace rtabmap
|
namespace rtabmap
|
||||||
{
|
{
|
||||||
@@ -42,8 +42,29 @@ namespace rtabmap
|
|||||||
namespace util3d
|
namespace util3d
|
||||||
{
|
{
|
||||||
|
|
||||||
cv::Mat RTABMAP_EXP downsample(
|
/**
|
||||||
const cv::Mat & cloud,
|
* Do some filtering approaches and try to
|
||||||
|
* avoid converting between pcl and opencv and to avoid not needed
|
||||||
|
* operations like computing normals while the scan has already
|
||||||
|
* normals and voxel filtering is not used.
|
||||||
|
*/
|
||||||
|
LaserScan RTABMAP_EXP commonFiltering(
|
||||||
|
const LaserScan & scan,
|
||||||
|
int downsamplingStep,
|
||||||
|
float rangeMin = 0.0f,
|
||||||
|
float rangeMax = 0.0f,
|
||||||
|
float voxelSize = 0.0f,
|
||||||
|
int normalK = 0,
|
||||||
|
float normalRadius = 0.0f,
|
||||||
|
bool forceGroundNormalsUp = false);
|
||||||
|
|
||||||
|
LaserScan RTABMAP_EXP rangeFiltering(
|
||||||
|
const LaserScan & scan,
|
||||||
|
float rangeMin,
|
||||||
|
float rangeMax);
|
||||||
|
|
||||||
|
LaserScan RTABMAP_EXP downsample(
|
||||||
|
const LaserScan & cloud,
|
||||||
int step);
|
int step);
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP downsample(
|
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP downsample(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
@@ -51,6 +72,12 @@ pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP downsample(
|
|||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP downsample(
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP downsample(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
int step);
|
int step);
|
||||||
|
pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP downsample(
|
||||||
|
const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
|
||||||
|
int step);
|
||||||
|
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP downsample(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
||||||
|
int step);
|
||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP voxelize(
|
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP voxelize(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
@@ -68,6 +95,14 @@ pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP voxelize(
|
|||||||
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
float voxelSize);
|
float voxelSize);
|
||||||
|
pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP voxelize(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
float voxelSize);
|
||||||
|
pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP voxelize(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
float voxelSize);
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP voxelize(
|
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP voxelize(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
float voxelSize);
|
float voxelSize);
|
||||||
@@ -80,6 +115,12 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP voxelize(
|
|||||||
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP voxelize(
|
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP voxelize(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
||||||
float voxelSize);
|
float voxelSize);
|
||||||
|
pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP voxelize(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
|
||||||
|
float voxelSize);
|
||||||
|
pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP voxelize(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
|
||||||
|
float voxelSize);
|
||||||
|
|
||||||
inline pcl::PointCloud<pcl::PointXYZ>::Ptr uniformSampling(
|
inline pcl::PointCloud<pcl::PointXYZ>::Ptr uniformSampling(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
@@ -123,6 +164,34 @@ pcl::IndicesPtr RTABMAP_EXP passThrough(
|
|||||||
float min,
|
float min,
|
||||||
float max,
|
float max,
|
||||||
bool negative = false);
|
bool negative = false);
|
||||||
|
pcl::IndicesPtr RTABMAP_EXP passThrough(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
const std::string & axis,
|
||||||
|
float min,
|
||||||
|
float max,
|
||||||
|
bool negative = false);
|
||||||
|
pcl::IndicesPtr RTABMAP_EXP passThrough(
|
||||||
|
const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
const std::string & axis,
|
||||||
|
float min,
|
||||||
|
float max,
|
||||||
|
bool negative = false);
|
||||||
|
pcl::IndicesPtr RTABMAP_EXP passThrough(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
const std::string & axis,
|
||||||
|
float min,
|
||||||
|
float max,
|
||||||
|
bool negative = false);
|
||||||
|
pcl::IndicesPtr RTABMAP_EXP passThrough(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
const std::string & axis,
|
||||||
|
float min,
|
||||||
|
float max,
|
||||||
|
bool negative = false);
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP passThrough(
|
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP passThrough(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
const std::string & axis,
|
const std::string & axis,
|
||||||
@@ -135,12 +204,30 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP passThrough(
|
|||||||
float min,
|
float min,
|
||||||
float max,
|
float max,
|
||||||
bool negative = false);
|
bool negative = false);
|
||||||
|
pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP passThrough(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
|
||||||
|
const std::string & axis,
|
||||||
|
float min,
|
||||||
|
float max,
|
||||||
|
bool negative = false);
|
||||||
pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP passThrough(
|
pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP passThrough(
|
||||||
const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
|
||||||
const std::string & axis,
|
const std::string & axis,
|
||||||
float min,
|
float min,
|
||||||
float max,
|
float max,
|
||||||
bool negative = false);
|
bool negative = false);
|
||||||
|
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP passThrough(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
||||||
|
const std::string & axis,
|
||||||
|
float min,
|
||||||
|
float max,
|
||||||
|
bool negative = false);
|
||||||
|
pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP passThrough(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
|
||||||
|
const std::string & axis,
|
||||||
|
float min,
|
||||||
|
float max,
|
||||||
|
bool negative = false);
|
||||||
|
|
||||||
pcl::IndicesPtr RTABMAP_EXP cropBox(
|
pcl::IndicesPtr RTABMAP_EXP cropBox(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
@@ -149,6 +236,13 @@ pcl::IndicesPtr RTABMAP_EXP cropBox(
|
|||||||
const Eigen::Vector4f & max,
|
const Eigen::Vector4f & max,
|
||||||
const Transform & transform = Transform::getIdentity(),
|
const Transform & transform = Transform::getIdentity(),
|
||||||
bool negative = false);
|
bool negative = false);
|
||||||
|
pcl::IndicesPtr RTABMAP_EXP cropBox(
|
||||||
|
const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
const Eigen::Vector4f & min,
|
||||||
|
const Eigen::Vector4f & max,
|
||||||
|
const Transform & transform = Transform::getIdentity(),
|
||||||
|
bool negative = false);
|
||||||
pcl::IndicesPtr RTABMAP_EXP cropBox(
|
pcl::IndicesPtr RTABMAP_EXP cropBox(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
@@ -156,18 +250,37 @@ pcl::IndicesPtr RTABMAP_EXP cropBox(
|
|||||||
const Eigen::Vector4f & max,
|
const Eigen::Vector4f & max,
|
||||||
const Transform & transform = Transform::getIdentity(),
|
const Transform & transform = Transform::getIdentity(),
|
||||||
bool negative = false);
|
bool negative = false);
|
||||||
|
pcl::IndicesPtr RTABMAP_EXP cropBox(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
const Eigen::Vector4f & min,
|
||||||
|
const Eigen::Vector4f & max,
|
||||||
|
const Transform & transform = Transform::getIdentity(),
|
||||||
|
bool negative = false);
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP cropBox(
|
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP cropBox(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
const Eigen::Vector4f & min,
|
const Eigen::Vector4f & min,
|
||||||
const Eigen::Vector4f & max,
|
const Eigen::Vector4f & max,
|
||||||
const Transform & transform = Transform::getIdentity(),
|
const Transform & transform = Transform::getIdentity(),
|
||||||
bool negative = false);
|
bool negative = false);
|
||||||
|
pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP cropBox(
|
||||||
|
const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
|
||||||
|
const Eigen::Vector4f & min,
|
||||||
|
const Eigen::Vector4f & max,
|
||||||
|
const Transform & transform = Transform::getIdentity(),
|
||||||
|
bool negative = false);
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP cropBox(
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP cropBox(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
const Eigen::Vector4f & min,
|
const Eigen::Vector4f & min,
|
||||||
const Eigen::Vector4f & max,
|
const Eigen::Vector4f & max,
|
||||||
const Transform & transform = Transform::getIdentity(),
|
const Transform & transform = Transform::getIdentity(),
|
||||||
bool negative = false);
|
bool negative = false);
|
||||||
|
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP cropBox(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
||||||
|
const Eigen::Vector4f & min,
|
||||||
|
const Eigen::Vector4f & max,
|
||||||
|
const Transform & transform = Transform::getIdentity(),
|
||||||
|
bool negative = false);
|
||||||
|
|
||||||
//Note: This assumes a coordinate system where X is forward, * Y is up, and Z is right.
|
//Note: This assumes a coordinate system where X is forward, * Y is up, and Z is right.
|
||||||
pcl::IndicesPtr RTABMAP_EXP frustumFiltering(
|
pcl::IndicesPtr RTABMAP_EXP frustumFiltering(
|
||||||
@@ -431,6 +544,13 @@ pcl::IndicesPtr RTABMAP_EXP normalFiltering(
|
|||||||
const Eigen::Vector4f & normal,
|
const Eigen::Vector4f & normal,
|
||||||
int normalKSearch,
|
int normalKSearch,
|
||||||
const Eigen::Vector4f & viewpoint);
|
const Eigen::Vector4f & viewpoint);
|
||||||
|
pcl::IndicesPtr RTABMAP_EXP normalFiltering(
|
||||||
|
const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
float angleMax,
|
||||||
|
const Eigen::Vector4f & normal,
|
||||||
|
int normalKSearch,
|
||||||
|
const Eigen::Vector4f & viewpoint);
|
||||||
pcl::IndicesPtr RTABMAP_EXP normalFiltering(
|
pcl::IndicesPtr RTABMAP_EXP normalFiltering(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
@@ -474,6 +594,13 @@ std::vector<pcl::IndicesPtr> RTABMAP_EXP extractClusters(
|
|||||||
int minClusterSize,
|
int minClusterSize,
|
||||||
int maxClusterSize = std::numeric_limits<int>::max(),
|
int maxClusterSize = std::numeric_limits<int>::max(),
|
||||||
int * biggestClusterIndex = 0);
|
int * biggestClusterIndex = 0);
|
||||||
|
std::vector<pcl::IndicesPtr> RTABMAP_EXP extractClusters(
|
||||||
|
const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
float clusterTolerance,
|
||||||
|
int minClusterSize,
|
||||||
|
int maxClusterSize = std::numeric_limits<int>::max(),
|
||||||
|
int * biggestClusterIndex = 0);
|
||||||
std::vector<pcl::IndicesPtr> RTABMAP_EXP extractClusters(
|
std::vector<pcl::IndicesPtr> RTABMAP_EXP extractClusters(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
@@ -493,6 +620,10 @@ pcl::IndicesPtr RTABMAP_EXP extractIndices(
|
|||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
bool negative);
|
bool negative);
|
||||||
|
pcl::IndicesPtr RTABMAP_EXP extractIndices(
|
||||||
|
const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
bool negative);
|
||||||
pcl::IndicesPtr RTABMAP_EXP extractIndices(
|
pcl::IndicesPtr RTABMAP_EXP extractIndices(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
@@ -512,6 +643,12 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP extractIndices(
|
|||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
bool negative,
|
bool negative,
|
||||||
bool keepOrganized);
|
bool keepOrganized);
|
||||||
|
// PCL default lacks of pcl::PointNormal type support
|
||||||
|
//pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP extractIndices(
|
||||||
|
// const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
|
||||||
|
// const pcl::IndicesPtr & indices,
|
||||||
|
// bool negative,
|
||||||
|
// bool keepOrganized);
|
||||||
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP extractIndices(
|
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP extractIndices(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ namespace util3d
|
|||||||
|
|
||||||
RTABMAP_DEPRECATED(void RTABMAP_EXP occupancy2DFromLaserScan(
|
RTABMAP_DEPRECATED(void RTABMAP_EXP occupancy2DFromLaserScan(
|
||||||
const cv::Mat & scan, // in /base_link frame
|
const cv::Mat & scan, // in /base_link frame
|
||||||
cv::Mat & ground,
|
cv::Mat & empty,
|
||||||
cv::Mat & obstacles,
|
cv::Mat & occupied,
|
||||||
float cellSize,
|
float cellSize,
|
||||||
bool unknownSpaceFilled = false,
|
bool unknownSpaceFilled = false,
|
||||||
float scanMaxRange = 0.0f), "Use interface with \"viewpoint\" parameter to make sure the ray tracing origin is from the sensor and not the base.");
|
float scanMaxRange = 0.0f), "Use interface with \"viewpoint\" parameter to make sure the ray tracing origin is from the sensor and not the base.");
|
||||||
@@ -54,8 +54,8 @@ RTABMAP_DEPRECATED(void RTABMAP_EXP occupancy2DFromLaserScan(
|
|||||||
RTABMAP_DEPRECATED(void RTABMAP_EXP occupancy2DFromLaserScan(
|
RTABMAP_DEPRECATED(void RTABMAP_EXP occupancy2DFromLaserScan(
|
||||||
const cv::Mat & scan, // in /base_link frame
|
const cv::Mat & scan, // in /base_link frame
|
||||||
const cv::Point3f & viewpoint, // /base_link -> /base_scan
|
const cv::Point3f & viewpoint, // /base_link -> /base_scan
|
||||||
cv::Mat & ground,
|
cv::Mat & empty,
|
||||||
cv::Mat & obstacles,
|
cv::Mat & occupied,
|
||||||
float cellSize,
|
float cellSize,
|
||||||
bool unknownSpaceFilled = false,
|
bool unknownSpaceFilled = false,
|
||||||
float scanMaxRange = 0.0f), "Use interface with scanHit/scanNoHit parameters: scanNoHit set to null matrix has the same functionality than this method.");
|
float scanMaxRange = 0.0f), "Use interface with scanHit/scanNoHit parameters: scanNoHit set to null matrix has the same functionality than this method.");
|
||||||
@@ -64,8 +64,8 @@ void RTABMAP_EXP occupancy2DFromLaserScan(
|
|||||||
const cv::Mat & scanHit, // in /base_link frame
|
const cv::Mat & scanHit, // in /base_link frame
|
||||||
const cv::Mat & scanNoHit, // in /base_link frame
|
const cv::Mat & scanNoHit, // in /base_link frame
|
||||||
const cv::Point3f & viewpoint, // /base_link -> /base_scan
|
const cv::Point3f & viewpoint, // /base_link -> /base_scan
|
||||||
cv::Mat & ground,
|
cv::Mat & empty,
|
||||||
cv::Mat & obstacles,
|
cv::Mat & occupied,
|
||||||
float cellSize,
|
float cellSize,
|
||||||
bool unknownSpaceFilled = false,
|
bool unknownSpaceFilled = false,
|
||||||
float scanMaxRange = 0.0f); // would be set if unknownSpaceFilled=true
|
float scanMaxRange = 0.0f); // would be set if unknownSpaceFilled=true
|
||||||
@@ -114,7 +114,8 @@ void RTABMAP_EXP rayTrace(const cv::Point2i & start,
|
|||||||
cv::Mat & grid,
|
cv::Mat & grid,
|
||||||
bool stopOnObstacle);
|
bool stopOnObstacle);
|
||||||
|
|
||||||
cv::Mat RTABMAP_EXP convertMap2Image8U(const cv::Mat & map8S);
|
cv::Mat RTABMAP_EXP convertMap2Image8U(const cv::Mat & map8S, bool pgmFormat = false);
|
||||||
|
cv::Mat RTABMAP_EXP convertImage8U2Map(const cv::Mat & map8U, bool pgmFormat = false);
|
||||||
|
|
||||||
cv::Mat RTABMAP_EXP erodeMap(const cv::Mat & map);
|
cv::Mat RTABMAP_EXP erodeMap(const cv::Mat & map);
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ void RTABMAP_EXP computeVarianceAndCorrespondences(
|
|||||||
const pcl::PointCloud<pcl::PointNormal>::ConstPtr & cloudA,
|
const pcl::PointCloud<pcl::PointNormal>::ConstPtr & cloudA,
|
||||||
const pcl::PointCloud<pcl::PointNormal>::ConstPtr & cloudB,
|
const pcl::PointCloud<pcl::PointNormal>::ConstPtr & cloudB,
|
||||||
double maxCorrespondenceDistance,
|
double maxCorrespondenceDistance,
|
||||||
|
double maxCorrespondenceAngle, // <=0 means that we don't care about normal angle difference
|
||||||
double & variance,
|
double & variance,
|
||||||
int & correspondencesOut);
|
int & correspondencesOut);
|
||||||
void RTABMAP_EXP computeVarianceAndCorrespondences(
|
void RTABMAP_EXP computeVarianceAndCorrespondences(
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <rtabmap/core/Transform.h>
|
#include <rtabmap/core/Transform.h>
|
||||||
#include <rtabmap/core/CameraModel.h>
|
#include <rtabmap/core/CameraModel.h>
|
||||||
#include <rtabmap/core/ProgressState.h>
|
#include <rtabmap/core/ProgressState.h>
|
||||||
|
#include <rtabmap/core/LaserScan.h>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
@@ -174,6 +175,15 @@ pcl::TextureMesh::Ptr RTABMAP_EXP concatenateTextureMeshes(
|
|||||||
void RTABMAP_EXP concatenateTextureMaterials(
|
void RTABMAP_EXP concatenateTextureMaterials(
|
||||||
pcl::TextureMesh & mesh, const cv::Size & imageSize, int textureSize, int maxTextures, float & scale, std::vector<bool> * materialsKept=0);
|
pcl::TextureMesh & mesh, const cv::Size & imageSize, int textureSize, int maxTextures, float & scale, std::vector<bool> * materialsKept=0);
|
||||||
|
|
||||||
|
std::vector<std::vector<unsigned int> > RTABMAP_EXP convertPolygonsFromPCL(
|
||||||
|
const std::vector<pcl::Vertices> & polygons);
|
||||||
|
std::vector<std::vector<std::vector<unsigned int> > > RTABMAP_EXP convertPolygonsFromPCL(
|
||||||
|
const std::vector<std::vector<pcl::Vertices> > & polygons);
|
||||||
|
std::vector<pcl::Vertices> RTABMAP_EXP convertPolygonsToPCL(
|
||||||
|
const std::vector<std::vector<unsigned int> > & polygons);
|
||||||
|
std::vector<std::vector<pcl::Vertices> > RTABMAP_EXP convertPolygonsToPCL(
|
||||||
|
const std::vector<std::vector<std::vector<unsigned int> > > & tex_polygons);
|
||||||
|
|
||||||
pcl::TextureMesh::Ptr RTABMAP_EXP assembleTextureMesh(
|
pcl::TextureMesh::Ptr RTABMAP_EXP assembleTextureMesh(
|
||||||
const cv::Mat & cloudMat,
|
const cv::Mat & cloudMat,
|
||||||
const std::vector<std::vector<std::vector<unsigned int> > > & polygons,
|
const std::vector<std::vector<std::vector<unsigned int> > > & polygons,
|
||||||
@@ -193,6 +203,24 @@ pcl::PolygonMesh::Ptr RTABMAP_EXP assemblePolygonMesh(
|
|||||||
* Merge all textures in the mesh into "textureCount" textures of size "textureSize".
|
* Merge all textures in the mesh into "textureCount" textures of size "textureSize".
|
||||||
* @return merged textures corresponding to new materials set in TextureMesh (height=textureSize, width=textureSize*materials)
|
* @return merged textures corresponding to new materials set in TextureMesh (height=textureSize, width=textureSize*materials)
|
||||||
*/
|
*/
|
||||||
|
cv::Mat RTABMAP_EXP mergeTextures(
|
||||||
|
pcl::TextureMesh & mesh,
|
||||||
|
const std::map<int, cv::Mat> & images, // raw or compressed, can be empty if memory or dbDriver should be used
|
||||||
|
const std::map<int, CameraModel> & calibrations, // Should match images
|
||||||
|
const Memory * memory = 0, // Should be set if images are not set
|
||||||
|
const DBDriver * dbDriver = 0, // Should be set if images and memory are not set
|
||||||
|
int textureSize = 4096,
|
||||||
|
int textureCount = 1,
|
||||||
|
const std::vector<std::map<int, pcl::PointXY> > & vertexToPixels = std::vector<std::map<int, pcl::PointXY> >(), // needed for parameters below
|
||||||
|
bool gainCompensation = true,
|
||||||
|
float gainBeta = 10.0f,
|
||||||
|
bool gainRGB = true, //Do gain compensation on each channel
|
||||||
|
bool blending = true,
|
||||||
|
int blendingDecimation = 0, //0=auto depending on projected polygon size and texture size
|
||||||
|
int brightnessContrastRatioLow = 0, //0=disabled, values between 0 and 100
|
||||||
|
int brightnessContrastRatioHigh = 0, //0=disabled, values between 0 and 100
|
||||||
|
bool exposureFusion = false, //Exposure fusion can be used only with OpenCV3
|
||||||
|
const ProgressState * state = 0);
|
||||||
cv::Mat RTABMAP_EXP mergeTextures(
|
cv::Mat RTABMAP_EXP mergeTextures(
|
||||||
pcl::TextureMesh & mesh,
|
pcl::TextureMesh & mesh,
|
||||||
const std::map<int, cv::Mat> & images, // raw or compressed, can be empty if memory or dbDriver should be used
|
const std::map<int, cv::Mat> & images, // raw or compressed, can be empty if memory or dbDriver should be used
|
||||||
@@ -212,38 +240,99 @@ cv::Mat RTABMAP_EXP mergeTextures(
|
|||||||
bool exposureFusion = false, //Exposure fusion can be used only with OpenCV3
|
bool exposureFusion = false, //Exposure fusion can be used only with OpenCV3
|
||||||
const ProgressState * state = 0);
|
const ProgressState * state = 0);
|
||||||
|
|
||||||
|
void RTABMAP_EXP fixTextureMeshForVisualization(pcl::TextureMesh & textureMesh);
|
||||||
|
|
||||||
|
cv::Mat RTABMAP_EXP computeNormals(
|
||||||
|
const cv::Mat & laserScan,
|
||||||
|
int searchK,
|
||||||
|
float searchRadius);
|
||||||
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeNormals(
|
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeNormals(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
int normalKSearch = 20,
|
int searchK = 20,
|
||||||
|
float searchRadius = 0.0f,
|
||||||
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
||||||
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeNormals(
|
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeNormals(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
int normalKSearch = 20,
|
int searchK = 20,
|
||||||
|
float searchRadius = 0.0f,
|
||||||
|
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
||||||
|
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeNormals(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
|
||||||
|
int searchK = 20,
|
||||||
|
float searchRadius = 0.0f,
|
||||||
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
||||||
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeNormals(
|
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeNormals(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
int normalKSearch = 20,
|
int searchK = 20,
|
||||||
|
float searchRadius = 0.0f,
|
||||||
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
||||||
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeNormals(
|
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeNormals(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
int normalKSearch = 20,
|
int searchK = 20,
|
||||||
|
float searchRadius = 0.0f,
|
||||||
|
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
||||||
|
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeNormals(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
int searchK = 20,
|
||||||
|
float searchRadius = 0.0f,
|
||||||
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
||||||
|
|
||||||
pcl::PointCloud<pcl::Normal>::Ptr computeFastOrganizedNormals(
|
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeNormals2D(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
|
int searchK = 5,
|
||||||
|
float searchRadius = 0.0f,
|
||||||
|
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
||||||
|
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeNormals2D(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
|
||||||
|
int searchK = 5,
|
||||||
|
float searchRadius = 0.0f,
|
||||||
|
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
||||||
|
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeFastOrganizedNormals2D(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
|
int searchK = 5,
|
||||||
|
float searchRadius = 0.0f,
|
||||||
|
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
||||||
|
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeFastOrganizedNormals2D(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
|
||||||
|
int searchK = 5,
|
||||||
|
float searchRadius = 0.0f,
|
||||||
|
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
||||||
|
|
||||||
|
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeFastOrganizedNormals(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
float maxDepthChangeFactor = 0.02f,
|
float maxDepthChangeFactor = 0.02f,
|
||||||
float normalSmoothingSize = 10.0f,
|
float normalSmoothingSize = 10.0f,
|
||||||
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
||||||
pcl::PointCloud<pcl::Normal>::Ptr computeFastOrganizedNormals(
|
pcl::PointCloud<pcl::Normal>::Ptr RTABMAP_EXP computeFastOrganizedNormals(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
float maxDepthChangeFactor = 0.02f,
|
float maxDepthChangeFactor = 0.02f,
|
||||||
float normalSmoothingSize = 10.0f,
|
float normalSmoothingSize = 10.0f,
|
||||||
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
const Eigen::Vector3f & viewPoint = Eigen::Vector3f(0,0,0));
|
||||||
|
|
||||||
|
float RTABMAP_EXP computeNormalsComplexity(
|
||||||
|
const LaserScan & scan,
|
||||||
|
cv::Mat * pcaEigenVectors = 0,
|
||||||
|
cv::Mat * pcaEigenValues = 0);
|
||||||
|
float RTABMAP_EXP computeNormalsComplexity(
|
||||||
|
const pcl::PointCloud<pcl::Normal> & normals,
|
||||||
|
bool is2d = false,
|
||||||
|
cv::Mat * pcaEigenVectors = 0,
|
||||||
|
cv::Mat * pcaEigenValues = 0);
|
||||||
|
float RTABMAP_EXP computeNormalsComplexity(
|
||||||
|
const pcl::PointCloud<pcl::PointNormal> & cloud,
|
||||||
|
bool is2d = false,
|
||||||
|
cv::Mat * pcaEigenVectors = 0,
|
||||||
|
cv::Mat * pcaEigenValues = 0);
|
||||||
|
float RTABMAP_EXP computeNormalsComplexity(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZRGBNormal> & cloud,
|
||||||
|
bool is2d = false,
|
||||||
|
cv::Mat * pcaEigenVectors = 0,
|
||||||
|
cv::Mat * pcaEigenValues = 0);
|
||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP mls(
|
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP mls(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
float searchRadius = 0.0f,
|
float searchRadius = 0.0f,
|
||||||
@@ -266,6 +355,18 @@ pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP mls(
|
|||||||
float dilationVoxelSize = 1.0f, // VOXEL_GRID_DILATION
|
float dilationVoxelSize = 1.0f, // VOXEL_GRID_DILATION
|
||||||
int dilationIterations = 0); // VOXEL_GRID_DILATION
|
int dilationIterations = 0); // VOXEL_GRID_DILATION
|
||||||
|
|
||||||
|
LaserScan RTABMAP_EXP adjustNormalsToViewPoint(
|
||||||
|
const LaserScan & scan,
|
||||||
|
const Eigen::Vector3f & viewpoint,
|
||||||
|
bool forceGroundNormalsUp);
|
||||||
|
void RTABMAP_EXP adjustNormalsToViewPoint(
|
||||||
|
pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
|
||||||
|
const Eigen::Vector3f & viewpoint = Eigen::Vector3f(0,0,0),
|
||||||
|
bool forceGroundNormalsUp = false);
|
||||||
|
void RTABMAP_EXP adjustNormalsToViewPoint(
|
||||||
|
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
||||||
|
const Eigen::Vector3f & viewpoint = Eigen::Vector3f(0,0,0),
|
||||||
|
bool forceGroundNormalsUp = false);
|
||||||
void RTABMAP_EXP adjustNormalsToViewPoints(
|
void RTABMAP_EXP adjustNormalsToViewPoints(
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & rawCloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & rawCloud,
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <pcl/point_types.h>
|
#include <pcl/point_types.h>
|
||||||
#include <pcl/pcl_base.h>
|
#include <pcl/pcl_base.h>
|
||||||
#include <rtabmap/core/Transform.h>
|
#include <rtabmap/core/Transform.h>
|
||||||
|
#include <rtabmap/core/LaserScan.h>
|
||||||
|
|
||||||
namespace rtabmap
|
namespace rtabmap
|
||||||
{
|
{
|
||||||
@@ -41,15 +42,15 @@ namespace rtabmap
|
|||||||
namespace util3d
|
namespace util3d
|
||||||
{
|
{
|
||||||
|
|
||||||
cv::Mat RTABMAP_EXP transformLaserScan(
|
LaserScan RTABMAP_EXP transformLaserScan(
|
||||||
const cv::Mat & laserScan,
|
const LaserScan & laserScan,
|
||||||
const Transform & transform);
|
const Transform & transform);
|
||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP transformPointCloud(
|
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP transformPointCloud(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
const Transform & transform);
|
const Transform & transform);
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP transformPointCloud(
|
pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP transformPointCloud(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
|
||||||
const Transform & transform);
|
const Transform & transform);
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP transformPointCloud(
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP transformPointCloud(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
@@ -60,13 +61,16 @@ pcl::PointCloud<pcl::PointNormal>::Ptr RTABMAP_EXP transformPointCloud(
|
|||||||
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP transformPointCloud(
|
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP transformPointCloud(
|
||||||
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
||||||
const Transform & transform);
|
const Transform & transform);
|
||||||
|
pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP transformPointCloud(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
|
||||||
|
const Transform & transform);
|
||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP transformPointCloud(
|
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP transformPointCloud(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
const Transform & transform);
|
const Transform & transform);
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr RTABMAP_EXP transformPointCloud(
|
pcl::PointCloud<pcl::PointXYZI>::Ptr RTABMAP_EXP transformPointCloud(
|
||||||
const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
const Transform & transform);
|
const Transform & transform);
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP transformPointCloud(
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr RTABMAP_EXP transformPointCloud(
|
||||||
@@ -81,6 +85,10 @@ pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr RTABMAP_EXP transformPointCloud(
|
|||||||
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
|
||||||
const pcl::IndicesPtr & indices,
|
const pcl::IndicesPtr & indices,
|
||||||
const Transform & transform);
|
const Transform & transform);
|
||||||
|
pcl::PointCloud<pcl::PointXYZINormal>::Ptr RTABMAP_EXP transformPointCloud(
|
||||||
|
const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
const Transform & transform);
|
||||||
|
|
||||||
cv::Point3f RTABMAP_EXP transformPoint(
|
cv::Point3f RTABMAP_EXP transformPoint(
|
||||||
const cv::Point3f & pt,
|
const cv::Point3f & pt,
|
||||||
@@ -88,6 +96,9 @@ cv::Point3f RTABMAP_EXP transformPoint(
|
|||||||
pcl::PointXYZ RTABMAP_EXP transformPoint(
|
pcl::PointXYZ RTABMAP_EXP transformPoint(
|
||||||
const pcl::PointXYZ & pt,
|
const pcl::PointXYZ & pt,
|
||||||
const Transform & transform);
|
const Transform & transform);
|
||||||
|
pcl::PointXYZI RTABMAP_EXP transformPoint(
|
||||||
|
const pcl::PointXYZI & pt,
|
||||||
|
const Transform & transform);
|
||||||
pcl::PointXYZRGB RTABMAP_EXP transformPoint(
|
pcl::PointXYZRGB RTABMAP_EXP transformPoint(
|
||||||
const pcl::PointXYZRGB & pt,
|
const pcl::PointXYZRGB & pt,
|
||||||
const Transform & transform);
|
const Transform & transform);
|
||||||
@@ -97,6 +108,9 @@ pcl::PointNormal RTABMAP_EXP transformPoint(
|
|||||||
pcl::PointXYZRGBNormal RTABMAP_EXP transformPoint(
|
pcl::PointXYZRGBNormal RTABMAP_EXP transformPoint(
|
||||||
const pcl::PointXYZRGBNormal & point,
|
const pcl::PointXYZRGBNormal & point,
|
||||||
const Transform & transform);
|
const Transform & transform);
|
||||||
|
pcl::PointXYZINormal RTABMAP_EXP transformPoint(
|
||||||
|
const pcl::PointXYZINormal & point,
|
||||||
|
const Transform & transform);
|
||||||
|
|
||||||
} // namespace util3d
|
} // namespace util3d
|
||||||
} // namespace rtabmap
|
} // namespace rtabmap
|
||||||
|
|||||||
+130
-84
@@ -30,6 +30,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "rtabmap/core/Signature.h"
|
#include "rtabmap/core/Signature.h"
|
||||||
#include "rtabmap/core/Parameters.h"
|
#include "rtabmap/core/Parameters.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <set>
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <unordered_set>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "rtabmap/utilite/UtiLite.h"
|
#include "rtabmap/utilite/UtiLite.h"
|
||||||
|
|
||||||
@@ -125,6 +130,7 @@ void BayesFilter::reset()
|
|||||||
{
|
{
|
||||||
_posterior.clear();
|
_posterior.clear();
|
||||||
_prediction = cv::Mat();
|
_prediction = cv::Mat();
|
||||||
|
_neighborsIndex.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::map<int, float> & BayesFilter::computePosterior(const Memory * memory, const std::map<int, float> & likelihood)
|
const std::map<int, float> & BayesFilter::computePosterior(const Memory * memory, const std::map<int, float> & likelihood)
|
||||||
@@ -219,7 +225,43 @@ const std::map<int, float> & BayesFilter::computePosterior(const Memory * memory
|
|||||||
return _posterior;
|
return _posterior;
|
||||||
}
|
}
|
||||||
|
|
||||||
cv::Mat BayesFilter::generatePrediction(const Memory * memory, const std::vector<int> & ids) const
|
float addNeighborProb(cv::Mat & prediction,
|
||||||
|
unsigned int col,
|
||||||
|
const std::map<int, int> & neighbors,
|
||||||
|
const std::vector<double> & predictionLC,
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
const std::unordered_map<int, int> & idToIndex
|
||||||
|
#else
|
||||||
|
const std::map<int, int> & idToIndex
|
||||||
|
#endif
|
||||||
|
)
|
||||||
|
{
|
||||||
|
UASSERT(col < (unsigned int)prediction.cols &&
|
||||||
|
col < (unsigned int)prediction.rows);
|
||||||
|
|
||||||
|
float sum=0.0f;
|
||||||
|
float * dataPtr = (float*)prediction.data;
|
||||||
|
for(std::map<int, int>::const_iterator iter=neighbors.begin(); iter!=neighbors.end(); ++iter)
|
||||||
|
{
|
||||||
|
if(iter->first>=0)
|
||||||
|
{
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
std::unordered_map<int, int>::const_iterator jter = idToIndex.find(iter->first);
|
||||||
|
#else
|
||||||
|
std::map<int, int>::const_iterator jter = idToIndex.find(iter->first);
|
||||||
|
#endif
|
||||||
|
if(jter != idToIndex.end())
|
||||||
|
{
|
||||||
|
UASSERT((iter->second+1) < (int)predictionLC.size());
|
||||||
|
sum += dataPtr[col + jter->second*prediction.cols] = predictionLC[iter->second+1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
cv::Mat BayesFilter::generatePrediction(const Memory * memory, const std::vector<int> & ids)
|
||||||
{
|
{
|
||||||
if(!_fullPredictionUpdate && !_prediction.empty())
|
if(!_fullPredictionUpdate && !_prediction.empty())
|
||||||
{
|
{
|
||||||
@@ -236,13 +278,21 @@ cv::Mat BayesFilter::generatePrediction(const Memory * memory, const std::vector
|
|||||||
UTimer timerGlobal;
|
UTimer timerGlobal;
|
||||||
timerGlobal.start();
|
timerGlobal.start();
|
||||||
|
|
||||||
std::map<int, int> idToIndexMap;
|
#if __cplusplus >= 201103L
|
||||||
|
std::unordered_map<int,int> idToIndexMap;
|
||||||
|
idToIndexMap.reserve(ids.size());
|
||||||
|
#else
|
||||||
|
std::map<int,int> idToIndexMap;
|
||||||
|
#endif
|
||||||
for(unsigned int i=0; i<ids.size(); ++i)
|
for(unsigned int i=0; i<ids.size(); ++i)
|
||||||
{
|
{
|
||||||
UASSERT_MSG(ids[i] != 0, "Signature id is null ?!?");
|
if(ids[i]>0)
|
||||||
idToIndexMap.insert(idToIndexMap.end(), std::make_pair(ids[i], i));
|
{
|
||||||
|
idToIndexMap[ids[i]] = i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//int rows = prediction.rows;
|
//int rows = prediction.rows;
|
||||||
cv::Mat prediction = cv::Mat::zeros(ids.size(), ids.size(), CV_32FC1);
|
cv::Mat prediction = cv::Mat::zeros(ids.size(), ids.size(), CV_32FC1);
|
||||||
int cols = prediction.cols;
|
int cols = prediction.cols;
|
||||||
@@ -260,7 +310,13 @@ cv::Mat BayesFilter::generatePrediction(const Memory * memory, const std::vector
|
|||||||
// Set high values (gaussians curves) to loop closure neighbors
|
// Set high values (gaussians curves) to loop closure neighbors
|
||||||
|
|
||||||
// ADD prob for each neighbors
|
// ADD prob for each neighbors
|
||||||
std::map<int, int> neighbors = memory->getNeighborsId(ids[i], _predictionLC.size()-1, 0, false, false, true);
|
std::map<int, int> neighbors = memory->getNeighborsId(ids[i], _predictionLC.size()-1, 0, false, false, true, true);
|
||||||
|
|
||||||
|
if(!_fullPredictionUpdate)
|
||||||
|
{
|
||||||
|
uInsert(_neighborsIndex, std::make_pair(ids[i], neighbors));
|
||||||
|
}
|
||||||
|
|
||||||
std::list<int> idsLoopMargin;
|
std::list<int> idsLoopMargin;
|
||||||
//filter neighbors in STM
|
//filter neighbors in STM
|
||||||
for(std::map<int, int>::iterator iter=neighbors.begin(); iter!=neighbors.end();)
|
for(std::map<int, int>::iterator iter=neighbors.begin(); iter!=neighbors.end();)
|
||||||
@@ -271,7 +327,7 @@ cv::Mat BayesFilter::generatePrediction(const Memory * memory, const std::vector
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(iter->second == 0)
|
if(iter->second == 0 && idToIndexMap.find(iter->first)!=idToIndexMap.end())
|
||||||
{
|
{
|
||||||
idsLoopMargin.push_back(iter->first);
|
idsLoopMargin.push_back(iter->first);
|
||||||
}
|
}
|
||||||
@@ -288,10 +344,16 @@ cv::Mat BayesFilter::generatePrediction(const Memory * memory, const std::vector
|
|||||||
// same neighbor tree for loop signatures (margin = 0)
|
// same neighbor tree for loop signatures (margin = 0)
|
||||||
for(std::list<int>::iterator iter = idsLoopMargin.begin(); iter!=idsLoopMargin.end(); ++iter)
|
for(std::list<int>::iterator iter = idsLoopMargin.begin(); iter!=idsLoopMargin.end(); ++iter)
|
||||||
{
|
{
|
||||||
|
if(!_fullPredictionUpdate)
|
||||||
|
{
|
||||||
|
uInsert(_neighborsIndex, std::make_pair(*iter, neighbors));
|
||||||
|
}
|
||||||
|
|
||||||
float sum = 0.0f; // sum values added
|
float sum = 0.0f; // sum values added
|
||||||
sum += this->addNeighborProb(prediction, idToIndexMap.at(*iter), neighbors, idToIndexMap);
|
int index = idToIndexMap.at(*iter);
|
||||||
|
sum += addNeighborProb(prediction, index, neighbors, _predictionLC, idToIndexMap);
|
||||||
idsDone.insert(*iter);
|
idsDone.insert(*iter);
|
||||||
this->normalize(prediction, idToIndexMap.at(*iter), sum, ids[0]<0);
|
this->normalize(prediction, index, sum, ids[0]<0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -405,7 +467,7 @@ void BayesFilter::normalize(cv::Mat & prediction, unsigned int index, float adde
|
|||||||
cv::Mat BayesFilter::updatePrediction(const cv::Mat & oldPrediction,
|
cv::Mat BayesFilter::updatePrediction(const cv::Mat & oldPrediction,
|
||||||
const Memory * memory,
|
const Memory * memory,
|
||||||
const std::vector<int> & oldIds,
|
const std::vector<int> & oldIds,
|
||||||
const std::vector<int> & newIds) const
|
const std::vector<int> & newIds)
|
||||||
{
|
{
|
||||||
UTimer timer;
|
UTimer timer;
|
||||||
UDEBUG("");
|
UDEBUG("");
|
||||||
@@ -417,34 +479,40 @@ cv::Mat BayesFilter::updatePrediction(const cv::Mat & oldPrediction,
|
|||||||
oldIds.size() == (unsigned int)oldPrediction.rows);
|
oldIds.size() == (unsigned int)oldPrediction.rows);
|
||||||
|
|
||||||
cv::Mat prediction = cv::Mat::zeros(newIds.size(), newIds.size(), CV_32FC1);
|
cv::Mat prediction = cv::Mat::zeros(newIds.size(), newIds.size(), CV_32FC1);
|
||||||
|
UDEBUG("time creating prediction = %fs", timer.restart());
|
||||||
|
|
||||||
// Create id to index maps
|
// Create id to index maps
|
||||||
std::map<int, int> oldIdToIndexMap;
|
#if __cplusplus >= 201103L
|
||||||
std::map<int, int> newIdToIndexMap;
|
std::unordered_set<int> oldIdsSet(oldIds.begin(), oldIds.end());
|
||||||
for(unsigned int i=0; i<oldIds.size() || i<newIds.size(); ++i)
|
#else
|
||||||
|
std::set<int> oldIdsSet(oldIds.begin(), oldIds.end());
|
||||||
|
#endif
|
||||||
|
UDEBUG("time creating old ids set = %fs", timer.restart());
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
std::unordered_map<int,int> newIdToIndexMap;
|
||||||
|
newIdToIndexMap.reserve(newIds.size());
|
||||||
|
#else
|
||||||
|
std::map<int,int> newIdToIndexMap;
|
||||||
|
#endif
|
||||||
|
for(unsigned int i=0; i<newIds.size(); ++i)
|
||||||
{
|
{
|
||||||
if(i<oldIds.size())
|
if(newIds[i]>0)
|
||||||
{
|
{
|
||||||
UASSERT(oldIds[i]);
|
newIdToIndexMap[newIds[i]] = i;
|
||||||
oldIdToIndexMap.insert(oldIdToIndexMap.end(), std::make_pair(oldIds[i], i));
|
|
||||||
//UDEBUG("oldIdToIndexMap[%d] = %d", oldIds[i], i);
|
|
||||||
}
|
|
||||||
if(i<newIds.size())
|
|
||||||
{
|
|
||||||
UASSERT(newIds[i]);
|
|
||||||
newIdToIndexMap.insert(newIdToIndexMap.end(), std::make_pair(newIds[i], i));
|
|
||||||
//UDEBUG("newIdToIndexMap[%d] = %d", newIds[i], i);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UDEBUG("time creating id-index maps = %fs", timer.restart());
|
|
||||||
|
UDEBUG("time creating id-index vector (size=%d oldIds.back()=%d newIds.back()=%d) = %fs", (int)newIdToIndexMap.size(), oldIds.back(), newIds.back(), timer.restart());
|
||||||
|
|
||||||
//Get removed ids
|
//Get removed ids
|
||||||
std::set<int> removedIds;
|
std::set<int> removedIds;
|
||||||
for(unsigned int i=0; i<oldIds.size(); ++i)
|
for(unsigned int i=0; i<oldIds.size(); ++i)
|
||||||
{
|
{
|
||||||
if(!uContains(newIdToIndexMap, oldIds[i]))
|
if(oldIds[i] > 0 && newIdToIndexMap.find(oldIds[i]) == newIdToIndexMap.end())
|
||||||
{
|
{
|
||||||
removedIds.insert(removedIds.end(), oldIds[i]);
|
removedIds.insert(removedIds.end(), oldIds[i]);
|
||||||
|
_neighborsIndex.erase(oldIds[i]);
|
||||||
UDEBUG("removed id=%d at oldIndex=%d", oldIds[i], i);
|
UDEBUG("removed id=%d at oldIndex=%d", oldIds[i], i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -476,16 +544,32 @@ cv::Mat BayesFilter::updatePrediction(const cv::Mat & oldPrediction,
|
|||||||
UDEBUG("From removed id %d, %d neighbors to update.", oldIds[i], count);
|
UDEBUG("From removed id %d, %d neighbors to update.", oldIds[i], count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(i<newIds.size() && !uContains(oldIdToIndexMap,newIds[i]))
|
if(i<newIds.size() && oldIdsSet.find(newIds[i]) == oldIdsSet.end())
|
||||||
{
|
{
|
||||||
std::map<int, int> neighbors = memory->getNeighborsId(newIds[i], _predictionLC.size()-1, 0, false, false, true);
|
if(_neighborsIndex.find(newIds[i]) == _neighborsIndex.end())
|
||||||
float sum = this->addNeighborProb(prediction, i, neighbors, newIdToIndexMap);
|
{
|
||||||
|
std::map<int, int> neighbors = memory->getNeighborsId(newIds[i], _predictionLC.size()-1, 0, false, false, true, true);
|
||||||
|
|
||||||
|
for(std::map<int, int>::iterator iter=neighbors.begin(); iter!=neighbors.end(); ++iter)
|
||||||
|
{
|
||||||
|
std::map<int, std::map<int, int> >::iterator jter = _neighborsIndex.find(iter->first);
|
||||||
|
if(jter != _neighborsIndex.end())
|
||||||
|
{
|
||||||
|
uInsert(jter->second, std::make_pair(newIds[i], iter->second));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_neighborsIndex.insert(std::make_pair(newIds[i], neighbors));
|
||||||
|
}
|
||||||
|
const std::map<int, int> & neighbors = _neighborsIndex.at(newIds[i]);
|
||||||
|
//std::map<int, int> neighbors = memory->getNeighborsId(newIds[i], _predictionLC.size()-1, 0, false, false, true, true);
|
||||||
|
|
||||||
|
float sum = addNeighborProb(prediction, i, neighbors, _predictionLC, newIdToIndexMap);
|
||||||
this->normalize(prediction, i, sum, newIds[0]<0);
|
this->normalize(prediction, i, sum, newIds[0]<0);
|
||||||
++added;
|
++added;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for(std::map<int,int>::iterator iter=neighbors.begin(); iter!=neighbors.end(); ++iter)
|
for(std::map<int,int>::const_iterator iter=neighbors.begin(); iter!=neighbors.end(); ++iter)
|
||||||
{
|
{
|
||||||
if(uContains(oldIdToIndexMap, iter->first) &&
|
if(oldIdsSet.find(iter->first)!=oldIdsSet.end() &&
|
||||||
removedIds.find(iter->first) == removedIds.end())
|
removedIds.find(iter->first) == removedIds.end())
|
||||||
{
|
{
|
||||||
idsToUpdate.insert(iter->first);
|
idsToUpdate.insert(iter->first);
|
||||||
@@ -497,51 +581,33 @@ cv::Mat BayesFilter::updatePrediction(const cv::Mat & oldPrediction,
|
|||||||
}
|
}
|
||||||
UDEBUG("time getting %d ids to update = %fs", idsToUpdate.size(), timer.restart());
|
UDEBUG("time getting %d ids to update = %fs", idsToUpdate.size(), timer.restart());
|
||||||
|
|
||||||
|
UTimer t1;
|
||||||
|
double e0=0,e1=0, e2=0, e3=0, e4=0;
|
||||||
// update modified/added ids
|
// update modified/added ids
|
||||||
int modified = 0;
|
int modified = 0;
|
||||||
std::set<int> idsDone;
|
|
||||||
for(std::set<int>::iterator iter = idsToUpdate.begin(); iter!=idsToUpdate.end(); ++iter)
|
for(std::set<int>::iterator iter = idsToUpdate.begin(); iter!=idsToUpdate.end(); ++iter)
|
||||||
{
|
{
|
||||||
if(idsDone.find(*iter) == idsDone.end() && *iter > 0)
|
int id = *iter;
|
||||||
|
if(id > 0)
|
||||||
{
|
{
|
||||||
std::map<int, int> neighbors = memory->getNeighborsId(*iter, _predictionLC.size()-1, 0, false, false, true);
|
int index = newIdToIndexMap.at(id);
|
||||||
|
|
||||||
std::list<int> idsLoopMargin;
|
e0 = t1.ticks();
|
||||||
//filter neighbors in STM
|
std::map<int, std::map<int, int> >::iterator kter = _neighborsIndex.find(id);
|
||||||
for(std::map<int, int>::iterator jter=neighbors.begin(); jter!=neighbors.end();)
|
UASSERT_MSG(kter != _neighborsIndex.end(), uFormat("Did not find %d (current index size=%d)", id, (int)_neighborsIndex.size()).c_str());
|
||||||
{
|
const std::map<int, int> & neighbors = kter->second;
|
||||||
if(memory->isInSTM(jter->first))
|
//std::map<int, int> neighbors = memory->getNeighborsId(id, _predictionLC.size()-1, 0, false, false, true, true);
|
||||||
{
|
e1+=t1.ticks();
|
||||||
neighbors.erase(jter++);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(jter->second == 0)
|
|
||||||
{
|
|
||||||
idsLoopMargin.push_back(jter->first);
|
|
||||||
}
|
|
||||||
++jter;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// should at least have 1 id in idsMarginLoop
|
float sum = addNeighborProb(prediction, index, neighbors, _predictionLC, newIdToIndexMap);
|
||||||
if(idsLoopMargin.size() == 0)
|
e3+=t1.ticks();
|
||||||
{
|
|
||||||
UFATAL("No 0 margin neighbor for signature %d !?!?", *iter);
|
|
||||||
}
|
|
||||||
|
|
||||||
// same neighbor tree for loop signatures (margin = 0)
|
this->normalize(prediction, index, sum, newIds[0]<0);
|
||||||
for(std::list<int>::iterator iter = idsLoopMargin.begin(); iter!=idsLoopMargin.end(); ++iter)
|
++modified;
|
||||||
{
|
e4+=t1.ticks();
|
||||||
int index = newIdToIndexMap.at(*iter);
|
|
||||||
float sum = this->addNeighborProb(prediction, index, neighbors, newIdToIndexMap);
|
|
||||||
idsDone.insert(*iter);
|
|
||||||
this->normalize(prediction, index, sum, newIds[0]<0);
|
|
||||||
++modified;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UDEBUG("time updating modified/added %d ids = %fs", idsToUpdate.size(), timer.restart());
|
UDEBUG("time updating modified/added %d ids = %fs (e0=%f e1=%f e2=%f e3=%f e4=%f)", idsToUpdate.size(), timer.restart(), e0, e1, e2, e3, e4);
|
||||||
|
|
||||||
//UDEBUG("oldIds.size()=%d, oldPrediction.cols=%d, oldPrediction.rows=%d", oldIds.size(), oldPrediction.cols, oldPrediction.rows);
|
//UDEBUG("oldIds.size()=%d, oldPrediction.cols=%d, oldPrediction.rows=%d", oldIds.size(), oldPrediction.cols, oldPrediction.rows);
|
||||||
//UDEBUG("newIdToIndexMap.size()=%d, prediction.cols=%d, prediction.rows=%d", newIdToIndexMap.size(), prediction.cols, prediction.rows);
|
//UDEBUG("newIdToIndexMap.size()=%d, prediction.cols=%d, prediction.rows=%d", newIdToIndexMap.size(), prediction.cols, prediction.rows);
|
||||||
@@ -624,24 +690,4 @@ void BayesFilter::updatePosterior(const Memory * memory, const std::vector<int>
|
|||||||
_posterior = newPosterior;
|
_posterior = newPosterior;
|
||||||
}
|
}
|
||||||
|
|
||||||
float BayesFilter::addNeighborProb(cv::Mat & prediction, unsigned int col, const std::map<int, int> & neighbors, const std::map<int, int> & idToIndexMap) const
|
|
||||||
{
|
|
||||||
UASSERT((unsigned int)prediction.cols == idToIndexMap.size() &&
|
|
||||||
(unsigned int)prediction.rows == idToIndexMap.size() &&
|
|
||||||
col < (unsigned int)prediction.cols &&
|
|
||||||
col < (unsigned int)prediction.rows);
|
|
||||||
|
|
||||||
float sum=0;
|
|
||||||
for(std::map<int, int>::const_iterator iter=neighbors.begin(); iter!=neighbors.end(); ++iter)
|
|
||||||
{
|
|
||||||
int index = uValue(idToIndexMap, iter->first, -1);
|
|
||||||
if(index >= 0)
|
|
||||||
{
|
|
||||||
sum += ((float*)prediction.data)[col + index*prediction.cols] = _predictionLC[iter->second+1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sum;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace rtabmap
|
} // namespace rtabmap
|
||||||
|
|||||||
+146
-26
@@ -11,6 +11,8 @@ SET(SRC_FILES
|
|||||||
DBDriverSqlite3.cpp
|
DBDriverSqlite3.cpp
|
||||||
DBReader.cpp
|
DBReader.cpp
|
||||||
|
|
||||||
|
Recovery.cpp
|
||||||
|
|
||||||
Camera.cpp
|
Camera.cpp
|
||||||
CameraThread.cpp
|
CameraThread.cpp
|
||||||
CameraRGB.cpp
|
CameraRGB.cpp
|
||||||
@@ -44,6 +46,7 @@ SET(SRC_FILES
|
|||||||
Graph.cpp
|
Graph.cpp
|
||||||
Compression.cpp
|
Compression.cpp
|
||||||
Link.cpp
|
Link.cpp
|
||||||
|
LaserScan.cpp
|
||||||
|
|
||||||
Optimizer.cpp
|
Optimizer.cpp
|
||||||
OptimizerTORO.cpp
|
OptimizerTORO.cpp
|
||||||
@@ -63,7 +66,12 @@ SET(SRC_FILES
|
|||||||
OdometryFovis.cpp
|
OdometryFovis.cpp
|
||||||
OdometryViso2.cpp
|
OdometryViso2.cpp
|
||||||
OdometryDVO.cpp
|
OdometryDVO.cpp
|
||||||
|
OdometryOkvis.cpp
|
||||||
OdometryORBSLAM2.cpp
|
OdometryORBSLAM2.cpp
|
||||||
|
OdometryLOAM.cpp
|
||||||
|
OdometryMSCKF.cpp
|
||||||
|
|
||||||
|
IMUThread.cpp
|
||||||
|
|
||||||
Stereo.cpp
|
Stereo.cpp
|
||||||
StereoDense.cpp
|
StereoDense.cpp
|
||||||
@@ -75,9 +83,7 @@ SET(SRC_FILES
|
|||||||
|
|
||||||
rtflann/ext/lz4.c
|
rtflann/ext/lz4.c
|
||||||
rtflann/ext/lz4hc.c
|
rtflann/ext/lz4hc.c
|
||||||
FlannIndex.cpp
|
FlannIndex.cpp
|
||||||
|
|
||||||
sqlite3/sqlite3.c
|
|
||||||
|
|
||||||
#clams stuff
|
#clams stuff
|
||||||
clams/discrete_depth_distortion_model_helpers.cpp
|
clams/discrete_depth_distortion_model_helpers.cpp
|
||||||
@@ -90,9 +96,20 @@ IF(OpenCV_VERSION_MAJOR EQUAL 2)
|
|||||||
SET(SRC_FILES
|
SET(SRC_FILES
|
||||||
${SRC_FILES}
|
${SRC_FILES}
|
||||||
opencv/Orb.cpp
|
opencv/Orb.cpp
|
||||||
opencv/solvepnp.cpp
|
|
||||||
)
|
)
|
||||||
ENDIF(OpenCV_VERSION_MAJOR EQUAL 2)
|
ENDIF(OpenCV_VERSION_MAJOR EQUAL 2)
|
||||||
|
SET(SRC_FILES
|
||||||
|
${SRC_FILES}
|
||||||
|
opencv/solvepnp.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
# to get includes in visual studio
|
||||||
|
IF(MSVC)
|
||||||
|
FILE(GLOB HEADERS
|
||||||
|
../include/${PROJECT_PREFIX}/core/*.h
|
||||||
|
)
|
||||||
|
SET(SRC_FILES ${SRC_FILES} ${HEADERS})
|
||||||
|
ENDIF(MSVC)
|
||||||
|
|
||||||
SET(INCLUDE_DIRS
|
SET(INCLUDE_DIRS
|
||||||
${PROJECT_SOURCE_DIR}/utilite/include
|
${PROJECT_SOURCE_DIR}/utilite/include
|
||||||
@@ -110,6 +127,26 @@ SET(LIBRARIES
|
|||||||
${ZLIB_LIBRARIES}
|
${ZLIB_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
IF(Sqlite3_FOUND)
|
||||||
|
SET(INCLUDE_DIRS
|
||||||
|
${INCLUDE_DIRS}
|
||||||
|
${Sqlite3_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(LIBRARIES
|
||||||
|
${LIBRARIES}
|
||||||
|
${Sqlite3_LIBRARIES}
|
||||||
|
)
|
||||||
|
ELSE()
|
||||||
|
SET(SRC_FILES
|
||||||
|
${SRC_FILES}
|
||||||
|
sqlite3/sqlite3.c
|
||||||
|
)
|
||||||
|
SET(INCLUDE_DIRS
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/sqlite3
|
||||||
|
${INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(Freenect_FOUND)
|
IF(Freenect_FOUND)
|
||||||
IF(Freenect_DASH_INCLUDES)
|
IF(Freenect_DASH_INCLUDES)
|
||||||
ADD_DEFINITIONS("-DFREENECT_DASH_INCLUDES")
|
ADD_DEFINITIONS("-DFREENECT_DASH_INCLUDES")
|
||||||
@@ -146,6 +183,17 @@ IF(freenect2_FOUND)
|
|||||||
)
|
)
|
||||||
ENDIF(freenect2_FOUND)
|
ENDIF(freenect2_FOUND)
|
||||||
|
|
||||||
|
IF(KinectSDK2_FOUND)
|
||||||
|
SET(INCLUDE_DIRS
|
||||||
|
${INCLUDE_DIRS}
|
||||||
|
${KinectSDK2_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(LIBRARIES
|
||||||
|
${LIBRARIES}
|
||||||
|
${KinectSDK2_LIBRARIES}
|
||||||
|
)
|
||||||
|
ENDIF(KinectSDK2_FOUND)
|
||||||
|
|
||||||
IF(RealSense_FOUND)
|
IF(RealSense_FOUND)
|
||||||
SET(INCLUDE_DIRS
|
SET(INCLUDE_DIRS
|
||||||
${INCLUDE_DIRS}
|
${INCLUDE_DIRS}
|
||||||
@@ -157,6 +205,24 @@ IF(RealSense_FOUND)
|
|||||||
)
|
)
|
||||||
ENDIF(RealSense_FOUND)
|
ENDIF(RealSense_FOUND)
|
||||||
|
|
||||||
|
IF(realsense2_FOUND)
|
||||||
|
SET(INCLUDE_DIRS
|
||||||
|
${INCLUDE_DIRS}
|
||||||
|
${realsense2_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
IF(WIN32)
|
||||||
|
SET(LIBRARIES
|
||||||
|
${LIBRARIES}
|
||||||
|
${RealSense2_LIBRARIES}
|
||||||
|
)
|
||||||
|
ELSE()
|
||||||
|
SET(LIBRARIES
|
||||||
|
${LIBRARIES}
|
||||||
|
realsense2
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF(realsense2_FOUND)
|
||||||
|
|
||||||
IF(DC1394_FOUND)
|
IF(DC1394_FOUND)
|
||||||
SET(INCLUDE_DIRS
|
SET(INCLUDE_DIRS
|
||||||
${INCLUDE_DIRS}
|
${INCLUDE_DIRS}
|
||||||
@@ -213,25 +279,6 @@ IF(G2O_FOUND)
|
|||||||
ENDIF(WITH_VERTIGO)
|
ENDIF(WITH_VERTIGO)
|
||||||
ENDIF(G2O_FOUND)
|
ENDIF(G2O_FOUND)
|
||||||
|
|
||||||
IF(GTSAM_FOUND)
|
|
||||||
IF(GTSAM_INCLUDE_DIR)
|
|
||||||
SET(INCLUDE_DIRS
|
|
||||||
${GTSAM_INCLUDE_DIR} # place it in front to use Eigen installed by GTSAM
|
|
||||||
${INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
ELSE()
|
|
||||||
SET(INCLUDE_DIRS
|
|
||||||
${GTSAM_INCLUDE_DIRS} # cmake standard
|
|
||||||
${INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
ENDIF()
|
|
||||||
add_definitions("-DGTSAM_IMPORT_STATIC")
|
|
||||||
SET(LIBRARIES
|
|
||||||
${LIBRARIES}
|
|
||||||
gtsam
|
|
||||||
)
|
|
||||||
ENDIF(GTSAM_FOUND)
|
|
||||||
|
|
||||||
IF(cvsba_FOUND)
|
IF(cvsba_FOUND)
|
||||||
SET(INCLUDE_DIRS
|
SET(INCLUDE_DIRS
|
||||||
${INCLUDE_DIRS}
|
${INCLUDE_DIRS}
|
||||||
@@ -243,6 +290,28 @@ IF(cvsba_FOUND)
|
|||||||
)
|
)
|
||||||
ENDIF(cvsba_FOUND)
|
ENDIF(cvsba_FOUND)
|
||||||
|
|
||||||
|
IF(libpointmatcher_FOUND)
|
||||||
|
SET(INCLUDE_DIRS
|
||||||
|
${INCLUDE_DIRS}
|
||||||
|
${libpointmatcher_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(LIBRARIES
|
||||||
|
${LIBRARIES}
|
||||||
|
${libpointmatcher_LIBRARIES}
|
||||||
|
)
|
||||||
|
ENDIF(libpointmatcher_FOUND)
|
||||||
|
|
||||||
|
IF(loam_velodyne_FOUND)
|
||||||
|
SET(INCLUDE_DIRS
|
||||||
|
${INCLUDE_DIRS}
|
||||||
|
${loam_velodyne_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(LIBRARIES
|
||||||
|
${LIBRARIES}
|
||||||
|
${loam_velodyne_LIBRARIES}
|
||||||
|
)
|
||||||
|
ENDIF(loam_velodyne_FOUND)
|
||||||
|
|
||||||
IF(ZED_FOUND)
|
IF(ZED_FOUND)
|
||||||
SET(INCLUDE_DIRS
|
SET(INCLUDE_DIRS
|
||||||
${INCLUDE_DIRS}
|
${INCLUDE_DIRS}
|
||||||
@@ -312,17 +381,68 @@ IF(dvo_core_FOUND)
|
|||||||
)
|
)
|
||||||
ENDIF(dvo_core_FOUND)
|
ENDIF(dvo_core_FOUND)
|
||||||
|
|
||||||
IF(ORB_SLAM2_FOUND)
|
IF(okvis_FOUND)
|
||||||
SET(INCLUDE_DIRS
|
SET(INCLUDE_DIRS
|
||||||
|
${OKVIS_INCLUDE_DIRS}
|
||||||
|
${BRISK_INCLUDE_DIRS}
|
||||||
|
${OPENGV_INCLUDE_DIRS}
|
||||||
|
${CERES_INCLUDE_DIRS}
|
||||||
${INCLUDE_DIRS}
|
${INCLUDE_DIRS}
|
||||||
${ORB_SLAM2_INCLUDE_DIRS}
|
|
||||||
)
|
)
|
||||||
SET(LIBRARIES
|
SET(LIBRARIES
|
||||||
|
${OKVIS_LIBRARIES}
|
||||||
|
${BRISK_LIBRARIES}
|
||||||
|
${OPENGV_LIBRARIES}
|
||||||
|
${CERES_LIBRARIES}
|
||||||
|
${LIBRARIES}
|
||||||
|
)
|
||||||
|
ENDIF(okvis_FOUND)
|
||||||
|
|
||||||
|
IF(msckf_vio_FOUND)
|
||||||
|
SET(INCLUDE_DIRS
|
||||||
|
${msckf_vio_INCLUDE_DIRS}
|
||||||
|
${INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(LIBRARIES
|
||||||
|
${msckf_vio_LIBRARIES}
|
||||||
|
${LIBRARIES}
|
||||||
|
)
|
||||||
|
ENDIF(msckf_vio_FOUND)
|
||||||
|
|
||||||
|
IF(ORB_SLAM2_FOUND)
|
||||||
|
SET(INCLUDE_DIRS
|
||||||
|
${ORB_SLAM2_INCLUDE_DIRS} #before so that g2o includes are taken from ORB_SLAM2 directory before the official g2o one
|
||||||
|
${INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
SET(LIBRARIES
|
||||||
|
${ORB_SLAM2_LIBRARIES}
|
||||||
${LIBRARIES}
|
${LIBRARIES}
|
||||||
${ORB_SLAM2_LIBRARIES}
|
|
||||||
)
|
)
|
||||||
ENDIF(ORB_SLAM2_FOUND)
|
ENDIF(ORB_SLAM2_FOUND)
|
||||||
|
|
||||||
|
IF(GTSAM_FOUND)
|
||||||
|
# Make sure GTSAM is built with system Eigen, not the included one in its package
|
||||||
|
IF(GTSAM_INCLUDE_DIR)
|
||||||
|
SET(INCLUDE_DIRS
|
||||||
|
${INCLUDE_DIRS}
|
||||||
|
${GTSAM_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
ELSE()
|
||||||
|
SET(INCLUDE_DIRS
|
||||||
|
${INCLUDE_DIRS}
|
||||||
|
${GTSAM_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
IF(WIN32)
|
||||||
|
# GTSAM should be built in STATIC on Windows to avoid "error C2338: THIS_METHOD_IS_ONLY_FOR_1x1_EXPRESSIONS" when building GTSAM
|
||||||
|
add_definitions("-DGTSAM_IMPORT_STATIC")
|
||||||
|
ENDIF(WIN32)
|
||||||
|
SET(LIBRARIES
|
||||||
|
${LIBRARIES}
|
||||||
|
gtsam # Windows: Place static libs at the end
|
||||||
|
)
|
||||||
|
ENDIF(GTSAM_FOUND)
|
||||||
|
|
||||||
####################################
|
####################################
|
||||||
# Generate resources files
|
# Generate resources files
|
||||||
####################################
|
####################################
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ Camera::~Camera()
|
|||||||
UDEBUG("");
|
UDEBUG("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Camera::resetTimer()
|
||||||
|
{
|
||||||
|
_frameRateTimer->start();
|
||||||
|
}
|
||||||
|
|
||||||
SensorData Camera::takeImage(CameraInfo * info)
|
SensorData Camera::takeImage(CameraInfo * info)
|
||||||
{
|
{
|
||||||
bool warnFrameRateTooHigh = false;
|
bool warnFrameRateTooHigh = false;
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <rtabmap/utilite/UFile.h>
|
#include <rtabmap/utilite/UFile.h>
|
||||||
#include <rtabmap/utilite/UConversion.h>
|
#include <rtabmap/utilite/UConversion.h>
|
||||||
#include <rtabmap/utilite/UMath.h>
|
#include <rtabmap/utilite/UMath.h>
|
||||||
|
#include <rtabmap/utilite/UStl.h>
|
||||||
#include <opencv2/imgproc/imgproc.hpp>
|
#include <opencv2/imgproc/imgproc.hpp>
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
@@ -57,7 +58,7 @@ CameraModel::CameraModel(
|
|||||||
localTransform_(localTransform)
|
localTransform_(localTransform)
|
||||||
{
|
{
|
||||||
UASSERT(K_.empty() || (K_.rows == 3 && K_.cols == 3 && K_.type() == CV_64FC1));
|
UASSERT(K_.empty() || (K_.rows == 3 && K_.cols == 3 && K_.type() == CV_64FC1));
|
||||||
UASSERT(D_.empty() || (D_.rows == 1 && (D_.cols == 4 || D_.cols == 5 || D_.cols == 8) && D_.type() == CV_64FC1));
|
UASSERT(D_.empty() || (D_.rows == 1 && (D_.cols == 4 || D_.cols == 5 || D_.cols == 6 || D_.cols == 8) && D_.type() == CV_64FC1));
|
||||||
UASSERT(R_.empty() || (R_.rows == 3 && R_.cols == 3 && R_.type() == CV_64FC1));
|
UASSERT(R_.empty() || (R_.rows == 3 && R_.cols == 3 && R_.type() == CV_64FC1));
|
||||||
UASSERT(P_.empty() || (P_.rows == 3 && P_.cols == 4 && P_.type() == CV_64FC1));
|
UASSERT(P_.empty() || (P_.rows == 3 && P_.cols == 4 && P_.type() == CV_64FC1));
|
||||||
}
|
}
|
||||||
@@ -153,12 +154,33 @@ CameraModel::CameraModel(
|
|||||||
void CameraModel::initRectificationMap()
|
void CameraModel::initRectificationMap()
|
||||||
{
|
{
|
||||||
UASSERT(imageSize_.height > 0 && imageSize_.width > 0);
|
UASSERT(imageSize_.height > 0 && imageSize_.width > 0);
|
||||||
UASSERT(D_.rows == 1 && (D_.cols == 4 || D_.cols == 5 || D_.cols == 8));
|
UASSERT(D_.rows == 1 && (D_.cols == 4 || D_.cols == 5 || D_.cols == 6 || D_.cols == 8));
|
||||||
UASSERT(R_.rows == 3 && R_.cols == 3);
|
UASSERT(R_.rows == 3 && R_.cols == 3);
|
||||||
UASSERT(P_.rows == 3 && P_.cols == 4);
|
UASSERT(P_.rows == 3 && P_.cols == 4);
|
||||||
// init rectification map
|
// init rectification map
|
||||||
UINFO("Initialize rectify map");
|
UINFO("Initialize rectify map");
|
||||||
cv::initUndistortRectifyMap(K_, D_, R_, P_, imageSize_, CV_32FC1, mapX_, mapY_);
|
if(D_.cols == 6)
|
||||||
|
{
|
||||||
|
#if CV_MAJOR_VERSION > 2 or (CV_MAJOR_VERSION == 2 and (CV_MINOR_VERSION >4 or (CV_MINOR_VERSION == 4 and CV_SUBMINOR_VERSION >=10)))
|
||||||
|
// Equidistant / FishEye
|
||||||
|
// get only k parameters (k1,k2,p1,p2,k3,k4)
|
||||||
|
cv::Mat D(1, 4, CV_64FC1);
|
||||||
|
D.at<double>(0,0) = D_.at<double>(0,1);
|
||||||
|
D.at<double>(0,1) = D_.at<double>(0,2);
|
||||||
|
D.at<double>(0,2) = D_.at<double>(0,4);
|
||||||
|
D.at<double>(0,3) = D_.at<double>(0,5);
|
||||||
|
cv::fisheye::initUndistortRectifyMap(K_, D, R_, P_, imageSize_, CV_32FC1, mapX_, mapY_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#else
|
||||||
|
UWARN("Too old opencv version (%d,%d,%d) to support fisheye model (min 2.4.10 required)!",
|
||||||
|
CV_MAJOR_VERSION, CV_MINOR_VERSION, CV_SUBMINOR_VERSION);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
// RadialTangential
|
||||||
|
cv::initUndistortRectifyMap(K_, D_, R_, P_, imageSize_, CV_32FC1, mapX_, mapY_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CameraModel::setImageSize(const cv::Size & size)
|
void CameraModel::setImageSize(const cv::Size & size)
|
||||||
@@ -263,6 +285,27 @@ bool CameraModel::load(const std::string & directory, const std::string & camera
|
|||||||
UWARN("Missing \"distorsion_coefficients\" field in \"%s\"", filePath.c_str());
|
UWARN("Missing \"distorsion_coefficients\" field in \"%s\"", filePath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
n = fs["distortion_model"];
|
||||||
|
if(n.type() != cv::FileNode::NONE)
|
||||||
|
{
|
||||||
|
std::string distortionModel = (std::string)n;
|
||||||
|
if(D_.cols>=4 &&
|
||||||
|
(uStrContains(distortionModel, "fisheye") ||
|
||||||
|
uStrContains(distortionModel, "equidistant")))
|
||||||
|
{
|
||||||
|
cv::Mat D = cv::Mat::zeros(1,6,CV_64FC1);
|
||||||
|
D.at<double>(0,0) = D_.at<double>(0,0);
|
||||||
|
D.at<double>(0,1) = D_.at<double>(0,1);
|
||||||
|
D.at<double>(0,4) = D_.at<double>(0,2);
|
||||||
|
D.at<double>(0,5) = D_.at<double>(0,3);
|
||||||
|
D_ = D;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UWARN("Missing \"distortion_model\" field in \"%s\"", filePath.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
n = fs["rectification_matrix"];
|
n = fs["rectification_matrix"];
|
||||||
if(n.type() != cv::FileNode::NONE)
|
if(n.type() != cv::FileNode::NONE)
|
||||||
{
|
{
|
||||||
@@ -347,20 +390,33 @@ bool CameraModel::save(const std::string & directory) const
|
|||||||
|
|
||||||
if(!D_.empty())
|
if(!D_.empty())
|
||||||
{
|
{
|
||||||
|
cv::Mat D = D_;
|
||||||
|
if(D_.cols == 6)
|
||||||
|
{
|
||||||
|
D = cv::Mat(1,4,CV_64FC1);
|
||||||
|
D.at<double>(0,0) = D_.at<double>(0,0);
|
||||||
|
D.at<double>(0,1) = D_.at<double>(0,1);
|
||||||
|
D.at<double>(0,2) = D_.at<double>(0,4);
|
||||||
|
D.at<double>(0,3) = D_.at<double>(0,5);
|
||||||
|
}
|
||||||
fs << "distortion_coefficients" << "{";
|
fs << "distortion_coefficients" << "{";
|
||||||
fs << "rows" << D_.rows;
|
fs << "rows" << D.rows;
|
||||||
fs << "cols" << D_.cols;
|
fs << "cols" << D.cols;
|
||||||
fs << "data" << std::vector<double>((double*)D_.data, ((double*)D_.data)+(D_.rows*D_.cols));
|
fs << "data" << std::vector<double>((double*)D.data, ((double*)D.data)+(D.rows*D.cols));
|
||||||
fs << "}";
|
fs << "}";
|
||||||
|
|
||||||
// compaibility with ROS
|
// compaibility with ROS
|
||||||
if(D_.cols > 5)
|
if(D_.cols == 6)
|
||||||
{
|
{
|
||||||
fs << "distortion_model" << "rational_polynomial";
|
fs << "distortion_model" << "equidistant"; // equidistant, fisheye
|
||||||
|
}
|
||||||
|
else if(D.cols > 5)
|
||||||
|
{
|
||||||
|
fs << "distortion_model" << "rational_polynomial"; // rad tan
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fs << "distortion_model" << "plumb_bob";
|
fs << "distortion_model" << "plumb_bob"; // rad tan
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+133
-77
@@ -37,6 +37,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <rtabmap/utilite/UTimer.h>
|
#include <rtabmap/utilite/UTimer.h>
|
||||||
|
|
||||||
#include <opencv2/imgproc/imgproc.hpp>
|
#include <opencv2/imgproc/imgproc.hpp>
|
||||||
|
#include <opencv2/imgproc/types_c.h>
|
||||||
|
#if CV_MAJOR_VERSION >= 3
|
||||||
|
#include <opencv2/videoio/videoio_c.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <rtabmap/core/util3d.h>
|
#include <rtabmap/core/util3d.h>
|
||||||
#include <rtabmap/core/util3d_filtering.h>
|
#include <rtabmap/core/util3d_filtering.h>
|
||||||
@@ -70,6 +74,8 @@ CameraImages::CameraImages() :
|
|||||||
_scanDownsampleStep(1),
|
_scanDownsampleStep(1),
|
||||||
_scanVoxelSize(0.0f),
|
_scanVoxelSize(0.0f),
|
||||||
_scanNormalsK(0),
|
_scanNormalsK(0),
|
||||||
|
_scanNormalsRadius(0),
|
||||||
|
_scanForceGroundNormalsUp(false),
|
||||||
_depthFromScan(false),
|
_depthFromScan(false),
|
||||||
_depthFromScanFillHoles(1),
|
_depthFromScanFillHoles(1),
|
||||||
_depthFromScanFillHolesFromBorder(false),
|
_depthFromScanFillHolesFromBorder(false),
|
||||||
@@ -77,6 +83,7 @@ CameraImages::CameraImages() :
|
|||||||
_syncImageRateWithStamps(true),
|
_syncImageRateWithStamps(true),
|
||||||
_odometryFormat(0),
|
_odometryFormat(0),
|
||||||
_groundTruthFormat(0),
|
_groundTruthFormat(0),
|
||||||
|
_maxPoseTimeDiff(0.02),
|
||||||
_captureDelay(0.0)
|
_captureDelay(0.0)
|
||||||
{}
|
{}
|
||||||
CameraImages::CameraImages(const std::string & path,
|
CameraImages::CameraImages(const std::string & path,
|
||||||
@@ -99,6 +106,8 @@ CameraImages::CameraImages(const std::string & path,
|
|||||||
_scanDownsampleStep(1),
|
_scanDownsampleStep(1),
|
||||||
_scanVoxelSize(0.0f),
|
_scanVoxelSize(0.0f),
|
||||||
_scanNormalsK(0),
|
_scanNormalsK(0),
|
||||||
|
_scanNormalsRadius(0),
|
||||||
|
_scanForceGroundNormalsUp(false),
|
||||||
_depthFromScan(false),
|
_depthFromScan(false),
|
||||||
_depthFromScanFillHoles(1),
|
_depthFromScanFillHoles(1),
|
||||||
_depthFromScanFillHolesFromBorder(false),
|
_depthFromScanFillHolesFromBorder(false),
|
||||||
@@ -106,6 +115,7 @@ CameraImages::CameraImages(const std::string & path,
|
|||||||
_syncImageRateWithStamps(true),
|
_syncImageRateWithStamps(true),
|
||||||
_odometryFormat(0),
|
_odometryFormat(0),
|
||||||
_groundTruthFormat(0),
|
_groundTruthFormat(0),
|
||||||
|
_maxPoseTimeDiff(0.02),
|
||||||
_captureDelay(0.0)
|
_captureDelay(0.0)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -114,14 +124,8 @@ CameraImages::CameraImages(const std::string & path,
|
|||||||
CameraImages::~CameraImages()
|
CameraImages::~CameraImages()
|
||||||
{
|
{
|
||||||
UDEBUG("");
|
UDEBUG("");
|
||||||
if(_dir)
|
delete _dir;
|
||||||
{
|
delete _scanDir;
|
||||||
delete _dir;
|
|
||||||
}
|
|
||||||
if(_scanDir)
|
|
||||||
{
|
|
||||||
delete _scanDir;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CameraImages::init(const std::string & calibrationFolder, const std::string & cameraName)
|
bool CameraImages::init(const std::string & calibrationFolder, const std::string & cameraName)
|
||||||
@@ -238,15 +242,43 @@ bool CameraImages::init(const std::string & calibrationFolder, const std::string
|
|||||||
const std::list<std::string> & filenames = _dir->getFileNames();
|
const std::list<std::string> & filenames = _dir->getFileNames();
|
||||||
for(std::list<std::string>::const_iterator iter=filenames.begin(); iter!=filenames.end(); ++iter)
|
for(std::list<std::string>::const_iterator iter=filenames.begin(); iter!=filenames.end(); ++iter)
|
||||||
{
|
{
|
||||||
// format is text_12234456.12334_text.png
|
// format is text_1223445645.12334_text.png or text_122344564512334_text.png
|
||||||
|
// If no decimals, 10 first number are the seconds
|
||||||
std::list<std::string> list = uSplit(*iter, '.');
|
std::list<std::string> list = uSplit(*iter, '.');
|
||||||
if(list.size() == 3)
|
if(list.size() == 3 || list.size() == 2)
|
||||||
{
|
{
|
||||||
list.pop_back(); // remove extension
|
list.pop_back(); // remove extension
|
||||||
std::string decimals = uSplitNumChar(list.back()).front();
|
double stamp = 0.0;
|
||||||
list.pop_back();
|
if(list.size() == 1)
|
||||||
std::string sec = uSplitNumChar(list.back()).back();
|
{
|
||||||
double stamp = uStr2Double(sec + "." + decimals);
|
std::list<std::string> numberList = uSplitNumChar(list.front());
|
||||||
|
for(std::list<std::string>::iterator iter=numberList.begin(); iter!=numberList.end(); ++iter)
|
||||||
|
{
|
||||||
|
if(uIsNumber(*iter))
|
||||||
|
{
|
||||||
|
std::string decimals;
|
||||||
|
std::string sec;
|
||||||
|
if(iter->length()>10)
|
||||||
|
{
|
||||||
|
decimals = iter->substr(10, iter->size()-10);
|
||||||
|
sec = iter->substr(0, 10);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sec = *iter;
|
||||||
|
}
|
||||||
|
stamp = uStr2Double(sec + "." + decimals);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::string decimals = uSplitNumChar(list.back()).front();
|
||||||
|
list.pop_back();
|
||||||
|
std::string sec = uSplitNumChar(list.back()).back();
|
||||||
|
stamp = uStr2Double(sec + "." + decimals);
|
||||||
|
}
|
||||||
if(stamp > 0.0)
|
if(stamp > 0.0)
|
||||||
{
|
{
|
||||||
_stamps.push_back(stamp);
|
_stamps.push_back(stamp);
|
||||||
@@ -310,12 +342,12 @@ bool CameraImages::init(const std::string & calibrationFolder, const std::string
|
|||||||
|
|
||||||
if(success && _odometryPath.size())
|
if(success && _odometryPath.size())
|
||||||
{
|
{
|
||||||
success = readPoses(odometry_, _stamps, _odometryPath, _odometryFormat);
|
success = readPoses(odometry_, _stamps, _odometryPath, _odometryFormat, _maxPoseTimeDiff);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(success && _groundTruthPath.size())
|
if(success && _groundTruthPath.size())
|
||||||
{
|
{
|
||||||
success = readPoses(groundTruth_, _stamps, _groundTruthPath, _groundTruthFormat);
|
success = readPoses(groundTruth_, _stamps, _groundTruthPath, _groundTruthFormat, _maxPoseTimeDiff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,7 +356,7 @@ bool CameraImages::init(const std::string & calibrationFolder, const std::string
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CameraImages::readPoses(std::list<Transform> & outputPoses, std::list<double> & inOutStamps, const std::string & filePath, int format) const
|
bool CameraImages::readPoses(std::list<Transform> & outputPoses, std::list<double> & inOutStamps, const std::string & filePath, int format, double maxTimeDiff) const
|
||||||
{
|
{
|
||||||
outputPoses.clear();
|
outputPoses.clear();
|
||||||
std::map<int, Transform> poses;
|
std::map<int, Transform> poses;
|
||||||
@@ -334,19 +366,19 @@ bool CameraImages::readPoses(std::list<Transform> & outputPoses, std::list<doubl
|
|||||||
UERROR("Cannot read pose file \"%s\".", filePath.c_str());
|
UERROR("Cannot read pose file \"%s\".", filePath.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if((format != 1 && format != 5 && format != 6 && format != 7) && poses.size() != this->imagesCount())
|
else if((format != 1 && format != 5 && format != 6 && format != 7 && format != 9) && poses.size() != this->imagesCount())
|
||||||
{
|
{
|
||||||
UERROR("The pose count is not the same as the images (%d vs %d)! Please remove "
|
UERROR("The pose count is not the same as the images (%d vs %d)! Please remove "
|
||||||
"the pose file path if you don't want to use it (current file path=%s).",
|
"the pose file path if you don't want to use it (current file path=%s).",
|
||||||
(int)poses.size(), this->imagesCount(), filePath.c_str());
|
(int)poses.size(), this->imagesCount(), filePath.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if((format == 1 || format == 5 || format == 6 || format == 7) && inOutStamps.size() == 0)
|
else if((format == 1 || format == 5 || format == 6 || format == 7 || format == 9) && inOutStamps.size() == 0)
|
||||||
{
|
{
|
||||||
UERROR("When using RGBD-SLAM, GPS, MALAGA and ST LUCIA formats, images must have timestamps!");
|
UERROR("When using RGBD-SLAM, GPS, MALAGA, ST LUCIA and EuRoC MAV formats, images must have timestamps!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if(format == 1 || format == 5 || format == 6 || format == 7)
|
else if(format == 1 || format == 5 || format == 6 || format == 7 || format == 9)
|
||||||
{
|
{
|
||||||
UDEBUG("");
|
UDEBUG("");
|
||||||
//Match ground truth values with images
|
//Match ground truth values with images
|
||||||
@@ -378,16 +410,21 @@ bool CameraImages::readPoses(std::list<Transform> & outputPoses, std::list<doubl
|
|||||||
double stampBeg = beginIter->first;
|
double stampBeg = beginIter->first;
|
||||||
double stampEnd = endIter->first;
|
double stampEnd = endIter->first;
|
||||||
UASSERT(stampEnd > stampBeg && *ster>stampBeg && *ster < stampEnd);
|
UASSERT(stampEnd > stampBeg && *ster>stampBeg && *ster < stampEnd);
|
||||||
if(stampEnd - stampBeg > 10.0)
|
if(fabs(*ster-stampEnd) > maxTimeDiff || fabs(*ster-stampBeg) > maxTimeDiff)
|
||||||
{
|
{
|
||||||
warned = true;
|
if(!warned)
|
||||||
UDEBUG("Cannot interpolate pose for stamp %f between %f and %f (>10 sec)",
|
{
|
||||||
*ster,
|
UWARN("Cannot interpolate pose for stamp %f between %f and %f (> maximum time diff of %f sec)",
|
||||||
stampBeg,
|
*ster,
|
||||||
stampEnd);
|
stampBeg,
|
||||||
|
stampEnd,
|
||||||
|
maxTimeDiff);
|
||||||
|
}
|
||||||
|
warned=true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
warned=false;
|
||||||
float t = (*ster - stampBeg) / (stampEnd-stampBeg);
|
float t = (*ster - stampBeg) / (stampEnd-stampBeg);
|
||||||
Transform & ta = poses.at(beginIter->second);
|
Transform & ta = poses.at(beginIter->second);
|
||||||
Transform & tb = poses.at(endIter->second);
|
Transform & tb = poses.at(endIter->second);
|
||||||
@@ -490,7 +527,7 @@ SensorData CameraImages::captureImage(CameraInfo * info)
|
|||||||
_captureDelay = 0.0;
|
_captureDelay = 0.0;
|
||||||
|
|
||||||
cv::Mat img;
|
cv::Mat img;
|
||||||
cv::Mat scan;
|
LaserScan scan(cv::Mat(), _scanMaxPts, 0, LaserScan::kUnknown, _scanLocalTransform);
|
||||||
double stamp = UTimer::now();
|
double stamp = UTimer::now();
|
||||||
Transform odometryPose;
|
Transform odometryPose;
|
||||||
Transform groundTruthPose;
|
Transform groundTruthPose;
|
||||||
@@ -531,6 +568,26 @@ SensorData CameraImages::captureImage(CameraInfo * info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(_stamps.size())
|
||||||
|
{
|
||||||
|
stamp = _stamps.front();
|
||||||
|
_stamps.pop_front();
|
||||||
|
if(_stamps.size())
|
||||||
|
{
|
||||||
|
_captureDelay = _stamps.front() - stamp;
|
||||||
|
}
|
||||||
|
if(odometry_.size())
|
||||||
|
{
|
||||||
|
odometryPose = odometry_.front();
|
||||||
|
odometry_.pop_front();
|
||||||
|
}
|
||||||
|
if(groundTruth_.size())
|
||||||
|
{
|
||||||
|
groundTruthPose = groundTruth_.front();
|
||||||
|
groundTruth_.pop_front();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -539,9 +596,48 @@ SensorData CameraImages::captureImage(CameraInfo * info)
|
|||||||
if(!fileName.empty())
|
if(!fileName.empty())
|
||||||
{
|
{
|
||||||
imageFilePath = _path + fileName;
|
imageFilePath = _path + fileName;
|
||||||
|
if(_stamps.size())
|
||||||
|
{
|
||||||
|
stamp = _stamps.front();
|
||||||
|
_stamps.pop_front();
|
||||||
|
if(_stamps.size())
|
||||||
|
{
|
||||||
|
_captureDelay = _stamps.front() - stamp;
|
||||||
|
}
|
||||||
|
if(odometry_.size())
|
||||||
|
{
|
||||||
|
odometryPose = odometry_.front();
|
||||||
|
odometry_.pop_front();
|
||||||
|
}
|
||||||
|
if(groundTruth_.size())
|
||||||
|
{
|
||||||
|
groundTruthPose = groundTruth_.front();
|
||||||
|
groundTruth_.pop_front();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
while(_count++ < _startAt && (fileName = _dir->getNextFileName()).size())
|
while(_count++ < _startAt && (fileName = _dir->getNextFileName()).size())
|
||||||
{
|
{
|
||||||
imageFilePath = _path + fileName;
|
imageFilePath = _path + fileName;
|
||||||
|
if(_stamps.size())
|
||||||
|
{
|
||||||
|
stamp = _stamps.front();
|
||||||
|
_stamps.pop_front();
|
||||||
|
if(_stamps.size())
|
||||||
|
{
|
||||||
|
_captureDelay = _stamps.front() - stamp;
|
||||||
|
}
|
||||||
|
if(odometry_.size())
|
||||||
|
{
|
||||||
|
odometryPose = odometry_.front();
|
||||||
|
odometry_.pop_front();
|
||||||
|
}
|
||||||
|
if(groundTruth_.size())
|
||||||
|
{
|
||||||
|
groundTruthPose = groundTruth_.front();
|
||||||
|
groundTruth_.pop_front();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(_scanDir)
|
if(_scanDir)
|
||||||
@@ -558,26 +654,6 @@ SensorData CameraImages::captureImage(CameraInfo * info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_stamps.size())
|
|
||||||
{
|
|
||||||
stamp = _stamps.front();
|
|
||||||
_stamps.pop_front();
|
|
||||||
if(_stamps.size())
|
|
||||||
{
|
|
||||||
_captureDelay = _stamps.front() - stamp;
|
|
||||||
}
|
|
||||||
if(odometry_.size())
|
|
||||||
{
|
|
||||||
odometryPose = odometry_.front();
|
|
||||||
odometry_.pop_front();
|
|
||||||
}
|
|
||||||
if(groundTruth_.size())
|
|
||||||
{
|
|
||||||
groundTruthPose = groundTruth_.front();
|
|
||||||
groundTruth_.pop_front();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!imageFilePath.empty())
|
if(!imageFilePath.empty())
|
||||||
{
|
{
|
||||||
ULOGGER_DEBUG("Loading image : %s", imageFilePath.c_str());
|
ULOGGER_DEBUG("Loading image : %s", imageFilePath.c_str());
|
||||||
@@ -594,9 +670,9 @@ SensorData CameraImages::captureImage(CameraInfo * info)
|
|||||||
{
|
{
|
||||||
if(img.type() != CV_16UC1 && img.type() != CV_32FC1)
|
if(img.type() != CV_16UC1 && img.type() != CV_32FC1)
|
||||||
{
|
{
|
||||||
UERROR("Depth is on and the loaded image has not a format supported (file = \"%s\"). "
|
UERROR("Depth is on and the loaded image has not a format supported (file = \"%s\", type=%d). "
|
||||||
"Formats supported are 16 bits 1 channel and 32 bits 1 channel.",
|
"Formats supported are 16 bits 1 channel (mm) and 32 bits 1 channel (m).",
|
||||||
imageFilePath.c_str());
|
imageFilePath.c_str(), img.type());
|
||||||
img = cv::Mat();
|
img = cv::Mat();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -650,8 +726,9 @@ SensorData CameraImages::captureImage(CameraInfo * info)
|
|||||||
if(!scanFilePath.empty())
|
if(!scanFilePath.empty())
|
||||||
{
|
{
|
||||||
// load without filtering
|
// load without filtering
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud = util3d::loadCloud(scanFilePath, _scanLocalTransform);
|
scan = util3d::loadScan(scanFilePath);
|
||||||
UDEBUG("Loaded scan=%d points", (int)cloud->size());
|
scan = LaserScan(scan.data(), _scanMaxPts, 0.0f, scan.format(), _scanLocalTransform);
|
||||||
|
UDEBUG("Loaded scan=%d points", (int)scan.size());
|
||||||
if(_depthFromScan && !img.empty())
|
if(_depthFromScan && !img.empty())
|
||||||
{
|
{
|
||||||
UDEBUG("Computing depth from scan...");
|
UDEBUG("Computing depth from scan...");
|
||||||
@@ -665,6 +742,7 @@ SensorData CameraImages::captureImage(CameraInfo * info)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud = util3d::laserScanToPointCloud(scan, scan.localTransform());
|
||||||
depthFromScan = util3d::projectCloudToCamera(img.size(), _model.K(), cloud, _model.localTransform());
|
depthFromScan = util3d::projectCloudToCamera(img.size(), _model.K(), cloud, _model.localTransform());
|
||||||
if(_depthFromScanFillHoles!=0)
|
if(_depthFromScanFillHoles!=0)
|
||||||
{
|
{
|
||||||
@@ -673,29 +751,7 @@ SensorData CameraImages::captureImage(CameraInfo * info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// filter the scan after registration
|
// filter the scan after registration
|
||||||
int previousSize = (int)cloud->size();
|
scan = util3d::commonFiltering(scan, _scanDownsampleStep, 0, 0, _scanVoxelSize, _scanNormalsK, _scanNormalsRadius, _scanForceGroundNormalsUp);
|
||||||
if(_scanDownsampleStep > 1 && cloud->size())
|
|
||||||
{
|
|
||||||
cloud = util3d::downsample(cloud, _scanDownsampleStep);
|
|
||||||
UDEBUG("Downsampling scan (step=%d): %d -> %d", _scanDownsampleStep, previousSize, (int)cloud->size());
|
|
||||||
}
|
|
||||||
previousSize = (int)cloud->size();
|
|
||||||
if(_scanVoxelSize > 0.0f && cloud->size())
|
|
||||||
{
|
|
||||||
cloud = util3d::voxelize(cloud, _scanVoxelSize);
|
|
||||||
UDEBUG("Voxel filtering scan (voxel=%f m): %d -> %d", _scanVoxelSize, previousSize, (int)cloud->size());
|
|
||||||
}
|
|
||||||
if(_scanNormalsK > 0 && cloud->size())
|
|
||||||
{
|
|
||||||
pcl::PointCloud<pcl::Normal>::Ptr normals = util3d::computeNormals(cloud, _scanNormalsK);
|
|
||||||
pcl::PointCloud<pcl::PointNormal>::Ptr cloudNormals(new pcl::PointCloud<pcl::PointNormal>);
|
|
||||||
pcl::concatenateFields(*cloud, *normals, *cloudNormals);
|
|
||||||
scan = util3d::laserScanFromPointCloud(*cloudNormals, _scanLocalTransform.inverse());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scan = util3d::laserScanFromPointCloud(*cloud, _scanLocalTransform.inverse());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -708,7 +764,7 @@ SensorData CameraImages::captureImage(CameraInfo * info)
|
|||||||
_model.setImageSize(img.size());
|
_model.setImageSize(img.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
SensorData data(scan, LaserScanInfo(scan.empty()?0:_scanMaxPts, 0, _scanLocalTransform), _isDepth?cv::Mat():img, _isDepth?img:depthFromScan, _model, this->getNextSeqID(), stamp);
|
SensorData data(scan, _isDepth?cv::Mat():img, _isDepth?img:depthFromScan, _model, this->getNextSeqID(), stamp);
|
||||||
data.setGroundTruth(groundTruthPose);
|
data.setGroundTruth(groundTruthPose);
|
||||||
|
|
||||||
if(info && !odometryPose.isNull())
|
if(info && !odometryPose.isNull())
|
||||||
|
|||||||
+1593
-147
File diff suppressed because it is too large
Load Diff
@@ -39,6 +39,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <rtabmap/utilite/UTimer.h>
|
#include <rtabmap/utilite/UTimer.h>
|
||||||
#include <rtabmap/utilite/UMath.h>
|
#include <rtabmap/utilite/UMath.h>
|
||||||
|
|
||||||
|
#include <opencv2/imgproc/types_c.h>
|
||||||
|
#if CV_MAJOR_VERSION >= 3
|
||||||
|
#include <opencv2/videoio/videoio_c.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef RTABMAP_DC1394
|
#ifdef RTABMAP_DC1394
|
||||||
#include <dc1394/dc1394.h>
|
#include <dc1394/dc1394.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -361,10 +366,7 @@ CameraStereoDC1394::CameraStereoDC1394(float imageRate, const Transform & localT
|
|||||||
CameraStereoDC1394::~CameraStereoDC1394()
|
CameraStereoDC1394::~CameraStereoDC1394()
|
||||||
{
|
{
|
||||||
#ifdef RTABMAP_DC1394
|
#ifdef RTABMAP_DC1394
|
||||||
if(device_)
|
delete device_;
|
||||||
{
|
|
||||||
delete device_;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,7 +381,7 @@ bool CameraStereoDC1394::init(const std::string & calibrationFolder, const std::
|
|||||||
// look for calibration files
|
// look for calibration files
|
||||||
if(!calibrationFolder.empty())
|
if(!calibrationFolder.empty())
|
||||||
{
|
{
|
||||||
if(!stereoModel_.load(calibrationFolder, cameraName.empty()?device_->guid():cameraName))
|
if(!stereoModel_.load(calibrationFolder, cameraName.empty()?device_->guid():cameraName, false))
|
||||||
{
|
{
|
||||||
UWARN("Missing calibration files for camera \"%s\" in \"%s\" folder, you should calibrate the camera!",
|
UWARN("Missing calibration files for camera \"%s\" in \"%s\" folder, you should calibrate the camera!",
|
||||||
cameraName.empty()?device_->guid().c_str():cameraName.c_str(), calibrationFolder.c_str());
|
cameraName.empty()?device_->guid().c_str():cameraName.c_str(), calibrationFolder.c_str());
|
||||||
@@ -829,10 +831,7 @@ CameraStereoZed::CameraStereoZed(
|
|||||||
CameraStereoZed::~CameraStereoZed()
|
CameraStereoZed::~CameraStereoZed()
|
||||||
{
|
{
|
||||||
#ifdef RTABMAP_ZED
|
#ifdef RTABMAP_ZED
|
||||||
if(zed_)
|
delete zed_;
|
||||||
{
|
|
||||||
delete zed_;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -855,7 +854,7 @@ bool CameraStereoZed::init(const std::string & calibrationFolder, const std::str
|
|||||||
param.depth_mode=(sl::DEPTH_MODE)quality_;
|
param.depth_mode=(sl::DEPTH_MODE)quality_;
|
||||||
param.coordinate_units=sl::UNIT_METER;
|
param.coordinate_units=sl::UNIT_METER;
|
||||||
param.coordinate_system=(sl::COORDINATE_SYSTEM)sl::COORDINATE_SYSTEM_IMAGE ;
|
param.coordinate_system=(sl::COORDINATE_SYSTEM)sl::COORDINATE_SYSTEM_IMAGE ;
|
||||||
param.sdk_verbose=false;
|
param.sdk_verbose=true;
|
||||||
param.sdk_gpu_id=-1;
|
param.sdk_gpu_id=-1;
|
||||||
param.depth_minimum_distance=-1;
|
param.depth_minimum_distance=-1;
|
||||||
param.camera_disable_self_calib=!selfCalibration_;
|
param.camera_disable_self_calib=!selfCalibration_;
|
||||||
@@ -877,7 +876,7 @@ bool CameraStereoZed::init(const std::string & calibrationFolder, const std::str
|
|||||||
|
|
||||||
if(r!=sl::ERROR_CODE::SUCCESS)
|
if(r!=sl::ERROR_CODE::SUCCESS)
|
||||||
{
|
{
|
||||||
UERROR("Camera initialization failed: \"%s\"", errorCode2str(r).c_str());
|
UERROR("Camera initialization failed: \"%s\"", toString(r).c_str());
|
||||||
delete zed_;
|
delete zed_;
|
||||||
zed_ = 0;
|
zed_ = 0;
|
||||||
return false;
|
return false;
|
||||||
@@ -888,19 +887,26 @@ bool CameraStereoZed::init(const std::string & calibrationFolder, const std::str
|
|||||||
quality_, sl::UNIT_METER, sl::COORDINATE_SYSTEM_IMAGE , selfCalibration_?"true":"false");
|
quality_, sl::UNIT_METER, sl::COORDINATE_SYSTEM_IMAGE , selfCalibration_?"true":"false");
|
||||||
UDEBUG("");
|
UDEBUG("");
|
||||||
|
|
||||||
zed_->setConfidenceThreshold(confidenceThr_);
|
if(quality_!=sl::DEPTH_MODE_NONE)
|
||||||
|
{
|
||||||
|
zed_->setConfidenceThreshold(confidenceThr_);
|
||||||
|
}
|
||||||
|
|
||||||
if (computeOdometry_)
|
if (computeOdometry_)
|
||||||
{
|
{
|
||||||
sl::TrackingParameters tparam;
|
sl::TrackingParameters tparam;
|
||||||
tparam.enable_spatial_memory=false;
|
tparam.enable_spatial_memory=false;
|
||||||
zed_->enableTracking(tparam);
|
zed_->enableTracking(tparam);
|
||||||
|
if(r!=sl::ERROR_CODE::SUCCESS)
|
||||||
|
{
|
||||||
|
UERROR("Camera tracking initialization failed: \"%s\"", toString(r).c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sl::CameraInformation infos = zed_->getCameraInformation();
|
sl::CameraInformation infos = zed_->getCameraInformation();
|
||||||
sl::CalibrationParameters *stereoParams = &(infos.calibration_parameters );
|
sl::CalibrationParameters *stereoParams = &(infos.calibration_parameters );
|
||||||
sl::Resolution res = stereoParams->left_cam.image_size;
|
sl::Resolution res = stereoParams->left_cam.image_size;
|
||||||
|
|
||||||
stereoModel_ = StereoCameraModel(
|
stereoModel_ = StereoCameraModel(
|
||||||
stereoParams->left_cam.fx,
|
stereoParams->left_cam.fx,
|
||||||
stereoParams->left_cam.fy,
|
stereoParams->left_cam.fy,
|
||||||
@@ -993,16 +999,17 @@ SensorData CameraStereoZed::captureImage(CameraInfo * info)
|
|||||||
{
|
{
|
||||||
UTimer timer;
|
UTimer timer;
|
||||||
bool res = zed_->grab(rparam);
|
bool res = zed_->grab(rparam);
|
||||||
while (src_ == CameraVideo::kUsbDevice && res && timer.elapsed() < 2.0)
|
while (src_ == CameraVideo::kUsbDevice && res!=sl::SUCCESS && timer.elapsed() < 2.0)
|
||||||
{
|
{
|
||||||
// maybe there is a latency with the USB, try again in 10 ms (for the next 2 seconds)
|
// maybe there is a latency with the USB, try again in 10 ms (for the next 2 seconds)
|
||||||
uSleep(10);
|
uSleep(10);
|
||||||
res = zed_->grab(rparam);
|
res = zed_->grab(rparam);
|
||||||
}
|
}
|
||||||
if(!res)
|
if(res==sl::SUCCESS)
|
||||||
{
|
{
|
||||||
// get left image
|
// get left image
|
||||||
sl::Mat tmp;zed_->retrieveImage(tmp,sl::VIEW_LEFT);
|
sl::Mat tmp;
|
||||||
|
zed_->retrieveImage(tmp,sl::VIEW_LEFT);
|
||||||
cv::Mat rgbaLeft = slMat2cvMat(tmp);
|
cv::Mat rgbaLeft = slMat2cvMat(tmp);
|
||||||
|
|
||||||
cv::Mat left;
|
cv::Mat left;
|
||||||
@@ -1032,28 +1039,37 @@ SensorData CameraStereoZed::captureImage(CameraInfo * info)
|
|||||||
if (computeOdometry_ && info)
|
if (computeOdometry_ && info)
|
||||||
{
|
{
|
||||||
sl::Pose pose;
|
sl::Pose pose;
|
||||||
zed_->getPosition(pose);
|
sl::TRACKING_STATE tracking_state = zed_->getPosition(pose);
|
||||||
int trackingConfidence = pose.pose_confidence;
|
if (tracking_state == sl::TRACKING_STATE_OK)
|
||||||
// FIXME What does pose_confidence == -1 mean?
|
|
||||||
if (trackingConfidence>0)
|
|
||||||
{
|
{
|
||||||
info->odomPose = zedPoseToTransform(pose);
|
int trackingConfidence = pose.pose_confidence;
|
||||||
if (!info->odomPose.isNull())
|
// FIXME What does pose_confidence == -1 mean?
|
||||||
|
if (trackingConfidence>0)
|
||||||
{
|
{
|
||||||
//transform x->forward, y->left, z->up
|
info->odomPose = zedPoseToTransform(pose);
|
||||||
Transform opticalTransform(0, 0, 1, 0, -1, 0, 0, 0, 0, -1, 0, 0);
|
if (!info->odomPose.isNull())
|
||||||
info->odomPose = opticalTransform * info->odomPose * opticalTransform.inverse();
|
|
||||||
|
|
||||||
if (lost_)
|
|
||||||
{
|
{
|
||||||
info->odomCovariance = cv::Mat::eye(6, 6, CV_64FC1) * 9999.0f; // don't know transform with previous pose
|
//transform x->forward, y->left, z->up
|
||||||
lost_ = false;
|
Transform opticalTransform(0, 0, 1, 0, -1, 0, 0, 0, 0, -1, 0, 0);
|
||||||
UDEBUG("Init %s (var=%f)", info->odomPose.prettyPrint().c_str(), 9999.0f);
|
info->odomPose = opticalTransform * info->odomPose * opticalTransform.inverse();
|
||||||
|
|
||||||
|
if (lost_)
|
||||||
|
{
|
||||||
|
info->odomCovariance = cv::Mat::eye(6, 6, CV_64FC1) * 9999.0f; // don't know transform with previous pose
|
||||||
|
lost_ = false;
|
||||||
|
UDEBUG("Init %s (var=%f)", info->odomPose.prettyPrint().c_str(), 9999.0f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
info->odomCovariance = cv::Mat::eye(6, 6, CV_64FC1) * 1.0f / float(trackingConfidence);
|
||||||
|
UDEBUG("Run %s (var=%f)", info->odomPose.prettyPrint().c_str(), 1.0f / float(trackingConfidence));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
info->odomCovariance = cv::Mat::eye(6, 6, CV_64FC1) * 1.0f / float(trackingConfidence);
|
info->odomCovariance = cv::Mat::eye(6, 6, CV_64FC1) * 9999.0f; // lost
|
||||||
UDEBUG("Run %s (var=%f)", info->odomPose.prettyPrint().c_str(), 1.0f / float(trackingConfidence));
|
lost_ = true;
|
||||||
|
UWARN("ZED lost! (trackingConfidence=%d)", trackingConfidence);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1065,9 +1081,7 @@ SensorData CameraStereoZed::captureImage(CameraInfo * info)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
info->odomCovariance = cv::Mat::eye(6, 6, CV_64FC1) * 9999.0f; // lost
|
UWARN("Tracking not ok: state=\"%s\"", toString(tracking_state).c_str());
|
||||||
lost_ = true;
|
|
||||||
UWARN("ZED lost! (trackingConfidence=%d)", trackingConfidence);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1135,10 +1149,7 @@ CameraStereoImages::CameraStereoImages(
|
|||||||
CameraStereoImages::~CameraStereoImages()
|
CameraStereoImages::~CameraStereoImages()
|
||||||
{
|
{
|
||||||
UDEBUG("");
|
UDEBUG("");
|
||||||
if(camera2_)
|
delete camera2_;
|
||||||
{
|
|
||||||
delete camera2_;
|
|
||||||
}
|
|
||||||
UDEBUG("");
|
UDEBUG("");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1147,7 +1158,7 @@ bool CameraStereoImages::init(const std::string & calibrationFolder, const std::
|
|||||||
// look for calibration files
|
// look for calibration files
|
||||||
if(!calibrationFolder.empty() && !cameraName.empty())
|
if(!calibrationFolder.empty() && !cameraName.empty())
|
||||||
{
|
{
|
||||||
if(!stereoModel_.load(calibrationFolder, cameraName))
|
if(!stereoModel_.load(calibrationFolder, cameraName, false) && !stereoModel_.isValidForProjection())
|
||||||
{
|
{
|
||||||
UWARN("Missing calibration files for camera \"%s\" in \"%s\" folder, you should calibrate the camera!",
|
UWARN("Missing calibration files for camera \"%s\" in \"%s\" folder, you should calibrate the camera!",
|
||||||
cameraName.c_str(), calibrationFolder.c_str());
|
cameraName.c_str(), calibrationFolder.c_str());
|
||||||
@@ -1255,7 +1266,7 @@ SensorData CameraStereoImages::captureImage(CameraInfo * info)
|
|||||||
stereoModel_.setImageSize(leftImage.size());
|
stereoModel_.setImageSize(leftImage.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
data = SensorData(left.laserScanRaw(), left.laserScanInfo(), leftImage, rightImage, stereoModel_, left.id()/(camera2_?1:2), left.stamp());
|
data = SensorData(left.laserScanRaw(), leftImage, rightImage, stereoModel_, left.id()/(camera2_?1:2), left.stamp());
|
||||||
data.setGroundTruth(left.groundTruth());
|
data.setGroundTruth(left.groundTruth());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1279,7 +1290,8 @@ CameraStereoVideo::CameraStereoVideo(
|
|||||||
path_(path),
|
path_(path),
|
||||||
rectifyImages_(rectifyImages),
|
rectifyImages_(rectifyImages),
|
||||||
src_(CameraVideo::kVideoFile),
|
src_(CameraVideo::kVideoFile),
|
||||||
usbDevice_(0)
|
usbDevice_(0),
|
||||||
|
usbDevice2_(-1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1294,7 +1306,8 @@ CameraStereoVideo::CameraStereoVideo(
|
|||||||
path2_(pathRight),
|
path2_(pathRight),
|
||||||
rectifyImages_(rectifyImages),
|
rectifyImages_(rectifyImages),
|
||||||
src_(CameraVideo::kVideoFile),
|
src_(CameraVideo::kVideoFile),
|
||||||
usbDevice_(0)
|
usbDevice_(0),
|
||||||
|
usbDevice2_(-1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1306,7 +1319,22 @@ CameraStereoVideo::CameraStereoVideo(
|
|||||||
Camera(imageRate, localTransform),
|
Camera(imageRate, localTransform),
|
||||||
rectifyImages_(rectifyImages),
|
rectifyImages_(rectifyImages),
|
||||||
src_(CameraVideo::kUsbDevice),
|
src_(CameraVideo::kUsbDevice),
|
||||||
usbDevice_(device)
|
usbDevice_(device),
|
||||||
|
usbDevice2_(-1)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CameraStereoVideo::CameraStereoVideo(
|
||||||
|
int deviceLeft,
|
||||||
|
int deviceRight,
|
||||||
|
bool rectifyImages,
|
||||||
|
float imageRate,
|
||||||
|
const Transform & localTransform) :
|
||||||
|
Camera(imageRate, localTransform),
|
||||||
|
rectifyImages_(rectifyImages),
|
||||||
|
src_(CameraVideo::kUsbDevice),
|
||||||
|
usbDevice_(deviceLeft),
|
||||||
|
usbDevice2_(deviceRight)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1330,20 +1358,27 @@ bool CameraStereoVideo::init(const std::string & calibrationFolder, const std::s
|
|||||||
|
|
||||||
if (src_ == CameraVideo::kUsbDevice)
|
if (src_ == CameraVideo::kUsbDevice)
|
||||||
{
|
{
|
||||||
ULOGGER_DEBUG("CameraStereoVideo: Usb device initialization on device %d", usbDevice_);
|
|
||||||
capture_.open(usbDevice_);
|
capture_.open(usbDevice_);
|
||||||
|
if(usbDevice2_ < 0)
|
||||||
|
{
|
||||||
|
ULOGGER_DEBUG("CameraStereoVideo: Usb device initialization on device %d", usbDevice_);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ULOGGER_DEBUG("CameraStereoVideo: Usb device initialization on devices %d and %d", usbDevice_, usbDevice2_);
|
||||||
|
capture2_.open(usbDevice2_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (src_ == CameraVideo::kVideoFile)
|
else if (src_ == CameraVideo::kVideoFile)
|
||||||
{
|
{
|
||||||
|
capture_.open(path_.c_str());
|
||||||
if(path2_.empty())
|
if(path2_.empty())
|
||||||
{
|
{
|
||||||
ULOGGER_DEBUG("CameraStereoVideo: filename=\"%s\"", path_.c_str());
|
ULOGGER_DEBUG("CameraStereoVideo: filename=\"%s\"", path_.c_str());
|
||||||
capture_.open(path_.c_str());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ULOGGER_DEBUG("CameraStereoVideo: filenames=\"%s\" and \"%s\"", path_.c_str(), path2_.c_str());
|
ULOGGER_DEBUG("CameraStereoVideo: filenames=\"%s\" and \"%s\"", path_.c_str(), path2_.c_str());
|
||||||
capture_.open(path_.c_str());
|
|
||||||
capture2_.open(path2_.c_str());
|
capture2_.open(path2_.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1352,7 +1387,7 @@ bool CameraStereoVideo::init(const std::string & calibrationFolder, const std::s
|
|||||||
ULOGGER_ERROR("CameraStereoVideo: Unknown source...");
|
ULOGGER_ERROR("CameraStereoVideo: Unknown source...");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!capture_.isOpened() || (!path2_.empty() && !capture2_.isOpened()))
|
if(!capture_.isOpened() || ((!path2_.empty() || usbDevice2_>=0) && !capture2_.isOpened()))
|
||||||
{
|
{
|
||||||
ULOGGER_ERROR("CameraStereoVideo: Failed to create a capture object!");
|
ULOGGER_ERROR("CameraStereoVideo: Failed to create a capture object!");
|
||||||
capture_.release();
|
capture_.release();
|
||||||
@@ -1372,7 +1407,7 @@ bool CameraStereoVideo::init(const std::string & calibrationFolder, const std::s
|
|||||||
// look for calibration files
|
// look for calibration files
|
||||||
if(!calibrationFolder.empty() && !cameraName_.empty())
|
if(!calibrationFolder.empty() && !cameraName_.empty())
|
||||||
{
|
{
|
||||||
if(!stereoModel_.load(calibrationFolder, cameraName_))
|
if(!stereoModel_.load(calibrationFolder, cameraName_, false))
|
||||||
{
|
{
|
||||||
UWARN("Missing calibration files for camera \"%s\" in \"%s\" folder, you should calibrate the camera!",
|
UWARN("Missing calibration files for camera \"%s\" in \"%s\" folder, you should calibrate the camera!",
|
||||||
cameraName_.c_str(), calibrationFolder.c_str());
|
cameraName_.c_str(), calibrationFolder.c_str());
|
||||||
@@ -1411,11 +1446,11 @@ SensorData CameraStereoVideo::captureImage(CameraInfo * info)
|
|||||||
SensorData data;
|
SensorData data;
|
||||||
|
|
||||||
cv::Mat img;
|
cv::Mat img;
|
||||||
if(capture_.isOpened() && (path2_.empty() || capture2_.isOpened()))
|
if(capture_.isOpened() && ((path2_.empty() && usbDevice2_ < 0) || capture2_.isOpened()))
|
||||||
{
|
{
|
||||||
cv::Mat leftImage;
|
cv::Mat leftImage;
|
||||||
cv::Mat rightImage;
|
cv::Mat rightImage;
|
||||||
if(path2_.empty())
|
if(path2_.empty() && usbDevice2_ < 0)
|
||||||
{
|
{
|
||||||
if(!capture_.read(img))
|
if(!capture_.read(img))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "rtabmap/core/StereoDense.h"
|
#include "rtabmap/core/StereoDense.h"
|
||||||
#include "rtabmap/core/DBReader.h"
|
#include "rtabmap/core/DBReader.h"
|
||||||
#include "rtabmap/core/clams/discrete_depth_distortion_model.h"
|
#include "rtabmap/core/clams/discrete_depth_distortion_model.h"
|
||||||
|
#include <opencv2/stitching/detail/exposure_compensate.hpp>
|
||||||
#include <rtabmap/utilite/UTimer.h>
|
#include <rtabmap/utilite/UTimer.h>
|
||||||
#include <rtabmap/utilite/ULogger.h>
|
#include <rtabmap/utilite/ULogger.h>
|
||||||
|
|
||||||
@@ -49,6 +49,7 @@ namespace rtabmap
|
|||||||
CameraThread::CameraThread(Camera * camera, const ParametersMap & parameters) :
|
CameraThread::CameraThread(Camera * camera, const ParametersMap & parameters) :
|
||||||
_camera(camera),
|
_camera(camera),
|
||||||
_mirroring(false),
|
_mirroring(false),
|
||||||
|
_stereoExposureCompensation(false),
|
||||||
_colorOnly(false),
|
_colorOnly(false),
|
||||||
_imageDecimation(1),
|
_imageDecimation(1),
|
||||||
_stereoToDepth(false),
|
_stereoToDepth(false),
|
||||||
@@ -58,6 +59,7 @@ CameraThread::CameraThread(Camera * camera, const ParametersMap & parameters) :
|
|||||||
_scanMinDepth(0.0f),
|
_scanMinDepth(0.0f),
|
||||||
_scanVoxelSize(0.0f),
|
_scanVoxelSize(0.0f),
|
||||||
_scanNormalsK(0),
|
_scanNormalsK(0),
|
||||||
|
_scanNormalsRadius(0.0f),
|
||||||
_stereoDense(new StereoBM(parameters)),
|
_stereoDense(new StereoBM(parameters)),
|
||||||
_distortionModel(0),
|
_distortionModel(0),
|
||||||
_bilateralFiltering(false),
|
_bilateralFiltering(false),
|
||||||
@@ -71,14 +73,8 @@ CameraThread::~CameraThread()
|
|||||||
{
|
{
|
||||||
UDEBUG("");
|
UDEBUG("");
|
||||||
join(true);
|
join(true);
|
||||||
if(_camera)
|
delete _camera;
|
||||||
{
|
delete _distortionModel;
|
||||||
delete _camera;
|
|
||||||
}
|
|
||||||
if(_distortionModel)
|
|
||||||
{
|
|
||||||
delete _distortionModel;
|
|
||||||
}
|
|
||||||
delete _stereoDense;
|
delete _stereoDense;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,6 +117,7 @@ void CameraThread::enableBilateralFiltering(float sigmaS, float sigmaR)
|
|||||||
void CameraThread::mainLoopBegin()
|
void CameraThread::mainLoopBegin()
|
||||||
{
|
{
|
||||||
ULogger::registerCurrentThread("Camera");
|
ULogger::registerCurrentThread("Camera");
|
||||||
|
_camera->resetTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CameraThread::mainLoop()
|
void CameraThread::mainLoop()
|
||||||
@@ -254,7 +251,9 @@ void CameraThread::postUpdate(SensorData * dataPtr, CameraInfo * info) const
|
|||||||
data.cameraModels()[0].fy(),
|
data.cameraModels()[0].fy(),
|
||||||
float(data.imageRaw().cols) - data.cameraModels()[0].cx(),
|
float(data.imageRaw().cols) - data.cameraModels()[0].cx(),
|
||||||
data.cameraModels()[0].cy(),
|
data.cameraModels()[0].cy(),
|
||||||
data.cameraModels()[0].localTransform());
|
data.cameraModels()[0].localTransform(),
|
||||||
|
data.cameraModels()[0].Tx(),
|
||||||
|
data.cameraModels()[0].imageSize());
|
||||||
data.setCameraModel(tmpModel);
|
data.setCameraModel(tmpModel);
|
||||||
}
|
}
|
||||||
if(!data.depthRaw().empty())
|
if(!data.depthRaw().empty())
|
||||||
@@ -265,6 +264,33 @@ void CameraThread::postUpdate(SensorData * dataPtr, CameraInfo * info) const
|
|||||||
}
|
}
|
||||||
if(info) info->timeMirroring = timer.ticks();
|
if(info) info->timeMirroring = timer.ticks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(_stereoExposureCompensation && !data.imageRaw().empty() && !data.rightRaw().empty())
|
||||||
|
{
|
||||||
|
#if CV_MAJOR_VERSION < 3
|
||||||
|
UWARN("Stereo exposure compensation not implemented for OpenCV version under 3.");
|
||||||
|
#else
|
||||||
|
UDEBUG("");
|
||||||
|
UTimer timer;
|
||||||
|
cv::Ptr<cv::detail::ExposureCompensator> compensator = cv::detail::ExposureCompensator::createDefault(cv::detail::ExposureCompensator::GAIN);
|
||||||
|
std::vector<cv::Point> topLeftCorners(2, cv::Point(0,0));
|
||||||
|
std::vector<cv::UMat> images;
|
||||||
|
std::vector<cv::UMat> masks(2, cv::UMat(data.imageRaw().size(), CV_8UC1, cv::Scalar(255)));
|
||||||
|
images.push_back(data.imageRaw().getUMat(cv::ACCESS_READ));
|
||||||
|
images.push_back(data.rightRaw().getUMat(cv::ACCESS_READ));
|
||||||
|
compensator->feed(topLeftCorners, images, masks);
|
||||||
|
cv::Mat img = data.imageRaw().clone();
|
||||||
|
compensator->apply(0, cv::Point(0,0), img, masks[0]);
|
||||||
|
data.setImageRaw(img);
|
||||||
|
img = data.rightRaw().clone();
|
||||||
|
compensator->apply(1, cv::Point(0,0), img, masks[1]);
|
||||||
|
data.setDepthOrRightRaw(img);
|
||||||
|
cv::detail::GainCompensator * gainCompensator = (cv::detail::GainCompensator*)compensator.get();
|
||||||
|
UDEBUG("gains = %f %f ", gainCompensator->gains()[0], gainCompensator->gains()[1]);
|
||||||
|
if(info) info->timeStereoExposureCompensation = timer.ticks();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if(_stereoToDepth && !data.imageRaw().empty() && data.stereoCameraModel().isValidForProjection() && !data.rightRaw().empty())
|
if(_stereoToDepth && !data.imageRaw().empty() && data.stereoCameraModel().isValidForProjection() && !data.rightRaw().empty())
|
||||||
{
|
{
|
||||||
UDEBUG("");
|
UDEBUG("");
|
||||||
@@ -280,7 +306,8 @@ void CameraThread::postUpdate(SensorData * dataPtr, CameraInfo * info) const
|
|||||||
data.stereoCameraModel().left().cx(),
|
data.stereoCameraModel().left().cx(),
|
||||||
data.stereoCameraModel().left().cy(),
|
data.stereoCameraModel().left().cy(),
|
||||||
data.stereoCameraModel().localTransform(),
|
data.stereoCameraModel().localTransform(),
|
||||||
-data.stereoCameraModel().baseline()*data.stereoCameraModel().left().fx());
|
-data.stereoCameraModel().baseline()*data.stereoCameraModel().left().fx(),
|
||||||
|
data.stereoCameraModel().left().imageSize());
|
||||||
data.setCameraModel(model);
|
data.setCameraModel(model);
|
||||||
data.setDepthOrRightRaw(depth);
|
data.setDepthOrRightRaw(depth);
|
||||||
data.setStereoCameraModel(StereoCameraModel());
|
data.setStereoCameraModel(StereoCameraModel());
|
||||||
@@ -292,12 +319,12 @@ void CameraThread::postUpdate(SensorData * dataPtr, CameraInfo * info) const
|
|||||||
!data.depthRaw().empty())
|
!data.depthRaw().empty())
|
||||||
{
|
{
|
||||||
UDEBUG("");
|
UDEBUG("");
|
||||||
if(data.laserScanRaw().empty())
|
if(data.laserScanRaw().isEmpty())
|
||||||
{
|
{
|
||||||
UASSERT(_scanDecimation >= 1);
|
UASSERT(_scanDecimation >= 1);
|
||||||
UTimer timer;
|
UTimer timer;
|
||||||
pcl::IndicesPtr validIndices(new std::vector<int>);
|
pcl::IndicesPtr validIndices(new std::vector<int>);
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud = util3d::cloudFromSensorData(
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud = util3d::cloudRGBFromSensorData(
|
||||||
data,
|
data,
|
||||||
_scanDecimation,
|
_scanDecimation,
|
||||||
_scanMaxDepth,
|
_scanMaxDepth,
|
||||||
@@ -306,6 +333,7 @@ void CameraThread::postUpdate(SensorData * dataPtr, CameraInfo * info) const
|
|||||||
float maxPoints = (data.depthRaw().rows/_scanDecimation)*(data.depthRaw().cols/_scanDecimation);
|
float maxPoints = (data.depthRaw().rows/_scanDecimation)*(data.depthRaw().cols/_scanDecimation);
|
||||||
cv::Mat scan;
|
cv::Mat scan;
|
||||||
const Transform & baseToScan = data.cameraModels()[0].localTransform();
|
const Transform & baseToScan = data.cameraModels()[0].localTransform();
|
||||||
|
LaserScan::Format format = LaserScan::kXYZRGB;
|
||||||
if(validIndices->size())
|
if(validIndices->size())
|
||||||
{
|
{
|
||||||
if(_scanVoxelSize>0.0f)
|
if(_scanVoxelSize>0.0f)
|
||||||
@@ -316,20 +344,21 @@ void CameraThread::postUpdate(SensorData * dataPtr, CameraInfo * info) const
|
|||||||
}
|
}
|
||||||
else if(!cloud->is_dense)
|
else if(!cloud->is_dense)
|
||||||
{
|
{
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr denseCloud(new pcl::PointCloud<pcl::PointXYZ>);
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr denseCloud(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||||
pcl::copyPointCloud(*cloud, *validIndices, *denseCloud);
|
pcl::copyPointCloud(*cloud, *validIndices, *denseCloud);
|
||||||
cloud = denseCloud;
|
cloud = denseCloud;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cloud->size())
|
if(cloud->size())
|
||||||
{
|
{
|
||||||
if(_scanNormalsK>0)
|
if(_scanNormalsK>0 || _scanNormalsRadius>0.0f)
|
||||||
{
|
{
|
||||||
Eigen::Vector3f viewPoint(baseToScan.x(), baseToScan.y(), baseToScan.z());
|
Eigen::Vector3f viewPoint(baseToScan.x(), baseToScan.y(), baseToScan.z());
|
||||||
pcl::PointCloud<pcl::Normal>::Ptr normals = util3d::computeNormals(cloud, _scanNormalsK, viewPoint);
|
pcl::PointCloud<pcl::Normal>::Ptr normals = util3d::computeNormals(cloud, _scanNormalsK, _scanNormalsRadius, viewPoint);
|
||||||
pcl::PointCloud<pcl::PointNormal>::Ptr cloudNormals(new pcl::PointCloud<pcl::PointNormal>);
|
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr cloudNormals(new pcl::PointCloud<pcl::PointXYZRGBNormal>);
|
||||||
pcl::concatenateFields(*cloud, *normals, *cloudNormals);
|
pcl::concatenateFields(*cloud, *normals, *cloudNormals);
|
||||||
scan = util3d::laserScanFromPointCloud(*cloudNormals, baseToScan.inverse());
|
scan = util3d::laserScanFromPointCloud(*cloudNormals, baseToScan.inverse());
|
||||||
|
format = LaserScan::kXYZRGBNormal;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -337,7 +366,7 @@ void CameraThread::postUpdate(SensorData * dataPtr, CameraInfo * info) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.setLaserScanRaw(scan, LaserScanInfo((int)maxPoints, _scanMaxDepth, baseToScan));
|
data.setLaserScanRaw(LaserScan(scan, (int)maxPoints, _scanMaxDepth, format, baseToScan));
|
||||||
if(info) info->timeScanFromDepth = timer.ticks();
|
if(info) info->timeScanFromDepth = timer.ticks();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -139,7 +139,11 @@ cv::Mat uncompressImage(const cv::Mat & bytes)
|
|||||||
#endif
|
#endif
|
||||||
if(image.type() == CV_8UC4)
|
if(image.type() == CV_8UC4)
|
||||||
{
|
{
|
||||||
image = cv::Mat(image.size(), CV_32FC1, image.data).clone();
|
// Using clone() or copyTo() caused a memory leak !?!?
|
||||||
|
// image = cv::Mat(image.size(), CV_32FC1, image.data).clone();
|
||||||
|
cv::Mat depth(image.size(), CV_32FC1);
|
||||||
|
memcpy(depth.data, image.data, image.total()*image.elemSize());
|
||||||
|
image = depth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return image;
|
return image;
|
||||||
@@ -270,4 +274,21 @@ cv::Mat uncompressData(const unsigned char * bytes, unsigned long size)
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cv::Mat compressString(const std::string & str)
|
||||||
|
{
|
||||||
|
// +1 to include null character
|
||||||
|
return compressData2(cv::Mat(1, str.size()+1, CV_8SC1, (void *)str.data()));
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string uncompressString(const cv::Mat & bytes)
|
||||||
|
{
|
||||||
|
cv::Mat strMat = uncompressData(bytes);
|
||||||
|
if(!strMat.empty())
|
||||||
|
{
|
||||||
|
UASSERT(strMat.type() == CV_8SC1 && strMat.rows == 1);
|
||||||
|
return (const char*)strMat.data;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
} /* namespace rtabmap */
|
} /* namespace rtabmap */
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user