mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Compare commits
370 Commits
0.20.21-me
...
0.21.5-jaz
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04fdc0d9e2 | ||
|
|
41fe47efdf | ||
|
|
7641f28250 | ||
|
|
f5a477f0f4 | ||
|
|
2fbe31f7cb | ||
|
|
623d056436 | ||
|
|
1611aa14f6 | ||
|
|
7d970ef020 | ||
|
|
1ab0133f14 | ||
|
|
4c1822683a | ||
|
|
7c601bb6e8 | ||
|
|
0d221a806f | ||
|
|
28fd696c18 | ||
|
|
c58fffe56d | ||
|
|
2a840fe340 | ||
|
|
0f03db9d7f | ||
|
|
4349f304d2 | ||
|
|
80a4ce02c9 | ||
|
|
b37f7d6351 | ||
|
|
35d4bd768c | ||
|
|
e6691658bd | ||
|
|
3cfcccdb1d | ||
|
|
8310925c81 | ||
|
|
99cb02fdff | ||
|
|
8b372b52ac | ||
|
|
c25add868a | ||
|
|
91cbbc8238 | ||
|
|
ccdddfc83f | ||
|
|
9b255d1f27 | ||
|
|
3ab8ae7eaf | ||
|
|
a327c9530c | ||
|
|
5b810da73b | ||
|
|
098301e52c | ||
|
|
f2df35be01 | ||
|
|
2f21d42555 | ||
|
|
fc9dcd6b3d | ||
|
|
0ad1d0ad69 | ||
|
|
ce0c806d75 | ||
|
|
fb37b3adba | ||
|
|
da9ff08198 | ||
|
|
32e03aaf68 | ||
|
|
03afb94d92 | ||
|
|
c5c190a2a0 | ||
|
|
bc66060fab | ||
|
|
3d5f1ad5c2 | ||
|
|
41a7eff8fa | ||
|
|
6acec02dbe | ||
|
|
fbeabf0751 | ||
|
|
0d4e4730c7 | ||
|
|
995f65b2ec | ||
|
|
c034a9631c | ||
|
|
256dcbded4 | ||
|
|
812caeeb9a | ||
|
|
a66564f98f | ||
|
|
375597af00 | ||
|
|
72d7418011 | ||
|
|
9505a21a7e | ||
|
|
36304b2cd1 | ||
|
|
f3cfa7831d | ||
|
|
99c4612c64 | ||
|
|
27dea71398 | ||
|
|
726bceb816 | ||
|
|
700704bec9 | ||
|
|
6a6913c939 | ||
|
|
a55b4203cd | ||
|
|
a3267c9da6 | ||
|
|
fbbab1c077 | ||
|
|
4e7110930c | ||
|
|
9266926a4a | ||
|
|
5a159cef04 | ||
|
|
5ed1bf0ca8 | ||
|
|
c33e995e83 | ||
|
|
92edae35fc | ||
|
|
d794669ef9 | ||
|
|
9cb0046734 | ||
|
|
76f63ab79a | ||
|
|
063ca9c8ee | ||
|
|
11adbdcc9f | ||
|
|
8612ebba93 | ||
|
|
a0476af896 | ||
|
|
3b735907c8 | ||
|
|
0ba79be461 | ||
|
|
cc17ebe92b | ||
|
|
bfeb487dba | ||
|
|
bc6d390fb6 | ||
|
|
f8a63ecf10 | ||
|
|
7183b43c2a | ||
|
|
fa3ece5183 | ||
|
|
2f132b3a40 | ||
|
|
79dc180bf4 | ||
|
|
264c560a2c | ||
|
|
4ce36ef245 | ||
|
|
d0227694c5 | ||
|
|
a6d9425bce | ||
|
|
e299505a64 | ||
|
|
57b4954cb3 | ||
|
|
2577c47e77 | ||
|
|
52e1b01597 | ||
|
|
8019a2dc49 | ||
|
|
33b875ecbf | ||
|
|
c24f95a8d9 | ||
|
|
6f7e5cc97b | ||
|
|
fccf33dd96 | ||
|
|
752ca76cf5 | ||
|
|
81e249b56c | ||
|
|
ff7c8af56f | ||
|
|
a11ea291d8 | ||
|
|
cd615c6e52 | ||
|
|
1bd2d9fe81 | ||
|
|
510aef19e4 | ||
|
|
1dadd50cf2 | ||
|
|
b2a86d640a | ||
|
|
c27507bc77 | ||
|
|
b374c6cd8e | ||
|
|
29dc6c67fa | ||
|
|
10de748531 | ||
|
|
dcd5994456 | ||
|
|
13cd5e7a5e | ||
|
|
856e372dde | ||
|
|
423e67558b | ||
|
|
ace653593b | ||
|
|
7b31c737be | ||
|
|
0b534c9427 | ||
|
|
cdbdcfe676 | ||
|
|
b7239fdc84 | ||
|
|
a0559b156b | ||
|
|
79db6b2811 | ||
|
|
096592e4fc | ||
|
|
d135ef02e2 | ||
|
|
ee09e92496 | ||
|
|
e619c57759 | ||
|
|
f6a0323d46 | ||
|
|
933d26f005 | ||
|
|
ec8f9fdcfd | ||
|
|
f4a60f0b6f | ||
|
|
ade94cde1c | ||
|
|
71415992ac | ||
|
|
45392fcfc6 | ||
|
|
be3e6c538c | ||
|
|
f56875db4a | ||
|
|
0876603325 | ||
|
|
3a7f88dc6c | ||
|
|
07c24e95ba | ||
|
|
7ab1ee0a0b | ||
|
|
fc8ead2237 | ||
|
|
a1d43d2353 | ||
|
|
aaff1abc4f | ||
|
|
9c56a429cc | ||
|
|
757d3eb90b | ||
|
|
4812ce4eaf | ||
|
|
56552afa6c | ||
|
|
45a3b59a23 | ||
|
|
08d0ef7408 | ||
|
|
8da6ea1707 | ||
|
|
64962e8e3d | ||
|
|
71bb0cf226 | ||
|
|
948e15c72c | ||
|
|
f06cc0b17f | ||
|
|
2aa139b579 | ||
|
|
67c6a15b93 | ||
|
|
78c029d833 | ||
|
|
afd10b1aa6 | ||
|
|
f1cd819673 | ||
|
|
fb466a6a96 | ||
|
|
0b7181fc88 | ||
|
|
97f2b4b65d | ||
|
|
39dedba93a | ||
|
|
49daa211ea | ||
|
|
01c2e70b11 | ||
|
|
fa4a2eb5e3 | ||
|
|
9e86faa4ad | ||
|
|
e31eec2c55 | ||
|
|
2d7d0ec424 | ||
|
|
191e4250ef | ||
|
|
e56e0c37f7 | ||
|
|
6a5b844bac | ||
|
|
20ad6cca2c | ||
|
|
f90fede65c | ||
|
|
61dbe51ee3 | ||
|
|
f2687ed1ff | ||
|
|
cdd8cd9e34 | ||
|
|
6d36fc1fcd | ||
|
|
ba5579f063 | ||
|
|
6395487b58 | ||
|
|
f0ba56bf5e | ||
|
|
a94a4c9802 | ||
|
|
e2f037189a | ||
|
|
bcb29cfb66 | ||
|
|
d25bb758ca | ||
|
|
424dc90dce | ||
|
|
5d6875ed98 | ||
|
|
f8b761d79b | ||
|
|
446590b19f | ||
|
|
3feb03cf35 | ||
|
|
a593b0d525 | ||
|
|
ca4276a951 | ||
|
|
e8b54de94a | ||
|
|
f9719c197d | ||
|
|
d391f237eb | ||
|
|
0b4f5d2925 | ||
|
|
7d2272beb3 | ||
|
|
6d690a315a | ||
|
|
ce81fe445a | ||
|
|
a2a75a28ba | ||
|
|
ddeca4585d | ||
|
|
64f79813cd | ||
|
|
b8c298efd9 | ||
|
|
97be9d4ace | ||
|
|
a1168ba8a9 | ||
|
|
c307f5c65f | ||
|
|
b0cf2e9927 | ||
|
|
c7e46c1431 | ||
|
|
092f6abccc | ||
|
|
dcbad6a0aa | ||
|
|
337832e1b8 | ||
|
|
d901fb23e3 | ||
|
|
59d5675fe6 | ||
|
|
ab3ade0309 | ||
|
|
720d50fe74 | ||
|
|
33fb2f75ad | ||
|
|
36c0054070 | ||
|
|
55a84cfdaa | ||
|
|
2dd64a6283 | ||
|
|
f75839294a | ||
|
|
e219152e8f | ||
|
|
d031d79369 | ||
|
|
0c476936e3 | ||
|
|
d86193036f | ||
|
|
0c3b202006 | ||
|
|
1cc7c2818f | ||
|
|
1e145550df | ||
|
|
2a3580e060 | ||
|
|
d3facb1a84 | ||
|
|
bf5c70d2e2 | ||
|
|
7f7609075f | ||
|
|
cf49ebf238 | ||
|
|
879f0f6941 | ||
|
|
af481fc730 | ||
|
|
1b67d6a86a | ||
|
|
31d975acd5 | ||
|
|
54c68f8e6c | ||
|
|
aedfcdc576 | ||
|
|
bfc4e939d1 | ||
|
|
67df99aa57 | ||
|
|
d88c816ca1 | ||
|
|
5b1c9e7233 | ||
|
|
8d6c809c3c | ||
|
|
52e417c313 | ||
|
|
5592a1ebfe | ||
|
|
42fbdda567 | ||
|
|
ae3fda37a9 | ||
|
|
ffd89ead86 | ||
|
|
937e9fbb3b | ||
|
|
9ecf71e5ed | ||
|
|
ff83b14b49 | ||
|
|
263eb6fbde | ||
|
|
e7d61b3856 | ||
|
|
682d54725a | ||
|
|
ba33c080bc | ||
|
|
2da448f4ee | ||
|
|
376c82325e | ||
|
|
95f65e1599 | ||
|
|
060af6f7bb | ||
|
|
999c01d71d | ||
|
|
a54f76238b | ||
|
|
f8f6b7788a | ||
|
|
e54195c47f | ||
|
|
e300d4c5c1 | ||
|
|
b91addb261 | ||
|
|
0f221ba3cd | ||
|
|
0070de4aaf | ||
|
|
11b4becdde | ||
|
|
8b8a512cbb | ||
|
|
141f2d3334 | ||
|
|
6dca8ab0f3 | ||
|
|
fc7a6708c5 | ||
|
|
11e5437eba | ||
|
|
c4e94bcdc3 | ||
|
|
51a7122dbe | ||
|
|
d13f594d9c | ||
|
|
85cc6fe3c7 | ||
|
|
50a0961f4e | ||
|
|
a406c37750 | ||
|
|
1cb7f3fb87 | ||
|
|
ab99719a78 | ||
|
|
e66ea7b42b | ||
|
|
46edd15121 | ||
|
|
e7bea0ec03 | ||
|
|
e3b7e9378d | ||
|
|
6fe5e6375f | ||
|
|
92b9cc89e0 | ||
|
|
53025bf059 | ||
|
|
e51d161407 | ||
|
|
3a3a4ed745 | ||
|
|
d6704ca2ed | ||
|
|
8c5c4f63bf | ||
|
|
98635ae33d | ||
|
|
70cbe52fcf | ||
|
|
e6e6630d54 | ||
|
|
34fec972dc | ||
|
|
67604a0fb0 | ||
|
|
731d73b798 | ||
|
|
70c3d5d97f | ||
|
|
23b0b37493 | ||
|
|
c7f49134eb | ||
|
|
549fc2a592 | ||
|
|
7005a8aa2a | ||
|
|
2065688116 | ||
|
|
89e3e10d89 | ||
|
|
437ed09335 | ||
|
|
59d220c54f | ||
|
|
2acd8f82b5 | ||
|
|
724e068194 | ||
|
|
e30e6937fa | ||
|
|
9406b15746 | ||
|
|
67ca39514a | ||
|
|
5fd0448924 | ||
|
|
413be8e824 | ||
|
|
dcedd8bb6b | ||
|
|
e4edee33eb | ||
|
|
128d3b0d0a | ||
|
|
ff61266430 | ||
|
|
f928cb6787 | ||
|
|
3a9ae201a7 | ||
|
|
34af17de59 | ||
|
|
95e6a9f039 | ||
|
|
b5eef4b86a | ||
|
|
40ab33031b | ||
|
|
0e908206d0 | ||
|
|
6b9f7de782 | ||
|
|
22fede9335 | ||
|
|
22917cc1c3 | ||
|
|
98bf3fb184 | ||
|
|
8d301afe6c | ||
|
|
e3ceb8a572 | ||
|
|
f12cc83fc2 | ||
|
|
4a6a765cd1 | ||
|
|
a4761ad397 | ||
|
|
aa380de2a7 | ||
|
|
467dc738c7 | ||
|
|
64cb7fb6fe | ||
|
|
8a8c360f89 | ||
|
|
83693ed1b9 | ||
|
|
860c14e0ec | ||
|
|
85bc1ee27f | ||
|
|
05676d1577 | ||
|
|
6d713c2ccb | ||
|
|
16e3314e64 | ||
|
|
d59a306ae3 | ||
|
|
bdfab4e0be | ||
|
|
c9d50ef445 | ||
|
|
2889cf8048 | ||
|
|
def876983d | ||
|
|
69214b927a | ||
|
|
67b2cbe5ca | ||
|
|
86f66cc8b8 | ||
|
|
d70924a3a4 | ||
|
|
1297714271 | ||
|
|
8e30c1c812 | ||
|
|
df888962f4 | ||
|
|
a8cdf1f940 | ||
|
|
769ace86ce | ||
|
|
97a150b180 | ||
|
|
6e8f43916c | ||
|
|
5b0047efad | ||
|
|
fdb78d33b0 | ||
|
|
2cbd43dfb6 | ||
|
|
1f06386f37 | ||
|
|
1e9b090624 | ||
|
|
7e3e5ec50b |
@@ -17,6 +17,9 @@ init:
|
|||||||
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
|
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
# To download from google drive
|
||||||
|
- set PATH=C:\Python38-x64;C:\Python38-x64\Scripts;%PATH%
|
||||||
|
- ps: py -m pip --disable-pip-version-check install gdown>=5.1.0
|
||||||
# Qt
|
# Qt
|
||||||
- set QTDIR=C:\Qt\5.10.1\msvc2015_64
|
- 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
|
# make sure Qt bin path is before cmake bin path to avoid copying qt5 dlls from cmake before qt installation
|
||||||
@@ -73,7 +76,7 @@ install:
|
|||||||
- ps: "ls \"C:/Program Files/PCL\""
|
- ps: "ls \"C:/Program Files/PCL\""
|
||||||
- set PATH=%PATH%;C:\Program Files\PCL\bin
|
- set PATH=%PATH%;C:\Program Files\PCL\bin
|
||||||
# zlib
|
# zlib
|
||||||
- ps: wget 'https://docs.google.com/uc?authuser=0&id=0B46akLGdg-uaYm9MTTI4MUtUcmc&export=download' -outfile zlib-1.2.8-vc2010-x64.zip
|
- ps: gdown -q 0B46akLGdg-uaYm9MTTI4MUtUcmc
|
||||||
- ps: Expand-Archive zlib-1.2.8-vc2010-x64.zip -DestinationPath 'C:\Program Files'
|
- ps: Expand-Archive zlib-1.2.8-vc2010-x64.zip -DestinationPath 'C:\Program Files'
|
||||||
- ECHO "Installed zlib:"
|
- ECHO "Installed zlib:"
|
||||||
- ps: "ls \"C:/Program Files/zlib\""
|
- ps: "ls \"C:/Program Files/zlib\""
|
||||||
|
|||||||
8
.devcontainer/android/devcontainer.json
Normal file
8
.devcontainer/android/devcontainer.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"image": "introlab3it/rtabmap:android-deps",
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": ["ms-vscode.cpptools-themes", "ms-vscode.cmake-tools", "vscjava.vscode-java-pack"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
.devcontainer/bionic/devcontainer.json
Normal file
8
.devcontainer/bionic/devcontainer.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"image": "introlab3it/rtabmap:18.04",
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": ["ms-vscode.cpptools-themes", "ms-vscode.cmake-tools"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
.devcontainer/focal/devcontainer.json
Normal file
8
.devcontainer/focal/devcontainer.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"image": "introlab3it/rtabmap:20.04",
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": ["ms-vscode.cpptools-themes", "ms-vscode.cmake-tools"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
.devcontainer/jammy/devcontainer.json
Normal file
8
.devcontainer/jammy/devcontainer.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"image": "introlab3it/rtabmap:22.04",
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": ["ms-vscode.cpptools-themes", "ms-vscode.cmake-tools"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
.devcontainer/noble/devcontainer.json
Normal file
8
.devcontainer/noble/devcontainer.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"image": "introlab3it/rtabmap:24.04",
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": ["ms-vscode.cpptools-themes", "ms-vscode.cmake-tools"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
53
.github/workflows/cmake-ros.yml
vendored
53
.github/workflows/cmake-ros.yml
vendored
@@ -2,10 +2,10 @@ name: CMake-ROS
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '**'
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- '**'
|
- '**'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -18,50 +18,47 @@ jobs:
|
|||||||
# well on Windows or Mac. You can convert this to a matrix build if you need
|
# well on Windows or Mac. You can convert this to a matrix build if you need
|
||||||
# cross-platform coverage.
|
# cross-platform coverage.
|
||||||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
||||||
name: Build on ros ${{ matrix.ros_distro }} and ${{ matrix.os }}
|
name: Build on ros ${{ matrix.ros_distribution }} and ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-20.04, ubuntu-18.04]
|
ros_distribution: [ noetic, humble, iron]
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-20.04
|
- ros_distribution: 'noetic'
|
||||||
ros_distro: 'noetic'
|
os: ubuntu-20.04
|
||||||
- os: ubuntu-18.04
|
- ros_distribution: 'humble'
|
||||||
ros_distro: 'melodic'
|
os: ubuntu-22.04
|
||||||
|
- ros_distribution: 'iron'
|
||||||
|
os: ubuntu-22.04
|
||||||
|
# Currently CI has some errors on setup-ros with this OS, disabling for now
|
||||||
|
#- ros_distribution: 'jazzy'
|
||||||
|
# os: ubuntu-24.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: ros-tooling/setup-ros@v0.2
|
- uses: ros-tooling/setup-ros@v0.6
|
||||||
with:
|
with:
|
||||||
required-ros-distributions: ${{ matrix.ros_distro }}
|
required-ros-distributions: ${{ matrix.ros_distribution }}
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
|
||||||
sudo apt-get -y install ros-${{ matrix.ros_distro }}-rtabmap-ros
|
rosdep update
|
||||||
sudo apt-get -y remove ros-${{ matrix.ros_distro }}-rtabmap
|
rosdep install --from-paths ${{github.workspace}} -y
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
|
||||||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
|
||||||
run: |
|
run: |
|
||||||
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
|
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
|
||||||
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
# Build your program with the given configuration
|
|
||||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||||
|
|
||||||
- name: Info
|
- name: Info
|
||||||
working-directory: ${{github.workspace}}/build/bin
|
working-directory: ${{github.workspace}}/build/bin
|
||||||
run: |
|
run: |
|
||||||
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
|
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
|
||||||
./rtabmap-console --version
|
./rtabmap-console --version
|
||||||
|
|
||||||
# - name: Test
|
|
||||||
# working-directory: ${{github.workspace}}/build
|
|
||||||
# # Execute tests defined by the CMake configuration.
|
|
||||||
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
|
||||||
# run: ctest -C ${{env.BUILD_TYPE}}
|
|
||||||
|
|
||||||
|
|||||||
9
.github/workflows/cmake.yml
vendored
9
.github/workflows/cmake.yml
vendored
@@ -3,7 +3,7 @@ name: CMake
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '**'
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- '**'
|
- '**'
|
||||||
@@ -16,17 +16,18 @@ jobs:
|
|||||||
name: ${{ matrix.os }}
|
name: ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04]
|
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
DEBIAN_FRONTEND=noninteractive
|
DEBIAN_FRONTEND=noninteractive
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install libopencv-dev libpcl-dev git cmake software-properties-common
|
sudo apt-get -y install libopencv-dev libpcl-dev git cmake software-properties-common libyaml-cpp-dev
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
107
.github/workflows/docker.yml
vendored
107
.github/workflows/docker.yml
vendored
@@ -6,24 +6,88 @@ on:
|
|||||||
- 'master'
|
- 'master'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker_deps:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
docker_tag: [xenial, bionic, focal, android23, android24, android26, android30]
|
docker_tag: [focal-deps, jammy-deps, jammy-iron-deps, noble-deps]
|
||||||
include:
|
include:
|
||||||
- docker_tag: xenial
|
- docker_tag: focal-deps
|
||||||
docker_tags: |
|
docker_tags: |
|
||||||
introlab3it/rtabmap:xenial
|
introlab3it/rtabmap:focal-deps
|
||||||
introlab3it/rtabmap:16.04
|
|
||||||
docker_platforms: |
|
docker_platforms: |
|
||||||
linux/amd64
|
linux/amd64
|
||||||
docker_path: 'xenial'
|
linux/arm64
|
||||||
|
linux/arm/v7
|
||||||
|
docker_path: 'focal/deps'
|
||||||
|
- docker_tag: jammy-deps
|
||||||
|
docker_tags: |
|
||||||
|
introlab3it/rtabmap:jammy-deps
|
||||||
|
docker_platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
docker_path: 'jammy/deps'
|
||||||
|
- docker_tag: jammy-iron-deps
|
||||||
|
docker_tags: |
|
||||||
|
introlab3it/rtabmap:jammy-iron-deps
|
||||||
|
docker_platforms: |
|
||||||
|
linux/amd64
|
||||||
|
docker_path: 'jammy-iron/deps'
|
||||||
|
- docker_tag: noble-deps
|
||||||
|
docker_tags: |
|
||||||
|
introlab3it/rtabmap:noble-deps
|
||||||
|
docker_platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
docker_path: 'noble/deps'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
with:
|
||||||
|
platforms: all
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
-
|
||||||
|
name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: ${{ matrix.docker_platforms }}
|
||||||
|
file: ./docker/${{ matrix.docker_path }}/Dockerfile
|
||||||
|
tags: ${{ matrix.docker_tags }}
|
||||||
|
cache-from: type=registry,ref=introlab3it/rtabmap:${{ matrix.docker_tag }}
|
||||||
|
cache-to: type=inline
|
||||||
|
|
||||||
|
docker:
|
||||||
|
needs: docker_deps
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
docker_tag: [bionic, focal, jammy, jammy-iron, noble, android23, android24, android26, android30]
|
||||||
|
include:
|
||||||
- docker_tag: bionic
|
- docker_tag: bionic
|
||||||
docker_tags: |
|
docker_tags: |
|
||||||
introlab3it/rtabmap:bionic
|
introlab3it/rtabmap:bionic
|
||||||
introlab3it/rtabmap:18.04
|
introlab3it/rtabmap:18.04
|
||||||
|
docker_args: |
|
||||||
|
NOT_USED=0
|
||||||
docker_platforms: |
|
docker_platforms: |
|
||||||
linux/amd64
|
linux/amd64
|
||||||
linux/arm64
|
linux/arm64
|
||||||
@@ -33,10 +97,41 @@ jobs:
|
|||||||
introlab3it/rtabmap:focal
|
introlab3it/rtabmap:focal
|
||||||
introlab3it/rtabmap:20.04
|
introlab3it/rtabmap:20.04
|
||||||
introlab3it/rtabmap:latest
|
introlab3it/rtabmap:latest
|
||||||
|
docker_args: |
|
||||||
|
NOT_USED=0
|
||||||
docker_platforms: |
|
docker_platforms: |
|
||||||
linux/amd64
|
linux/amd64
|
||||||
linux/arm64
|
linux/arm64
|
||||||
|
linux/arm/v7
|
||||||
docker_path: 'focal'
|
docker_path: 'focal'
|
||||||
|
- docker_tag: jammy
|
||||||
|
docker_tags: |
|
||||||
|
introlab3it/rtabmap:jammy
|
||||||
|
introlab3it/rtabmap:22.04
|
||||||
|
docker_args: |
|
||||||
|
NOT_USED=0
|
||||||
|
docker_platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
docker_path: 'jammy'
|
||||||
|
- docker_tag: jammy-iron
|
||||||
|
docker_tags: |
|
||||||
|
introlab3it/rtabmap:jammy-iron
|
||||||
|
docker_args: |
|
||||||
|
NOT_USED=0
|
||||||
|
docker_platforms: |
|
||||||
|
linux/amd64
|
||||||
|
docker_path: 'jammy-iron'
|
||||||
|
- docker_tag: noble
|
||||||
|
docker_tags: |
|
||||||
|
introlab3it/rtabmap:noble
|
||||||
|
introlab3it/rtabmap:24.04
|
||||||
|
docker_args: |
|
||||||
|
NOT_USED=0
|
||||||
|
docker_platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
docker_path: 'noble'
|
||||||
- docker_tag: android23
|
- docker_tag: android23
|
||||||
docker_tags: |
|
docker_tags: |
|
||||||
introlab3it/rtabmap:android23
|
introlab3it/rtabmap:android23
|
||||||
|
|||||||
16
.github/workflows/scheduled-stats.yml
vendored
Normal file
16
.github/workflows/scheduled-stats.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: RTAB-Map Scheduled Stats Extraction From GitHub
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 5 * * *'
|
||||||
|
jobs:
|
||||||
|
get_stats:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Update Stats
|
||||||
|
uses: introlab/github-stats-action@v1
|
||||||
|
with:
|
||||||
|
github-stats-token: ${{ secrets.STATS_TOKEN }}
|
||||||
|
google-application-credentials: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
||||||
|
spreadsheet-id: ${{ secrets.SPREADSHEET_ID }}
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -10,3 +10,5 @@ app/android/AndroidManifest.xml
|
|||||||
app/android/res/raw/
|
app/android/res/raw/
|
||||||
compile_flags.txt
|
compile_flags.txt
|
||||||
tags
|
tags
|
||||||
|
build_*
|
||||||
|
*.bak
|
||||||
|
|||||||
555
CMakeLists.txt
555
CMakeLists.txt
@@ -1,5 +1,5 @@
|
|||||||
# Top-Level CmakeLists.txt
|
# Top-Level CmakeLists.txt
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
PROJECT( RTABMap )
|
PROJECT( RTABMap )
|
||||||
SET(PROJECT_PREFIX rtabmap)
|
SET(PROJECT_PREFIX rtabmap)
|
||||||
|
|
||||||
@@ -19,8 +19,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 20)
|
SET(RTABMAP_MINOR_VERSION 21)
|
||||||
SET(RTABMAP_PATCH_VERSION 21)
|
SET(RTABMAP_PATCH_VERSION 5)
|
||||||
SET(RTABMAP_VERSION
|
SET(RTABMAP_VERSION
|
||||||
${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}.${RTABMAP_PATCH_VERSION})
|
${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}.${RTABMAP_PATCH_VERSION})
|
||||||
|
|
||||||
@@ -69,7 +69,11 @@ if(POLICY CMP0020)
|
|||||||
cmake_policy(SET CMP0020 NEW)
|
cmake_policy(SET CMP0020 NEW)
|
||||||
endif()
|
endif()
|
||||||
if(POLICY CMP0043)
|
if(POLICY CMP0043)
|
||||||
cmake_policy(SET CMP0043 OLD)
|
cmake_policy(SET CMP0043 NEW)
|
||||||
|
endif()
|
||||||
|
# To suppress g2o related opengl warning
|
||||||
|
if(POLICY CMP0072)
|
||||||
|
cmake_policy(SET CMP0072 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
IF(MINGW)
|
IF(MINGW)
|
||||||
@@ -106,6 +110,7 @@ if(MSVC)
|
|||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP${N}")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP${N}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
add_compile_options("/bigobj")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# [Eclipse] Automatic Discovery of Include directories (Optional, but handy)
|
# [Eclipse] Automatic Discovery of Include directories (Optional, but handy)
|
||||||
@@ -145,7 +150,7 @@ endif()
|
|||||||
set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR})
|
set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR})
|
||||||
|
|
||||||
####### BUILD OPTIONS #######
|
####### BUILD OPTIONS #######
|
||||||
|
include (GenerateExportHeader)
|
||||||
# ANDROID_PREBUILD (early exit if true)
|
# ANDROID_PREBUILD (early exit if true)
|
||||||
OPTION( ANDROID_PREBUILD "Set to ON to build rtabmap resource build tool (required for android build)" OFF )
|
OPTION( ANDROID_PREBUILD "Set to ON to build rtabmap resource build tool (required for android build)" OFF )
|
||||||
IF(ANDROID_PREBUILD)
|
IF(ANDROID_PREBUILD)
|
||||||
@@ -176,12 +181,14 @@ 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_K4W2 "Include Kinect for Windows v2 support" ON)
|
||||||
option(WITH_K4A "Include Kinect for Azure support" ON)
|
option(WITH_K4A "Include Kinect for Azure support" ON)
|
||||||
|
option(WITH_OPENNI "Include OpenNI 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)
|
||||||
option(WITH_GTSAM "Include GTSAM support" ON)
|
option(WITH_GTSAM "Include GTSAM support" ON)
|
||||||
option(WITH_TORO "Include TORO support" ON)
|
option(WITH_TORO "Include TORO support" ON)
|
||||||
option(WITH_CERES "Include Ceres support" OFF)
|
option(WITH_CERES "Include Ceres support" OFF)
|
||||||
|
option(WITH_MRPT "Include MRPT support" ON)
|
||||||
option(WITH_VERTIGO "Include Vertigo support" ON)
|
option(WITH_VERTIGO "Include Vertigo support" ON)
|
||||||
option(WITH_CVSBA "Include cvsba support" OFF)
|
option(WITH_CVSBA "Include cvsba support" OFF)
|
||||||
option(WITH_POINTMATCHER "Include libpointmatcher support" ON)
|
option(WITH_POINTMATCHER "Include libpointmatcher support" ON)
|
||||||
@@ -197,11 +204,13 @@ option(WITH_REALSENSE_SLAM "Include RealSenseSlam support" ON)
|
|||||||
option(WITH_REALSENSE2 "Include RealSense support" ON)
|
option(WITH_REALSENSE2 "Include RealSense support" ON)
|
||||||
option(WITH_MYNTEYE "Include mynteye-s support" ON)
|
option(WITH_MYNTEYE "Include mynteye-s support" ON)
|
||||||
option(WITH_DEPTHAI "Include depthai-core support" OFF)
|
option(WITH_DEPTHAI "Include depthai-core support" OFF)
|
||||||
option(WITH_OCTOMAP "Include Octomap support" ON)
|
option(WITH_XVSDK "Include XVisio SDK support" OFF)
|
||||||
|
option(WITH_OCTOMAP "Include OctoMap support" ON)
|
||||||
|
option(WITH_GRIDMAP "Include GridMap support" ON)
|
||||||
option(WITH_CPUTSDF "Include CPUTSDF support" OFF)
|
option(WITH_CPUTSDF "Include CPUTSDF support" OFF)
|
||||||
option(WITH_OPENCHISEL "Include open_chisel support" OFF)
|
option(WITH_OPENCHISEL "Include open_chisel support" OFF)
|
||||||
option(WITH_ALICE_VISION "Include AliceVision support" OFF)
|
option(WITH_ALICE_VISION "Include AliceVision support" OFF)
|
||||||
option(WITH_FOVIS "Include FOVIS support" OFF)
|
option(WITH_FOVIS "Include FOVIS supp++ort" OFF)
|
||||||
option(WITH_VISO2 "Include VISO2 support" OFF)
|
option(WITH_VISO2 "Include VISO2 support" OFF)
|
||||||
option(WITH_DVO "Include DVO support" OFF)
|
option(WITH_DVO "Include DVO support" OFF)
|
||||||
option(WITH_ORB_SLAM "Include ORB_SLAM2 or ORB_SLAM3 support" OFF)
|
option(WITH_ORB_SLAM "Include ORB_SLAM2 or ORB_SLAM3 support" OFF)
|
||||||
@@ -212,7 +221,7 @@ option(WITH_OPENVINS "Include OpenVINS support" OFF)
|
|||||||
option(WITH_MADGWICK "Include Madgwick IMU filtering support" ON)
|
option(WITH_MADGWICK "Include Madgwick IMU filtering support" ON)
|
||||||
option(WITH_FASTCV "Include FastCV support" ON)
|
option(WITH_FASTCV "Include FastCV support" ON)
|
||||||
option(WITH_OPENMP "Include OpenMP support" ON)
|
option(WITH_OPENMP "Include OpenMP support" ON)
|
||||||
option(WITH_OPENGV "Include OpenGV support" OFF)
|
option(WITH_OPENGV "Include OpenGV support" ON)
|
||||||
IF(MOBILE_BUILD)
|
IF(MOBILE_BUILD)
|
||||||
option(PCL_OMP "With PCL OMP implementations" OFF)
|
option(PCL_OMP "With PCL OMP implementations" OFF)
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -220,9 +229,9 @@ option(PCL_OMP "With PCL OMP implementations" ON)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
set(RTABMAP_QT_VERSION AUTO CACHE STRING "Force a specific Qt version.")
|
set(RTABMAP_QT_VERSION AUTO CACHE STRING "Force a specific Qt version.")
|
||||||
set_property(CACHE RTABMAP_QT_VERSION PROPERTY STRINGS AUTO 4 5)
|
set_property(CACHE RTABMAP_QT_VERSION PROPERTY STRINGS AUTO 4 5 6)
|
||||||
|
|
||||||
FIND_PACKAGE(OpenCV REQUIRED QUIET COMPONENTS core calib3d imgproc highgui stitching photo video OPTIONAL_COMPONENTS aruco xfeatures2d nonfree gpu cudafeatures2d)
|
FIND_PACKAGE(OpenCV REQUIRED QUIET COMPONENTS core calib3d imgproc highgui stitching photo video videoio OPTIONAL_COMPONENTS aruco xfeatures2d nonfree gpu cudafeatures2d)
|
||||||
|
|
||||||
IF(WITH_QT)
|
IF(WITH_QT)
|
||||||
FIND_PACKAGE(PCL 1.7 REQUIRED QUIET COMPONENTS common io kdtree search surface filters registration sample_consensus segmentation visualization)
|
FIND_PACKAGE(PCL 1.7 REQUIRED QUIET COMPONENTS common io kdtree search surface filters registration sample_consensus segmentation visualization)
|
||||||
@@ -245,10 +254,10 @@ endif()
|
|||||||
|
|
||||||
FIND_PACKAGE(ZLIB REQUIRED QUIET)
|
FIND_PACKAGE(ZLIB REQUIRED QUIET)
|
||||||
|
|
||||||
FIND_PACKAGE(Sqlite3 QUIET)
|
FIND_PACKAGE(SQLite3 QUIET)
|
||||||
IF(Sqlite3_FOUND)
|
IF(SQLite3_FOUND)
|
||||||
MESSAGE(STATUS "Found Sqlite3: ${Sqlite3_INCLUDE_DIRS} ${Sqlite3_LIBRARIES}")
|
MESSAGE(STATUS "Found SQLite3: ${SQLite3_INCLUDE_DIRS} ${SQLite3_LIBRARIES}")
|
||||||
ENDIF(Sqlite3_FOUND)
|
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
|
||||||
@@ -287,39 +296,65 @@ SET(ADD_VTK_GUI_SUPPORT_QT_TO_CONF FALSE)
|
|||||||
IF(WITH_QT)
|
IF(WITH_QT)
|
||||||
FIND_PACKAGE(VTK)
|
FIND_PACKAGE(VTK)
|
||||||
IF(NOT VTK_FOUND)
|
IF(NOT VTK_FOUND)
|
||||||
MESSAGE(FATAL_ERROR "VTK is required when using Qt. Set -DWITH_QT=OFF if you don't want gui tools.")
|
MESSAGE(FATAL_ERROR "VTK is required when using Qt. Set -DWITH_QT=OFF if you don't want gui tools.")
|
||||||
ENDIF(NOT VTK_FOUND)
|
ENDIF(NOT VTK_FOUND)
|
||||||
|
|
||||||
# If Qt is here, the GUI will be built
|
# If Qt is here, the GUI will be built
|
||||||
# look for Qt5 (if vtk>5 is installed) before Qt4
|
IF(NOT(${VTK_MAJOR_VERSION} LESS 9))
|
||||||
IF("${VTK_MAJOR_VERSION}" GREATER 5)
|
IF(NOT VTK_QT_VERSION)
|
||||||
if(RTABMAP_QT_VERSION STREQUAL "AUTO" OR RTABMAP_QT_VERSION STREQUAL "5")
|
MESSAGE(FATAL_ERROR "WITH_QT option is ON, but VTK ${VTK_MAJOR_VERSION} has not been built with Qt support, disabling Qt.")
|
||||||
FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui QUIET)
|
ENDIF()
|
||||||
IF(Qt5_FOUND)
|
|
||||||
FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui OPTIONAL_COMPONENTS Svg)
|
|
||||||
ENDIF(Qt5_FOUND)
|
|
||||||
ENDIF(RTABMAP_QT_VERSION STREQUAL "AUTO" OR RTABMAP_QT_VERSION STREQUAL "5")
|
|
||||||
ENDIF("${VTK_MAJOR_VERSION}" GREATER 5)
|
|
||||||
|
|
||||||
IF(NOT Qt5_FOUND)
|
option(VTK_GLOBAL_WARNING_DISPLAY "Show VTK warning display on runtime" OFF)
|
||||||
|
IF(NOT VTK_GLOBAL_WARNING_DISPLAY)
|
||||||
|
ADD_DEFINITIONS(-DVTK_GLOBAL_WARNING_DISPLAY_OFF)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
MESSAGE(STATUS "VTK>=9 detected, will use VTK_QT_VERSION=${VTK_QT_VERSION} for Qt version.")
|
||||||
|
IF(${VTK_QT_VERSION} EQUAL 6)
|
||||||
|
FIND_PACKAGE(Qt6 COMPONENTS Widgets Core Gui OpenGL PrintSupport QUIET OPTIONAL_COMPONENTS Svg)
|
||||||
|
ELSEIF(${VTK_QT_VERSION} EQUAL 5)
|
||||||
|
FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui OpenGL PrintSupport QUIET OPTIONAL_COMPONENTS Svg)
|
||||||
|
ELSE()
|
||||||
|
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui OPTIONAL_COMPONENTS QtSvg)
|
||||||
|
ENDIF()
|
||||||
|
ELSE()
|
||||||
|
# look for Qt5 (if vtk>5 is installed) before Qt4
|
||||||
|
IF("${VTK_MAJOR_VERSION}" GREATER 5)
|
||||||
|
IF(RTABMAP_QT_VERSION STREQUAL "AUTO" OR RTABMAP_QT_VERSION STREQUAL "5")
|
||||||
|
FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui OpenGL PrintSupport QUIET OPTIONAL_COMPONENTS Svg)
|
||||||
|
ENDIF(RTABMAP_QT_VERSION STREQUAL "AUTO" OR RTABMAP_QT_VERSION STREQUAL "5")
|
||||||
|
ENDIF("${VTK_MAJOR_VERSION}" GREATER 5)
|
||||||
|
|
||||||
|
IF(NOT Qt5_FOUND)
|
||||||
IF(RTABMAP_QT_VERSION STREQUAL "AUTO" OR RTABMAP_QT_VERSION STREQUAL "4")
|
IF(RTABMAP_QT_VERSION STREQUAL "AUTO" OR RTABMAP_QT_VERSION STREQUAL "4")
|
||||||
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui OPTIONAL_COMPONENTS QtSvg)
|
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui OPTIONAL_COMPONENTS QtSvg)
|
||||||
ENDIF(RTABMAP_QT_VERSION STREQUAL "AUTO" OR RTABMAP_QT_VERSION STREQUAL "4")
|
ENDIF(RTABMAP_QT_VERSION STREQUAL "AUTO" OR RTABMAP_QT_VERSION STREQUAL "4")
|
||||||
ENDIF(NOT Qt5_FOUND)
|
ENDIF(NOT Qt5_FOUND)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(QT4_FOUND OR Qt5_FOUND)
|
IF(QT4_FOUND OR Qt5_FOUND OR Qt6_FOUND)
|
||||||
|
# For VCPKG build, set those global variables to off,
|
||||||
|
# we will enable them for jsut specific targets
|
||||||
|
set(CMAKE_AUTOMOC OFF)
|
||||||
|
set(CMAKE_AUTORCC OFF)
|
||||||
|
set(CMAKE_AUTOUIC OFF)
|
||||||
IF("${VTK_MAJOR_VERSION}" EQUAL 5)
|
IF("${VTK_MAJOR_VERSION}" EQUAL 5)
|
||||||
FIND_PACKAGE(QVTK REQUIRED) # only for VTK 5
|
FIND_PACKAGE(QVTK REQUIRED) # only for VTK 5
|
||||||
ELSE()
|
ELSE()
|
||||||
list(FIND PCL_LIBRARIES VTK::GUISupportQt value)
|
list(FIND PCL_LIBRARIES VTK::GUISupportQt value)
|
||||||
IF(value EQUAL -1)
|
IF(value EQUAL -1)
|
||||||
list(FIND PCL_LIBRARIES vtkGUISupportQt value)
|
list(FIND PCL_LIBRARIES vtkGUISupportQt value)
|
||||||
IF(value EQUAL -1)
|
IF(value EQUAL -1)
|
||||||
SET(PCL_LIBRARIES "${PCL_LIBRARIES};vtkGUISupportQt")
|
IF(NOT(${VTK_MAJOR_VERSION} LESS 9))
|
||||||
|
SET(PCL_LIBRARIES "${PCL_LIBRARIES};VTK::GUISupportQt")
|
||||||
|
ELSE()
|
||||||
|
SET(PCL_LIBRARIES "${PCL_LIBRARIES};vtkGUISupportQt")
|
||||||
|
ENDIF()
|
||||||
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)
|
||||||
ENDIF(value EQUAL -1)
|
ENDIF(value EQUAL -1)
|
||||||
|
|
||||||
MESSAGE(STATUS "VTK_RENDERING_BACKEND=${VTK_RENDERING_BACKEND}")
|
MESSAGE(STATUS "VTK_RENDERING_BACKEND=${VTK_RENDERING_BACKEND}")
|
||||||
|
|
||||||
IF(VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
|
IF(VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
|
||||||
@@ -337,17 +372,17 @@ IF(WITH_QT)
|
|||||||
ENDIF(value EQUAL -1)
|
ENDIF(value EQUAL -1)
|
||||||
ELSEIF("${VTK_MAJOR_VERSION}" EQUAL 9)
|
ELSEIF("${VTK_MAJOR_VERSION}" EQUAL 9)
|
||||||
list(FIND PCL_LIBRARIES VTK::RenderingOpenGL2 value)
|
list(FIND PCL_LIBRARIES VTK::RenderingOpenGL2 value)
|
||||||
IF(NOT value EQUAL -1)
|
IF(NOT value EQUAL -1)
|
||||||
list(FIND PCL_LIBRARIES VTK::RenderingVolumeOpenGL2 value)
|
list(FIND PCL_LIBRARIES VTK::RenderingVolumeOpenGL2 value)
|
||||||
IF(value EQUAL -1)
|
IF(value EQUAL -1)
|
||||||
SET(PCL_LIBRARIES "${PCL_LIBRARIES};VTK::RenderingVolumeOpenGL2")
|
SET(PCL_LIBRARIES "${PCL_LIBRARIES};VTK::RenderingVolumeOpenGL2")
|
||||||
ENDIF(value EQUAL -1)
|
ENDIF(value EQUAL -1)
|
||||||
ENDIF(NOT value EQUAL -1)
|
ENDIF(NOT value EQUAL -1)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ADD_DEFINITIONS(-DQT_NO_KEYWORDS) # To avoid conflicts with boost signals/foreach and Qt macros
|
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 OR Qt6_FOUND)
|
||||||
ENDIF(WITH_QT)
|
ENDIF(WITH_QT)
|
||||||
|
|
||||||
IF(NOT VTK_FOUND)
|
IF(NOT VTK_FOUND)
|
||||||
@@ -368,6 +403,7 @@ IF(WITH_PYTHON)
|
|||||||
FIND_PACKAGE(Python3 COMPONENTS Interpreter Development NumPy)
|
FIND_PACKAGE(Python3 COMPONENTS Interpreter Development NumPy)
|
||||||
IF(Python3_FOUND)
|
IF(Python3_FOUND)
|
||||||
MESSAGE(STATUS "Found Python3")
|
MESSAGE(STATUS "Found Python3")
|
||||||
|
FIND_PACKAGE(pybind11 REQUIRED)
|
||||||
ENDIF(Python3_FOUND)
|
ENDIF(Python3_FOUND)
|
||||||
ENDIF(WITH_PYTHON)
|
ENDIF(WITH_PYTHON)
|
||||||
|
|
||||||
@@ -405,7 +441,7 @@ ENDIF(WITH_FREENECT2)
|
|||||||
|
|
||||||
IF(WITH_K4W2 AND WIN32)
|
IF(WITH_K4W2 AND WIN32)
|
||||||
FIND_PACKAGE(KinectSDK2 QUIET)
|
FIND_PACKAGE(KinectSDK2 QUIET)
|
||||||
IF(KinectSDK2_FOUND)
|
IF(KinectSDK2_FOUND)
|
||||||
MESSAGE(STATUS "Found Kinect for Windows 2: ${KinectSDK2_INCLUDE_DIRS}")
|
MESSAGE(STATUS "Found Kinect for Windows 2: ${KinectSDK2_INCLUDE_DIRS}")
|
||||||
ENDIF(KinectSDK2_FOUND)
|
ENDIF(KinectSDK2_FOUND)
|
||||||
ENDIF(WITH_K4W2 AND WIN32)
|
ENDIF(WITH_K4W2 AND WIN32)
|
||||||
@@ -420,7 +456,7 @@ IF(WITH_K4A)
|
|||||||
SET(k4a_FOUND FALSE)
|
SET(k4a_FOUND FALSE)
|
||||||
ENDIF(NOT (k4a_FOUND AND k4arecord_FOUND))
|
ENDIF(NOT (k4a_FOUND AND k4arecord_FOUND))
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(k4a_FOUND)
|
IF(k4a_FOUND)
|
||||||
MESSAGE(STATUS "Found Kinect for Azure: ${k4a_INCLUDE_DIRS}")
|
MESSAGE(STATUS "Found Kinect for Azure: ${k4a_INCLUDE_DIRS}")
|
||||||
ENDIF(k4a_FOUND)
|
ENDIF(k4a_FOUND)
|
||||||
ENDIF(WITH_K4A)
|
ENDIF(WITH_K4A)
|
||||||
@@ -441,13 +477,13 @@ IF(WITH_DC1394)
|
|||||||
ENDIF(WITH_DC1394)
|
ENDIF(WITH_DC1394)
|
||||||
|
|
||||||
IF(WITH_G2O)
|
IF(WITH_G2O)
|
||||||
FIND_PACKAGE(g2o QUIET NO_MODULE)
|
FIND_PACKAGE(g2o NO_MODULE)
|
||||||
IF(g2o_FOUND)
|
IF(g2o_FOUND)
|
||||||
MESSAGE(STATUS "Found g2o (targets)")
|
MESSAGE(STATUS "Found g2o (targets)")
|
||||||
SET(G2O_FOUND ${g2o_FOUND})
|
SET(G2O_FOUND ${g2o_FOUND})
|
||||||
get_target_property(G2O_INCLUDES g2o::core INTERFACE_INCLUDE_DIRECTORIES)
|
get_target_property(G2O_INCLUDES g2o::core INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
MESSAGE(STATUS "g2o include dir: ${G2O_INCLUDES}")
|
MESSAGE(STATUS "g2o include dir: ${G2O_INCLUDES}")
|
||||||
FIND_FILE(G2O_FACTORY_FILE g2o/core/factory.h
|
FIND_FILE(G2O_FACTORY_FILE g2o/core/factory.h
|
||||||
PATHS ${G2O_INCLUDES}
|
PATHS ${G2O_INCLUDES}
|
||||||
NO_DEFAULT_PATH)
|
NO_DEFAULT_PATH)
|
||||||
FILE(READ ${G2O_FACTORY_FILE} TMPTXT)
|
FILE(READ ${G2O_FACTORY_FILE} TMPTXT)
|
||||||
@@ -472,6 +508,14 @@ IF(WITH_GTSAM)
|
|||||||
FIND_PACKAGE(GTSAM CONFIG QUIET)
|
FIND_PACKAGE(GTSAM CONFIG QUIET)
|
||||||
ENDIF(WITH_GTSAM)
|
ENDIF(WITH_GTSAM)
|
||||||
|
|
||||||
|
IF(WITH_MRPT)
|
||||||
|
FIND_PACKAGE(MRPT COMPONENTS poses QUIET)
|
||||||
|
IF(MRPT_FOUND)
|
||||||
|
message(STATUS "MRPT_VERSION: ${MRPT_VERSION}")
|
||||||
|
message(STATUS "MRPT_LIBRARIES: ${MRPT_LIBRARIES}")
|
||||||
|
ENDIF(MRPT_FOUND)
|
||||||
|
ENDIF(WITH_MRPT)
|
||||||
|
|
||||||
IF(WITH_FLYCAPTURE2)
|
IF(WITH_FLYCAPTURE2)
|
||||||
FIND_PACKAGE(FlyCapture2 QUIET)
|
FIND_PACKAGE(FlyCapture2 QUIET)
|
||||||
IF(FlyCapture2_FOUND)
|
IF(FlyCapture2_FOUND)
|
||||||
@@ -489,7 +533,19 @@ ENDIF(WITH_CVSBA)
|
|||||||
IF(WITH_POINTMATCHER)
|
IF(WITH_POINTMATCHER)
|
||||||
find_package(libpointmatcher QUIET)
|
find_package(libpointmatcher QUIET)
|
||||||
IF(libpointmatcher_FOUND)
|
IF(libpointmatcher_FOUND)
|
||||||
MESSAGE(STATUS "Found libpointmatcher: ${libpointmatcher_INCLUDE_DIRS}")
|
MESSAGE(STATUS "Found libpointmatcher: ${libpointmatcher_INCLUDE_DIRS}")
|
||||||
|
string(FIND "${libpointmatcher_LIBRARIES}" "libnabo" value)
|
||||||
|
IF(value EQUAL -1)
|
||||||
|
# Find libnabo (Issue #1117):
|
||||||
|
find_package(libnabo REQUIRED PATHS ${LIBNABO_INSTALL_DIR})
|
||||||
|
message(STATUS "libnabo found, version ${libnabo_VERSION} (Config mode)")
|
||||||
|
SET(libpointmatcher_LIBRARIES "${libpointmatcher_LIBRARIES};libnabo::nabo")
|
||||||
|
ENDIF(value EQUAL -1)
|
||||||
|
string(FIND "${libpointmatcher_LIBRARIES}" "yaml-cpp::yaml-cpp" value)
|
||||||
|
IF(NOT value EQUAL -1)
|
||||||
|
# Find yaml-cpp (Issue #1268):
|
||||||
|
find_package(yaml-cpp QUIET)
|
||||||
|
ENDIF(NOT value EQUAL -1)
|
||||||
ENDIF(libpointmatcher_FOUND)
|
ENDIF(libpointmatcher_FOUND)
|
||||||
ENDIF(WITH_POINTMATCHER)
|
ENDIF(WITH_POINTMATCHER)
|
||||||
|
|
||||||
@@ -499,8 +555,8 @@ IF(libpointmatcher_FOUND OR GTSAM_FOUND)
|
|||||||
find_package(Boost COMPONENTS thread filesystem system program_options date_time chrono timer serialization REQUIRED)
|
find_package(Boost COMPONENTS thread filesystem system program_options date_time chrono timer serialization REQUIRED)
|
||||||
ENDIF(Boost_MINOR_VERSION GREATER 47)
|
ENDIF(Boost_MINOR_VERSION GREATER 47)
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
MESSAGE(STATUS "Boost_LIBRARY_DIRS=${Boost_LIBRARY_DIRS}")
|
MESSAGE(STATUS "Boost_LIBRARY_DIRS=${Boost_LIBRARY_DIRS}")
|
||||||
link_directories(${Boost_LIBRARY_DIRS})
|
link_directories(${Boost_LIBRARY_DIRS})
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
ENDIF(libpointmatcher_FOUND OR GTSAM_FOUND)
|
ENDIF(libpointmatcher_FOUND OR GTSAM_FOUND)
|
||||||
|
|
||||||
@@ -602,12 +658,19 @@ IF(WITH_MYNTEYE)
|
|||||||
ENDIF(WITH_MYNTEYE)
|
ENDIF(WITH_MYNTEYE)
|
||||||
|
|
||||||
IF(WITH_DEPTHAI)
|
IF(WITH_DEPTHAI)
|
||||||
FIND_PACKAGE(depthai 2 QUIET)
|
FIND_PACKAGE(depthai 2.24 QUIET)
|
||||||
IF(depthai_FOUND)
|
IF(depthai_FOUND)
|
||||||
MESSAGE(STATUS "Found depthai-core (targets)")
|
MESSAGE(STATUS "Found depthai-core (targets)")
|
||||||
ENDIF(depthai_FOUND)
|
ENDIF(depthai_FOUND)
|
||||||
ENDIF(WITH_DEPTHAI)
|
ENDIF(WITH_DEPTHAI)
|
||||||
|
|
||||||
|
IF(WITH_XVSDK)
|
||||||
|
FIND_PACKAGE(xvsdk QUIET)
|
||||||
|
IF(xvsdk_FOUND)
|
||||||
|
MESSAGE(STATUS "Found xvsdk (targets)")
|
||||||
|
ENDIF(xvsdk_FOUND)
|
||||||
|
ENDIF(WITH_XVSDK)
|
||||||
|
|
||||||
IF(WITH_OCTOMAP)
|
IF(WITH_OCTOMAP)
|
||||||
FIND_PACKAGE(octomap QUIET)
|
FIND_PACKAGE(octomap QUIET)
|
||||||
IF(octomap_FOUND)
|
IF(octomap_FOUND)
|
||||||
@@ -618,6 +681,13 @@ IF(WITH_OCTOMAP)
|
|||||||
ENDIF(octomap_FOUND)
|
ENDIF(octomap_FOUND)
|
||||||
ENDIF(WITH_OCTOMAP)
|
ENDIF(WITH_OCTOMAP)
|
||||||
|
|
||||||
|
IF(WITH_GRIDMAP)
|
||||||
|
FIND_PACKAGE(grid_map_core QUIET)
|
||||||
|
IF(grid_map_core_FOUND)
|
||||||
|
MESSAGE(STATUS "Found grid_map_core ${grid_map_core_VERSION}: ${grid_map_core_INCLUDE_DIRS}")
|
||||||
|
ENDIF(grid_map_core_FOUND)
|
||||||
|
ENDIF(WITH_GRIDMAP)
|
||||||
|
|
||||||
IF(WITH_CPUTSDF)
|
IF(WITH_CPUTSDF)
|
||||||
FIND_PACKAGE(CPUTSDF QUIET)
|
FIND_PACKAGE(CPUTSDF QUIET)
|
||||||
IF(CPUTSDF_FOUND)
|
IF(CPUTSDF_FOUND)
|
||||||
@@ -737,51 +807,48 @@ IF(WITH_ORB_SLAM AND NOT G2O_FOUND)
|
|||||||
ENDIF(WITH_ORB_SLAM AND NOT G2O_FOUND)
|
ENDIF(WITH_ORB_SLAM AND NOT G2O_FOUND)
|
||||||
|
|
||||||
IF(NOT MSVC)
|
IF(NOT MSVC)
|
||||||
IF((NOT WITH_MSCKF_VIO OR NOT msckf_vio_FOUND) AND (loam_velodyne_FOUND OR floam_FOUND OR PCL_VERSION VERSION_GREATER "1.9.1" OR TORCH_FOUND OR G2O_FOUND OR CCCoreLib_FOUND OR Open3D_FOUND))
|
IF(Qt6_FOUND OR (G2O_FOUND AND G2O_CPP11 EQUAL 1) OR TORCH_FOUND)
|
||||||
#LOAM, PCL>=1.10, latest g2o and CCCoreLib require c++14, but MSCKF_VIO requires c++11
|
# Qt6 requires c++17
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
|
CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
|
||||||
IF(COMPILER_SUPPORTS_CXX14)
|
IF(COMPILER_SUPPORTS_CXX17)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
ELSE()
|
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, latest PCL or g2o.")
|
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++17 support. Please use a different C++ compiler if you want to use Qt6.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
IF((NOT (${CMAKE_CXX_STANDARD} STREQUAL "17")) AND (msckf_vio_FOUND OR loam_velodyne_FOUND OR floam_FOUND OR PCL_VERSION VERSION_GREATER "1.9.1" OR G2O_FOUND OR CCCoreLib_FOUND OR Open3D_FOUND))
|
||||||
|
#MSCKF_VIO, LOAM, PCL>=1.10, latest g2o and CCCoreLib require c++14
|
||||||
|
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")
|
||||||
|
set(CMAKE_CXX_STANDARD 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, latest PCL or g2o.")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF( (NOT (${CMAKE_CXX_STANDARD} STREQUAL "14")) AND (
|
IF(NOT ("${CMAKE_CXX_STANDARD}" STREQUAL "17") AND NOT ("${CMAKE_CXX_STANDARD}" STREQUAL "14"))
|
||||||
G2O_FOUND OR
|
#Newest versions require std11
|
||||||
GTSAM_FOUND OR
|
include(CheckCXXCompilerFlag)
|
||||||
CERES_FOUND OR
|
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||||
ZED_FOUND OR
|
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
||||||
ZEDOC_FOUND OR
|
IF(COMPILER_SUPPORTS_CXX11)
|
||||||
ANDROID OR
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
RealSense_FOUND OR
|
ELSEIF(COMPILER_SUPPORTS_CXX0X)
|
||||||
realsense2_FOUND OR
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||||
ORB_SLAM_FOUND OR
|
ELSE()
|
||||||
okvis_FOUND OR
|
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
|
||||||
open_chisel_FOUND OR
|
ENDIF()
|
||||||
msckf_vio_FOUND OR
|
ENDIF()
|
||||||
vins_FOUND OR
|
|
||||||
ov_msckf_FOUND OR
|
|
||||||
libpointmatcher_FOUND))
|
|
||||||
#Newest versions require std11
|
|
||||||
include(CheckCXXCompilerFlag)
|
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
|
||||||
IF(COMPILER_SUPPORTS_CXX11)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
||||||
ELSEIF(COMPILER_SUPPORTS_CXX0X)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
|
||||||
ELSE()
|
|
||||||
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
####### OSX BUNDLE CMAKE_INSTALL_PREFIX #######
|
####### OSX BUNDLE CMAKE_INSTALL_PREFIX #######
|
||||||
IF(APPLE AND BUILD_AS_BUNDLE)
|
IF(APPLE AND BUILD_AS_BUNDLE)
|
||||||
IF(Qt5_FOUND OR (QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND))
|
IF(Qt6_FOUND OR Qt5_FOUND OR (QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND))
|
||||||
|
|
||||||
# Required when packaging, and set CMAKE_INSTALL_PREFIX to "/".
|
# Required when packaging, and set CMAKE_INSTALL_PREFIX to "/".
|
||||||
SET(CMAKE_INSTALL_PREFIX "/")
|
SET(CMAKE_INSTALL_PREFIX "/")
|
||||||
@@ -809,11 +876,6 @@ ENDIF(APPLE AND BUILD_AS_BUNDLE)
|
|||||||
|
|
||||||
####### SOURCES (Projects) #######
|
####### SOURCES (Projects) #######
|
||||||
|
|
||||||
# CONF_DEPENDENCIES contains only dependencies not required by the headers
|
|
||||||
SET(CONF_DEPENDENCIES
|
|
||||||
${ZLIB_LIBRARIES}
|
|
||||||
)
|
|
||||||
|
|
||||||
# OpenCV2 has nonfree if OPENCV_NONFREE_FOUND
|
# OpenCV2 has nonfree if OPENCV_NONFREE_FOUND
|
||||||
# OpenCV<=3.4.2 has nonfree if OPENCV_XFEATURES2D_FOUND
|
# OpenCV<=3.4.2 has nonfree if OPENCV_XFEATURES2D_FOUND
|
||||||
# OpenCV>3.4.2 has nonfree if OPENCV_XFEATURES2D_FOUND and OPENCV_ENABLE_NONFREE is defined
|
# OpenCV>3.4.2 has nonfree if OPENCV_XFEATURES2D_FOUND and OPENCV_ENABLE_NONFREE is defined
|
||||||
@@ -834,19 +896,19 @@ IF(NOT G2O_FOUND)
|
|||||||
SET(G2O "//")
|
SET(G2O "//")
|
||||||
SET(G2O_CPP_CONF "//")
|
SET(G2O_CPP_CONF "//")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${G2O_LIBRARIES})
|
|
||||||
IF(NOT G2O_CPP11)
|
IF(NOT G2O_CPP11)
|
||||||
SET(G2O_CPP_CONF "//")
|
SET(G2O_CPP_CONF "//")
|
||||||
ENDIF(NOT G2O_CPP11)
|
ENDIF(NOT G2O_CPP11)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT GTSAM_FOUND)
|
IF(NOT GTSAM_FOUND)
|
||||||
SET(GTSAM "//")
|
SET(GTSAM "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${GTSAM_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT CERES_FOUND)
|
IF(NOT MRPT_FOUND)
|
||||||
|
SET(MRPT "//")
|
||||||
|
ENDIF(NOT MRPT_FOUND)
|
||||||
|
IF(NOT WITH_CERES OR NOT CERES_FOUND)
|
||||||
SET(CERES "//")
|
SET(CERES "//")
|
||||||
ENDIF(NOT CERES_FOUND)
|
ENDIF(NOT WITH_CERES OR NOT CERES_FOUND)
|
||||||
IF(NOT WITH_TORO)
|
IF(NOT WITH_TORO)
|
||||||
SET(TORO "//")
|
SET(TORO "//")
|
||||||
ENDIF(NOT WITH_TORO)
|
ENDIF(NOT WITH_TORO)
|
||||||
@@ -855,8 +917,6 @@ IF(NOT WITH_VERTIGO)
|
|||||||
ENDIF(NOT WITH_VERTIGO)
|
ENDIF(NOT WITH_VERTIGO)
|
||||||
IF(NOT cvsba_FOUND)
|
IF(NOT cvsba_FOUND)
|
||||||
SET(CVSBA "//")
|
SET(CVSBA "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${cvsba_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT libpointmatcher_FOUND)
|
IF(NOT libpointmatcher_FOUND)
|
||||||
SET(POINTMATCHER "//")
|
SET(POINTMATCHER "//")
|
||||||
@@ -870,9 +930,9 @@ ENDIF(NOT Open3D_FOUND)
|
|||||||
IF(NOT FastCV_FOUND)
|
IF(NOT FastCV_FOUND)
|
||||||
SET(FASTCV "//")
|
SET(FASTCV "//")
|
||||||
ENDIF(NOT FastCV_FOUND)
|
ENDIF(NOT FastCV_FOUND)
|
||||||
IF(NOT opengv_FOUND)
|
IF(NOT opengv_FOUND OR NOT WITH_OPENGV)
|
||||||
SET(OPENGV "//")
|
SET(OPENGV "//")
|
||||||
ENDIF(NOT opengv_FOUND)
|
ENDIF(NOT opengv_FOUND OR NOT WITH_OPENGV)
|
||||||
IF(NOT PDAL_FOUND)
|
IF(NOT PDAL_FOUND)
|
||||||
SET(PDAL "//")
|
SET(PDAL "//")
|
||||||
ENDIF(NOT PDAL_FOUND)
|
ENDIF(NOT PDAL_FOUND)
|
||||||
@@ -884,129 +944,124 @@ IF(NOT floam_FOUND)
|
|||||||
ENDIF(NOT floam_FOUND)
|
ENDIF(NOT floam_FOUND)
|
||||||
IF(NOT Freenect_FOUND)
|
IF(NOT Freenect_FOUND)
|
||||||
SET(FREENECT "//")
|
SET(FREENECT "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${Freenect_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT freenect2_FOUND)
|
IF(NOT freenect2_FOUND)
|
||||||
SET(FREENECT2 "//")
|
SET(FREENECT2 "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${freenect2_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT KinectSDK2_FOUND)
|
IF(NOT KinectSDK2_FOUND)
|
||||||
SET(K4W2 "//")
|
SET(K4W2 "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${KinectSDK2_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT k4a_FOUND)
|
IF(NOT k4a_FOUND)
|
||||||
SET(K4A "//")
|
SET(K4A "//")
|
||||||
|
SET(CONF_WITH_K4A 0)
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${k4a_LIBRARIES})
|
SET(CONF_WITH_K4A 1)
|
||||||
|
IF(WIN32)
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindK4A.cmake"
|
||||||
|
DESTINATION ${INSTALL_CMAKE_DIR}/Modules/.
|
||||||
|
COMPONENT devel
|
||||||
|
)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT (OpenNI_FOUND AND WITH_OPENNI))
|
||||||
|
SET(OPENNI "//")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT OpenNI2_FOUND)
|
IF(NOT OpenNI2_FOUND)
|
||||||
SET(OPENNI2 "//")
|
SET(OPENNI2 "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${OpenNI2_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT DC1394_FOUND)
|
IF(NOT DC1394_FOUND)
|
||||||
SET(DC1394 "//")
|
SET(DC1394 "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${DC1394_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT FlyCapture2_FOUND)
|
IF(NOT FlyCapture2_FOUND)
|
||||||
SET(FLYCAPTURE2 "//")
|
SET(FLYCAPTURE2 "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${FlyCapture2_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT ZED_FOUND)
|
IF(NOT ZED_FOUND)
|
||||||
SET(ZED "//")
|
SET(ZED "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${ZED_LIBRARIES} ${CUDA_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT ZEDOC_FOUND)
|
IF(NOT ZEDOC_FOUND)
|
||||||
SET(ZEDOC "//")
|
SET(ZEDOC "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${ZEDOC_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT RealSense_FOUND)
|
IF(NOT RealSense_FOUND)
|
||||||
SET(REALSENSE "//")
|
SET(REALSENSE "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${RealSense_LIBRARIES})
|
|
||||||
ENDIF()
|
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)
|
IF(NOT realsense2_FOUND)
|
||||||
SET(REALSENSE2 "//")
|
SET(REALSENSE2 "//")
|
||||||
|
SET(CONF_WITH_REALSENSE2 0)
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${realsense2_LIBRARIES})
|
SET(CONF_WITH_REALSENSE2 1)
|
||||||
|
IF(WIN32)
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindRealSense2.cmake"
|
||||||
|
DESTINATION ${INSTALL_CMAKE_DIR}/Modules/.
|
||||||
|
COMPONENT devel
|
||||||
|
)
|
||||||
|
ENDIF(WIN32)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT mynteye_FOUND)
|
IF(NOT mynteye_FOUND)
|
||||||
SET(MYNTEYE "//")
|
SET(MYNTEYE "//")
|
||||||
ENDIF(NOT mynteye_FOUND)
|
ENDIF(NOT mynteye_FOUND)
|
||||||
IF(NOT depthai_FOUND)
|
IF(NOT depthai_FOUND)
|
||||||
SET(CONF_DEPTH_AI OFF)
|
SET(CONF_WITH_DEPTH_AI 0)
|
||||||
SET(DEPTHAI "//")
|
SET(DEPTHAI "//")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(CONF_DEPTH_AI ON)
|
SET(CONF_WITH_DEPTH_AI 1)
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} depthai::core depthai::opencv)
|
ENDIF()
|
||||||
|
IF(NOT xvsdk_FOUND)
|
||||||
|
SET(XVSDK "//")
|
||||||
|
SET(CONF_WITH_XVSDK 0)
|
||||||
|
ELSE()
|
||||||
|
SET(CONF_WITH_XVSDK 1)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT octomap_FOUND)
|
IF(NOT octomap_FOUND)
|
||||||
SET(OCTOMAP "//")
|
SET(OCTOMAP "//")
|
||||||
|
SET(CONF_WITH_OCTOMAP 0)
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${OCTOMAP_LIBRARIES})
|
SET(CONF_WITH_OCTOMAP 1)
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT grid_map_core_FOUND)
|
||||||
|
SET(GRIDMAP "//")
|
||||||
|
SET(CONF_WITH_GRIDMAP 0)
|
||||||
|
ELSE()
|
||||||
|
SET(CONF_WITH_GRIDMAP 1)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT CPUTSDF_FOUND)
|
IF(NOT CPUTSDF_FOUND)
|
||||||
SET(CPUTSDF "//")
|
SET(CPUTSDF "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${CPUTSDF_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT open_chisel_FOUND)
|
IF(NOT open_chisel_FOUND)
|
||||||
SET(OPENCHISEL "//")
|
SET(OPENCHISEL "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${open_chisel_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT AliceVision_FOUND)
|
IF(NOT AliceVision_FOUND)
|
||||||
SET(ALICE_VISION "//")
|
SET(ALICE_VISION "//")
|
||||||
ENDIF(NOT AliceVision_FOUND)
|
ENDIF(NOT AliceVision_FOUND)
|
||||||
IF(NOT libfovis_FOUND)
|
IF(NOT libfovis_FOUND)
|
||||||
SET(FOVIS "//")
|
SET(FOVIS "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${libfovis_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT libviso2_FOUND)
|
IF(NOT libviso2_FOUND)
|
||||||
SET(VISO2 "//")
|
SET(VISO2 "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${libviso2_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT dvo_core_FOUND)
|
IF(NOT dvo_core_FOUND)
|
||||||
SET(DVO "//")
|
SET(DVO "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${dvo_core_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT okvis_FOUND)
|
IF(NOT okvis_FOUND)
|
||||||
SET(OKVIS "//")
|
SET(OKVIS "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${OKVIS_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT msckf_vio_FOUND)
|
IF(NOT msckf_vio_FOUND)
|
||||||
SET(MSCKF_VIO "//")
|
SET(MSCKF_VIO "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${msckf_vio_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT vins_FOUND)
|
IF(NOT vins_FOUND)
|
||||||
SET(VINS "//")
|
SET(VINS "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${vins_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT ov_msckf_FOUND)
|
IF(NOT ov_msckf_FOUND)
|
||||||
SET(OPENVINS "//")
|
SET(OPENVINS "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${ov_msckf_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT ORB_SLAM_FOUND)
|
IF(NOT ORB_SLAM_FOUND)
|
||||||
SET(ORB_SLAM "//")
|
SET(ORB_SLAM "//")
|
||||||
ELSE()
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${ORB_SLAM_LIBRARIES})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT WITH_ORB_OCTREE)
|
IF(NOT WITH_ORB_OCTREE)
|
||||||
SET(ORB_OCTREE "//")
|
SET(ORB_OCTREE "//")
|
||||||
@@ -1016,21 +1071,20 @@ IF(NOT TORCH_FOUND)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT WITH_PYTHON OR NOT Python3_FOUND)
|
IF(NOT WITH_PYTHON OR NOT Python3_FOUND)
|
||||||
SET(PYTHON "//")
|
SET(PYTHON "//")
|
||||||
|
SET(CONF_WITH_PYTHON 0)
|
||||||
|
ELSE()
|
||||||
|
SET(CONF_WITH_PYTHON 1)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(ADD_VTK_GUI_SUPPORT_QT_TO_CONF)
|
IF(ADD_VTK_GUI_SUPPORT_QT_TO_CONF)
|
||||||
SET(CONF_VTK_QT true)
|
SET(CONF_VTK_QT true)
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} vtkGUISupportQt)
|
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(CONF_VTK_QT false)
|
SET(CONF_VTK_QT false)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(VTK_USE_QVTK)
|
|
||||||
SET(CONF_DEPENDENCIES ${CONF_DEPENDENCIES} ${QVTK_LIBRARY})
|
|
||||||
ENDIF(VTK_USE_QVTK)
|
|
||||||
IF(NOT WITH_MADGWICK)
|
IF(NOT WITH_MADGWICK)
|
||||||
SET(MADGWICK "//")
|
SET(MADGWICK "//")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
CONFIGURE_FILE(Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/corelib/include/${PROJECT_PREFIX}/core/Version.h)
|
CONFIGURE_FILE(Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/corelib/src/include/${PROJECT_PREFIX}/core/Version.h)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY( utilite )
|
ADD_SUBDIRECTORY( utilite )
|
||||||
ADD_SUBDIRECTORY( corelib )
|
ADD_SUBDIRECTORY( corelib )
|
||||||
@@ -1039,13 +1093,15 @@ IF(ANDROID)
|
|||||||
IF(BUILD_APP)
|
IF(BUILD_APP)
|
||||||
ADD_SUBDIRECTORY( app )
|
ADD_SUBDIRECTORY( app )
|
||||||
ENDIF(BUILD_APP)
|
ENDIF(BUILD_APP)
|
||||||
ELSEIF(Qt5_FOUND OR (QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND))
|
|
||||||
ADD_SUBDIRECTORY( guilib )
|
|
||||||
IF(BUILD_APP)
|
|
||||||
ADD_SUBDIRECTORY( app )
|
|
||||||
ENDIF(BUILD_APP)
|
|
||||||
ELSEIF(WITH_QT)
|
ELSEIF(WITH_QT)
|
||||||
MESSAGE(WARNING "Qt not found, the GUI lib and the stand-alone application will not be compiled...")
|
IF(Qt6_FOUND OR Qt5_FOUND OR (QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND))
|
||||||
|
ADD_SUBDIRECTORY( guilib )
|
||||||
|
IF(BUILD_APP)
|
||||||
|
ADD_SUBDIRECTORY( app )
|
||||||
|
ENDIF(BUILD_APP)
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(WARNING "Qt not found, the GUI lib and the stand-alone application will not be compiled...")
|
||||||
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(BUILD_TOOLS)
|
IF(BUILD_TOOLS)
|
||||||
@@ -1058,6 +1114,7 @@ ENDIF(BUILD_EXAMPLES)
|
|||||||
#######################
|
#######################
|
||||||
# Uninstall target, for "make uninstall"
|
# Uninstall target, for "make uninstall"
|
||||||
#######################
|
#######################
|
||||||
|
IF (NOT TARGET uninstall)
|
||||||
CONFIGURE_FILE(
|
CONFIGURE_FILE(
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||||
@@ -1065,57 +1122,87 @@ CONFIGURE_FILE(
|
|||||||
|
|
||||||
ADD_CUSTOM_TARGET(uninstall
|
ADD_CUSTOM_TARGET(uninstall
|
||||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
####
|
||||||
|
# Global Export Target
|
||||||
|
####
|
||||||
|
add_library(rtabmap INTERFACE)
|
||||||
|
add_library(rtabmap::rtabmap ALIAS rtabmap)
|
||||||
|
IF(WITH_QT AND (QT4_FOUND OR Qt5_FOUND OR Qt6_FOUND))
|
||||||
|
set(CONF_WITH_GUI ON)
|
||||||
|
IF(QT4_FOUND)
|
||||||
|
set(CONF_QT_VERSION 4)
|
||||||
|
ELSEIF(Qt5_FOUND)
|
||||||
|
set(CONF_QT_VERSION 5)
|
||||||
|
ELSE()
|
||||||
|
set(CONF_QT_VERSION 6)
|
||||||
|
ENDIF()
|
||||||
|
target_link_libraries(rtabmap INTERFACE rtabmap_utilite rtabmap_core rtabmap_gui)
|
||||||
|
ELSE()
|
||||||
|
set(CONF_WITH_GUI OFF)
|
||||||
|
target_link_libraries(rtabmap INTERFACE rtabmap_utilite rtabmap_core)
|
||||||
|
ENDIF()
|
||||||
|
install(TARGETS rtabmap EXPORT rtabmapTargets)
|
||||||
|
export(EXPORT rtabmapTargets
|
||||||
|
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake"
|
||||||
|
NAMESPACE rtabmap::
|
||||||
|
)
|
||||||
|
install(EXPORT rtabmapTargets
|
||||||
|
FILE
|
||||||
|
${PROJECT_NAME}Targets.cmake
|
||||||
|
DESTINATION
|
||||||
|
${INSTALL_CMAKE_DIR}
|
||||||
|
NAMESPACE rtabmap::
|
||||||
|
COMPONENT
|
||||||
|
devel
|
||||||
|
)
|
||||||
|
|
||||||
####
|
####
|
||||||
# Setup RTABMapConfig.cmake
|
# Setup RTABMapConfig.cmake
|
||||||
####
|
####
|
||||||
# Create the RTABMapConfig.cmake and RTABMapConfigVersion files
|
include(CMakePackageConfigHelpers)
|
||||||
file(RELATIVE_PATH REL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}")
|
write_basic_package_version_file(
|
||||||
file(RELATIVE_PATH REL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
|
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||||
|
VERSION ${PROJECT_VERSION}
|
||||||
# ... for the build tree
|
COMPATIBILITY AnyNewerVersion
|
||||||
set(CONF_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/corelib/include"
|
)
|
||||||
"${PROJECT_SOURCE_DIR}/corelib/include"
|
|
||||||
"${PROJECT_SOURCE_DIR}/guilib/include"
|
|
||||||
"${PROJECT_SOURCE_DIR}/utilite/include")
|
|
||||||
set(CONF_LIB_DIR "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
|
|
||||||
IF(QT4_FOUND OR Qt5_FOUND)
|
|
||||||
set(CONF_WITH_GUI ON)
|
|
||||||
IF(QT4_FOUND)
|
|
||||||
set(CONF_QT_VERSION 4)
|
|
||||||
ELSE()
|
|
||||||
set(CONF_QT_VERSION 5)
|
|
||||||
ENDIF()
|
|
||||||
ELSE()
|
|
||||||
set(CONF_WITH_GUI OFF)
|
|
||||||
ENDIF()
|
|
||||||
configure_file(RTABMapConfig.cmake.in
|
|
||||||
"${PROJECT_BINARY_DIR}/RTABMapConfig.cmake" @ONLY)
|
|
||||||
|
|
||||||
# ... for the install tree
|
|
||||||
set(CONF_INCLUDE_DIRS "\${RTABMap_CMAKE_DIR}/${REL_INCLUDE_DIR}")
|
|
||||||
set(CONF_LIB_DIR "\${RTABMap_CMAKE_DIR}/${REL_LIB_DIR}")
|
|
||||||
configure_file(RTABMapConfig.cmake.in
|
|
||||||
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/RTABMapConfig.cmake" @ONLY)
|
|
||||||
|
|
||||||
# ... for both
|
|
||||||
configure_file(RTABMapConfigVersion.cmake.in
|
|
||||||
"${PROJECT_BINARY_DIR}/RTABMapConfigVersion.cmake" @ONLY)
|
|
||||||
|
|
||||||
# Install the RTABMapConfig.cmake and RTABMapConfigVersion.cmake
|
# Build tree:
|
||||||
install(FILES
|
SET(CONF_MODULES_DIR "../cmake_modules")
|
||||||
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/RTABMapConfig.cmake"
|
configure_file(
|
||||||
"${PROJECT_BINARY_DIR}/RTABMapConfigVersion.cmake"
|
${PROJECT_NAME}Config.cmake.in
|
||||||
DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT devel)
|
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
|
# Install tree:
|
||||||
|
SET(CONF_MODULES_DIR "Modules")
|
||||||
|
configure_file(
|
||||||
|
${PROJECT_NAME}Config.cmake.in
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake"
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||||
|
DESTINATION
|
||||||
|
${INSTALL_CMAKE_DIR}
|
||||||
|
COMPONENT
|
||||||
|
devel
|
||||||
|
)
|
||||||
|
|
||||||
####
|
####
|
||||||
|
|
||||||
### Install package.xml for catkin
|
### Install package.xml for catkin
|
||||||
install(FILES package.xml DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_PREFIX}")
|
install(FILES package.xml DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_PREFIX}" COMPONENT devel)
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
# CPACK (Packaging)
|
# CPACK (Packaging)
|
||||||
#######################
|
#######################
|
||||||
IF(BUILD_AS_BUNDLE)
|
IF(BUILD_AS_BUNDLE)
|
||||||
|
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT runtime)
|
||||||
INCLUDE(InstallRequiredSystemLibraries)
|
INCLUDE(InstallRequiredSystemLibraries)
|
||||||
ENDIF(BUILD_AS_BUNDLE)
|
ENDIF(BUILD_AS_BUNDLE)
|
||||||
|
|
||||||
@@ -1132,6 +1219,7 @@ SET(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
|
|||||||
#SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
#SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||||
SET(CPACK_PACKAGE_CONTACT "matlabbe@gmail.com")
|
SET(CPACK_PACKAGE_CONTACT "matlabbe@gmail.com")
|
||||||
|
|
||||||
|
|
||||||
set(CPACK_SOURCE_IGNORE_FILES
|
set(CPACK_SOURCE_IGNORE_FILES
|
||||||
"\\\\.svn/"
|
"\\\\.svn/"
|
||||||
"\\\\.settings/"
|
"\\\\.settings/"
|
||||||
@@ -1253,12 +1341,15 @@ IF(OpenCV_FOUND)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF(OpenCV_FOUND)
|
ENDIF(OpenCV_FOUND)
|
||||||
|
|
||||||
IF(QT4_FOUND)
|
IF(WITH_QT AND QT4_FOUND)
|
||||||
MESSAGE(STATUS " With Qt4 = YES (License: Open Source or Commercial)")
|
MESSAGE(STATUS " With Qt4 = YES (License: Open Source or Commercial)")
|
||||||
MESSAGE(STATUS " With VTK ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} = YES (License: BSD)")
|
MESSAGE(STATUS " With VTK ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} = YES (License: BSD)")
|
||||||
ELSEIF(Qt5_FOUND)
|
ELSEIF(WITH_QT AND Qt5_FOUND)
|
||||||
MESSAGE(STATUS " With Qt ${Qt5_VERSION} = YES (License: Open Source or Commercial)")
|
MESSAGE(STATUS " With Qt ${Qt5_VERSION} = YES (License: Open Source or Commercial)")
|
||||||
MESSAGE(STATUS " With VTK ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} = YES (License: BSD)")
|
MESSAGE(STATUS " With VTK ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} = YES (License: BSD)")
|
||||||
|
ELSEIF(WITH_QT AND Qt6_FOUND)
|
||||||
|
MESSAGE(STATUS " With Qt ${Qt6_VERSION} = YES (License: Open Source or Commercial)")
|
||||||
|
MESSAGE(STATUS " With VTK ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} = YES (License: BSD)")
|
||||||
|
|
||||||
ELSEIF(NOT WITH_QT)
|
ELSEIF(NOT WITH_QT)
|
||||||
MESSAGE(STATUS " With Qt = NO (WITH_QT=OFF)")
|
MESSAGE(STATUS " With Qt = NO (WITH_QT=OFF)")
|
||||||
@@ -1266,10 +1357,10 @@ ELSE()
|
|||||||
MESSAGE(STATUS " With Qt = NO (Qt not found)")
|
MESSAGE(STATUS " With Qt = NO (Qt not found)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(Sqlite3_FOUND)
|
IF(SQLite3_FOUND)
|
||||||
MESSAGE(STATUS " With external SQLite3 = YES (License: Public Domain)")
|
MESSAGE(STATUS " With external SQLite3 = YES (License: Public Domain)")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS " With external SQLite3 = NO (sqlite3 not found, internal version is used for convenience)")
|
MESSAGE(STATUS " With external SQLite3 = NO (SQLite3 not found, internal version is used for convenience)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(WITH_ORB_OCTREE)
|
IF(WITH_ORB_OCTREE)
|
||||||
@@ -1309,7 +1400,7 @@ MESSAGE(STATUS " With FastCV = NO (FastCV not found)")
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(PDAL_FOUND)
|
IF(PDAL_FOUND)
|
||||||
MESSAGE(STATUS " With PDAL = YES (License: BSD)")
|
MESSAGE(STATUS " With PDAL ${PDAL_VERSION} = YES (License: BSD)")
|
||||||
ELSEIF(NOT WITH_PDAL)
|
ELSEIF(NOT WITH_PDAL)
|
||||||
MESSAGE(STATUS " With PDAL = NO (WITH_PDAL=OFF)")
|
MESSAGE(STATUS " With PDAL = NO (WITH_PDAL=OFF)")
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -1325,7 +1416,7 @@ 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 ${g2o_VERSION} = 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()
|
||||||
@@ -1333,25 +1424,29 @@ 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 ${GTSAM_VERSION} = 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(CERES_FOUND)
|
IF(WITH_CERES AND CERES_FOUND)
|
||||||
IF(WITH_CERES)
|
MESSAGE(STATUS " *With Ceres ${Ceres_VERSION} = YES (License: BSD)")
|
||||||
MESSAGE(STATUS " *With Ceres ${Ceres_VERSION} = YES (License: BSD)")
|
|
||||||
ELSE()
|
|
||||||
MESSAGE(STATUS " *With Ceres ${Ceres_VERSION} = YES (License: BSD, WITH_CERES=OFF but it is enabled by okvis or floam dependencies)")
|
|
||||||
ENDIF()
|
|
||||||
ELSEIF(NOT WITH_CERES)
|
ELSEIF(NOT WITH_CERES)
|
||||||
MESSAGE(STATUS " *With Ceres = NO (WITH_CERES=OFF)")
|
MESSAGE(STATUS " *With Ceres = NO (WITH_CERES=OFF)")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS " *With Ceres = NO (Ceres not found)")
|
MESSAGE(STATUS " *With Ceres = NO (Ceres not found)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(MRPT_FOUND)
|
||||||
|
MESSAGE(STATUS " With MRPT ${MRPT_VERSION} = YES (License: BSD)")
|
||||||
|
ELSEIF(NOT WITH_MRPT)
|
||||||
|
MESSAGE(STATUS " With MRPT = NO (WITH_MRPT=OFF)")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS " With MRPT = NO (MRPT not found)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(G2O_FOUND OR GTSAM_FOUND)
|
IF(G2O_FOUND OR GTSAM_FOUND)
|
||||||
IF(WITH_VERTIGO)
|
IF(WITH_VERTIGO)
|
||||||
MESSAGE(STATUS " With VERTIGO = YES (License: GPLv3)")
|
MESSAGE(STATUS " With VERTIGO = YES (License: GPLv3)")
|
||||||
@@ -1371,7 +1466,7 @@ MESSAGE(STATUS " With cvsba = NO (cvsba not found)")
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(libpointmatcher_FOUND)
|
IF(libpointmatcher_FOUND)
|
||||||
MESSAGE(STATUS " *With libpointmatcher = YES (License: BSD)")
|
MESSAGE(STATUS " *With libpointmatcher ${libpointmatcher_VERSION} = YES (License: BSD)")
|
||||||
ELSEIF(NOT WITH_POINTMATCHER)
|
ELSEIF(NOT WITH_POINTMATCHER)
|
||||||
MESSAGE(STATUS " *With libpointmatcher = NO (WITH_POINTMATCHER=OFF)")
|
MESSAGE(STATUS " *With libpointmatcher = NO (WITH_POINTMATCHER=OFF)")
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -1396,8 +1491,8 @@ ELSE()
|
|||||||
MESSAGE(STATUS " With Open3D = NO (Open3D not found)")
|
MESSAGE(STATUS " With Open3D = NO (Open3D not found)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(opengv_FOUND)
|
IF(opengv_FOUND AND WITH_OPENGV)
|
||||||
MESSAGE(STATUS " With OpenGV = YES (License: BSD)")
|
MESSAGE(STATUS " With OpenGV ${opengv_VERSION} = YES (License: BSD)")
|
||||||
ELSEIF(NOT WITH_OPENGV)
|
ELSEIF(NOT WITH_OPENGV)
|
||||||
MESSAGE(STATUS " With OpenGV = NO (WITH_OPENGV=OFF)")
|
MESSAGE(STATUS " With OpenGV = NO (WITH_OPENGV=OFF)")
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -1407,11 +1502,19 @@ ENDIF()
|
|||||||
MESSAGE(STATUS "")
|
MESSAGE(STATUS "")
|
||||||
MESSAGE(STATUS " Reconstruction Approaches:")
|
MESSAGE(STATUS " Reconstruction Approaches:")
|
||||||
IF(octomap_FOUND)
|
IF(octomap_FOUND)
|
||||||
MESSAGE(STATUS " With OCTOMAP = YES (License: BSD)")
|
MESSAGE(STATUS " With OctoMap ${octomap_VERSION} = YES (License: BSD)")
|
||||||
ELSEIF(NOT WITH_OCTOMAP)
|
ELSEIF(NOT WITH_OCTOMAP)
|
||||||
MESSAGE(STATUS " With OCTOMAP = NO (WITH_OCTOMAP=OFF)")
|
MESSAGE(STATUS " With OctoMap = NO (WITH_OCTOMAP=OFF)")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS " With OCTOMAP = NO (octomap not found)")
|
MESSAGE(STATUS " With OctoMap = NO (octomap not found)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(grid_map_core_FOUND)
|
||||||
|
MESSAGE(STATUS " With GridMap ${grid_map_core_VERSION} = YES (License: BSD)")
|
||||||
|
ELSEIF(NOT WITH_OCTOMAP)
|
||||||
|
MESSAGE(STATUS " With GridMap = NO (WITH_GRIDMAP=OFF)")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS " With GridMap = NO (grid_map_core not found)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(CPUTSDF_FOUND)
|
IF(CPUTSDF_FOUND)
|
||||||
@@ -1448,6 +1551,14 @@ ELSE()
|
|||||||
MESSAGE(STATUS " With Freenect = NO (libfreenect not found)")
|
MESSAGE(STATUS " With Freenect = NO (libfreenect not found)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(WITH_OPENNI AND OpenNI_FOUND)
|
||||||
|
MESSAGE(STATUS " With OpenNI = YES (License: Apache v2)")
|
||||||
|
ELSEIF(NOT WITH_OPENNI)
|
||||||
|
MESSAGE(STATUS " With OpenNI = NO (WITH_OPENNI=OFF)")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS " With OpenNI = NO (OpenNI not found)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(OpenNI2_FOUND)
|
IF(OpenNI2_FOUND)
|
||||||
MESSAGE(STATUS " With OpenNI2 = YES (License: Apache v2)")
|
MESSAGE(STATUS " With OpenNI2 = YES (License: Apache v2)")
|
||||||
ELSEIF(NOT WITH_OPENNI2)
|
ELSEIF(NOT WITH_OPENNI2)
|
||||||
@@ -1528,7 +1639,11 @@ MESSAGE(STATUS " With RealSense = NO (librealsense not found)")
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(realsense2_FOUND)
|
IF(realsense2_FOUND)
|
||||||
|
IF(WIN32)
|
||||||
MESSAGE(STATUS " With RealSense2 = YES (License: Apache-2)")
|
MESSAGE(STATUS " With RealSense2 = YES (License: Apache-2)")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS " With RealSense2 ${realsense2_VERSION} = YES (License: Apache-2)")
|
||||||
|
ENDIF()
|
||||||
ELSEIF(NOT WITH_REALSENSE2)
|
ELSEIF(NOT WITH_REALSENSE2)
|
||||||
MESSAGE(STATUS " With RealSense2 = NO (WITH_REALSENSE2=OFF)")
|
MESSAGE(STATUS " With RealSense2 = NO (WITH_REALSENSE2=OFF)")
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -1544,13 +1659,21 @@ MESSAGE(STATUS " With MyntEyeS = NO (mynteye s sdk not found)")
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(depthai_FOUND)
|
IF(depthai_FOUND)
|
||||||
MESSAGE(STATUS " With DepthAI = YES (License: MIT)")
|
MESSAGE(STATUS " With DepthAI ${depthai_VERSION} = YES (License: MIT)")
|
||||||
ELSEIF(NOT WITH_DEPTHAI)
|
ELSEIF(NOT WITH_DEPTHAI)
|
||||||
MESSAGE(STATUS " With DepthAI = NO (WITH_DEPTHAI=OFF)")
|
MESSAGE(STATUS " With DepthAI = NO (WITH_DEPTHAI=OFF)")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS " With DepthAI = NO (depthai-core not found)")
|
MESSAGE(STATUS " With DepthAI = NO (depthai-core not found)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(xvsdk_FOUND)
|
||||||
|
MESSAGE(STATUS " With XVisio SDK ${xvsdk_VERSION} = YES")
|
||||||
|
ELSEIF(NOT WITH_XVSDK)
|
||||||
|
MESSAGE(STATUS " With XVisio SDK = NO (WITH_XVSDK=OFF)")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS " With XVisio SDK = NO (xvsdk not found)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
MESSAGE(STATUS "")
|
MESSAGE(STATUS "")
|
||||||
MESSAGE(STATUS " Odometry Approaches:")
|
MESSAGE(STATUS " Odometry Approaches:")
|
||||||
IF(loam_velodyne_FOUND)
|
IF(loam_velodyne_FOUND)
|
||||||
|
|||||||
60
README.md
60
README.md
@@ -4,14 +4,15 @@ rtabmap
|
|||||||
[](http://introlab.github.io/rtabmap)
|
[](http://introlab.github.io/rtabmap)
|
||||||
|
|
||||||
[![Release][release-image]][releases]
|
[![Release][release-image]][releases]
|
||||||
|
[![Downloads][downloads-image]][downloads]
|
||||||
[![License][license-image]][license]
|
[![License][license-image]][license]
|
||||||
|
|
||||||
* Linux: [](https://github.com/introlab/rtabmap/actions/workflows/cmake.yml) [](https://github.com/introlab/rtabmap/actions/workflows/cmake-ros.yml) [](https://github.com/introlab/rtabmap/actions/workflows/docker.yml)
|
[release-image]: https://img.shields.io/badge/release-0.21.4-green.svg?style=flat
|
||||||
* Windows: [](https://ci.appveyor.com/project/matlabbe/rtabmap/branch/master)
|
|
||||||
|
|
||||||
[release-image]: https://img.shields.io/badge/release-0.20.16-green.svg?style=flat
|
|
||||||
[releases]: https://github.com/introlab/rtabmap/releases
|
[releases]: https://github.com/introlab/rtabmap/releases
|
||||||
|
|
||||||
|
[downloads-image]: https://img.shields.io/github/downloads/introlab/rtabmap/total?label=downloads
|
||||||
|
[downloads]: https://github.com/introlab/rtabmap/releases
|
||||||
|
|
||||||
[license-image]: https://img.shields.io/badge/license-BSD-green.svg?style=flat
|
[license-image]: https://img.shields.io/badge/license-BSD-green.svg?style=flat
|
||||||
[license]: https://github.com/introlab/rtabmap/blob/master/LICENSE
|
[license]: https://github.com/introlab/rtabmap/blob/master/LICENSE
|
||||||
|
|
||||||
@@ -28,3 +29,54 @@ This project is supported by [IntRoLab - Intelligent / Interactive / Integrated
|
|||||||
<a href="https://introlab.3it.usherbrooke.ca/">
|
<a href="https://introlab.3it.usherbrooke.ca/">
|
||||||
<img src="https://github.com/introlab/16SoundsUSB/blob/master/images/IntRoLab.png" alt="IntRoLab" height="100">
|
<img src="https://github.com/introlab/16SoundsUSB/blob/master/images/IntRoLab.png" alt="IntRoLab" height="100">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
#### CI Latest
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Linux</td>
|
||||||
|
<td><a href="https://github.com/introlab/rtabmap/actions/workflows/cmake.yml"><img src="https://github.com/introlab/rtabmap/actions/workflows/cmake.yml/badge.svg" alt="Build Status"/> <br> <a href="https://github.com/introlab/rtabmap/actions/workflows/cmake-ros.yml"><img src="https://github.com/introlab/rtabmap/actions/workflows/cmake-ros.yml/badge.svg" alt="Build Status"/> <br> <a href="https://github.com/introlab/rtabmap/actions/workflows/docker.yml"><img src="https://github.com/introlab/rtabmap/actions/workflows/docker.yml/badge.svg" alt="Build Status"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Windows</td>
|
||||||
|
<td><a href="https://ci.appveyor.com/project/matlabbe/rtabmap/branch/master"><img src="https://ci.appveyor.com/api/projects/status/hr73xspix9oqa26h/branch/master?svg=true" alt="Build Status"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
#### ROS Binaries
|
||||||
|
|
||||||
|
`ros-$ROS_DISTRO-rtabmap`
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="1">ROS 1</td>
|
||||||
|
<td>Noetic</td>
|
||||||
|
<td><a href="http://build.ros.org/job/Nbin_ufv8_uFv8__rtabmap__ubuntu_focal_arm64__binary/"><img src="http://build.ros.org/buildStatus/icon?job=Nbin_ufv8_uFv8__rtabmap__ubuntu_focal_arm64__binary" alt="Build Status"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="3">ROS 2</td>
|
||||||
|
<td>Humble</td>
|
||||||
|
<td><a href="http://build.ros2.org/job/Hbin_uJ64__rtabmap__ubuntu_jammy_amd64__binary/"><img src="http://build.ros2.org/buildStatus/icon?job=Hbin_uJ64__rtabmap__ubuntu_jammy_amd64__binary" alt="Build Status"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Iron</td>
|
||||||
|
<td><a href="http://build.ros2.org/job/Ibin_uJ64__rtabmap__ubuntu_jammy_amd64__binary/"><img src="http://build.ros2.org/buildStatus/icon?job=Ibin_uJ64__rtabmap__ubuntu_jammy_amd64__binary" alt="Build Status"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Rolling</td>
|
||||||
|
<td><a href="http://build.ros2.org/job/Rbin_uJ64__rtabmap__ubuntu_jammy_amd64__binary/"><img src="http://build.ros2.org/buildStatus/icon?job=Rbin_uJ64__rtabmap__ubuntu_jammy_amd64__binary" alt="Build Status"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Docker</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://hub.docker.com/r/introlab3it/rtabmap">rtabmap</a>
|
||||||
|
</td>
|
||||||
|
<td><img src="https://img.shields.io/docker/pulls/introlab3it/rtabmap.svg?label=pulls" alt="Docker Pulls"/></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|||||||
@@ -1,99 +1,106 @@
|
|||||||
# - Config file for the RTABMap package
|
include(CMakeFindDependencyMacro)
|
||||||
# Components:
|
|
||||||
# core (required)
|
|
||||||
# gui (optional)
|
|
||||||
# utilite (required)
|
|
||||||
# It defines the following variables
|
|
||||||
# RTABMap_INCLUDE_DIRS - include directories for RTABMap
|
|
||||||
# RTABMap_LIBRARIES - libraries to link against
|
|
||||||
# RTABMap_CORE - core library
|
|
||||||
# RTABMap_UTILITE - utilite library
|
|
||||||
# RTABMap_GUI - gui library (set if RTABMap is built with Qt)
|
|
||||||
|
|
||||||
# Compute paths
|
# Mandatory dependencies
|
||||||
get_filename_component(RTABMap_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
find_dependency(OpenCV COMPONENTS core calib3d imgproc highgui stitching photo video OPTIONAL_COMPONENTS aruco xfeatures2d nonfree gpu cudafeatures2d)
|
||||||
set(RTABMap_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
|
|
||||||
|
|
||||||
#core lib
|
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/RTABMap_guiTargets.cmake")
|
||||||
find_library(RTABMap_CORE_RELEASE NAMES rtabmap_core NO_DEFAULT_PATH HINTS @CONF_LIB_DIR@)
|
find_dependency(PCL 1.7 COMPONENTS common io kdtree search surface filters registration sample_consensus segmentation visualization)
|
||||||
find_library(RTABMap_CORE_DEBUG NAMES rtabmap_cored NO_DEFAULT_PATH HINTS @CONF_LIB_DIR@)
|
|
||||||
|
if(@CONF_QT_VERSION@ EQUAL 6)
|
||||||
IF(RTABMap_CORE_DEBUG AND RTABMap_CORE_RELEASE)
|
find_dependency(Qt6 COMPONENTS Widgets Core Gui OpenGL)
|
||||||
SET(RTABMap_CORE
|
elseif(@CONF_QT_VERSION@ EQUAL 5)
|
||||||
debug ${RTABMap_CORE_DEBUG}
|
find_dependency(Qt5 COMPONENTS Widgets Core Gui OpenGL)
|
||||||
optimized ${RTABMap_CORE_RELEASE}
|
else() # Qt4
|
||||||
)
|
find_dependency(Qt4 COMPONENTS QtCore QtGui)
|
||||||
ELSEIF(RTABMap_CORE_DEBUG)
|
endif()
|
||||||
SET(RTABMap_CORE ${RTABMap_CORE_DEBUG})
|
set(RTABMap_QT_VERSION @CONF_QT_VERSION@)
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(RTABMap_CORE ${RTABMap_CORE_RELEASE})
|
find_dependency(PCL 1.7 COMPONENTS common io kdtree search surface filters registration sample_consensus segmentation)
|
||||||
|
ENDIF()
|
||||||
|
set(RTABMap_DEFINITIONS ${PCL_DEFINITIONS})
|
||||||
|
add_definitions(${RTABMap_DEFINITIONS}) # To include -march=native if set
|
||||||
|
|
||||||
|
# Optional dependencies
|
||||||
|
IF(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@CONF_MODULES_DIR@")
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/@CONF_MODULES_DIR@")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
#utilite lib
|
IF(@CONF_WITH_REALSENSE2@)
|
||||||
find_library(RTABMap_UTILITE_RELEASE NAMES rtabmap_utilite NO_DEFAULT_PATH HINTS @CONF_LIB_DIR@)
|
IF(WIN32)
|
||||||
find_library(RTABMap_UTILITE_DEBUG NAMES rtabmap_utilited NO_DEFAULT_PATH HINTS @CONF_LIB_DIR@)
|
find_dependency(RealSense2)
|
||||||
|
ELSE()
|
||||||
IF(RTABMap_UTILITE_DEBUG AND RTABMap_UTILITE_RELEASE)
|
find_dependency(realsense2)
|
||||||
SET(RTABMap_UTILITE
|
ENDIF()
|
||||||
debug ${RTABMap_UTILITE_DEBUG}
|
|
||||||
optimized ${RTABMap_UTILITE_RELEASE}
|
|
||||||
)
|
|
||||||
ELSEIF(RTABMap_UTILITE_DEBUG)
|
|
||||||
SET(RTABMap_UTILITE ${RTABMap_UTILITE_DEBUG})
|
|
||||||
ELSE()
|
|
||||||
SET(RTABMap_UTILITE ${RTABMap_UTILITE_RELEASE})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
set(RTABMap_LIBRARIES ${RTABMap_CORE} ${RTABMap_UTILITE})
|
IF(@CONF_WITH_K4A@)
|
||||||
|
IF(WIN32)
|
||||||
|
find_dependency(K4A)
|
||||||
|
ELSE()
|
||||||
|
find_dependency(k4a)
|
||||||
|
find_dependency(k4arecord)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
list(LENGTH RTABMap_FIND_COMPONENTS RTABMap_FIND_COMPONENTS_LENGTH)
|
IF(@CONF_WITH_DEPTH_AI@)
|
||||||
set(WITH_GUI ON)
|
find_dependency(depthai 2.24)
|
||||||
if(${RTABMap_FIND_COMPONENTS_LENGTH} GREATER 0)
|
ENDIF()
|
||||||
list (FIND RTABMap_FIND_COMPONENTS "gui" _index)
|
|
||||||
if (${_index} EQUAL -1)
|
|
||||||
set(WITH_GUI OFF)
|
|
||||||
endif()
|
|
||||||
endif(${RTABMap_FIND_COMPONENTS_LENGTH} GREATER 0)
|
|
||||||
|
|
||||||
|
IF(@CONF_WITH_XVSDK@)
|
||||||
|
find_dependency(xvsdk)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
#gui lib (OFF if RTAB-Map is not built with Qt)
|
IF(@CONF_WITH_OCTOMAP@)
|
||||||
if(@CONF_WITH_GUI@ AND ${WITH_GUI})
|
find_dependency(octomap)
|
||||||
find_library(RTABMap_GUI_RELEASE NAMES rtabmap_gui NO_DEFAULT_PATH HINTS @CONF_LIB_DIR@)
|
ENDIF()
|
||||||
find_library(RTABMap_GUI_DEBUG NAMES rtabmap_guid NO_DEFAULT_PATH HINTS @CONF_LIB_DIR@)
|
|
||||||
|
|
||||||
IF(RTABMap_GUI_DEBUG AND RTABMap_GUI_RELEASE)
|
|
||||||
SET(RTABMap_GUI
|
|
||||||
debug ${RTABMap_GUI_DEBUG}
|
|
||||||
optimized ${RTABMap_GUI_RELEASE}
|
|
||||||
)
|
|
||||||
ELSEIF(RTABMap_GUI_RELEASE)
|
|
||||||
SET(RTABMap_GUI ${RTABMap_GUI_RELEASE})
|
|
||||||
ELSEIF(RTABMap_GUI_DEBUG)
|
|
||||||
SET(RTABMap_GUI ${RTABMap_GUI_DEBUG})
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
set(RTABMap_LIBRARIES ${RTABMap_LIBRARIES} ${RTABMap_GUI})
|
|
||||||
elseif(${WITH_GUI})
|
|
||||||
MESSAGE(WARNING "Asked for \"gui\" module but RTABMap hasn't been built with gui support.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Dependencies
|
IF(@CONF_WITH_GRIDMAP@)
|
||||||
if(@CONF_VTK_QT@ AND ${WITH_GUI})
|
find_dependency(grid_map_core)
|
||||||
find_package(VTK COMPONENTS vtkGUISupportQt NO_MODULE) # to define vtkGUISupportQt target
|
ENDIF()
|
||||||
endif(@CONF_VTK_QT@ AND ${WITH_GUI})
|
|
||||||
if(@CONF_DEPTH_AI@)
|
|
||||||
FIND_PACKAGE(depthai 2 QUIET REQUIRED)
|
|
||||||
endif(@CONF_DEPTH_AI@)
|
|
||||||
SET(RTABMap_LIBRARIES ${RTABMap_LIBRARIES} "@CONF_DEPENDENCIES@")
|
|
||||||
|
|
||||||
#backward compatibilities
|
IF(@CONF_WITH_PYTHON@)
|
||||||
set(RTABMAP_CORE ${RTABMap_CORE})
|
find_dependency(Python3 COMPONENTS Interpreter Development NumPy)
|
||||||
set(RTABMAP_UTILITE ${RTABMap_UTILITE})
|
ENDIF()
|
||||||
if(RTABMap_GUI)
|
|
||||||
set(RTABMAP_GUI ${RTABMap_GUI})
|
|
||||||
set(RTABMAP_QT_VERSION @CONF_QT_VERSION@)
|
|
||||||
endif(RTABMap_GUI)
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
# Provide those for backward compatibilities (e.g., catkin requires them to propagate dependencies)
|
||||||
find_package_handle_standard_args(RTABMap DEFAULT_MSG RTABMap_LIBRARIES RTABMap_INCLUDE_DIRS)
|
set(RTABMap_INCLUDE_DIRS "")
|
||||||
mark_as_advanced(RTABMap_LIBRARIES RTABMap_INCLUDE_DIRS RTABMap_LIBRARY_DIRS)
|
set(RTABMap_LIBRARIES "")
|
||||||
|
set(RTABMap_TARGETS "")
|
||||||
|
|
||||||
|
set(_RTABMap_supported_components utilite core gui)
|
||||||
|
|
||||||
|
foreach(_comp ${_RTABMap_supported_components})
|
||||||
|
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/RTABMap_${_comp}Targets.cmake")
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/RTABMap_${_comp}Targets.cmake")
|
||||||
|
set(RTABMap_${_comp}_FOUND True)
|
||||||
|
set(RTABMap_TARGETS
|
||||||
|
${RTABMap_TARGETS}
|
||||||
|
rtabmap::${_comp})
|
||||||
|
get_target_property(RTABMap_${_comp}_INCLUDE_DIRS rtabmap::${_comp} INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
get_target_property(RTABMap_${_comp}_LIBRARIES rtabmap::${_comp} INTERFACE_LINK_LIBRARIES)
|
||||||
|
set(RTABMap_INCLUDE_DIRS
|
||||||
|
${RTABMap_INCLUDE_DIRS}
|
||||||
|
${RTABMap_${_comp}_INCLUDE_DIRS})
|
||||||
|
set(RTABMap_LIBRARIES
|
||||||
|
${RTABMap_LIBRARIES}
|
||||||
|
rtabmap::${_comp})
|
||||||
|
if(RTABMap_${_comp}_LIBRARIES)
|
||||||
|
set(RTABMap_LIBRARIES
|
||||||
|
${RTABMap_LIBRARIES}
|
||||||
|
${RTABMap_${_comp}_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(RTABMap_${_comp}_FOUND False)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/RTABMapTargets.cmake")
|
||||||
|
|
||||||
|
foreach(_comp ${RTABMap_FIND_COMPONENTS})
|
||||||
|
if (NOT RTABMap_${_comp}_FOUND)
|
||||||
|
if(${RTABMap_FIND_REQUIRED_${_comp}})
|
||||||
|
set(RTABMap_FOUND False)
|
||||||
|
set(RTABMap_NOT_FOUND_MESSAGE "Unsupported or not found required component: ${_comp}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
set(PACKAGE_VERSION "@RTABMAP_VERSION@")
|
|
||||||
|
|
||||||
# Check whether the requested PACKAGE_FIND_VERSION is compatible
|
|
||||||
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
|
|
||||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
|
||||||
else()
|
|
||||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
|
||||||
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
|
|
||||||
set(PACKAGE_VERSION_EXACT TRUE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
@@ -43,7 +43,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
@G2O_CPP_CONF@#define RTABMAP_G2O_CPP11 @G2O_CPP11@
|
@G2O_CPP_CONF@#define RTABMAP_G2O_CPP11 @G2O_CPP11@
|
||||||
@GTSAM@#define RTABMAP_GTSAM
|
@GTSAM@#define RTABMAP_GTSAM
|
||||||
@CERES@#define RTABMAP_CERES
|
@CERES@#define RTABMAP_CERES
|
||||||
|
@MRPT@#define RTABMAP_MRPT
|
||||||
@VERTIGO@#define RTABMAP_VERTIGO
|
@VERTIGO@#define RTABMAP_VERTIGO
|
||||||
|
@OPENNI@#define RTABMAP_OPENNI
|
||||||
@OPENNI2@#define RTABMAP_OPENNI2
|
@OPENNI2@#define RTABMAP_OPENNI2
|
||||||
@FREENECT@#define RTABMAP_FREENECT
|
@FREENECT@#define RTABMAP_FREENECT
|
||||||
@FREENECT2@#define RTABMAP_FREENECT2
|
@FREENECT2@#define RTABMAP_FREENECT2
|
||||||
@@ -67,7 +69,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
@REALSENSE2@#define RTABMAP_REALSENSE2
|
@REALSENSE2@#define RTABMAP_REALSENSE2
|
||||||
@MYNTEYE@#define RTABMAP_MYNTEYE
|
@MYNTEYE@#define RTABMAP_MYNTEYE
|
||||||
@DEPTHAI@#define RTABMAP_DEPTHAI
|
@DEPTHAI@#define RTABMAP_DEPTHAI
|
||||||
|
@XVSDK@#define RTABMAP_XVSDK
|
||||||
@OCTOMAP@#define RTABMAP_OCTOMAP
|
@OCTOMAP@#define RTABMAP_OCTOMAP
|
||||||
|
@GRIDMAP@#define RTABMAP_GRIDMAP
|
||||||
@CPUTSDF@#define RTABMAP_CPUTSDF
|
@CPUTSDF@#define RTABMAP_CPUTSDF
|
||||||
@ALICE_VISION@#define RTABMAP_ALICE_VISION
|
@ALICE_VISION@#define RTABMAP_ALICE_VISION
|
||||||
@OPENCHISEL@#define RTABMAP_OPENCHISEL
|
@OPENCHISEL@#define RTABMAP_OPENCHISEL
|
||||||
|
|||||||
@@ -334,11 +334,12 @@ void CameraARCore::setScreenRotationAndSize(ScreenRotation colorCameraToDisplayR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SensorData CameraARCore::captureImage(CameraInfo * info)
|
SensorData CameraARCore::updateDataOnRender(Transform & pose)
|
||||||
{
|
{
|
||||||
UScopeMutex lock(arSessionMutex_);
|
UScopeMutex lock(arSessionMutex_);
|
||||||
//LOGI("Capturing image...");
|
//LOGI("Capturing image...");
|
||||||
|
|
||||||
|
pose.setNull();
|
||||||
SensorData data;
|
SensorData data;
|
||||||
if(!arSession_)
|
if(!arSession_)
|
||||||
{
|
{
|
||||||
@@ -370,7 +371,7 @@ SensorData CameraARCore::captureImage(CameraInfo * info)
|
|||||||
if (geometry_changed != 0 || !uvs_initialized_) {
|
if (geometry_changed != 0 || !uvs_initialized_) {
|
||||||
ArFrame_transformCoordinates2d(
|
ArFrame_transformCoordinates2d(
|
||||||
arSession_, arFrame_, AR_COORDINATES_2D_OPENGL_NORMALIZED_DEVICE_COORDINATES,
|
arSession_, arFrame_, AR_COORDINATES_2D_OPENGL_NORMALIZED_DEVICE_COORDINATES,
|
||||||
BackgroundRenderer::kNumVertices, BackgroundRenderer_kVertices, AR_COORDINATES_2D_TEXTURE_NORMALIZED,
|
BackgroundRenderer::kNumVertices, BackgroundRenderer_kVerticesDevice, AR_COORDINATES_2D_TEXTURE_NORMALIZED,
|
||||||
transformed_uvs_);
|
transformed_uvs_);
|
||||||
UASSERT(transformed_uvs_);
|
UASSERT(transformed_uvs_);
|
||||||
uvs_initialized_ = true;
|
uvs_initialized_ = true;
|
||||||
@@ -393,7 +394,6 @@ SensorData CameraARCore::captureImage(CameraInfo * info)
|
|||||||
ArTrackingState camera_tracking_state;
|
ArTrackingState camera_tracking_state;
|
||||||
ArCamera_getTrackingState(arSession_, ar_camera, &camera_tracking_state);
|
ArCamera_getTrackingState(arSession_, ar_camera, &camera_tracking_state);
|
||||||
|
|
||||||
Transform pose;
|
|
||||||
CameraModel model;
|
CameraModel model;
|
||||||
if(camera_tracking_state == AR_TRACKING_STATE_TRACKING)
|
if(camera_tracking_state == AR_TRACKING_STATE_TRACKING)
|
||||||
{
|
{
|
||||||
@@ -401,24 +401,13 @@ SensorData CameraARCore::captureImage(CameraInfo * info)
|
|||||||
float pose_raw[7];
|
float pose_raw[7];
|
||||||
ArCamera_getPose(arSession_, ar_camera, arPose_);
|
ArCamera_getPose(arSession_, ar_camera, arPose_);
|
||||||
ArPose_getPoseRaw(arSession_, arPose_, pose_raw);
|
ArPose_getPoseRaw(arSession_, arPose_, pose_raw);
|
||||||
pose = Transform(pose_raw[4], pose_raw[5], pose_raw[6], pose_raw[0], pose_raw[1], pose_raw[2], pose_raw[3]);
|
Transform poseArCore = Transform(pose_raw[4], pose_raw[5], pose_raw[6], pose_raw[0], pose_raw[1], pose_raw[2], pose_raw[3]);
|
||||||
pose = rtabmap::rtabmap_world_T_opengl_world * pose * rtabmap::opengl_world_T_rtabmap_world;
|
poseArCore = rtabmap::rtabmap_world_T_opengl_world * poseArCore * rtabmap::opengl_world_T_rtabmap_world;
|
||||||
|
|
||||||
Transform poseArCore = pose;
|
if(poseArCore.isNull())
|
||||||
if(pose.isNull())
|
|
||||||
{
|
{
|
||||||
LOGE("CameraARCore: Pose is null");
|
LOGE("CameraARCore: Pose is null");
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
this->poseReceived(pose);
|
|
||||||
// adjust origin
|
|
||||||
if(!getOriginOffset().isNull())
|
|
||||||
{
|
|
||||||
pose = getOriginOffset() * pose;
|
|
||||||
}
|
|
||||||
info->odomPose = pose;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get calibration parameters
|
// Get calibration parameters
|
||||||
float fx,fy, cx, cy;
|
float fx,fy, cx, cy;
|
||||||
@@ -551,6 +540,17 @@ SensorData CameraARCore::captureImage(CameraInfo * info)
|
|||||||
|
|
||||||
data = SensorData(scan, rgb, depthFromMotion_?getOcclusionImage():cv::Mat(), model, 0, stamp);
|
data = SensorData(scan, rgb, depthFromMotion_?getOcclusionImage():cv::Mat(), model, 0, stamp);
|
||||||
data.setFeatures(kpts, kpts3, cv::Mat());
|
data.setFeatures(kpts, kpts3, cv::Mat());
|
||||||
|
|
||||||
|
if(!poseArCore.isNull())
|
||||||
|
{
|
||||||
|
pose = poseArCore;
|
||||||
|
this->poseReceived(pose, stamp);
|
||||||
|
// adjust origin
|
||||||
|
if(!getOriginOffset().isNull())
|
||||||
|
{
|
||||||
|
pose = getOriginOffset() * pose;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -571,134 +571,6 @@ SensorData CameraARCore::captureImage(CameraInfo * info)
|
|||||||
ArCamera_release(ar_camera);
|
ArCamera_release(ar_camera);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void CameraARCore::capturePoseOnly()
|
|
||||||
{
|
|
||||||
UScopeMutex lock(arSessionMutex_);
|
|
||||||
//LOGI("Capturing image...");
|
|
||||||
|
|
||||||
if(!arSession_)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(textureId_ != 0)
|
|
||||||
{
|
|
||||||
glBindTexture(GL_TEXTURE_EXTERNAL_OES, textureId_);
|
|
||||||
glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
|
||||||
glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
|
||||||
glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
||||||
glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
|
||||||
ArSession_setCameraTextureName(arSession_, textureId_);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update session to get current frame and render camera background.
|
|
||||||
if (ArSession_update(arSession_, arFrame_) != AR_SUCCESS) {
|
|
||||||
LOGE("CameraARCore::capturePoseOnly() ArSession_update error");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If display rotation changed (also includes view size change), we need to
|
|
||||||
// re-query the uv coordinates for the on-screen portion of the camera image.
|
|
||||||
int32_t geometry_changed = 0;
|
|
||||||
ArFrame_getDisplayGeometryChanged(arSession_, arFrame_, &geometry_changed);
|
|
||||||
if (geometry_changed != 0 || !uvs_initialized_) {
|
|
||||||
ArFrame_transformCoordinates2d(
|
|
||||||
arSession_, arFrame_, AR_COORDINATES_2D_OPENGL_NORMALIZED_DEVICE_COORDINATES,
|
|
||||||
BackgroundRenderer::kNumVertices, BackgroundRenderer_kVertices, AR_COORDINATES_2D_TEXTURE_NORMALIZED,
|
|
||||||
transformed_uvs_);
|
|
||||||
UASSERT(transformed_uvs_);
|
|
||||||
uvs_initialized_ = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
ArCamera* ar_camera;
|
|
||||||
ArFrame_acquireCamera(arSession_, arFrame_, &ar_camera);
|
|
||||||
|
|
||||||
ArCamera_getViewMatrix(arSession_, ar_camera, glm::value_ptr(viewMatrix_));
|
|
||||||
ArCamera_getProjectionMatrix(arSession_, ar_camera,
|
|
||||||
/*near=*/0.1f, /*far=*/100.f,
|
|
||||||
glm::value_ptr(projectionMatrix_));
|
|
||||||
|
|
||||||
// adjust origin
|
|
||||||
if(!getOriginOffset().isNull())
|
|
||||||
{
|
|
||||||
viewMatrix_ = glm::inverse(rtabmap::glmFromTransform(rtabmap::opengl_world_T_rtabmap_world * getOriginOffset() *rtabmap::rtabmap_world_T_opengl_world)*glm::inverse(viewMatrix_));
|
|
||||||
}
|
|
||||||
|
|
||||||
ArTrackingState camera_tracking_state;
|
|
||||||
ArCamera_getTrackingState(arSession_, ar_camera, &camera_tracking_state);
|
|
||||||
|
|
||||||
Transform pose;
|
|
||||||
CameraModel model;
|
|
||||||
if(camera_tracking_state == AR_TRACKING_STATE_TRACKING)
|
|
||||||
{
|
|
||||||
// pose in OpenGL coordinates
|
|
||||||
float pose_raw[7];
|
|
||||||
ArCamera_getPose(arSession_, ar_camera, arPose_);
|
|
||||||
ArPose_getPoseRaw(arSession_, arPose_, pose_raw);
|
|
||||||
pose = Transform(pose_raw[4], pose_raw[5], pose_raw[6], pose_raw[0], pose_raw[1], pose_raw[2], pose_raw[3]);
|
|
||||||
if(!pose.isNull())
|
|
||||||
{
|
|
||||||
pose = rtabmap::rtabmap_world_T_opengl_world * pose * rtabmap::opengl_world_T_rtabmap_world;
|
|
||||||
this->poseReceived(pose);
|
|
||||||
|
|
||||||
if(!getOriginOffset().isNull())
|
|
||||||
{
|
|
||||||
pose = getOriginOffset() * pose;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t is_depth_supported = 0;
|
|
||||||
ArSession_isDepthModeSupported(arSession_, AR_DEPTH_MODE_AUTOMATIC, &is_depth_supported);
|
|
||||||
|
|
||||||
if(is_depth_supported)
|
|
||||||
{
|
|
||||||
LOGD("Acquire depth image!");
|
|
||||||
ArImage * depthImage = nullptr;
|
|
||||||
ArFrame_acquireDepthImage(arSession_, arFrame_, &depthImage);
|
|
||||||
|
|
||||||
ArImageFormat format;
|
|
||||||
ArImage_getFormat(arSession_, depthImage, &format);
|
|
||||||
if(format == AR_IMAGE_FORMAT_DEPTH16)
|
|
||||||
{
|
|
||||||
LOGD("Depth format detected!");
|
|
||||||
int planeCount;
|
|
||||||
ArImage_getNumberOfPlanes(arSession_, depthImage, &planeCount);
|
|
||||||
LOGD("planeCount=%d", planeCount);
|
|
||||||
UASSERT_MSG(planeCount == 1, uFormat("Error: getNumberOfPlanes() planceCount = %d", planeCount).c_str());
|
|
||||||
const uint8_t *data = nullptr;
|
|
||||||
int len = 0;
|
|
||||||
int stride;
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
ArImage_getWidth(arSession_, depthImage, &width);
|
|
||||||
ArImage_getHeight(arSession_, depthImage, &height);
|
|
||||||
ArImage_getPlaneRowStride(arSession_, depthImage, 0, &stride);
|
|
||||||
ArImage_getPlaneData(arSession_, depthImage, 0, &data, &len);
|
|
||||||
|
|
||||||
LOGD("width=%d, height=%d, bytes=%d stride=%d", width, height, len, stride);
|
|
||||||
|
|
||||||
cv::Mat occlusionImage = cv::Mat(height, width, CV_16UC1, (void*)data).clone();
|
|
||||||
|
|
||||||
float fx,fy, cx, cy;
|
|
||||||
int32_t rgb_width, rgb_height;
|
|
||||||
ArCamera_getImageIntrinsics(arSession_, ar_camera, arCameraIntrinsics_);
|
|
||||||
ArCameraIntrinsics_getFocalLength(arSession_, arCameraIntrinsics_, &fx, &fy);
|
|
||||||
ArCameraIntrinsics_getPrincipalPoint(arSession_, arCameraIntrinsics_, &cx, &cy);
|
|
||||||
ArCameraIntrinsics_getImageDimensions(arSession_, arCameraIntrinsics_, &rgb_width, &rgb_height);
|
|
||||||
|
|
||||||
float scaleX = (float)width / (float)rgb_width;
|
|
||||||
float scaleY = (float)height / (float)rgb_height;
|
|
||||||
CameraModel occlusionModel(fx*scaleX, fy*scaleY, cx*scaleX, cy*scaleY, pose*deviceTColorCamera_, 0, cv::Size(width, height));
|
|
||||||
this->setOcclusionImage(occlusionImage, occlusionModel);
|
|
||||||
}
|
|
||||||
ArImage_release(depthImage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ArCamera_release(ar_camera);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace rtabmap */
|
} /* namespace rtabmap */
|
||||||
|
|||||||
@@ -63,23 +63,14 @@ public:
|
|||||||
CameraARCore(void* env, void* context, void* activity, bool depthFromMotion = false, bool smoothing = false);
|
CameraARCore(void* env, void* context, void* activity, bool depthFromMotion = false, bool smoothing = false);
|
||||||
virtual ~CameraARCore();
|
virtual ~CameraARCore();
|
||||||
|
|
||||||
bool uvsInitialized() const {return uvs_initialized_;}
|
|
||||||
const float* uvsTransformed() const {return transformed_uvs_;}
|
|
||||||
void getVPMatrices(glm::mat4 & view, glm::mat4 & projection) const {view=viewMatrix_; projection=projectionMatrix_;}
|
|
||||||
|
|
||||||
virtual void setScreenRotationAndSize(ScreenRotation colorCameraToDisplayRotation, int width, int height);
|
virtual void setScreenRotationAndSize(ScreenRotation colorCameraToDisplayRotation, int width, int height);
|
||||||
|
|
||||||
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
||||||
void setupGL();
|
virtual void close(); // close ARCore connection
|
||||||
virtual void close(); // close Tango connection
|
|
||||||
virtual std::string getSerial() const;
|
virtual std::string getSerial() const;
|
||||||
GLuint getTextureId() const {return textureId_;}
|
|
||||||
|
|
||||||
void imageCallback(AImageReader *reader);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual SensorData captureImage(CameraInfo * info = 0); // should be called in opengl thread
|
virtual SensorData updateDataOnRender(Transform & pose); // should be called in opengl thread
|
||||||
virtual void capturePoseOnly();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
rtabmap::Transform getPoseAtTimestamp(double timestamp);
|
rtabmap::Transform getPoseAtTimestamp(double timestamp);
|
||||||
|
|||||||
@@ -117,9 +117,6 @@ bool CameraAREngine::init(const std::string & calibrationFolder, const std::stri
|
|||||||
|
|
||||||
deviceTColorCamera_ = opticalRotation;
|
deviceTColorCamera_ = opticalRotation;
|
||||||
|
|
||||||
// Required as ArSession_update does some off-screen OpenGL stuff...
|
|
||||||
HwArSession_setCameraTextureName(arSession_, textureId_);
|
|
||||||
|
|
||||||
if (HwArSession_resume(arSession_) != HWAR_SUCCESS)
|
if (HwArSession_resume(arSession_) != HWAR_SUCCESS)
|
||||||
{
|
{
|
||||||
UERROR("Cannot resume camera!");
|
UERROR("Cannot resume camera!");
|
||||||
@@ -169,38 +166,87 @@ void CameraAREngine::close()
|
|||||||
CameraMobile::close();
|
CameraMobile::close();
|
||||||
}
|
}
|
||||||
|
|
||||||
SensorData CameraAREngine::captureImage(CameraInfo * info)
|
void CameraAREngine::setScreenRotationAndSize(ScreenRotation colorCameraToDisplayRotation, int width, int height)
|
||||||
|
{
|
||||||
|
CameraMobile::setScreenRotationAndSize(colorCameraToDisplayRotation, width, height);
|
||||||
|
if(arSession_)
|
||||||
|
{
|
||||||
|
int ret = static_cast<int>(colorCameraToDisplayRotation) + 1; // remove 90deg camera rotation
|
||||||
|
if (ret > 3) {
|
||||||
|
ret -= 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
HwArSession_setDisplayGeometry(arSession_, ret, width, height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SensorData CameraAREngine::updateDataOnRender(Transform & pose)
|
||||||
{
|
{
|
||||||
UScopeMutex lock(arSessionMutex_);
|
UScopeMutex lock(arSessionMutex_);
|
||||||
//LOGI("Capturing image...");
|
//LOGI("Capturing image...");
|
||||||
|
|
||||||
|
pose.setNull();
|
||||||
SensorData data;
|
SensorData data;
|
||||||
if(!arSession_)
|
if(!arSession_)
|
||||||
{
|
{
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(textureId_ == 0)
|
||||||
|
{
|
||||||
|
glGenTextures(1, &textureId_);
|
||||||
|
glBindTexture(GL_TEXTURE_EXTERNAL_OES, textureId_);
|
||||||
|
glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||||
|
glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
|
glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
}
|
||||||
|
if(textureId_!=0)
|
||||||
|
HwArSession_setCameraTextureName(arSession_, textureId_);
|
||||||
|
|
||||||
// Update session to get current frame and render camera background.
|
// Update session to get current frame and render camera background.
|
||||||
if (HwArSession_update(arSession_, arFrame_) != HWAR_SUCCESS) {
|
if (HwArSession_update(arSession_, arFrame_) != HWAR_SUCCESS) {
|
||||||
LOGE("CameraAREngine::captureImage() ArSession_update error");
|
LOGE("CameraAREngine::captureImage() ArSession_update error");
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If display rotation changed (also includes view size change), we need to
|
||||||
|
// re-query the uv coordinates for the on-screen portion of the camera image.
|
||||||
|
int32_t geometry_changed = 0;
|
||||||
|
HwArFrame_getDisplayGeometryChanged(arSession_, arFrame_, &geometry_changed);
|
||||||
|
if (geometry_changed != 0 || !uvs_initialized_) {
|
||||||
|
HwArFrame_transformDisplayUvCoords(
|
||||||
|
arSession_, arFrame_,
|
||||||
|
BackgroundRenderer::kNumVertices*2, BackgroundRenderer_kVerticesView,
|
||||||
|
transformed_uvs_);
|
||||||
|
UERROR("uv: (%f,%f) (%f,%f) (%f,%f) (%f,%f)",
|
||||||
|
transformed_uvs_[0], transformed_uvs_[1],
|
||||||
|
transformed_uvs_[2], transformed_uvs_[3],
|
||||||
|
transformed_uvs_[4], transformed_uvs_[5],
|
||||||
|
transformed_uvs_[6], transformed_uvs_[7]);
|
||||||
|
UASSERT(transformed_uvs_);
|
||||||
|
uvs_initialized_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
HwArCamera* ar_camera;
|
HwArCamera* ar_camera;
|
||||||
HwArFrame_acquireCamera(arSession_, arFrame_, &ar_camera);
|
HwArFrame_acquireCamera(arSession_, arFrame_, &ar_camera);
|
||||||
|
|
||||||
|
HwArCamera_getViewMatrix(arSession_, ar_camera, glm::value_ptr(viewMatrix_));
|
||||||
|
HwArCamera_getProjectionMatrix(arSession_, ar_camera,
|
||||||
|
/*near=*/0.1f, /*far=*/100.f,
|
||||||
|
glm::value_ptr(projectionMatrix_));
|
||||||
|
|
||||||
|
// adjust origin
|
||||||
|
if(!getOriginOffset().isNull())
|
||||||
|
{
|
||||||
|
viewMatrix_ = glm::inverse(rtabmap::glmFromTransform(rtabmap::opengl_world_T_rtabmap_world * getOriginOffset() *rtabmap::rtabmap_world_T_opengl_world)*glm::inverse(viewMatrix_));
|
||||||
|
}
|
||||||
|
|
||||||
HwArTrackingState camera_tracking_state;
|
HwArTrackingState camera_tracking_state;
|
||||||
HwArCamera_getTrackingState(arSession_, ar_camera, &camera_tracking_state);
|
HwArCamera_getTrackingState(arSession_, ar_camera, &camera_tracking_state);
|
||||||
|
|
||||||
Transform pose;
|
|
||||||
if(camera_tracking_state == HWAR_TRACKING_STATE_TRACKING)
|
if(camera_tracking_state == HWAR_TRACKING_STATE_TRACKING)
|
||||||
{
|
{
|
||||||
// pose in OpenGL coordinates
|
|
||||||
float pose_raw[7];
|
|
||||||
HwArCamera_getPose(arSession_, ar_camera, arPose_);
|
|
||||||
HwArPose_getPoseRaw(arSession_, arPose_, pose_raw);
|
|
||||||
pose = Transform(pose_raw[4], pose_raw[5], pose_raw[6], pose_raw[0], pose_raw[1], pose_raw[2], pose_raw[3]);
|
|
||||||
|
|
||||||
// Get calibration parameters
|
// Get calibration parameters
|
||||||
// FIXME: Hard-coded as getting intrinsics with the api fails
|
// FIXME: Hard-coded as getting intrinsics with the api fails
|
||||||
float fx=492.689667,fy=492.606201, cx=323.594849, cy=234.659744;
|
float fx=492.689667,fy=492.606201, cx=323.594849, cy=234.659744;
|
||||||
@@ -274,6 +320,26 @@ SensorData CameraAREngine::captureImage(CameraInfo * info)
|
|||||||
double stamp = double(timestamp_ns)/10e8;
|
double stamp = double(timestamp_ns)/10e8;
|
||||||
CameraModel model = CameraModel(fx, fy, cx, cy, deviceTColorCamera_, 0, cv::Size(camWidth, camHeight));
|
CameraModel model = CameraModel(fx, fy, cx, cy, deviceTColorCamera_, 0, cv::Size(camWidth, camHeight));
|
||||||
data = SensorData(outputRGB, outputDepth, model, 0, stamp);
|
data = SensorData(outputRGB, outputDepth, model, 0, stamp);
|
||||||
|
|
||||||
|
// pose in OpenGL coordinates
|
||||||
|
float pose_raw[7];
|
||||||
|
HwArCamera_getPose(arSession_, ar_camera, arPose_);
|
||||||
|
HwArPose_getPoseRaw(arSession_, arPose_, pose_raw);
|
||||||
|
pose = Transform(pose_raw[4], pose_raw[5], pose_raw[6], pose_raw[0], pose_raw[1], pose_raw[2], pose_raw[3]);
|
||||||
|
if(pose.isNull())
|
||||||
|
{
|
||||||
|
LOGE("CameraAREngine: Pose is null");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pose = rtabmap::rtabmap_world_T_opengl_world * pose * rtabmap::opengl_world_T_rtabmap_world;
|
||||||
|
this->poseReceived(pose, stamp);
|
||||||
|
// adjust origin
|
||||||
|
if(!getOriginOffset().isNull())
|
||||||
|
{
|
||||||
|
pose = getOriginOffset() * pose;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -291,66 +357,8 @@ SensorData CameraAREngine::captureImage(CameraInfo * info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
HwArCamera_release(ar_camera);
|
HwArCamera_release(ar_camera);
|
||||||
|
|
||||||
if(pose.isNull())
|
|
||||||
{
|
|
||||||
LOGE("CameraAREngine: Pose is null");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pose = rtabmap::rtabmap_world_T_opengl_world * pose * rtabmap::opengl_world_T_rtabmap_world;
|
|
||||||
this->poseReceived(pose);
|
|
||||||
// adjust origin
|
|
||||||
if(!getOriginOffset().isNull())
|
|
||||||
{
|
|
||||||
pose = getOriginOffset() * pose;
|
|
||||||
}
|
|
||||||
info->odomPose = pose;
|
|
||||||
}
|
|
||||||
return data;
|
return data;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CameraAREngine::capturePoseOnly()
|
|
||||||
{
|
|
||||||
UScopeMutex lock(arSessionMutex_);
|
|
||||||
//LOGI("Capturing image...");
|
|
||||||
|
|
||||||
SensorData data;
|
|
||||||
if(!arSession_)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update session to get current frame and render camera background.
|
|
||||||
if (HwArSession_update(arSession_, arFrame_) != HWAR_SUCCESS) {
|
|
||||||
LOGE("CameraARCore::captureImage() ArSession_update error");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
HwArCamera* ar_camera;
|
|
||||||
HwArFrame_acquireCamera(arSession_, arFrame_, &ar_camera);
|
|
||||||
|
|
||||||
HwArTrackingState camera_tracking_state;
|
|
||||||
HwArCamera_getTrackingState(arSession_, ar_camera, &camera_tracking_state);
|
|
||||||
|
|
||||||
Transform pose;
|
|
||||||
CameraModel model;
|
|
||||||
if(camera_tracking_state == HWAR_TRACKING_STATE_TRACKING)
|
|
||||||
{
|
|
||||||
// pose in OpenGL coordinates
|
|
||||||
float pose_raw[7];
|
|
||||||
HwArCamera_getPose(arSession_, ar_camera, arPose_);
|
|
||||||
HwArPose_getPoseRaw(arSession_, arPose_, pose_raw);
|
|
||||||
pose = Transform(pose_raw[4], pose_raw[5], pose_raw[6], pose_raw[0], pose_raw[1], pose_raw[2], pose_raw[3]);
|
|
||||||
if(!pose.isNull())
|
|
||||||
{
|
|
||||||
pose = rtabmap::rtabmap_world_T_opengl_world * pose * rtabmap::opengl_world_T_rtabmap_world;
|
|
||||||
this->poseReceived(pose);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
HwArCamera_release(ar_camera);
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* namespace rtabmap */
|
} /* namespace rtabmap */
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <rtabmap/utilite/UEvent.h>
|
#include <rtabmap/utilite/UEvent.h>
|
||||||
#include <rtabmap/utilite/UTimer.h>
|
#include <rtabmap/utilite/UTimer.h>
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
|
#include <background_renderer.h>
|
||||||
|
|
||||||
#include <huawei_arengine_interface.h>
|
#include <huawei_arengine_interface.h>
|
||||||
|
|
||||||
@@ -48,13 +49,14 @@ public:
|
|||||||
CameraAREngine(void* env, void* context, void* activity, bool smoothing = false);
|
CameraAREngine(void* env, void* context, void* activity, bool smoothing = false);
|
||||||
virtual ~CameraAREngine();
|
virtual ~CameraAREngine();
|
||||||
|
|
||||||
|
virtual void setScreenRotationAndSize(ScreenRotation colorCameraToDisplayRotation, int width, int height);
|
||||||
|
|
||||||
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
||||||
virtual void close(); // close Tango connection
|
virtual void close(); // close AREngine connection
|
||||||
virtual std::string getSerial() const;
|
virtual std::string getSerial() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual SensorData captureImage(CameraInfo * info = 0);
|
virtual SensorData updateDataOnRender(Transform & pose);
|
||||||
virtual void capturePoseOnly();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
rtabmap::Transform getPoseAtTimestamp(double timestamp);
|
rtabmap::Transform getPoseAtTimestamp(double timestamp);
|
||||||
@@ -69,7 +71,6 @@ private:
|
|||||||
HwArCameraIntrinsics *arCameraIntrinsics_ = nullptr;
|
HwArCameraIntrinsics *arCameraIntrinsics_ = nullptr;
|
||||||
HwArPose * arPose_ = nullptr;
|
HwArPose * arPose_ = nullptr;
|
||||||
bool arInstallRequested_;
|
bool arInstallRequested_;
|
||||||
GLuint textureId_;
|
|
||||||
UMutex arSessionMutex_;
|
UMutex arSessionMutex_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -55,10 +55,8 @@ const rtabmap::Transform CameraMobile::opticalRotationInv = Transform(
|
|||||||
CameraMobile::CameraMobile(bool smoothing) :
|
CameraMobile::CameraMobile(bool smoothing) :
|
||||||
Camera(10),
|
Camera(10),
|
||||||
deviceTColorCamera_(Transform::getIdentity()),
|
deviceTColorCamera_(Transform::getIdentity()),
|
||||||
spinOncePreviousStamp_(0.0),
|
|
||||||
textureId_(0),
|
textureId_(0),
|
||||||
uvs_initialized_(false),
|
uvs_initialized_(false),
|
||||||
previousStamp_(0.0),
|
|
||||||
stampEpochOffset_(0.0),
|
stampEpochOffset_(0.0),
|
||||||
smoothing_(smoothing),
|
smoothing_(smoothing),
|
||||||
colorCameraToDisplayRotation_(ROTATION_0),
|
colorCameraToDisplayRotation_(ROTATION_0),
|
||||||
@@ -79,13 +77,12 @@ bool CameraMobile::init(const std::string &, const std::string &)
|
|||||||
|
|
||||||
void CameraMobile::close()
|
void CameraMobile::close()
|
||||||
{
|
{
|
||||||
previousPose_.setNull();
|
firstFrame_ = true;
|
||||||
previousStamp_ = 0.0;
|
|
||||||
lastKnownGPS_ = GPS();
|
lastKnownGPS_ = GPS();
|
||||||
lastEnvSensors_.clear();
|
lastEnvSensors_.clear();
|
||||||
originOffset_ = Transform();
|
originOffset_ = Transform();
|
||||||
originUpdate_ = false;
|
originUpdate_ = false;
|
||||||
pose_ = Transform();
|
dataPose_ = Transform();
|
||||||
data_ = SensorData();
|
data_ = SensorData();
|
||||||
|
|
||||||
if(textureId_ != 0)
|
if(textureId_ != 0)
|
||||||
@@ -97,35 +94,107 @@ void CameraMobile::close()
|
|||||||
|
|
||||||
void CameraMobile::resetOrigin()
|
void CameraMobile::resetOrigin()
|
||||||
{
|
{
|
||||||
previousPose_.setNull();
|
firstFrame_ = true;
|
||||||
previousStamp_ = 0.0;
|
|
||||||
lastKnownGPS_ = GPS();
|
lastKnownGPS_ = GPS();
|
||||||
lastEnvSensors_.clear();
|
lastEnvSensors_.clear();
|
||||||
pose_ = Transform();
|
dataPose_ = Transform();
|
||||||
data_ = SensorData();
|
data_ = SensorData();
|
||||||
originUpdate_ = true;
|
originUpdate_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CameraMobile::poseReceived(const Transform & pose)
|
bool CameraMobile::getPose(double stamp, Transform & pose, cv::Mat & covariance, double maxWaitTime)
|
||||||
|
{
|
||||||
|
pose.setNull();
|
||||||
|
|
||||||
|
int maxWaitTimeMs = maxWaitTime * 1000;
|
||||||
|
|
||||||
|
// Interpolate pose
|
||||||
|
if(!poseBuffer_.empty())
|
||||||
|
{
|
||||||
|
poseMutex_.lock();
|
||||||
|
int waitTry = 0;
|
||||||
|
while(maxWaitTimeMs>0 && poseBuffer_.rbegin()->first < stamp && waitTry < maxWaitTimeMs)
|
||||||
|
{
|
||||||
|
poseMutex_.unlock();
|
||||||
|
++waitTry;
|
||||||
|
uSleep(1);
|
||||||
|
poseMutex_.lock();
|
||||||
|
}
|
||||||
|
if(poseBuffer_.rbegin()->first < stamp)
|
||||||
|
{
|
||||||
|
if(maxWaitTimeMs > 0)
|
||||||
|
{
|
||||||
|
UWARN("Could not find poses to interpolate at time %f after waiting %d ms (latest is %f)...", stamp, maxWaitTimeMs, poseBuffer_.rbegin()->first);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UWARN("Could not find poses to interpolate at time %f (latest is %f)...", stamp, poseBuffer_.rbegin()->first);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::map<double, Transform>::const_iterator iterB = poseBuffer_.lower_bound(stamp);
|
||||||
|
std::map<double, Transform>::const_iterator iterA = iterB;
|
||||||
|
if(iterA != poseBuffer_.begin())
|
||||||
|
{
|
||||||
|
iterA = --iterA;
|
||||||
|
}
|
||||||
|
if(iterB == poseBuffer_.end())
|
||||||
|
{
|
||||||
|
iterB = --iterB;
|
||||||
|
}
|
||||||
|
if(iterA == iterB && stamp == iterA->first)
|
||||||
|
{
|
||||||
|
pose = iterA->second;
|
||||||
|
}
|
||||||
|
else if(stamp >= iterA->first && stamp <= iterB->first)
|
||||||
|
{
|
||||||
|
pose = iterA->second.interpolate((stamp-iterA->first) / (iterB->first-iterA->first), iterB->second);
|
||||||
|
}
|
||||||
|
else // stamp < iterA->first
|
||||||
|
{
|
||||||
|
UWARN("Could not find pose data to interpolate at time %f (earliest is %f). Are sensors synchronized?", stamp, iterA->first);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
poseMutex_.unlock();
|
||||||
|
}
|
||||||
|
return !pose.isNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CameraMobile::poseReceived(const Transform & pose, double deviceStamp)
|
||||||
{
|
{
|
||||||
if(!pose.isNull())
|
if(!pose.isNull())
|
||||||
{
|
{
|
||||||
// send pose of the camera (without optical rotation)
|
Transform p = pose;
|
||||||
Transform p = pose*deviceTColorCamera_;
|
|
||||||
if(originUpdate_)
|
if(originUpdate_)
|
||||||
{
|
{
|
||||||
originOffset_ = p.translation().inverse();
|
originOffset_ = p.translation().inverse();
|
||||||
originUpdate_ = false;
|
originUpdate_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(stampEpochOffset_ == 0.0)
|
||||||
|
{
|
||||||
|
stampEpochOffset_ = UTimer::now() - deviceStamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
double epochStamp = stampEpochOffset_ + deviceStamp;
|
||||||
|
|
||||||
if(!originOffset_.isNull())
|
if(!originOffset_.isNull())
|
||||||
{
|
{
|
||||||
this->post(new PoseEvent(originOffset_*p));
|
p = originOffset_*p;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
{
|
||||||
this->post(new PoseEvent(p));
|
UScopeMutex lock(poseMutex_);
|
||||||
|
poseBuffer_.insert(poseBuffer_.end(), std::make_pair(epochStamp, p));
|
||||||
|
if(poseBuffer_.size() > 1000)
|
||||||
|
{
|
||||||
|
poseBuffer_.erase(poseBuffer_.begin());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// send pose of the camera (with optical rotation)
|
||||||
|
this->post(new PoseEvent(p * deviceTColorCamera_));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,11 +208,20 @@ void CameraMobile::setGPS(const GPS & gps)
|
|||||||
lastKnownGPS_ = gps;
|
lastKnownGPS_ = gps;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CameraMobile::setData(const SensorData & data, const Transform & pose, const glm::mat4 & viewMatrix, const glm::mat4 & projectionMatrix, const float * texCoord)
|
void CameraMobile::addEnvSensor(int type, float value)
|
||||||
{
|
{
|
||||||
LOGD("CameraMobile::setData pose=%s stamp=%f", pose.prettyPrint().c_str(), data.stamp());
|
lastEnvSensors_.insert(std::make_pair((EnvSensor::Type)type, EnvSensor((EnvSensor::Type)type, value)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CameraMobile::update(const SensorData & data, const Transform & pose, const glm::mat4 & viewMatrix, const glm::mat4 & projectionMatrix, const float * texCoord)
|
||||||
|
{
|
||||||
|
UScopeMutex lock(dataMutex_);
|
||||||
|
|
||||||
|
bool notify = !data_.isValid();
|
||||||
|
|
||||||
|
LOGD("CameraMobile::update pose=%s stamp=%f", pose.prettyPrint().c_str(), data.stamp());
|
||||||
data_ = data;
|
data_ = data;
|
||||||
pose_ = pose;
|
dataPose_ = pose;
|
||||||
|
|
||||||
viewMatrix_ = viewMatrix;
|
viewMatrix_ = viewMatrix;
|
||||||
projectionMatrix_ = projectionMatrix;
|
projectionMatrix_ = projectionMatrix;
|
||||||
@@ -151,7 +229,7 @@ void CameraMobile::setData(const SensorData & data, const Transform & pose, cons
|
|||||||
// adjust origin
|
// adjust origin
|
||||||
if(!originOffset_.isNull())
|
if(!originOffset_.isNull())
|
||||||
{
|
{
|
||||||
pose_ = originOffset_ * pose_;
|
dataPose_ = originOffset_ * dataPose_;
|
||||||
viewMatrix_ = glm::inverse(rtabmap::glmFromTransform(rtabmap::opengl_world_T_rtabmap_world * originOffset_ *rtabmap::rtabmap_world_T_opengl_world)*glm::inverse(viewMatrix_));
|
viewMatrix_ = glm::inverse(rtabmap::glmFromTransform(rtabmap::opengl_world_T_rtabmap_world * originOffset_ *rtabmap::rtabmap_world_T_opengl_world)*glm::inverse(viewMatrix_));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +244,7 @@ void CameraMobile::setData(const SensorData & data, const Transform & pose, cons
|
|||||||
uvs_initialized_ = true;
|
uvs_initialized_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGD("CameraMobile::setData textureId_=%d", (int)textureId_);
|
LOGD("CameraMobile::update textureId_=%d", (int)textureId_);
|
||||||
|
|
||||||
if(textureId_ != 0 && texCoord != 0)
|
if(textureId_ != 0 && texCoord != 0)
|
||||||
{
|
{
|
||||||
@@ -193,78 +271,63 @@ void CameraMobile::setData(const SensorData & data, const Transform & pose, cons
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void CameraMobile::addEnvSensor(int type, float value)
|
postUpdate();
|
||||||
{
|
|
||||||
lastEnvSensors_.insert(std::make_pair((EnvSensor::Type)type, EnvSensor((EnvSensor::Type)type, value)));
|
if(notify)
|
||||||
}
|
|
||||||
|
|
||||||
void CameraMobile::spinOnce()
|
|
||||||
{
|
|
||||||
if(!this->isRunning())
|
|
||||||
{
|
{
|
||||||
bool ignoreFrame = false;
|
dataReady_.release();
|
||||||
//float rate = 10.0f; // maximum 10 FPS for image data
|
}
|
||||||
double now = UTimer::now();
|
}
|
||||||
/*if(rate>0.0f)
|
|
||||||
{
|
|
||||||
if((spinOncePreviousStamp_>=0.0 && now>spinOncePreviousStamp_ && now - spinOncePreviousStamp_ < 1.0f/rate) ||
|
|
||||||
((spinOncePreviousStamp_<=0.0 || now<=spinOncePreviousStamp_) && spinOnceFrameRateTimer_.getElapsedTime() < 1.0f/rate))
|
|
||||||
{
|
|
||||||
ignoreFrame = true;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if(!ignoreFrame)
|
void CameraMobile::updateOnRender()
|
||||||
|
{
|
||||||
|
UScopeMutex lock(dataMutex_);
|
||||||
|
bool notify = !data_.isValid();
|
||||||
|
|
||||||
|
data_ = updateDataOnRender(dataPose_);
|
||||||
|
|
||||||
|
if(data_.isValid())
|
||||||
|
{
|
||||||
|
postUpdate();
|
||||||
|
|
||||||
|
if(notify)
|
||||||
{
|
{
|
||||||
spinOnceFrameRateTimer_.start();
|
dataReady_.release();
|
||||||
spinOncePreviousStamp_ = now;
|
|
||||||
mainLoop();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// just send pose
|
|
||||||
capturePoseOnly();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CameraMobile::mainLoopBegin()
|
SensorData CameraMobile::updateDataOnRender(Transform & pose)
|
||||||
{
|
{
|
||||||
double t = cameraStartedTime_.elapsed();
|
LOGE("To use CameraMobile::updateOnRender(), CameraMobile::updateDataOnRender() "
|
||||||
if(t < 5.0)
|
"should be overridden by inherited classes. Returning empty data!\n");
|
||||||
{
|
return SensorData();
|
||||||
uSleep((5.0-t)*1000); // just to make sure that the camera is started
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CameraMobile::mainLoop()
|
void CameraMobile::postUpdate()
|
||||||
{
|
{
|
||||||
CameraInfo info;
|
if(data_.isValid())
|
||||||
SensorData data = this->captureImage(&info);
|
|
||||||
|
|
||||||
if(data.isValid() && !info.odomPose.isNull())
|
|
||||||
{
|
{
|
||||||
if(lastKnownGPS_.stamp() > 0.0 && data.stamp()-lastKnownGPS_.stamp()<1.0)
|
if(lastKnownGPS_.stamp() > 0.0 && data_.stamp()-lastKnownGPS_.stamp()<1.0)
|
||||||
{
|
{
|
||||||
data.setGPS(lastKnownGPS_);
|
data_.setGPS(lastKnownGPS_);
|
||||||
}
|
}
|
||||||
else if(lastKnownGPS_.stamp()>0.0)
|
else if(lastKnownGPS_.stamp()>0.0)
|
||||||
{
|
{
|
||||||
LOGD("GPS too old (current time=%f, gps time = %f)", data.stamp(), lastKnownGPS_.stamp());
|
LOGD("GPS too old (current time=%f, gps time = %f)", data_.stamp(), lastKnownGPS_.stamp());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lastEnvSensors_.size())
|
if(lastEnvSensors_.size())
|
||||||
{
|
{
|
||||||
data.setEnvSensors(lastEnvSensors_);
|
data_.setEnvSensors(lastEnvSensors_);
|
||||||
lastEnvSensors_.clear();
|
lastEnvSensors_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(smoothing_ && !data.depthRaw().empty())
|
if(smoothing_ && !data_.depthRaw().empty())
|
||||||
{
|
{
|
||||||
//UTimer t;
|
//UTimer t;
|
||||||
data.setDepthOrRightRaw(rtabmap::util2d::fastBilateralFiltering(data.depthRaw(), bilateralFilteringSigmaS, bilateralFilteringSigmaR));
|
data_.setDepthOrRightRaw(rtabmap::util2d::fastBilateralFiltering(data_.depthRaw(), bilateralFilteringSigmaS, bilateralFilteringSigmaR));
|
||||||
//LOGD("Bilateral filtering, time=%fs", t.ticks());
|
//LOGD("Bilateral filtering, time=%fs", t.ticks());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,15 +336,15 @@ void CameraMobile::mainLoop()
|
|||||||
{
|
{
|
||||||
UDEBUG("ROTATION_90");
|
UDEBUG("ROTATION_90");
|
||||||
cv::Mat rgb, depth;
|
cv::Mat rgb, depth;
|
||||||
cv::Mat rgbt(data.imageRaw().cols, data.imageRaw().rows, data.imageRaw().type());
|
cv::Mat rgbt(data_.imageRaw().cols, data_.imageRaw().rows, data_.imageRaw().type());
|
||||||
cv::flip(data.imageRaw(),rgb,1);
|
cv::flip(data_.imageRaw(),rgb,1);
|
||||||
cv::transpose(rgb,rgbt);
|
cv::transpose(rgb,rgbt);
|
||||||
rgb = rgbt;
|
rgb = rgbt;
|
||||||
cv::Mat deptht(data.depthRaw().cols, data.depthRaw().rows, data.depthRaw().type());
|
cv::Mat deptht(data_.depthRaw().cols, data_.depthRaw().rows, data_.depthRaw().type());
|
||||||
cv::flip(data.depthRaw(),depth,1);
|
cv::flip(data_.depthRaw(),depth,1);
|
||||||
cv::transpose(depth,deptht);
|
cv::transpose(depth,deptht);
|
||||||
depth = deptht;
|
depth = deptht;
|
||||||
CameraModel model = data.cameraModels()[0];
|
CameraModel model = data_.cameraModels()[0];
|
||||||
cv::Size sizet(model.imageHeight(), model.imageWidth());
|
cv::Size sizet(model.imageHeight(), model.imageWidth());
|
||||||
model = CameraModel(
|
model = CameraModel(
|
||||||
model.fy(),
|
model.fy(),
|
||||||
@@ -290,25 +353,25 @@ void CameraMobile::mainLoop()
|
|||||||
model.cx()>0?model.imageWidth()-model.cx():0,
|
model.cx()>0?model.imageWidth()-model.cx():0,
|
||||||
model.localTransform()*rtabmap::Transform(0,-1,0,0, 1,0,0,0, 0,0,1,0));
|
model.localTransform()*rtabmap::Transform(0,-1,0,0, 1,0,0,0, 0,0,1,0));
|
||||||
model.setImageSize(sizet);
|
model.setImageSize(sizet);
|
||||||
data.setRGBDImage(rgb, depth, model);
|
data_.setRGBDImage(rgb, depth, model);
|
||||||
|
|
||||||
std::vector<cv::KeyPoint> keypoints = data.keypoints();
|
std::vector<cv::KeyPoint> keypoints = data_.keypoints();
|
||||||
for(size_t i=0; i<keypoints.size(); ++i)
|
for(size_t i=0; i<keypoints.size(); ++i)
|
||||||
{
|
{
|
||||||
keypoints[i].pt.x = data.keypoints()[i].pt.y;
|
keypoints[i].pt.x = data_.keypoints()[i].pt.y;
|
||||||
keypoints[i].pt.y = rgb.rows - data.keypoints()[i].pt.x;
|
keypoints[i].pt.y = rgb.rows - data_.keypoints()[i].pt.x;
|
||||||
}
|
}
|
||||||
data.setFeatures(keypoints, data.keypoints3D(), cv::Mat());
|
data_.setFeatures(keypoints, data_.keypoints3D(), cv::Mat());
|
||||||
}
|
}
|
||||||
else if(colorCameraToDisplayRotation_ == ROTATION_180)
|
else if(colorCameraToDisplayRotation_ == ROTATION_180)
|
||||||
{
|
{
|
||||||
UDEBUG("ROTATION_180");
|
UDEBUG("ROTATION_180");
|
||||||
cv::Mat rgb, depth;
|
cv::Mat rgb, depth;
|
||||||
cv::flip(data.imageRaw(),rgb,1);
|
cv::flip(data_.imageRaw(),rgb,1);
|
||||||
cv::flip(rgb,rgb,0);
|
cv::flip(rgb,rgb,0);
|
||||||
cv::flip(data.depthOrRightRaw(),depth,1);
|
cv::flip(data_.depthOrRightRaw(),depth,1);
|
||||||
cv::flip(depth,depth,0);
|
cv::flip(depth,depth,0);
|
||||||
CameraModel model = data.cameraModels()[0];
|
CameraModel model = data_.cameraModels()[0];
|
||||||
cv::Size sizet(model.imageWidth(), model.imageHeight());
|
cv::Size sizet(model.imageWidth(), model.imageHeight());
|
||||||
model = CameraModel(
|
model = CameraModel(
|
||||||
model.fx(),
|
model.fx(),
|
||||||
@@ -317,26 +380,26 @@ void CameraMobile::mainLoop()
|
|||||||
model.cy()>0?model.imageHeight()-model.cy():0,
|
model.cy()>0?model.imageHeight()-model.cy():0,
|
||||||
model.localTransform()*rtabmap::Transform(0,0,0,0,0,1,0));
|
model.localTransform()*rtabmap::Transform(0,0,0,0,0,1,0));
|
||||||
model.setImageSize(sizet);
|
model.setImageSize(sizet);
|
||||||
data.setRGBDImage(rgb, depth, model);
|
data_.setRGBDImage(rgb, depth, model);
|
||||||
|
|
||||||
std::vector<cv::KeyPoint> keypoints = data.keypoints();
|
std::vector<cv::KeyPoint> keypoints = data_.keypoints();
|
||||||
for(size_t i=0; i<keypoints.size(); ++i)
|
for(size_t i=0; i<keypoints.size(); ++i)
|
||||||
{
|
{
|
||||||
keypoints[i].pt.x = rgb.cols - data.keypoints()[i].pt.x;
|
keypoints[i].pt.x = rgb.cols - data_.keypoints()[i].pt.x;
|
||||||
keypoints[i].pt.y = rgb.rows - data.keypoints()[i].pt.y;
|
keypoints[i].pt.y = rgb.rows - data_.keypoints()[i].pt.y;
|
||||||
}
|
}
|
||||||
data.setFeatures(keypoints, data.keypoints3D(), cv::Mat());
|
data_.setFeatures(keypoints, data_.keypoints3D(), cv::Mat());
|
||||||
}
|
}
|
||||||
else if(colorCameraToDisplayRotation_ == ROTATION_270)
|
else if(colorCameraToDisplayRotation_ == ROTATION_270)
|
||||||
{
|
{
|
||||||
UDEBUG("ROTATION_270");
|
UDEBUG("ROTATION_270");
|
||||||
cv::Mat rgb(data.imageRaw().cols, data.imageRaw().rows, data.imageRaw().type());
|
cv::Mat rgb(data_.imageRaw().cols, data_.imageRaw().rows, data_.imageRaw().type());
|
||||||
cv::transpose(data.imageRaw(),rgb);
|
cv::transpose(data_.imageRaw(),rgb);
|
||||||
cv::flip(rgb,rgb,1);
|
cv::flip(rgb,rgb,1);
|
||||||
cv::Mat depth(data.depthOrRightRaw().cols, data.depthOrRightRaw().rows, data.depthOrRightRaw().type());
|
cv::Mat depth(data_.depthOrRightRaw().cols, data_.depthOrRightRaw().rows, data_.depthOrRightRaw().type());
|
||||||
cv::transpose(data.depthOrRightRaw(),depth);
|
cv::transpose(data_.depthOrRightRaw(),depth);
|
||||||
cv::flip(depth,depth,1);
|
cv::flip(depth,depth,1);
|
||||||
CameraModel model = data.cameraModels()[0];
|
CameraModel model = data_.cameraModels()[0];
|
||||||
cv::Size sizet(model.imageHeight(), model.imageWidth());
|
cv::Size sizet(model.imageHeight(), model.imageWidth());
|
||||||
model = CameraModel(
|
model = CameraModel(
|
||||||
model.fy(),
|
model.fy(),
|
||||||
@@ -345,61 +408,54 @@ void CameraMobile::mainLoop()
|
|||||||
model.cx(),
|
model.cx(),
|
||||||
model.localTransform()*rtabmap::Transform(0,1,0,0, -1,0,0,0, 0,0,1,0));
|
model.localTransform()*rtabmap::Transform(0,1,0,0, -1,0,0,0, 0,0,1,0));
|
||||||
model.setImageSize(sizet);
|
model.setImageSize(sizet);
|
||||||
data.setRGBDImage(rgb, depth, model);
|
data_.setRGBDImage(rgb, depth, model);
|
||||||
|
|
||||||
std::vector<cv::KeyPoint> keypoints = data.keypoints();
|
std::vector<cv::KeyPoint> keypoints = data_.keypoints();
|
||||||
for(size_t i=0; i<keypoints.size(); ++i)
|
for(size_t i=0; i<keypoints.size(); ++i)
|
||||||
{
|
{
|
||||||
keypoints[i].pt.x = rgb.cols - data.keypoints()[i].pt.y;
|
keypoints[i].pt.x = rgb.cols - data_.keypoints()[i].pt.y;
|
||||||
keypoints[i].pt.y = data.keypoints()[i].pt.x;
|
keypoints[i].pt.y = data_.keypoints()[i].pt.x;
|
||||||
}
|
}
|
||||||
data.setFeatures(keypoints, data.keypoints3D(), cv::Mat());
|
data_.setFeatures(keypoints, data_.keypoints3D(), cv::Mat());
|
||||||
}
|
}
|
||||||
|
|
||||||
rtabmap::Transform pose = info.odomPose;
|
|
||||||
data.setGroundTruth(Transform());
|
|
||||||
|
|
||||||
// convert stamp to epoch
|
|
||||||
bool firstFrame = previousPose_.isNull();
|
|
||||||
if(firstFrame)
|
|
||||||
{
|
|
||||||
stampEpochOffset_ = UTimer::now()-data.stamp();
|
|
||||||
}
|
|
||||||
data.setStamp(stampEpochOffset_ + data.stamp());
|
|
||||||
OdometryInfo info;
|
|
||||||
if(!firstFrame)
|
|
||||||
{
|
|
||||||
info.interval = data.stamp()-previousStamp_;
|
|
||||||
info.transform = previousPose_.inverse() * pose;
|
|
||||||
}
|
|
||||||
// linear cov = 0.0001
|
|
||||||
info.reg.covariance = cv::Mat::eye(6,6,CV_64FC1) * (firstFrame?9999.0:0.0001);
|
|
||||||
if(!firstFrame)
|
|
||||||
{
|
|
||||||
// angular cov = 0.000001
|
|
||||||
info.reg.covariance.at<double>(3,3) *= 0.01;
|
|
||||||
info.reg.covariance.at<double>(4,4) *= 0.01;
|
|
||||||
info.reg.covariance.at<double>(5,5) *= 0.01;
|
|
||||||
}
|
|
||||||
LOGI("Publish odometry message (variance=%f)", firstFrame?9999:0.0001);
|
|
||||||
this->post(new OdometryEvent(data, pose, info));
|
|
||||||
previousPose_ = pose;
|
|
||||||
previousStamp_ = data.stamp();
|
|
||||||
}
|
|
||||||
else if(!this->isKilled() && info.odomPose.isNull())
|
|
||||||
{
|
|
||||||
LOGW("Odometry lost");
|
|
||||||
this->post(new OdometryEvent());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SensorData CameraMobile::captureImage(CameraInfo * info)
|
SensorData CameraMobile::captureImage(SensorCaptureInfo * info)
|
||||||
{
|
{
|
||||||
if(info)
|
SensorData data;
|
||||||
|
if(dataReady_.acquire(1, 5000))
|
||||||
{
|
{
|
||||||
info->odomPose = pose_;
|
UScopeMutex lock(dataMutex_);
|
||||||
|
data = data_;
|
||||||
|
data_ = SensorData();
|
||||||
}
|
}
|
||||||
return data_;
|
if(data.isValid())
|
||||||
|
{
|
||||||
|
data.setGroundTruth(Transform());
|
||||||
|
data.setStamp(stampEpochOffset_ + data.stamp());
|
||||||
|
|
||||||
|
if(info)
|
||||||
|
{
|
||||||
|
// linear cov = 0.0001
|
||||||
|
info->odomCovariance = cv::Mat::eye(6,6,CV_64FC1) * (firstFrame_?9999.0:0.0001);
|
||||||
|
if(!firstFrame_)
|
||||||
|
{
|
||||||
|
// angular cov = 0.000001
|
||||||
|
info->odomCovariance.at<double>(3,3) *= 0.01;
|
||||||
|
info->odomCovariance.at<double>(4,4) *= 0.01;
|
||||||
|
info->odomCovariance.at<double>(5,5) *= 0.01;
|
||||||
|
}
|
||||||
|
info->odomPose = dataPose_;
|
||||||
|
}
|
||||||
|
|
||||||
|
firstFrame_ = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UWARN("CameraMobile::captureImage() invalid data!");
|
||||||
|
}
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
LaserScan CameraMobile::scanFromPointCloudData(
|
LaserScan CameraMobile::scanFromPointCloudData(
|
||||||
@@ -432,23 +488,25 @@ LaserScan CameraMobile::scanFromPointCloudData(
|
|||||||
//get color from rgb image
|
//get color from rgb image
|
||||||
cv::Point3f org= pt;
|
cv::Point3f org= pt;
|
||||||
pt = util3d::transformPoint(pt, opticalRotationInv);
|
pt = util3d::transformPoint(pt, opticalRotationInv);
|
||||||
int u,v;
|
if(pt.z > 0)
|
||||||
model.reproject(pt.x, pt.y, pt.z, u, v);
|
|
||||||
unsigned char r=255,g=255,b=255;
|
|
||||||
if(model.inFrame(u, v))
|
|
||||||
{
|
{
|
||||||
b=rgb.at<cv::Vec3b>(v,u).val[0];
|
int u,v;
|
||||||
g=rgb.at<cv::Vec3b>(v,u).val[1];
|
model.reproject(pt.x, pt.y, pt.z, u, v);
|
||||||
r=rgb.at<cv::Vec3b>(v,u).val[2];
|
unsigned char r=255,g=255,b=255;
|
||||||
if(kpts)
|
if(model.inFrame(u, v))
|
||||||
kpts->push_back(cv::KeyPoint(u,v,kptsSize));
|
{
|
||||||
if(kpts3D)
|
b=rgb.at<cv::Vec3b>(v,u).val[0];
|
||||||
kpts3D->push_back(org);
|
g=rgb.at<cv::Vec3b>(v,u).val[1];
|
||||||
|
r=rgb.at<cv::Vec3b>(v,u).val[2];
|
||||||
*(int*)&ptr[oi*4 + 3] = int(b) | (int(g) << 8) | (int(r) << 16);
|
if(kpts)
|
||||||
++oi;
|
kpts->push_back(cv::KeyPoint(u,v,kptsSize));
|
||||||
|
if(kpts3D)
|
||||||
|
kpts3D->push_back(org);
|
||||||
|
|
||||||
|
*(int*)&ptr[oi*4 + 3] = int(b) | (int(g) << 8) | (int(r) << 16);
|
||||||
|
++oi;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//confidence
|
//confidence
|
||||||
//*(int*)&ptr[i*4 + 3] = (int(pointCloudData[i*4 + 3] * 255.0f) << 8) | (int(255) << 16);
|
//*(int*)&ptr[i*4 + 3] = (int(pointCloudData[i*4 + 3] * 255.0f) << 8) | (int(255) << 16);
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ private:
|
|||||||
Transform pose_;
|
Transform pose_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CameraMobile : public Camera, public UThread, public UEventsSender {
|
class CameraMobile : public Camera, public UEventsSender {
|
||||||
public:
|
public:
|
||||||
static const float bilateralFilteringSigmaS;
|
static const float bilateralFilteringSigmaS;
|
||||||
static const float bilateralFilteringSigmaR;
|
static const float bilateralFilteringSigmaR;
|
||||||
@@ -93,14 +93,20 @@ public:
|
|||||||
|
|
||||||
// abstract functions
|
// abstract functions
|
||||||
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
|
||||||
virtual void close(); // inherited classes should call its parent in their close().
|
virtual void close(); // inherited classes should call its parent at the end of their close().
|
||||||
virtual std::string getSerial() const {return "CameraMobile";}
|
virtual std::string getSerial() const {return "CameraMobile";}
|
||||||
|
|
||||||
|
void update(const SensorData & data, const Transform & pose, const glm::mat4 & viewMatrix, const glm::mat4 & projectionMatrix, const float * texCoord);
|
||||||
|
void updateOnRender();
|
||||||
|
|
||||||
const Transform & getOriginOffset() const {return originOffset_;} // in rtabmap frame
|
const Transform & getOriginOffset() const {return originOffset_;} // in rtabmap frame
|
||||||
void resetOrigin();
|
void resetOrigin();
|
||||||
virtual bool isCalibrated() const;
|
virtual bool isCalibrated() const;
|
||||||
|
|
||||||
void poseReceived(const Transform & pose); // in rtabmap frame
|
virtual bool odomProvided() const { return true; }
|
||||||
|
virtual bool getPose(double epochStamp, Transform & pose, cv::Mat & covariance, double maxWaitTime = 0.06); // Return pose of device in rtabmap frame (with origin offset), stamp should be epoch time
|
||||||
|
void poseReceived(const Transform & pose, double deviceStamp); // original pose of device in rtabmap frame (without origin offset), stamp of the device (may be not epoch)
|
||||||
|
double getStampEpochOffset() const {return stampEpochOffset_;}
|
||||||
|
|
||||||
const CameraModel & getCameraModel() const {return model_;}
|
const CameraModel & getCameraModel() const {return model_;}
|
||||||
const Transform & getDeviceTColorCamera() const {return deviceTColorCamera_;}
|
const Transform & getDeviceTColorCamera() const {return deviceTColorCamera_;}
|
||||||
@@ -108,10 +114,7 @@ public:
|
|||||||
virtual void setScreenRotationAndSize(ScreenRotation colorCameraToDisplayRotation, int width, int height) {colorCameraToDisplayRotation_ = colorCameraToDisplayRotation;}
|
virtual void setScreenRotationAndSize(ScreenRotation colorCameraToDisplayRotation, int width, int height) {colorCameraToDisplayRotation_ = colorCameraToDisplayRotation;}
|
||||||
void setGPS(const GPS & gps);
|
void setGPS(const GPS & gps);
|
||||||
void addEnvSensor(int type, float value);
|
void addEnvSensor(int type, float value);
|
||||||
void setData(const SensorData & data, const Transform & pose, const glm::mat4 & viewMatrix, const glm::mat4 & projectionMatrix, const float * texCoord);
|
|
||||||
|
|
||||||
void spinOnce(); // Should only be called if not thread is not running, otherwise it does nothing
|
|
||||||
|
|
||||||
GLuint getTextureId() {return textureId_;}
|
GLuint getTextureId() {return textureId_;}
|
||||||
bool uvsInitialized() const {return uvs_initialized_;}
|
bool uvsInitialized() const {return uvs_initialized_;}
|
||||||
const float* uvsTransformed() const {return transformed_uvs_;}
|
const float* uvsTransformed() const {return transformed_uvs_;}
|
||||||
@@ -122,17 +125,15 @@ public:
|
|||||||
const cv::Mat & getOcclusionImage(CameraModel * model=0) const {if(model)*model=occlusionModel_; return occlusionImage_; }
|
const cv::Mat & getOcclusionImage(CameraModel * model=0) const {if(model)*model=occlusionModel_; return occlusionImage_; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual SensorData captureImage(CameraInfo * info = 0);
|
virtual SensorData updateDataOnRender(Transform & pose);
|
||||||
virtual void capturePoseOnly() {}
|
|
||||||
|
|
||||||
virtual void mainLoopBegin();
|
private:
|
||||||
virtual void mainLoop();
|
virtual SensorData captureImage(SensorCaptureInfo * info = 0);
|
||||||
|
void postUpdate(); // Should be called while being protected by dataMutex_
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CameraModel model_; // local transform is the device to camera optical rotation in rtabmap frame
|
CameraModel model_; // local transform is the device to camera optical rotation in rtabmap frame
|
||||||
Transform deviceTColorCamera_; // device to camera optical rotation in rtabmap frame
|
Transform deviceTColorCamera_; // device to camera optical rotation in rtabmap frame
|
||||||
UTimer spinOnceFrameRateTimer_;
|
|
||||||
double spinOncePreviousStamp_;
|
|
||||||
|
|
||||||
GLuint textureId_;
|
GLuint textureId_;
|
||||||
glm::mat4 viewMatrix_;
|
glm::mat4 viewMatrix_;
|
||||||
@@ -141,9 +142,7 @@ protected:
|
|||||||
bool uvs_initialized_ = false;
|
bool uvs_initialized_ = false;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Transform previousPose_;
|
bool firstFrame_;
|
||||||
double previousStamp_;
|
|
||||||
UTimer cameraStartedTime_;
|
|
||||||
double stampEpochOffset_;
|
double stampEpochOffset_;
|
||||||
bool smoothing_;
|
bool smoothing_;
|
||||||
ScreenRotation colorCameraToDisplayRotation_;
|
ScreenRotation colorCameraToDisplayRotation_;
|
||||||
@@ -152,8 +151,13 @@ private:
|
|||||||
Transform originOffset_;
|
Transform originOffset_;
|
||||||
bool originUpdate_;
|
bool originUpdate_;
|
||||||
|
|
||||||
|
USemaphore dataReady_;
|
||||||
|
UMutex dataMutex_;
|
||||||
SensorData data_;
|
SensorData data_;
|
||||||
Transform pose_;
|
Transform dataPose_;
|
||||||
|
|
||||||
|
UMutex poseMutex_;
|
||||||
|
std::map<double, Transform> poseBuffer_; // <stamp, Pose>
|
||||||
|
|
||||||
cv::Mat occlusionImage_;
|
cv::Mat occlusionImage_;
|
||||||
CameraModel occlusionModel_;
|
CameraModel occlusionModel_;
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ void onPoseAvailableRouter(void* context, const TangoPoseData* pose)
|
|||||||
if(pose->status_code == TANGO_POSE_VALID)
|
if(pose->status_code == TANGO_POSE_VALID)
|
||||||
{
|
{
|
||||||
CameraTango* app = static_cast<CameraTango*>(context);
|
CameraTango* app = static_cast<CameraTango*>(context);
|
||||||
app->poseReceived(rtabmap_world_T_tango_world * app->tangoPoseToTransform(pose) * tango_device_T_rtabmap_world);
|
app->poseReceived(rtabmap_world_T_tango_world * app->tangoPoseToTransform(pose) * tango_device_T_rtabmap_world, pose->timestamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -444,7 +444,7 @@ void CameraTango::cloudReceived(const cv::Mat & cloud, double timestamp)
|
|||||||
//LOGD("Depth received! %fs (%d points)", timestamp, cloud.cols);
|
//LOGD("Depth received! %fs (%d points)", timestamp, cloud.cols);
|
||||||
|
|
||||||
UASSERT(cloud.type() == CV_32FC4);
|
UASSERT(cloud.type() == CV_32FC4);
|
||||||
boost::mutex::scoped_lock lock(dataMutex_);
|
boost::mutex::scoped_lock lock(tangoDataMutex_);
|
||||||
|
|
||||||
// From post: http://stackoverflow.com/questions/29236110/timing-issues-with-tango-image-frames
|
// From post: http://stackoverflow.com/questions/29236110/timing-issues-with-tango-image-frames
|
||||||
// "In the current version of Project Tango Tablet RGB IR camera
|
// "In the current version of Project Tango Tablet RGB IR camera
|
||||||
@@ -463,7 +463,7 @@ void CameraTango::cloudReceived(const cv::Mat & cloud, double timestamp)
|
|||||||
|
|
||||||
if(dt >= 0.0 && dt < 0.5)
|
if(dt >= 0.0 && dt < 0.5)
|
||||||
{
|
{
|
||||||
bool notify = !data_.isValid();
|
bool notify = !tangoData_.isValid();
|
||||||
|
|
||||||
cv::Mat tangoImage = tangoColor_;
|
cv::Mat tangoImage = tangoColor_;
|
||||||
cv::Mat rgb;
|
cv::Mat rgb;
|
||||||
@@ -495,7 +495,7 @@ void CameraTango::cloudReceived(const cv::Mat & cloud, double timestamp)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOGE("Not supported color format : %d.", tangoColorType);
|
LOGE("Not supported color format : %d.", tangoColorType);
|
||||||
data_ = SensorData();
|
tangoData_ = SensorData();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -678,24 +678,24 @@ void CameraTango::cloudReceived(const cv::Mat & cloud, double timestamp)
|
|||||||
|
|
||||||
if(rawScanPublished_)
|
if(rawScanPublished_)
|
||||||
{
|
{
|
||||||
data_ = SensorData(LaserScan::backwardCompatibility(scan, cloud.total()/scanDownsampling, 0, scanLocalTransform), rgb, depth, model, this->getNextSeqID(), rgbStamp);
|
tangoData_ = 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);
|
tangoData_ = SensorData(rgb, depth, model, this->getNextSeqID(), rgbStamp);
|
||||||
}
|
}
|
||||||
data_.setGroundTruth(odom);
|
tangoData_.setGroundTruth(odom);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOGE("Could not get depth and rgb images!?!");
|
LOGE("Could not get depth and rgb images!?!");
|
||||||
data_ = SensorData();
|
tangoData_ = SensorData();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(notify)
|
if(notify)
|
||||||
{
|
{
|
||||||
dataReady_.release();
|
tangoDataReady_.release();
|
||||||
}
|
}
|
||||||
LOGD("process cloud received %fs", timer.ticks());
|
LOGD("process cloud received %fs", timer.ticks());
|
||||||
}
|
}
|
||||||
@@ -709,7 +709,7 @@ void CameraTango::rgbReceived(const cv::Mat & tangoImage, int type, double times
|
|||||||
{
|
{
|
||||||
//LOGD("RGB received! %fs", timestamp);
|
//LOGD("RGB received! %fs", timestamp);
|
||||||
|
|
||||||
boost::mutex::scoped_lock lock(dataMutex_);
|
boost::mutex::scoped_lock lock(tangoDataMutex_);
|
||||||
|
|
||||||
tangoColor_ = tangoImage.clone();
|
tangoColor_ = tangoImage.clone();
|
||||||
tangoColorStamp_ = timestamp;
|
tangoColorStamp_ = timestamp;
|
||||||
@@ -775,10 +775,11 @@ rtabmap::Transform CameraTango::getPoseAtTimestamp(double timestamp)
|
|||||||
return pose;
|
return pose;
|
||||||
}
|
}
|
||||||
|
|
||||||
SensorData CameraTango::captureImage(CameraInfo * info)
|
SensorData CameraTango::updateDataOnRender(Transform & pose)
|
||||||
{
|
{
|
||||||
//LOGI("Capturing image...");
|
//LOGI("Capturing image...");
|
||||||
|
|
||||||
|
pose.setNull();
|
||||||
if(textureId_ == 0)
|
if(textureId_ == 0)
|
||||||
{
|
{
|
||||||
glGenTextures(1, &textureId_);
|
glGenTextures(1, &textureId_);
|
||||||
@@ -797,10 +798,7 @@ SensorData CameraTango::captureImage(CameraInfo * info)
|
|||||||
|
|
||||||
if (status == TANGO_SUCCESS)
|
if (status == TANGO_SUCCESS)
|
||||||
{
|
{
|
||||||
if(info)
|
pose = getPoseAtTimestamp(video_overlay_timestamp);
|
||||||
{
|
|
||||||
info->odomPose = getPoseAtTimestamp(video_overlay_timestamp);
|
|
||||||
}
|
|
||||||
|
|
||||||
int rotation = static_cast<int>(getScreenRotation()) + 1; // remove 90deg camera rotation
|
int rotation = static_cast<int>(getScreenRotation()) + 1; // remove 90deg camera rotation
|
||||||
if (rotation > 3) {
|
if (rotation > 3) {
|
||||||
@@ -876,16 +874,13 @@ SensorData CameraTango::captureImage(CameraInfo * info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SensorData data;
|
SensorData data;
|
||||||
if(dataReady_.acquireTry(1))
|
if(tangoDataReady_.acquireTry(1))
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(dataMutex_);
|
boost::mutex::scoped_lock lock(tangoDataMutex_);
|
||||||
data = data_;
|
data = tangoData_;
|
||||||
data_ = SensorData();
|
tangoData_ = SensorData();
|
||||||
if(info)
|
pose = data.groundTruth();
|
||||||
{
|
data.setGroundTruth(Transform());
|
||||||
info->odomPose = data.groundTruth();
|
|
||||||
data.setGroundTruth(Transform());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ public:
|
|||||||
virtual void close(); // close Tango connection
|
virtual void close(); // close Tango connection
|
||||||
virtual std::string getSerial() const;
|
virtual std::string getSerial() const;
|
||||||
rtabmap::Transform tangoPoseToTransform(const TangoPoseData * tangoPose) const;
|
rtabmap::Transform tangoPoseToTransform(const TangoPoseData * tangoPose) const;
|
||||||
void setColorCamera(bool enabled) {if(!this->isRunning()) colorCamera_ = enabled;}
|
|
||||||
void setDecimation(int value) {decimation_ = value;}
|
void setDecimation(int value) {decimation_ = value;}
|
||||||
void setRawScanPublished(bool enabled) {rawScanPublished_ = enabled;}
|
void setRawScanPublished(bool enabled) {rawScanPublished_ = enabled;}
|
||||||
|
|
||||||
@@ -61,7 +60,7 @@ public:
|
|||||||
void tangoEventReceived(int type, const char * key, const char * value);
|
void tangoEventReceived(int type, const char * key, const char * value);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual SensorData captureImage(CameraInfo * info = 0);
|
virtual SensorData updateDataOnRender(Transform & pose);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
rtabmap::Transform getPoseAtTimestamp(double timestamp);
|
rtabmap::Transform getPoseAtTimestamp(double timestamp);
|
||||||
@@ -71,12 +70,12 @@ private:
|
|||||||
bool colorCamera_;
|
bool colorCamera_;
|
||||||
int decimation_;
|
int decimation_;
|
||||||
bool rawScanPublished_;
|
bool rawScanPublished_;
|
||||||
SensorData data_;
|
SensorData tangoData_;
|
||||||
cv::Mat tangoColor_;
|
cv::Mat tangoColor_;
|
||||||
int tangoColorType_;
|
int tangoColorType_;
|
||||||
double tangoColorStamp_;
|
double tangoColorStamp_;
|
||||||
boost::mutex dataMutex_;
|
boost::mutex tangoDataMutex_;
|
||||||
USemaphore dataReady_;
|
USemaphore tangoDataReady_;
|
||||||
cv::Mat fisheyeRectifyMapX_;
|
cv::Mat fisheyeRectifyMapX_;
|
||||||
cv::Mat fisheyeRectifyMapY_;
|
cv::Mat fisheyeRectifyMapY_;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <rtabmap/core/GainCompensator.h>
|
#include <rtabmap/core/GainCompensator.h>
|
||||||
#include <rtabmap/core/DBDriver.h>
|
#include <rtabmap/core/DBDriver.h>
|
||||||
#include <rtabmap/core/Recovery.h>
|
#include <rtabmap/core/Recovery.h>
|
||||||
|
#include <rtabmap/core/lidar/LidarVLP16.h>
|
||||||
#include <pcl/common/common.h>
|
#include <pcl/common/common.h>
|
||||||
#include <pcl/filters/extract_indices.h>
|
#include <pcl/filters/extract_indices.h>
|
||||||
#include <pcl/io/ply_io.h>
|
#include <pcl/io/ply_io.h>
|
||||||
@@ -134,6 +135,7 @@ rtabmap::ParametersMap RTABMapApp::getRtabmapParameters()
|
|||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRtabmapPublishLikelihood(), std::string("false")));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRtabmapPublishLikelihood(), std::string("false")));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRtabmapPublishPdf(), std::string("false")));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRtabmapPublishPdf(), std::string("false")));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRtabmapStartNewMapOnLoopClosure(), uBool2Str(!localizationMode_ && appendMode_)));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRtabmapStartNewMapOnLoopClosure(), uBool2Str(!localizationMode_ && appendMode_)));
|
||||||
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDAggressiveLoopThr(), "0.0"));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kMemBinDataKept(), uBool2Str(!trajectoryMode_)));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kMemBinDataKept(), uBool2Str(!trajectoryMode_)));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kOptimizerIterations(), "10"));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kOptimizerIterations(), "10"));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kMemIncrementalMemory(), uBool2Str(!localizationMode_)));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kMemIncrementalMemory(), uBool2Str(!localizationMode_)));
|
||||||
@@ -202,6 +204,7 @@ RTABMapApp::RTABMapApp() :
|
|||||||
#endif
|
#endif
|
||||||
cameraDriver_(0),
|
cameraDriver_(0),
|
||||||
camera_(0),
|
camera_(0),
|
||||||
|
sensorCaptureThread_(0),
|
||||||
rtabmapThread_(0),
|
rtabmapThread_(0),
|
||||||
rtabmap_(0),
|
rtabmap_(0),
|
||||||
logHandler_(0),
|
logHandler_(0),
|
||||||
@@ -216,6 +219,7 @@ RTABMapApp::RTABMapApp() :
|
|||||||
cameraColor_(true),
|
cameraColor_(true),
|
||||||
fullResolution_(false),
|
fullResolution_(false),
|
||||||
appendMode_(true),
|
appendMode_(true),
|
||||||
|
useExternalLidar_(false),
|
||||||
maxCloudDepth_(2.5),
|
maxCloudDepth_(2.5),
|
||||||
minCloudDepth_(0.0),
|
minCloudDepth_(0.0),
|
||||||
cloudDensityLevel_(1),
|
cloudDensityLevel_(1),
|
||||||
@@ -537,7 +541,7 @@ int RTABMapApp::openDatabase(const std::string & databasePath, bool databaseInMe
|
|||||||
// Voxelize and filter depending on the previous cloud?
|
// Voxelize and filter depending on the previous cloud?
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
||||||
pcl::IndicesPtr indices(new std::vector<int>);
|
pcl::IndicesPtr indices(new std::vector<int>);
|
||||||
if(!data.imageRaw().empty() && !data.depthRaw().empty())
|
if(!data.imageRaw().empty() && !data.depthRaw().empty() && (!useExternalLidar_ || data.laserScanRaw().isEmpty()))
|
||||||
{
|
{
|
||||||
int meshDecimation = updateMeshDecimation(data.depthRaw().cols, data.depthRaw().rows);
|
int meshDecimation = updateMeshDecimation(data.depthRaw().cols, data.depthRaw().rows);
|
||||||
|
|
||||||
@@ -649,9 +653,9 @@ int RTABMapApp::openDatabase(const std::string & databasePath, bool databaseInMe
|
|||||||
UWARN("Cloud %d is empty", id);
|
UWARN("Cloud %d is empty", id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if(!data.depthOrRightCompressed().empty() || !data.laserScanCompressed().isEmpty())
|
||||||
{
|
{
|
||||||
UERROR("Failed to uncompress data!");
|
UERROR("Failed to uncompress data! (rgb=%d, depth=%d, scan=%d)", data.imageCompressed().cols, data.depthOrRightCompressed().cols, data.laserScanCompressed().size());
|
||||||
status=-2;
|
status=-2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -885,7 +889,7 @@ bool RTABMapApp::startCamera()
|
|||||||
#endif
|
#endif
|
||||||
LOGW("startCamera() camera driver=%d", cameraDriver_);
|
LOGW("startCamera() camera driver=%d", cameraDriver_);
|
||||||
boost::mutex::scoped_lock lock(cameraMutex_);
|
boost::mutex::scoped_lock lock(cameraMutex_);
|
||||||
|
|
||||||
if(cameraDriver_ == 0) // Tango
|
if(cameraDriver_ == 0) // Tango
|
||||||
{
|
{
|
||||||
#ifdef RTABMAP_TANGO
|
#ifdef RTABMAP_TANGO
|
||||||
@@ -937,6 +941,19 @@ bool RTABMapApp::startCamera()
|
|||||||
|
|
||||||
LOGI("Start camera thread");
|
LOGI("Start camera thread");
|
||||||
cameraJustInitialized_ = true;
|
cameraJustInitialized_ = true;
|
||||||
|
if(useExternalLidar_)
|
||||||
|
{
|
||||||
|
rtabmap::LidarVLP16 * lidar = new rtabmap::LidarVLP16(boost::asio::ip::address_v4::from_string("192.168.1.201"), 2368, true);
|
||||||
|
lidar->init();
|
||||||
|
camera_->setImageRate(0); // if lidar, to get close camera synchronization
|
||||||
|
sensorCaptureThread_ = new rtabmap::SensorCaptureThread(lidar, camera_, camera_, rtabmap::Transform::getIdentity());
|
||||||
|
sensorCaptureThread_->setScanParameters(false, 1, 0.0f, 0.0f, 0.0f, 0, 0.0f, 0.0f, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sensorCaptureThread_ = new rtabmap::SensorCaptureThread(camera_);
|
||||||
|
}
|
||||||
|
sensorCaptureThread_->start();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
UERROR("Failed camera initialization!");
|
UERROR("Failed camera initialization!");
|
||||||
@@ -948,13 +965,12 @@ void RTABMapApp::stopCamera()
|
|||||||
LOGI("stopCamera()");
|
LOGI("stopCamera()");
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(cameraMutex_);
|
boost::mutex::scoped_lock lock(cameraMutex_);
|
||||||
if(camera_!=0)
|
if(sensorCaptureThread_!=0)
|
||||||
{
|
{
|
||||||
camera_->join(true);
|
sensorCaptureThread_->join(true);
|
||||||
camera_->close();
|
delete sensorCaptureThread_; // camera_ is closed and deleted inside
|
||||||
delete camera_;
|
sensorCaptureThread_ = 0;
|
||||||
camera_ = 0;
|
camera_ = 0;
|
||||||
poseBuffer_.clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@@ -1241,7 +1257,7 @@ int RTABMapApp::Render()
|
|||||||
std::list<rtabmap::RtabmapEvent*> rtabmapEvents;
|
std::list<rtabmap::RtabmapEvent*> rtabmapEvents;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(camera_ == 0)
|
if(sensorCaptureThread_ == 0)
|
||||||
{
|
{
|
||||||
// We are not doing continous drawing, just measure single draw
|
// We are not doing continous drawing, just measure single draw
|
||||||
fpsTime_.restart();
|
fpsTime_.restart();
|
||||||
@@ -1272,49 +1288,45 @@ int RTABMapApp::Render()
|
|||||||
{
|
{
|
||||||
if(cameraDriver_ <= 2)
|
if(cameraDriver_ <= 2)
|
||||||
{
|
{
|
||||||
camera_->spinOnce();
|
camera_->updateOnRender();
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_RENDERING_PERFORMANCE
|
#ifdef DEBUG_RENDERING_PERFORMANCE
|
||||||
LOGW("Camera spinOnce %fs", time.ticks());
|
LOGW("Camera updateOnRender %fs", time.ticks());
|
||||||
#endif
|
#endif
|
||||||
|
if(main_scene_.background_renderer_ == 0 && camera_->getTextureId() != 0)
|
||||||
if(cameraDriver_ != 2)
|
|
||||||
{
|
{
|
||||||
if(main_scene_.background_renderer_ == 0 && camera_->getTextureId() != 0)
|
main_scene_.background_renderer_ = new BackgroundRenderer();
|
||||||
|
main_scene_.background_renderer_->InitializeGlContent(((rtabmap::CameraMobile*)camera_)->getTextureId(), cameraDriver_ <= 2);
|
||||||
|
}
|
||||||
|
if(camera_->uvsInitialized())
|
||||||
|
{
|
||||||
|
uvsTransformed = ((rtabmap::CameraMobile*)camera_)->uvsTransformed();
|
||||||
|
((rtabmap::CameraMobile*)camera_)->getVPMatrices(arViewMatrix, arProjectionMatrix);
|
||||||
|
if(graphOptimization_ && !mapToOdom_.isIdentity())
|
||||||
{
|
{
|
||||||
main_scene_.background_renderer_ = new BackgroundRenderer();
|
rtabmap::Transform mapCorrection = rtabmap::opengl_world_T_rtabmap_world * mapToOdom_ *rtabmap::rtabmap_world_T_opengl_world;
|
||||||
main_scene_.background_renderer_->InitializeGlContent(((rtabmap::CameraMobile*)camera_)->getTextureId(), cameraDriver_ == 0 || cameraDriver_ == 1);
|
arViewMatrix = glm::inverse(rtabmap::glmFromTransform(mapCorrection)*glm::inverse(arViewMatrix));
|
||||||
}
|
}
|
||||||
if(camera_->uvsInitialized())
|
}
|
||||||
{
|
if(!visualizingMesh_ && main_scene_.GetCameraType() == tango_gl::GestureCamera::kFirstPerson)
|
||||||
uvsTransformed = ((rtabmap::CameraMobile*)camera_)->uvsTransformed();
|
{
|
||||||
((rtabmap::CameraMobile*)camera_)->getVPMatrices(arViewMatrix, arProjectionMatrix);
|
rtabmap::CameraModel occlusionModel;
|
||||||
if(graphOptimization_ && !mapToOdom_.isIdentity())
|
cv::Mat occlusionImage = ((rtabmap::CameraMobile*)camera_)->getOcclusionImage(&occlusionModel);
|
||||||
{
|
|
||||||
rtabmap::Transform mapCorrection = rtabmap::opengl_world_T_rtabmap_world * mapToOdom_ *rtabmap::rtabmap_world_T_opengl_world;
|
|
||||||
arViewMatrix = glm::inverse(rtabmap::glmFromTransform(mapCorrection)*glm::inverse(arViewMatrix));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!visualizingMesh_ && main_scene_.GetCameraType() == tango_gl::GestureCamera::kFirstPerson)
|
|
||||||
{
|
|
||||||
rtabmap::CameraModel occlusionModel;
|
|
||||||
cv::Mat occlusionImage = ((rtabmap::CameraMobile*)camera_)->getOcclusionImage(&occlusionModel);
|
|
||||||
|
|
||||||
if(occlusionModel.isValidForProjection())
|
if(occlusionModel.isValidForProjection())
|
||||||
{
|
{
|
||||||
pcl::IndicesPtr indices(new std::vector<int>);
|
pcl::IndicesPtr indices(new std::vector<int>);
|
||||||
int meshDecimation = updateMeshDecimation(occlusionImage.cols, occlusionImage.rows);
|
int meshDecimation = updateMeshDecimation(occlusionImage.cols, occlusionImage.rows);
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud = rtabmap::util3d::cloudFromDepth(occlusionImage, occlusionModel, meshDecimation, 0, 0, indices.get());
|
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud = rtabmap::util3d::cloudFromDepth(occlusionImage, occlusionModel, meshDecimation, 0, 0, indices.get());
|
||||||
cloud = rtabmap::util3d::transformPointCloud(cloud, rtabmap::opengl_world_T_rtabmap_world*mapToOdom_*occlusionModel.localTransform());
|
cloud = rtabmap::util3d::transformPointCloud(cloud, rtabmap::opengl_world_T_rtabmap_world*mapToOdom_*occlusionModel.localTransform());
|
||||||
occlusionMesh.cloud.reset(new pcl::PointCloud<pcl::PointXYZRGB>());
|
occlusionMesh.cloud.reset(new pcl::PointCloud<pcl::PointXYZRGB>());
|
||||||
pcl::copyPointCloud(*cloud, *occlusionMesh.cloud);
|
pcl::copyPointCloud(*cloud, *occlusionMesh.cloud);
|
||||||
occlusionMesh.indices = indices;
|
occlusionMesh.indices = indices;
|
||||||
occlusionMesh.polygons = rtabmap::util3d::organizedFastMesh(cloud, 1.0*M_PI/180.0, false, meshTrianglePix_);
|
occlusionMesh.polygons = rtabmap::util3d::organizedFastMesh(cloud, 1.0*M_PI/180.0, false, meshTrianglePix_);
|
||||||
}
|
}
|
||||||
else if(!occlusionImage.empty())
|
else if(!occlusionImage.empty())
|
||||||
{
|
{
|
||||||
UERROR("invalid occlusionModel: %f %f %f %f %dx%d", occlusionModel.fx(), occlusionModel.fy(), occlusionModel.cx(), occlusionModel.cy(), occlusionModel.imageWidth(), occlusionModel.imageHeight());
|
UERROR("invalid occlusionModel: %f %f %f %f %dx%d", occlusionModel.fx(), occlusionModel.fy(), occlusionModel.cx(), occlusionModel.cy(), occlusionModel.imageWidth(), occlusionModel.imageHeight());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_RENDERING_PERFORMANCE
|
#ifdef DEBUG_RENDERING_PERFORMANCE
|
||||||
@@ -1334,14 +1346,14 @@ int RTABMapApp::Render()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rtabmap::OdometryEvent odomEvent;
|
rtabmap::SensorEvent sensorEvent;
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(odomMutex_);
|
boost::mutex::scoped_lock lock(sensorMutex_);
|
||||||
if(odomEvents_.size())
|
if(sensorEvents_.size())
|
||||||
{
|
{
|
||||||
LOGI("Process odom events");
|
LOGI("Process sensor events");
|
||||||
odomEvent = odomEvents_.back();
|
sensorEvent = sensorEvents_.back();
|
||||||
odomEvents_.clear();
|
sensorEvents_.clear();
|
||||||
if(cameraJustInitialized_)
|
if(cameraJustInitialized_)
|
||||||
{
|
{
|
||||||
notifyCameraStarted = true;
|
notifyCameraStarted = true;
|
||||||
@@ -1361,7 +1373,7 @@ int RTABMapApp::Render()
|
|||||||
{
|
{
|
||||||
main_scene_.SetCameraPose(rtabmap::opengl_world_T_rtabmap_world*pose*rtabmap::optical_T_opengl);
|
main_scene_.SetCameraPose(rtabmap::opengl_world_T_rtabmap_world*pose*rtabmap::optical_T_opengl);
|
||||||
}
|
}
|
||||||
if(camera_!=0 && cameraJustInitialized_)
|
if(sensorCaptureThread_!=0 && cameraJustInitialized_)
|
||||||
{
|
{
|
||||||
notifyCameraStarted = true;
|
notifyCameraStarted = true;
|
||||||
cameraJustInitialized_ = false;
|
cameraJustInitialized_ = false;
|
||||||
@@ -1562,9 +1574,9 @@ int RTABMapApp::Render()
|
|||||||
if(clearSceneOnNextRender_)
|
if(clearSceneOnNextRender_)
|
||||||
{
|
{
|
||||||
LOGI("Clearing all rendering data...");
|
LOGI("Clearing all rendering data...");
|
||||||
odomMutex_.lock();
|
sensorMutex_.lock();
|
||||||
odomEvents_.clear();
|
sensorEvents_.clear();
|
||||||
odomMutex_.unlock();
|
sensorMutex_.unlock();
|
||||||
|
|
||||||
poseMutex_.lock();
|
poseMutex_.lock();
|
||||||
poseEvents_.clear();
|
poseEvents_.clear();
|
||||||
@@ -1800,7 +1812,7 @@ int RTABMapApp::Render()
|
|||||||
// Voxelize and filter depending on the previous cloud?
|
// Voxelize and filter depending on the previous cloud?
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
||||||
pcl::IndicesPtr indices(new std::vector<int>);
|
pcl::IndicesPtr indices(new std::vector<int>);
|
||||||
if(!data.imageRaw().empty() && !data.depthRaw().empty())
|
if(!data.imageRaw().empty() && !data.depthRaw().empty() && (!useExternalLidar_ || data.laserScanRaw().isEmpty()))
|
||||||
{
|
{
|
||||||
int meshDecimation = updateMeshDecimation(data.depthRaw().cols, data.depthRaw().rows);
|
int meshDecimation = updateMeshDecimation(data.depthRaw().cols, data.depthRaw().rows);
|
||||||
cloud = rtabmap::util3d::cloudRGBFromSensorData(data, meshDecimation, maxCloudDepth_, minCloudDepth_, indices.get());
|
cloud = rtabmap::util3d::cloudRGBFromSensorData(data, meshDecimation, maxCloudDepth_, minCloudDepth_, indices.get());
|
||||||
@@ -2004,26 +2016,26 @@ int RTABMapApp::Render()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
main_scene_.setCloudVisible(-1, odomCloudShown_ && !trajectoryMode_ && camera_!=0);
|
main_scene_.setCloudVisible(-1, odomCloudShown_ && !trajectoryMode_ && sensorCaptureThread_!=0);
|
||||||
|
|
||||||
//just process the last one
|
//just process the last one
|
||||||
if(!odomEvent.pose().isNull())
|
if(!sensorEvent.info().odomPose.isNull())
|
||||||
{
|
{
|
||||||
if(odomCloudShown_ && !trajectoryMode_)
|
if(odomCloudShown_ && !trajectoryMode_)
|
||||||
{
|
{
|
||||||
if((!odomEvent.data().imageRaw().empty() && !odomEvent.data().depthRaw().empty()) || !odomEvent.data().laserScanRaw().isEmpty())
|
if((!sensorEvent.data().imageRaw().empty() && !sensorEvent.data().depthRaw().empty()) || !sensorEvent.data().laserScanRaw().isEmpty())
|
||||||
{
|
{
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
||||||
pcl::IndicesPtr indices(new std::vector<int>);
|
pcl::IndicesPtr indices(new std::vector<int>);
|
||||||
if((!odomEvent.data().imageRaw().empty() && !odomEvent.data().depthRaw().empty()))
|
if(!sensorEvent.data().imageRaw().empty() && !sensorEvent.data().depthRaw().empty() && (!useExternalLidar_ || sensorEvent.data().laserScanRaw().isEmpty()))
|
||||||
{
|
{
|
||||||
int meshDecimation = updateMeshDecimation(odomEvent.data().depthRaw().cols, odomEvent.data().depthRaw().rows);
|
int meshDecimation = updateMeshDecimation(sensorEvent.data().depthRaw().cols, sensorEvent.data().depthRaw().rows);
|
||||||
cloud = rtabmap::util3d::cloudRGBFromSensorData(odomEvent.data(), meshDecimation, maxCloudDepth_, minCloudDepth_, indices.get());
|
cloud = rtabmap::util3d::cloudRGBFromSensorData(sensorEvent.data(), meshDecimation, maxCloudDepth_, minCloudDepth_, indices.get());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//scan
|
//scan
|
||||||
cloud = rtabmap::util3d::laserScanToPointCloudRGB(rtabmap::util3d::commonFiltering(odomEvent.data().laserScanRaw(), 1, minCloudDepth_, maxCloudDepth_), odomEvent.data().laserScanRaw().localTransform(), 255, 255, 255);
|
cloud = rtabmap::util3d::laserScanToPointCloudRGB(rtabmap::util3d::commonFiltering(sensorEvent.data().laserScanRaw(), 1, minCloudDepth_, maxCloudDepth_), sensorEvent.data().laserScanRaw().localTransform(), 255, 255, 255);
|
||||||
indices->resize(cloud->size());
|
indices->resize(cloud->size());
|
||||||
for(unsigned int i=0; i<cloud->size(); ++i)
|
for(unsigned int i=0; i<cloud->size(); ++i)
|
||||||
{
|
{
|
||||||
@@ -2034,10 +2046,10 @@ int RTABMapApp::Render()
|
|||||||
if(cloud->size() && indices->size())
|
if(cloud->size() && indices->size())
|
||||||
{
|
{
|
||||||
LOGI("Created odom cloud (rgb=%dx%d depth=%dx%d cloud=%dx%d)",
|
LOGI("Created odom cloud (rgb=%dx%d depth=%dx%d cloud=%dx%d)",
|
||||||
odomEvent.data().imageRaw().cols, odomEvent.data().imageRaw().rows,
|
sensorEvent.data().imageRaw().cols, sensorEvent.data().imageRaw().rows,
|
||||||
odomEvent.data().depthRaw().cols, odomEvent.data().depthRaw().rows,
|
sensorEvent.data().depthRaw().cols, sensorEvent.data().depthRaw().rows,
|
||||||
(int)cloud->width, (int)cloud->height);
|
(int)cloud->width, (int)cloud->height);
|
||||||
main_scene_.addCloud(-1, cloud, indices, rtabmap::opengl_world_T_rtabmap_world*mapToOdom_*odomEvent.pose());
|
main_scene_.addCloud(-1, cloud, indices, rtabmap::opengl_world_T_rtabmap_world*mapToOdom_*sensorEvent.info().odomPose);
|
||||||
main_scene_.setCloudVisible(-1, true);
|
main_scene_.setCloudVisible(-1, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2127,10 +2139,10 @@ int RTABMapApp::Render()
|
|||||||
|
|
||||||
lastPostRenderEventTime_ = UTimer::now();
|
lastPostRenderEventTime_ = UTimer::now();
|
||||||
|
|
||||||
if(camera_!=0 && lastPoseEventTime_>0.0 && UTimer::now()-lastPoseEventTime_ > 1.0)
|
if(sensorCaptureThread_!=0 && lastPoseEventTime_>0.0 && UTimer::now()-lastPoseEventTime_ > 1.0)
|
||||||
{
|
{
|
||||||
UERROR("TangoPoseEventNotReceived");
|
UERROR("TangoPoseEventNotReceived");
|
||||||
UEventsManager::post(new rtabmap::CameraInfoEvent(10, "TangoPoseEventNotReceived", uNumber2Str(UTimer::now()-lastPoseEventTime_)));
|
UEventsManager::post(new rtabmap::CameraInfoEvent(10, "TangoPoseEventNotReceived", uNumber2Str(UTimer::now()-lastPoseEventTime_, 6)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2319,7 +2331,7 @@ void RTABMapApp::setTrajectoryMode(bool enabled)
|
|||||||
void RTABMapApp::setGraphOptimization(bool enabled)
|
void RTABMapApp::setGraphOptimization(bool enabled)
|
||||||
{
|
{
|
||||||
graphOptimization_ = enabled;
|
graphOptimization_ = enabled;
|
||||||
if((camera_ == 0) && rtabmap_ && rtabmap_->getMemory()->getLastWorkingSignature()!=0)
|
if((sensorCaptureThread_ == 0) && rtabmap_ && rtabmap_->getMemory()->getLastWorkingSignature()!=0)
|
||||||
{
|
{
|
||||||
std::map<int, rtabmap::Transform> poses;
|
std::map<int, rtabmap::Transform> poses;
|
||||||
std::multimap<int, rtabmap::Link> links;
|
std::multimap<int, rtabmap::Link> links;
|
||||||
@@ -3709,19 +3721,12 @@ void RTABMapApp::postCameraPoseEvent(
|
|||||||
if(qx==0 && qy==0 && qz==0 && qw==0)
|
if(qx==0 && qy==0 && qz==0 && qw==0)
|
||||||
{
|
{
|
||||||
// Lost! clear buffer
|
// Lost! clear buffer
|
||||||
poseBuffer_.clear();
|
|
||||||
camera_->resetOrigin(); // we are lost, create new session on next valid frame
|
camera_->resetOrigin(); // we are lost, create new session on next valid frame
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rtabmap::Transform pose(x,y,z,qx,qy,qz,qw);
|
rtabmap::Transform pose(x,y,z,qx,qy,qz,qw);
|
||||||
pose = rtabmap::rtabmap_world_T_opengl_world * pose * rtabmap::opengl_world_T_rtabmap_world;
|
pose = rtabmap::rtabmap_world_T_opengl_world * pose * rtabmap::opengl_world_T_rtabmap_world;
|
||||||
camera_->poseReceived(pose);
|
camera_->poseReceived(pose, stamp);
|
||||||
|
|
||||||
poseBuffer_.insert(std::make_pair(stamp, pose));
|
|
||||||
if(poseBuffer_.size() > 1000)
|
|
||||||
{
|
|
||||||
poseBuffer_.erase(poseBuffer_.begin());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3833,66 +3838,41 @@ void RTABMapApp::postOdometryEvent(
|
|||||||
{
|
{
|
||||||
pose = rtabmap::rtabmap_world_T_opengl_world * pose * rtabmap::opengl_world_T_rtabmap_world;
|
pose = rtabmap::rtabmap_world_T_opengl_world * pose * rtabmap::opengl_world_T_rtabmap_world;
|
||||||
|
|
||||||
|
rtabmap::Transform poseWithOriginOffset = pose;
|
||||||
|
if(!camera_->getOriginOffset().isNull())
|
||||||
|
{
|
||||||
|
poseWithOriginOffset = camera_->getOriginOffset() * pose;
|
||||||
|
}
|
||||||
|
|
||||||
// Registration depth to rgb
|
// Registration depth to rgb
|
||||||
if(!outputDepth.empty() && !depthFrame.isNull() && depth_fx!=0 && (rgbFrame != depthFrame || depthStamp!=stamp))
|
if(!outputDepth.empty() && !depthFrame.isNull() && depth_fx!=0 && (rgbFrame != depthFrame || depthStamp!=stamp))
|
||||||
{
|
{
|
||||||
UTimer time;
|
UTimer time;
|
||||||
rtabmap::Transform motion = rtabmap::Transform::getIdentity();
|
rtabmap::Transform motion = rtabmap::Transform::getIdentity();
|
||||||
if(depthStamp != stamp && !poseBuffer_.empty())
|
if(depthStamp != stamp)
|
||||||
{
|
{
|
||||||
// Interpolate pose
|
// Interpolate pose
|
||||||
if(!poseBuffer_.empty())
|
rtabmap::Transform poseDepth;
|
||||||
|
cv::Mat cov;
|
||||||
|
if(!camera_->getPose(camera_->getStampEpochOffset()+depthStamp, poseDepth, cov, 0.0))
|
||||||
|
{
|
||||||
|
UERROR("Could not find pose at depth stamp %f (epoch=%f rgb=%f)!", depthStamp, camera_->getStampEpochOffset()+depthStamp, stamp);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if(poseBuffer_.rbegin()->first < depthStamp)
|
|
||||||
{
|
|
||||||
UWARN("Could not find poses to interpolate at time %f (last is %f)...", depthStamp, poseBuffer_.rbegin()->first);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::map<double, rtabmap::Transform >::const_iterator iterB = poseBuffer_.lower_bound(depthStamp);
|
|
||||||
std::map<double, rtabmap::Transform >::const_iterator iterA = iterB;
|
|
||||||
rtabmap::Transform poseDepth;
|
|
||||||
if(iterA != poseBuffer_.begin())
|
|
||||||
{
|
|
||||||
iterA = --iterA;
|
|
||||||
}
|
|
||||||
if(iterB == poseBuffer_.end())
|
|
||||||
{
|
|
||||||
iterB = --iterB;
|
|
||||||
}
|
|
||||||
if(iterA == iterB && depthStamp == iterA->first)
|
|
||||||
{
|
|
||||||
poseDepth = iterA->second;
|
|
||||||
}
|
|
||||||
else if(depthStamp >= iterA->first && depthStamp <= iterB->first)
|
|
||||||
{
|
|
||||||
poseDepth = iterA->second.interpolate((depthStamp-iterA->first) / (iterB->first-iterA->first), iterB->second);
|
|
||||||
}
|
|
||||||
else if(depthStamp < iterA->first)
|
|
||||||
{
|
|
||||||
UERROR("Could not find poses to interpolate at image time %f (earliest is %f). Are sensors synchronized?", depthStamp, iterA->first);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UERROR("Could not find poses to interpolate at image time %f (between %f and %f), Are sensors synchronized?", depthStamp, iterA->first, iterB->first);
|
|
||||||
}
|
|
||||||
if(!poseDepth.isNull())
|
|
||||||
{
|
|
||||||
#ifndef DISABLE_LOG
|
#ifndef DISABLE_LOG
|
||||||
UDEBUG("poseRGB =%s (stamp=%f)", pose.prettyPrint().c_str(), depthStamp);
|
UDEBUG("poseRGB =%s (stamp=%f)", poseWithOriginOffset.prettyPrint().c_str(), stamp);
|
||||||
UDEBUG("poseDepth=%s (stamp=%f)", poseDepth.prettyPrint().c_str(), depthStamp);
|
UDEBUG("poseDepth=%s (stamp=%f)", poseDepth.prettyPrint().c_str(), depthStamp);
|
||||||
#endif
|
#endif
|
||||||
motion = pose.inverse()*poseDepth;
|
motion = poseWithOriginOffset.inverse()*poseDepth;
|
||||||
// transform in camera frame
|
// transform in camera frame
|
||||||
#ifndef DISABLE_LOG
|
#ifndef DISABLE_LOG
|
||||||
UDEBUG("motion=%s", motion.prettyPrint().c_str());
|
UDEBUG("motion=%s", motion.prettyPrint().c_str());
|
||||||
#endif
|
#endif
|
||||||
motion = rtabmap::CameraModel::opticalRotation().inverse() * motion * rtabmap::CameraModel::opticalRotation();
|
motion = rtabmap::CameraModel::opticalRotation().inverse() * motion * rtabmap::CameraModel::opticalRotation();
|
||||||
#ifndef DISABLE_LOG
|
#ifndef DISABLE_LOG
|
||||||
UDEBUG("motion=%s", motion.prettyPrint().c_str());
|
UDEBUG("motion=%s", motion.prettyPrint().c_str());
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rtabmap::Transform rgbToDepth = motion*rgbFrame.inverse()*depthFrame;
|
rtabmap::Transform rgbToDepth = motion*rgbFrame.inverse()*depthFrame;
|
||||||
@@ -3941,11 +3921,6 @@ void RTABMapApp::postOdometryEvent(
|
|||||||
|
|
||||||
if(!outputDepth.empty())
|
if(!outputDepth.empty())
|
||||||
{
|
{
|
||||||
rtabmap::Transform poseWithOriginOffset = pose;
|
|
||||||
if(!camera_->getOriginOffset().isNull())
|
|
||||||
{
|
|
||||||
poseWithOriginOffset = camera_->getOriginOffset() * pose;
|
|
||||||
}
|
|
||||||
rtabmap::CameraModel depthModel = model.scaled(float(outputDepth.cols) / float(model.imageWidth()));
|
rtabmap::CameraModel depthModel = model.scaled(float(outputDepth.cols) / float(model.imageWidth()));
|
||||||
depthModel.setLocalTransform(poseWithOriginOffset*model.localTransform());
|
depthModel.setLocalTransform(poseWithOriginOffset*model.localTransform());
|
||||||
camera_->setOcclusionImage(outputDepth, depthModel);
|
camera_->setOcclusionImage(outputDepth, depthModel);
|
||||||
@@ -3971,8 +3946,7 @@ void RTABMapApp::postOdometryEvent(
|
|||||||
texCoords[5] = t5;
|
texCoords[5] = t5;
|
||||||
texCoords[6] = t6;
|
texCoords[6] = t6;
|
||||||
texCoords[7] = t7;
|
texCoords[7] = t7;
|
||||||
camera_->setData(data, pose, viewMatrixMat, projectionMatrix, main_scene_.GetCameraType() == tango_gl::GestureCamera::kFirstPerson?texCoords:0);
|
camera_->update(data, pose, viewMatrixMat, projectionMatrix, main_scene_.GetCameraType() == tango_gl::GestureCamera::kFirstPerson?texCoords:0);
|
||||||
camera_->spinOnce();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3989,17 +3963,17 @@ void RTABMapApp::postOdometryEvent(
|
|||||||
|
|
||||||
bool RTABMapApp::handleEvent(UEvent * event)
|
bool RTABMapApp::handleEvent(UEvent * event)
|
||||||
{
|
{
|
||||||
if(camera_!=0)
|
if(sensorCaptureThread_!=0)
|
||||||
{
|
{
|
||||||
// called from events manager thread, so protect the data
|
// called from events manager thread, so protect the data
|
||||||
if(event->getClassName().compare("OdometryEvent") == 0)
|
if(event->getClassName().compare("SensorEvent") == 0)
|
||||||
{
|
{
|
||||||
LOGI("Received OdometryEvent!");
|
LOGI("Received SensorEvent!");
|
||||||
if(odomMutex_.try_lock())
|
if(sensorMutex_.try_lock())
|
||||||
{
|
{
|
||||||
odomEvents_.clear();
|
sensorEvents_.clear();
|
||||||
odomEvents_.push_back(*((rtabmap::OdometryEvent*)(event)));
|
sensorEvents_.push_back(*((rtabmap::SensorEvent*)(event)));
|
||||||
odomMutex_.unlock();
|
sensorMutex_.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(event->getClassName().compare("RtabmapEvent") == 0)
|
if(event->getClassName().compare("RtabmapEvent") == 0)
|
||||||
|
|||||||
@@ -40,7 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "ProgressionStatus.h"
|
#include "ProgressionStatus.h"
|
||||||
|
|
||||||
|
#include <rtabmap/core/SensorCaptureThread.h>
|
||||||
#include <rtabmap/core/RtabmapThread.h>
|
#include <rtabmap/core/RtabmapThread.h>
|
||||||
|
#include <rtabmap/core/SensorEvent.h>
|
||||||
#include <rtabmap/utilite/UEventsHandler.h>
|
#include <rtabmap/utilite/UEventsHandler.h>
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#include <pcl/pcl_base.h>
|
#include <pcl/pcl_base.h>
|
||||||
@@ -209,6 +211,7 @@ class RTABMapApp : public UEventsHandler {
|
|||||||
private:
|
private:
|
||||||
int cameraDriver_;
|
int cameraDriver_;
|
||||||
rtabmap::CameraMobile * camera_;
|
rtabmap::CameraMobile * camera_;
|
||||||
|
rtabmap::SensorCaptureThread * sensorCaptureThread_;
|
||||||
rtabmap::RtabmapThread * rtabmapThread_;
|
rtabmap::RtabmapThread * rtabmapThread_;
|
||||||
rtabmap::Rtabmap * rtabmap_;
|
rtabmap::Rtabmap * rtabmap_;
|
||||||
rtabmap::LogHandler * logHandler_;
|
rtabmap::LogHandler * logHandler_;
|
||||||
@@ -224,6 +227,7 @@ class RTABMapApp : public UEventsHandler {
|
|||||||
bool cameraColor_;
|
bool cameraColor_;
|
||||||
bool fullResolution_;
|
bool fullResolution_;
|
||||||
bool appendMode_;
|
bool appendMode_;
|
||||||
|
bool useExternalLidar_;
|
||||||
float maxCloudDepth_;
|
float maxCloudDepth_;
|
||||||
float minCloudDepth_;
|
float minCloudDepth_;
|
||||||
int cloudDensityLevel_;
|
int cloudDensityLevel_;
|
||||||
@@ -270,16 +274,15 @@ class RTABMapApp : public UEventsHandler {
|
|||||||
UTimer fpsTime_;
|
UTimer fpsTime_;
|
||||||
|
|
||||||
std::list<rtabmap::RtabmapEvent*> rtabmapEvents_;
|
std::list<rtabmap::RtabmapEvent*> rtabmapEvents_;
|
||||||
std::list<rtabmap::OdometryEvent> odomEvents_;
|
std::list<rtabmap::SensorEvent> sensorEvents_;
|
||||||
std::list<rtabmap::Transform> poseEvents_;
|
std::list<rtabmap::Transform> poseEvents_;
|
||||||
std::map<double, rtabmap::Transform> poseBuffer_;
|
|
||||||
|
|
||||||
rtabmap::Transform mapToOdom_;
|
rtabmap::Transform mapToOdom_;
|
||||||
|
|
||||||
boost::mutex cameraMutex_;
|
boost::mutex cameraMutex_;
|
||||||
boost::mutex rtabmapMutex_;
|
boost::mutex rtabmapMutex_;
|
||||||
boost::mutex meshesMutex_;
|
boost::mutex meshesMutex_;
|
||||||
boost::mutex odomMutex_;
|
boost::mutex sensorMutex_;
|
||||||
boost::mutex poseMutex_;
|
boost::mutex poseMutex_;
|
||||||
boost::mutex renderingMutex_;
|
boost::mutex renderingMutex_;
|
||||||
|
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ void BackgroundRenderer::InitializeGlContent(GLuint textureId, bool oes)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BackgroundRenderer::Draw(const float * transformed_uvs, const GLuint & depthTexture, int screenWidth, int screenHeight, bool redUnknown) {
|
void BackgroundRenderer::Draw(const float * transformed_uvs, const GLuint & depthTexture, int screenWidth, int screenHeight, bool redUnknown) {
|
||||||
static_assert(std::extent<decltype(BackgroundRenderer_kVertices)>::value == kNumVertices * 2, "Incorrect kVertices length");
|
static_assert(std::extent<decltype(BackgroundRenderer_kVerticesDevice)>::value == kNumVertices * 2, "Incorrect kVertices length");
|
||||||
|
|
||||||
GLuint program = shaderPrograms_[depthTexture>0?1:0];
|
GLuint program = shaderPrograms_[depthTexture>0?1:0];
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ void BackgroundRenderer::Draw(const float * transformed_uvs, const GLuint & dept
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
glBindTexture(GL_TEXTURE_2D, texture_id_);
|
glBindTexture(GL_TEXTURE_2D, texture_id_);
|
||||||
|
|
||||||
if(depthTexture>0)
|
if(depthTexture>0)
|
||||||
{
|
{
|
||||||
// Texture activate unit 1
|
// Texture activate unit 1
|
||||||
@@ -191,7 +191,7 @@ void BackgroundRenderer::Draw(const float * transformed_uvs, const GLuint & dept
|
|||||||
GLuint attributeVertices = glGetAttribLocation(program, "a_Position");
|
GLuint attributeVertices = glGetAttribLocation(program, "a_Position");
|
||||||
GLuint attributeUvs = glGetAttribLocation(program, "a_TexCoord");
|
GLuint attributeUvs = glGetAttribLocation(program, "a_TexCoord");
|
||||||
|
|
||||||
glVertexAttribPointer(attributeVertices, 2, GL_FLOAT, GL_FALSE, 0, BackgroundRenderer_kVertices);
|
glVertexAttribPointer(attributeVertices, 2, GL_FLOAT, GL_FALSE, 0, BackgroundRenderer_kVerticesDevice);
|
||||||
glVertexAttribPointer(attributeUvs, 2, GL_FLOAT, GL_FALSE, 0, transformed_uvs?transformed_uvs:BackgroundRenderer_kTexCoord);
|
glVertexAttribPointer(attributeUvs, 2, GL_FLOAT, GL_FALSE, 0, transformed_uvs?transformed_uvs:BackgroundRenderer_kTexCoord);
|
||||||
|
|
||||||
glEnableVertexAttribArray(attributeVertices);
|
glEnableVertexAttribArray(attributeVertices);
|
||||||
|
|||||||
@@ -28,9 +28,15 @@
|
|||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
static const GLfloat BackgroundRenderer_kVertices[] = {
|
static const GLfloat BackgroundRenderer_kVerticesDevice[] = {
|
||||||
-1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f,
|
-1.0f, -1.0f, +1.0f, -1.0f, -1.0f, +1.0f, +1.0f, +1.0f,
|
||||||
};
|
};
|
||||||
|
//static const GLfloat BackgroundRenderer_kVerticesView[] = {
|
||||||
|
// 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f,
|
||||||
|
//};
|
||||||
|
static const GLfloat BackgroundRenderer_kVerticesView[] = {
|
||||||
|
0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f,
|
||||||
|
};
|
||||||
static const GLfloat BackgroundRenderer_kTexCoord[] = {
|
static const GLfloat BackgroundRenderer_kTexCoord[] = {
|
||||||
1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
|
1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
|
||||||
};
|
};
|
||||||
|
|||||||
5
app/android/libs/.gitignore
vendored
5
app/android/libs/.gitignore
vendored
@@ -1 +1,4 @@
|
|||||||
*.jar
|
# Ignore everything in this directory
|
||||||
|
*
|
||||||
|
# Except this file
|
||||||
|
!.gitignore
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
<string name="pref_key_depth_from_motion">pref_key_depth_from_motion</string>
|
<string name="pref_key_depth_from_motion">pref_key_depth_from_motion</string>
|
||||||
<string name="pref_default_depth_from_motion">false</string>
|
<string name="pref_default_depth_from_motion">false</string>
|
||||||
<string name="pref_key_arcore_localization_filtering_speed">pref_key_arcore_localization_filtering_speed</string>
|
<string name="pref_key_arcore_localization_filtering_speed">pref_key_arcore_localization_filtering_speed</string>
|
||||||
<string name="pref_default_arcore_localization_filtering_speed">1</string>
|
<string name="pref_default_arcore_localization_filtering_speed">0</string>
|
||||||
<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_key_max_speed">pref_key_max_speed</string>
|
||||||
|
|||||||
@@ -115,6 +115,9 @@ public class ARCoreSharedCamera {
|
|||||||
// Image reader that continuously processes CPU images.
|
// Image reader that continuously processes CPU images.
|
||||||
public TOF_ImageReader mTOFImageReader = new TOF_ImageReader();
|
public TOF_ImageReader mTOFImageReader = new TOF_ImageReader();
|
||||||
private boolean mTOFAvailable = false;
|
private boolean mTOFAvailable = false;
|
||||||
|
|
||||||
|
ByteBuffer mPreviousDepth = null;
|
||||||
|
double mPreviousDepthStamp = 0.0;
|
||||||
|
|
||||||
public boolean isDepthSupported() {return mTOFAvailable;}
|
public boolean isDepthSupported() {return mTOFAvailable;}
|
||||||
|
|
||||||
@@ -698,6 +701,7 @@ public class ARCoreSharedCamera {
|
|||||||
mToast.setText(msg);
|
mToast.setText(msg);
|
||||||
}
|
}
|
||||||
previousAnchorPose = null;
|
previousAnchorPose = null;
|
||||||
|
arCoreCorrection = Pose.IDENTITY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -718,7 +722,8 @@ public class ARCoreSharedCamera {
|
|||||||
final double speed = Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])/((double)(frame.getTimestamp()-previousAnchorTimeStamp)/10e8);
|
final double speed = Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])/((double)(frame.getTimestamp()-previousAnchorTimeStamp)/10e8);
|
||||||
if(speed>=mARCoreLocalizationFilteringSpeed)
|
if(speed>=mARCoreLocalizationFilteringSpeed)
|
||||||
{
|
{
|
||||||
arCoreCorrection = arCoreCorrection.compose(previousAnchorPose).compose(pose.inverse());
|
// Only correct the translation to not lose rotation aligned with gravity
|
||||||
|
arCoreCorrection = arCoreCorrection.compose(previousAnchorPose.compose(pose.inverse()).extractTranslation());
|
||||||
t = arCoreCorrection.getTranslation();
|
t = arCoreCorrection.getTranslation();
|
||||||
Log.e(TAG, String.format("POTENTIAL TELEPORTATION!!!!!!!!!!!!!! previous anchor moved (speed=%f), new arcorrection: %f %f %f", speed, t[0], t[1], t[2]));
|
Log.e(TAG, String.format("POTENTIAL TELEPORTATION!!!!!!!!!!!!!! previous anchor moved (speed=%f), new arcorrection: %f %f %f", speed, t[0], t[1], t[2]));
|
||||||
|
|
||||||
@@ -744,7 +749,6 @@ public class ARCoreSharedCamera {
|
|||||||
{
|
{
|
||||||
mToast.setText(msg);
|
mToast.setText(msg);
|
||||||
}
|
}
|
||||||
previousAnchorPose = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -755,9 +759,8 @@ public class ARCoreSharedCamera {
|
|||||||
previousAnchorTimeStamp = frame.getTimestamp();
|
previousAnchorTimeStamp = frame.getTimestamp();
|
||||||
|
|
||||||
double stamp = (double)frame.getTimestamp()/10e8;
|
double stamp = (double)frame.getTimestamp()/10e8;
|
||||||
if(!RTABMapActivity.DISABLE_LOG) Log.d(TAG, String.format("pose=%f %f %f q=%f %f %f %f stamp=%f", odomPose.tx(), odomPose.ty(), odomPose.tz(), odomPose.qx(), odomPose.qy(), odomPose.qz(), odomPose.qw(), stamp));
|
if(!RTABMapActivity.DISABLE_LOG) Log.d(TAG, String.format("pose=%f %f %f arcore %f %f %f cor= %f %f %f stamp=%f", odomPose.tx(), odomPose.ty(), odomPose.tz(), pose.tx(), pose.ty(), pose.tz(), arCoreCorrection.tx(), arCoreCorrection.ty(), arCoreCorrection.tz(), stamp));
|
||||||
RTABMapLib.postCameraPoseEvent(RTABMapActivity.nativeApplication, odomPose.tx(), odomPose.ty(), odomPose.tz(), odomPose.qx(), odomPose.qy(), odomPose.qz(), odomPose.qw(), stamp);
|
RTABMapLib.postCameraPoseEvent(RTABMapActivity.nativeApplication, odomPose.tx(), odomPose.ty(), odomPose.tz(), odomPose.qx(), odomPose.qy(), odomPose.qz(), odomPose.qw(), stamp);
|
||||||
|
|
||||||
CameraIntrinsics intrinsics = camera.getImageIntrinsics();
|
CameraIntrinsics intrinsics = camera.getImageIntrinsics();
|
||||||
try{
|
try{
|
||||||
Image image = frame.acquireCameraImage();
|
Image image = frame.acquireCameraImage();
|
||||||
@@ -813,6 +816,12 @@ public class ARCoreSharedCamera {
|
|||||||
depth = mTOFImageReader.depth16_raw;
|
depth = mTOFImageReader.depth16_raw;
|
||||||
depthStamp = (double)mTOFImageReader.timestamp/10e8;
|
depthStamp = (double)mTOFImageReader.timestamp/10e8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(mPreviousDepth == null)
|
||||||
|
{
|
||||||
|
mPreviousDepth = depth;
|
||||||
|
mPreviousDepthStamp = depthStamp;
|
||||||
|
}
|
||||||
|
|
||||||
if(!RTABMapActivity.DISABLE_LOG) Log.d(TAG, String.format("Depth %dx%d len=%dbytes format=%d stamp=%f",
|
if(!RTABMapActivity.DISABLE_LOG) Log.d(TAG, String.format("Depth %dx%d len=%dbytes format=%d stamp=%f",
|
||||||
mTOFImageReader.WIDTH, mTOFImageReader.HEIGHT, depth.limit(), ImageFormat.DEPTH16, depthStamp));
|
mTOFImageReader.WIDTH, mTOFImageReader.HEIGHT, depth.limit(), ImageFormat.DEPTH16, depthStamp));
|
||||||
@@ -825,13 +834,17 @@ public class ARCoreSharedCamera {
|
|||||||
rgbExtrinsics.tx(), rgbExtrinsics.ty(), rgbExtrinsics.tz(), rgbExtrinsics.qx(), rgbExtrinsics.qy(), rgbExtrinsics.qz(), rgbExtrinsics.qw(),
|
rgbExtrinsics.tx(), rgbExtrinsics.ty(), rgbExtrinsics.tz(), rgbExtrinsics.qx(), rgbExtrinsics.qy(), rgbExtrinsics.qz(), rgbExtrinsics.qw(),
|
||||||
depthExtrinsics.tx(), depthExtrinsics.ty(), depthExtrinsics.tz(), depthExtrinsics.qx(), depthExtrinsics.qy(), depthExtrinsics.qz(), depthExtrinsics.qw(),
|
depthExtrinsics.tx(), depthExtrinsics.ty(), depthExtrinsics.tz(), depthExtrinsics.qx(), depthExtrinsics.qy(), depthExtrinsics.qz(), depthExtrinsics.qw(),
|
||||||
stamp,
|
stamp,
|
||||||
depthStamp,
|
depthStamp>stamp?mPreviousDepthStamp:depthStamp,
|
||||||
y, u, v, y.limit(), image.getWidth(), image.getHeight(), image.getFormat(),
|
y, u, v, y.limit(), image.getWidth(), image.getHeight(), image.getFormat(),
|
||||||
depth, depth.limit(), mTOFImageReader.WIDTH, mTOFImageReader.HEIGHT, ImageFormat.DEPTH16,
|
depthStamp>stamp?mPreviousDepth:depth, depthStamp>stamp?mPreviousDepth.limit():depth.limit(), mTOFImageReader.WIDTH, mTOFImageReader.HEIGHT, ImageFormat.DEPTH16,
|
||||||
points, points.limit()/4,
|
points, points.limit()/4,
|
||||||
viewMatrix[12], viewMatrix[13], viewMatrix[14], quat[1], quat[2], quat[3], quat[0],
|
viewMatrix[12], viewMatrix[13], viewMatrix[14], quat[1], quat[2], quat[3], quat[0],
|
||||||
p[0], p[5], p[8], p[9], p[10], p[11], p[14],
|
p[0], p[5], p[8], p[9], p[10], p[11], p[14],
|
||||||
texCoord[0],texCoord[1],texCoord[2],texCoord[3],texCoord[4],texCoord[5],texCoord[6],texCoord[7]);
|
texCoord[0],texCoord[1],texCoord[2],texCoord[3],texCoord[4],texCoord[5],texCoord[6],texCoord[7]);
|
||||||
|
|
||||||
|
|
||||||
|
mPreviousDepthStamp = depthStamp;
|
||||||
|
mPreviousDepth = depth;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1007,7 +1007,7 @@
|
|||||||
"$(PROJECT_DIR)/RTABMapApp/Libraries/lib",
|
"$(PROJECT_DIR)/RTABMapApp/Libraries/lib",
|
||||||
"$(PROJECT_DIR)/RTABMapApp/Libraries/share/OpenCV/3rdparty/lib",
|
"$(PROJECT_DIR)/RTABMapApp/Libraries/share/OpenCV/3rdparty/lib",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 0.20.19;
|
MARKETING_VERSION = 0.21.0;
|
||||||
OTHER_CFLAGS = "";
|
OTHER_CFLAGS = "";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.introlab.rtabmap;
|
PRODUCT_BUNDLE_IDENTIFIER = com.introlab.rtabmap;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
@@ -1020,7 +1020,7 @@
|
|||||||
"\"$(SRCROOT)/RTABMapApp/Libraries/include\"",
|
"\"$(SRCROOT)/RTABMapApp/Libraries/include\"",
|
||||||
"\"$(SRCROOT)/RTABMapApp/Libraries/include/eigen3\"",
|
"\"$(SRCROOT)/RTABMapApp/Libraries/include/eigen3\"",
|
||||||
"\"$(SRCROOT)/RTABMapApp/Libraries/include/pcl-1.11\"",
|
"\"$(SRCROOT)/RTABMapApp/Libraries/include/pcl-1.11\"",
|
||||||
"\"$(SRCROOT)/RTABMapApp/Libraries/include/rtabmap-0.20\"",
|
"\"$(SRCROOT)/RTABMapApp/Libraries/include/rtabmap-0.21\"",
|
||||||
"\"$(SRCROOT)/../android/jni/tango-gl/include\"",
|
"\"$(SRCROOT)/../android/jni/tango-gl/include\"",
|
||||||
"\"$(SRCROOT)/../android/jni/third-party/include\"",
|
"\"$(SRCROOT)/../android/jni/third-party/include\"",
|
||||||
"\"$(SRCROOT)/RTABMapApp/Libraries/lib/vtk.framework/Headers\"",
|
"\"$(SRCROOT)/RTABMapApp/Libraries/lib/vtk.framework/Headers\"",
|
||||||
@@ -1064,7 +1064,7 @@
|
|||||||
"$(PROJECT_DIR)/RTABMapApp/Libraries/lib",
|
"$(PROJECT_DIR)/RTABMapApp/Libraries/lib",
|
||||||
"$(PROJECT_DIR)/RTABMapApp/Libraries/share/OpenCV/3rdparty/lib",
|
"$(PROJECT_DIR)/RTABMapApp/Libraries/share/OpenCV/3rdparty/lib",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 0.20.19;
|
MARKETING_VERSION = 0.21.0;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
OTHER_CFLAGS = "";
|
OTHER_CFLAGS = "";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.introlab.rtabmap;
|
PRODUCT_BUNDLE_IDENTIFIER = com.introlab.rtabmap;
|
||||||
@@ -1078,7 +1078,7 @@
|
|||||||
"\"$(SRCROOT)/RTABMapApp/Libraries/include\"",
|
"\"$(SRCROOT)/RTABMapApp/Libraries/include\"",
|
||||||
"\"$(SRCROOT)/RTABMapApp/Libraries/include/eigen3\"",
|
"\"$(SRCROOT)/RTABMapApp/Libraries/include/eigen3\"",
|
||||||
"\"$(SRCROOT)/RTABMapApp/Libraries/include/pcl-1.11\"",
|
"\"$(SRCROOT)/RTABMapApp/Libraries/include/pcl-1.11\"",
|
||||||
"\"$(SRCROOT)/RTABMapApp/Libraries/include/rtabmap-0.20\"",
|
"\"$(SRCROOT)/RTABMapApp/Libraries/include/rtabmap-0.21\"",
|
||||||
"\"$(SRCROOT)/../android/jni/tango-gl/include\"",
|
"\"$(SRCROOT)/../android/jni/tango-gl/include\"",
|
||||||
"\"$(SRCROOT)/../android/jni/third-party/include\"",
|
"\"$(SRCROOT)/../android/jni/third-party/include\"",
|
||||||
"\"$(SRCROOT)/RTABMapApp/Libraries/lib/vtk.framework/Headers\"",
|
"\"$(SRCROOT)/RTABMapApp/Libraries/lib/vtk.framework/Headers\"",
|
||||||
|
|||||||
1
app/ios/RTABMapApp/.gitignore
vendored
Normal file
1
app/ios/RTABMapApp/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Libraries
|
||||||
6
app/ios/RTABMapApp/Libraries/.gitignore
vendored
6
app/ios/RTABMapApp/Libraries/.gitignore
vendored
@@ -1,6 +0,0 @@
|
|||||||
# Ignore everything
|
|
||||||
*
|
|
||||||
|
|
||||||
# But not these files...
|
|
||||||
!.gitignore
|
|
||||||
!install_deps.sh
|
|
||||||
@@ -284,11 +284,11 @@ void setCameraNative(const void *object, int type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void postCameraPoseEventNative(const void *object,
|
void postCameraPoseEventNative(const void *object,
|
||||||
float x, float y, float z, float qx, float qy, float qz, float qw)
|
float x, float y, float z, float qx, float qy, float qz, float qw, double stamp)
|
||||||
{
|
{
|
||||||
if(object)
|
if(object)
|
||||||
{
|
{
|
||||||
native(object)->postCameraPoseEvent(x,y,z,qx,qy,qz,qw,0.0);
|
native(object)->postCameraPoseEvent(x,y,z,qx,qy,qz,qw,stamp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -489,13 +489,6 @@ void setGridVisibleNative(const void *object, bool visible)
|
|||||||
else
|
else
|
||||||
UERROR("object is null!");
|
UERROR("object is null!");
|
||||||
}
|
}
|
||||||
void setRawScanSavedNative(const void *object, bool enabled)
|
|
||||||
{
|
|
||||||
if(object)
|
|
||||||
native(object)->setRawScanSaved(enabled);
|
|
||||||
else
|
|
||||||
UERROR("object is null!");
|
|
||||||
}
|
|
||||||
void setFullResolutionNative(const void *object, bool enabled)
|
void setFullResolutionNative(const void *object, bool enabled)
|
||||||
{
|
{
|
||||||
if(object)
|
if(object)
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ bool startCameraNative(const void *object);
|
|||||||
void stopCameraNative(const void *object);
|
void stopCameraNative(const void *object);
|
||||||
void setCameraNative(const void *object, int type);
|
void setCameraNative(const void *object, int type);
|
||||||
void postCameraPoseEventNative(const void *object,
|
void postCameraPoseEventNative(const void *object,
|
||||||
float x, float y, float z, float qx, float qy, float qz, float qw);
|
float x, float y, float z, float qx, float qy, float qz, float qw, double stamp);
|
||||||
void postOdometryEventNative(const void *object,
|
void postOdometryEventNative(const void *object,
|
||||||
float x, float y, float z, float qx, float qy, float qz, float qw,
|
float x, float y, float z, float qx, float qy, float qz, float qw,
|
||||||
float fx, float fy, float cx, float cy,
|
float fx, float fy, float cx, float cy,
|
||||||
@@ -97,7 +97,6 @@ void setGraphOptimizationNative(const void *object, bool enabled);
|
|||||||
void setNodesFilteringNative(const void *object, bool enabled);
|
void setNodesFilteringNative(const void *object, bool enabled);
|
||||||
void setGraphVisibleNative(const void *object, bool visible);
|
void setGraphVisibleNative(const void *object, bool visible);
|
||||||
void setGridVisibleNative(const void *object, bool visible);
|
void setGridVisibleNative(const void *object, bool visible);
|
||||||
void setRawScanSavedNative(const void *object, bool enabled);
|
|
||||||
void setFullResolutionNative(const void *object, bool enabled);
|
void setFullResolutionNative(const void *object, bool enabled);
|
||||||
void setSmoothingNative(const void *object, bool enabled);
|
void setSmoothingNative(const void *object, bool enabled);
|
||||||
void setAppendModeNative(const void *object, bool enabled);
|
void setAppendModeNative(const void *object, bool enabled);
|
||||||
|
|||||||
@@ -216,18 +216,18 @@ class RTABMap {
|
|||||||
setCameraNative(native_rtabmap, Int32(type))
|
setCameraNative(native_rtabmap, Int32(type))
|
||||||
}
|
}
|
||||||
|
|
||||||
func postCameraPoseEvent(pose: simd_float4x4) {
|
func postCameraPoseEvent(pose: simd_float4x4, stamp: TimeInterval) {
|
||||||
let rotation = GLKMatrix3(
|
let rotation = GLKMatrix3(
|
||||||
m: (pose[0,0], pose[0,1], pose[0,2],
|
m: (pose[0,0], pose[0,1], pose[0,2],
|
||||||
pose[1,0], pose[1,1], pose[1,2],
|
pose[1,0], pose[1,1], pose[1,2],
|
||||||
pose[2,0], pose[2,1], pose[2,2]))
|
pose[2,0], pose[2,1], pose[2,2]))
|
||||||
let quat = GLKQuaternionMakeWithMatrix3(rotation)
|
let quat = GLKQuaternionMakeWithMatrix3(rotation)
|
||||||
postCameraPoseEventNative(native_rtabmap, pose[3,0], pose[3,1], pose[3,2], quat.x, quat.y, quat.z, quat.w)
|
postCameraPoseEventNative(native_rtabmap, pose[3,0], pose[3,1], pose[3,2], quat.x, quat.y, quat.z, quat.w, stamp)
|
||||||
}
|
}
|
||||||
|
|
||||||
func notifyLost() {
|
func notifyLost() {
|
||||||
// a null transform will make rtabmap creating a new session
|
// a null transform will make rtabmap creating a new session
|
||||||
postCameraPoseEventNative(native_rtabmap, 0,0,0,0,0,0,0)
|
postCameraPoseEventNative(native_rtabmap, 0,0,0,0,0,0,0,0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func postOdometryEvent(frame: ARFrame, orientation: UIInterfaceOrientation, viewport: CGSize) {
|
func postOdometryEvent(frame: ARFrame, orientation: UIInterfaceOrientation, viewport: CGSize) {
|
||||||
@@ -239,7 +239,7 @@ class RTABMap {
|
|||||||
|
|
||||||
let quat = GLKQuaternionMakeWithMatrix3(rotation)
|
let quat = GLKQuaternionMakeWithMatrix3(rotation)
|
||||||
|
|
||||||
postCameraPoseEventNative(native_rtabmap, pose[3,0], pose[3,1], pose[3,2], quat.x, quat.y, quat.z, quat.w)
|
postCameraPoseEventNative(native_rtabmap, pose[3,0], pose[3,1], pose[3,2], quat.x, quat.y, quat.z, quat.w, frame.timestamp)
|
||||||
|
|
||||||
let confMap = frame.sceneDepth?.confidenceMap
|
let confMap = frame.sceneDepth?.confidenceMap
|
||||||
let depthMap = frame.sceneDepth?.depthMap
|
let depthMap = frame.sceneDepth?.depthMap
|
||||||
@@ -405,9 +405,6 @@ class RTABMap {
|
|||||||
func setGridVisible(visible: Bool) {
|
func setGridVisible(visible: Bool) {
|
||||||
setGridVisibleNative(native_rtabmap, visible)
|
setGridVisibleNative(native_rtabmap, visible)
|
||||||
}
|
}
|
||||||
func setRawScanSaved(enabled: Bool) {
|
|
||||||
setRawScanSavedNative(native_rtabmap, enabled)
|
|
||||||
}
|
|
||||||
func setFullResolution(enabled: Bool) {
|
func setFullResolution(enabled: Bool) {
|
||||||
setFullResolutionNative(native_rtabmap, enabled)
|
setFullResolutionNative(native_rtabmap, enabled)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1319,7 +1319,6 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
|
|||||||
// update preference
|
// update preference
|
||||||
rtabmap!.setOnlineBlending(enabled: defaults.bool(forKey: "Blending"));
|
rtabmap!.setOnlineBlending(enabled: defaults.bool(forKey: "Blending"));
|
||||||
rtabmap!.setNodesFiltering(enabled: defaults.bool(forKey: "NodesFiltering"));
|
rtabmap!.setNodesFiltering(enabled: defaults.bool(forKey: "NodesFiltering"));
|
||||||
rtabmap!.setRawScanSaved(enabled: defaults.bool(forKey: "SaveRawScan"));
|
|
||||||
rtabmap!.setFullResolution(enabled: defaults.bool(forKey: "HDMode"));
|
rtabmap!.setFullResolution(enabled: defaults.bool(forKey: "HDMode"));
|
||||||
rtabmap!.setSmoothing(enabled: defaults.bool(forKey: "Smoothing"));
|
rtabmap!.setSmoothing(enabled: defaults.bool(forKey: "Smoothing"));
|
||||||
rtabmap!.setAppendMode(enabled: defaults.bool(forKey: "AppendMode"));
|
rtabmap!.setAppendMode(enabled: defaults.bool(forKey: "AppendMode"));
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euxo pipefail
|
||||||
|
|
||||||
# Tested on Apple Silicon Mac, with cmake 3.19.2.
|
# Tested on Apple Silicon Mac, with cmake 3.19.2.
|
||||||
|
|
||||||
|
mkdir Libraries
|
||||||
|
cd Libraries
|
||||||
pwd=$(pwd)
|
pwd=$(pwd)
|
||||||
prefix=$pwd
|
prefix=$pwd
|
||||||
sysroot=iphoneos
|
sysroot=iphoneos
|
||||||
@@ -107,7 +111,7 @@ git checkout tags/v8.2.0
|
|||||||
git cherry-pick bf3ae8072df2393c7270509bae41be0776826346
|
git cherry-pick bf3ae8072df2393c7270509bae41be0776826346
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_FRAMEWORK_INSTALL_PREFIX=$prefix/lib -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DVTK_IOS_BUILD=ON -DIOS_SIMULATOR_ARCHITECTURES=arm64 -DModule_vtkFiltersModeling=ON ..
|
cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_FRAMEWORK_INSTALL_PREFIX=$prefix/lib -DIOS_DEVICE_ARCHITECTURES="arm64" -DIOS_SIMULATOR_ARCHITECTURES="" -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DVTK_IOS_BUILD=ON -DModule_vtkFiltersModeling=ON ..
|
||||||
# For iphonesimulator: add -DIOS_DEVICE_ARCHITECTURES=""
|
# For iphonesimulator: add -DIOS_DEVICE_ARCHITECTURES=""
|
||||||
cmake --build . --config Release
|
cmake --build . --config Release
|
||||||
cd $pwd
|
cd $pwd
|
||||||
@@ -118,7 +122,7 @@ git clone https://github.com/PointCloudLibrary/pcl.git
|
|||||||
cd pcl
|
cd pcl
|
||||||
git checkout tags/pcl-1.11.1
|
git checkout tags/pcl-1.11.1
|
||||||
# patch
|
# patch
|
||||||
curl -L https://gist.github.com/matlabbe/f3ba9366eb91e1b855dadd2ddce5746d/raw/4a66ebb9faa1dfe997a0860d733bc5473cff20ee/pcl_1_11_1_vtk_ios_support.patch -o pcl_1_11_1_vtk_ios_support.patch
|
curl -L https://gist.github.com/matlabbe/f3ba9366eb91e1b855dadd2ddce5746d/raw/6869cf26211ab15492599e557b0e729b23b2c119/pcl_1_11_1_vtk_ios_support.patch -o pcl_1_11_1_vtk_ios_support.patch
|
||||||
git apply pcl_1_11_1_vtk_ios_support.patch
|
git apply pcl_1_11_1_vtk_ios_support.patch
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<string>
|
<string>
|
||||||
======= RTAB-Map =======
|
======= RTAB-Map =======
|
||||||
RTAB-Map - https://github.com/introlab/rtabmap
|
RTAB-Map - https://github.com/introlab/rtabmap
|
||||||
Copyright (c) 2010-2022, Mathieu Labbe - IntRoLab - Universite de Sherbrooke, all rights reserved.
|
Copyright (c) 2010-2023, Mathieu Labbe - IntRoLab - Universite de Sherbrooke, all rights reserved.
|
||||||
Copyright (c) XXX, contributors, all rights reserved.
|
Copyright (c) XXX, contributors, 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
|
||||||
|
|||||||
@@ -552,50 +552,50 @@
|
|||||||
<key>DefaultValue</key>
|
<key>DefaultValue</key>
|
||||||
<true/>
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
<string>PSGroupSpecifier</string>
|
<string>PSGroupSpecifier</string>
|
||||||
<key>FooterText</key>
|
<key>FooterText</key>
|
||||||
<string>Used only in localization mode (when clicking First-P. View during visualization). This is used to get smoother localizations and to verify localization transforms (when Max Optimization Error is not disabled) to make sure we don't teleport to a location very similar to one we previously localized on.</string>
|
<string>Used only in localization mode (when clicking First-P. View during visualization). This is used to get smoother localizations and to verify localization transforms (when Max Optimization Error is not disabled) to make sure we don't teleport to a location very similar to one we previously localized on.</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
<string>PSMultiValueSpecifier</string>
|
<string>PSMultiValueSpecifier</string>
|
||||||
<key>Title</key>
|
<key>Title</key>
|
||||||
<string>Maximum odometry cache size</string>
|
<string>Maximum odometry cache size</string>
|
||||||
<key>Key</key>
|
<key>Key</key>
|
||||||
<string>MaximumOdometryCacheSize</string>
|
<string>MaximumOdometryCacheSize</string>
|
||||||
<key>DefaultValue</key>
|
<key>DefaultValue</key>
|
||||||
<string>10</string>
|
<string>10</string>
|
||||||
<key>Titles</key>
|
<key>Titles</key>
|
||||||
<array>
|
<array>
|
||||||
<string>500</string>
|
<string>500</string>
|
||||||
<string>200</string>
|
<string>200</string>
|
||||||
<string>100</string>
|
<string>100</string>
|
||||||
<string>75</string>
|
<string>75</string>
|
||||||
<string>50</string>
|
<string>50</string>
|
||||||
<string>40</string>
|
<string>40</string>
|
||||||
<string>30</string>
|
<string>30</string>
|
||||||
<string>20</string>
|
<string>20</string>
|
||||||
<string>10</string>
|
<string>10</string>
|
||||||
<string>5</string>
|
<string>5</string>
|
||||||
<string>Disabled</string>
|
<string>Disabled</string>
|
||||||
</array>
|
</array>
|
||||||
<key>Values</key>
|
<key>Values</key>
|
||||||
<array>
|
<array>
|
||||||
<string>500</string>
|
<string>500</string>
|
||||||
<string>200</string>
|
<string>200</string>
|
||||||
<string>100</string>
|
<string>100</string>
|
||||||
<string>75</string>
|
<string>75</string>
|
||||||
<string>50</string>
|
<string>50</string>
|
||||||
<string>40</string>
|
<string>40</string>
|
||||||
<string>30</string>
|
<string>30</string>
|
||||||
<string>20</string>
|
<string>20</string>
|
||||||
<string>10</string>
|
<string>10</string>
|
||||||
<string>5</string>
|
<string>5</string>
|
||||||
<string>0</string>
|
<string>0</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
<string>PSGroupSpecifier</string>
|
<string>PSGroupSpecifier</string>
|
||||||
@@ -752,22 +752,6 @@
|
|||||||
<key>DefaultValue</key>
|
<key>DefaultValue</key>
|
||||||
<true/>
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>PSGroupSpecifier</string>
|
|
||||||
<key>FooterText</key>
|
|
||||||
<string>Save raw point clouds in database.</string>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>PSToggleSwitchSpecifier</string>
|
|
||||||
<key>Title</key>
|
|
||||||
<string>Save Raw Scan</string>
|
|
||||||
<key>Key</key>
|
|
||||||
<string>SaveRawScan</string>
|
|
||||||
<key>DefaultValue</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
<dict>
|
||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
<string>PSGroupSpecifier</string>
|
<string>PSGroupSpecifier</string>
|
||||||
|
|||||||
@@ -454,7 +454,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>FooterText</key>
|
<key>FooterText</key>
|
||||||
<string>Copyright (c) 2010-2022, Mathieu Labbe - IntRoLab - Université de Sherbrooke. All rights reserved.</string>
|
<string>Copyright (c) 2010-2023, Mathieu Labbe - IntRoLab - Université de Sherbrooke. All rights reserved.</string>
|
||||||
<key>Title</key>
|
<key>Title</key>
|
||||||
<string>About</string>
|
<string>About</string>
|
||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
@@ -462,7 +462,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>DefaultValue</key>
|
<key>DefaultValue</key>
|
||||||
<string>0.20.19</string>
|
<string>0.21.0</string>
|
||||||
<key>Key</key>
|
<key>Key</key>
|
||||||
<string>Version</string>
|
<string>Version</string>
|
||||||
<key>Title</key>
|
<key>Title</key>
|
||||||
|
|||||||
@@ -3,32 +3,6 @@ SET(SRC_FILES
|
|||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(INCLUDE_DIRS
|
|
||||||
${PROJECT_BINARY_DIR}/corelib/include
|
|
||||||
${PROJECT_SOURCE_DIR}/utilite/include
|
|
||||||
${PROJECT_SOURCE_DIR}/corelib/include
|
|
||||||
${PROJECT_SOURCE_DIR}/guilib/include
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
${OpenCV_INCLUDE_DIRS}
|
|
||||||
${PCL_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
IF(QT4_FOUND)
|
|
||||||
INCLUDE(${QT_USE_FILE})
|
|
||||||
ENDIF(QT4_FOUND)
|
|
||||||
|
|
||||||
SET(LIBRARIES
|
|
||||||
${QT_LIBRARIES}
|
|
||||||
${OpenCV_LIBS}
|
|
||||||
${PCL_LIBRARIES}
|
|
||||||
)
|
|
||||||
|
|
||||||
# rc.exe has problems with these defintions... commented!
|
|
||||||
#add_definitions(${PCL_DEFINITIONS})
|
|
||||||
|
|
||||||
# Make sure the compiler can find include files from our library.
|
|
||||||
INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
|
|
||||||
|
|
||||||
# For Apple set the icns file containing icons
|
# For Apple set the icns file containing icons
|
||||||
IF(APPLE AND BUILD_AS_BUNDLE)
|
IF(APPLE AND BUILD_AS_BUNDLE)
|
||||||
# set how it shows up in the Info.plist file
|
# set how it shows up in the Info.plist file
|
||||||
@@ -50,40 +24,37 @@ IF(WIN32)
|
|||||||
ELSE( MINGW )
|
ELSE( MINGW )
|
||||||
SET(SRC_FILES ${SRC_FILES} ${PROJECT_NAME}.rc)
|
SET(SRC_FILES ${SRC_FILES} ${PROJECT_NAME}.rc)
|
||||||
ENDIF( MINGW )
|
ENDIF( MINGW )
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
|
|
||||||
|
IF(BUILD_AS_BUNDLE)
|
||||||
|
ADD_DEFINITIONS("-DBUILD_AS_BUNDLE")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# Add binary
|
# Add binary
|
||||||
IF(APPLE AND BUILD_AS_BUNDLE)
|
IF(APPLE AND BUILD_AS_BUNDLE)
|
||||||
ADD_EXECUTABLE(rtabmap MACOSX_BUNDLE ${SRC_FILES})
|
ADD_EXECUTABLE(rtabmap_app MACOSX_BUNDLE ${SRC_FILES})
|
||||||
ELSEIF(MINGW)
|
ELSEIF(WIN32 AND BUILD_AS_BUNDLE)
|
||||||
ADD_EXECUTABLE(rtabmap WIN32 ${SRC_FILES})
|
ADD_EXECUTABLE(rtabmap_app WIN32 ${SRC_FILES})
|
||||||
ELSE()
|
ELSE()
|
||||||
ADD_EXECUTABLE(rtabmap ${SRC_FILES})
|
ADD_EXECUTABLE(rtabmap_app ${SRC_FILES})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
TARGET_LINK_LIBRARIES(rtabmap rtabmap_core rtabmap_gui rtabmap_utilite ${LIBRARIES})
|
TARGET_LINK_LIBRARIES(rtabmap_app rtabmap_gui)
|
||||||
IF(Qt5_FOUND)
|
|
||||||
IF(Qt5Svg_FOUND)
|
|
||||||
QT5_USE_MODULES(rtabmap Widgets Core Gui Svg PrintSupport)
|
|
||||||
ELSE()
|
|
||||||
QT5_USE_MODULES(rtabmap Widgets Core Gui PrintSupport)
|
|
||||||
ENDIF()
|
|
||||||
ENDIF(Qt5_FOUND)
|
|
||||||
|
|
||||||
IF(APPLE AND BUILD_AS_BUNDLE)
|
IF(APPLE AND BUILD_AS_BUNDLE)
|
||||||
SET_TARGET_PROPERTIES(rtabmap PROPERTIES
|
SET_TARGET_PROPERTIES(rtabmap_app PROPERTIES
|
||||||
OUTPUT_NAME ${CMAKE_BUNDLE_NAME})
|
OUTPUT_NAME ${CMAKE_BUNDLE_NAME})
|
||||||
ELSEIF(WIN32)
|
ELSEIF(WIN32)
|
||||||
SET_TARGET_PROPERTIES(rtabmap PROPERTIES
|
SET_TARGET_PROPERTIES(rtabmap_app PROPERTIES
|
||||||
OUTPUT_NAME ${PROJECT_NAME})
|
OUTPUT_NAME ${PROJECT_NAME})
|
||||||
ELSE()
|
ELSE()
|
||||||
SET_TARGET_PROPERTIES(rtabmap PROPERTIES
|
SET_TARGET_PROPERTIES(rtabmap_app PROPERTIES
|
||||||
OUTPUT_NAME ${PROJECT_PREFIX})
|
OUTPUT_NAME ${PROJECT_PREFIX})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
#---------------------------
|
#---------------------------
|
||||||
# Installation stuff
|
# Installation stuff
|
||||||
#---------------------------
|
#---------------------------
|
||||||
INSTALL(TARGETS rtabmap
|
INSTALL(TARGETS rtabmap_app
|
||||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
|
||||||
BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime)
|
BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime)
|
||||||
|
|
||||||
@@ -94,15 +65,18 @@ ENDIF(APPLE AND BUILD_AS_BUNDLE)
|
|||||||
|
|
||||||
IF(BUILD_AS_BUNDLE AND (APPLE 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/plugins)
|
||||||
SET(qtconf_dest_dir bin)
|
SET(qtconf_dest_dir bin)
|
||||||
SET(openni2_dest_dir bin)
|
SET(thirdparty_dest_dir bin)
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
SET(plugin_dest_dir MacOS)
|
SET(plugin_dest_dir MacOS/plugins)
|
||||||
|
IF(Qt6_FOUND)
|
||||||
|
SET(plugin_dest_dir PlugIns)
|
||||||
|
ENDIF()
|
||||||
SET(qtconf_dest_dir Resources)
|
SET(qtconf_dest_dir Resources)
|
||||||
SET(openni2_dest_dir MacOS)
|
SET(thirdparty_dest_dir MacOS)
|
||||||
SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
|
SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
IF(OpenNI2_FOUND)
|
IF(OpenNI2_FOUND)
|
||||||
@@ -118,11 +92,11 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
INSTALL(DIRECTORY "${OpenNI2_BIN_DIR}/OpenNI2"
|
INSTALL(DIRECTORY "${OpenNI2_BIN_DIR}/OpenNI2"
|
||||||
DESTINATION ${openni2_dest_dir}
|
DESTINATION ${thirdparty_dest_dir}
|
||||||
COMPONENT runtime
|
COMPONENT runtime
|
||||||
REGEX ".*pdb" EXCLUDE)
|
REGEX ".*pdb" EXCLUDE)
|
||||||
INSTALL(FILES "${OpenNI2_BIN_DIR}/OpenNI.ini"
|
INSTALL(FILES "${OpenNI2_BIN_DIR}/OpenNI.ini"
|
||||||
DESTINATION ${openni2_dest_dir}
|
DESTINATION ${thirdparty_dest_dir}
|
||||||
COMPONENT runtime)
|
COMPONENT runtime)
|
||||||
ENDIF(OpenNI2_FOUND)
|
ENDIF(OpenNI2_FOUND)
|
||||||
|
|
||||||
@@ -131,7 +105,7 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
|||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
file(TO_CMAKE_PATH "$ENV{K4A_ROOT_DIR}" ENV_K4A_ROOT_DIR)
|
file(TO_CMAKE_PATH "$ENV{K4A_ROOT_DIR}" ENV_K4A_ROOT_DIR)
|
||||||
INSTALL(FILES "${ENV_K4A_ROOT_DIR}/tools/depthengine_2_0.dll"
|
INSTALL(FILES "${ENV_K4A_ROOT_DIR}/tools/depthengine_2_0.dll"
|
||||||
DESTINATION ${plugin_dest_dir}
|
DESTINATION ${thirdparty_dest_dir}
|
||||||
COMPONENT runtime)
|
COMPONENT runtime)
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
ENDIF(k4a_FOUND)
|
ENDIF(k4a_FOUND)
|
||||||
@@ -146,7 +120,7 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
|||||||
MESSAGE(STATUS "Found ${CUDNN_OPS_DLL}")
|
MESSAGE(STATUS "Found ${CUDNN_OPS_DLL}")
|
||||||
MESSAGE(STATUS "Found ${CUDNN_CNN_DLL}")
|
MESSAGE(STATUS "Found ${CUDNN_CNN_DLL}")
|
||||||
INSTALL(FILES ${CUDNN_OPS_DLL} ${CUDNN_CNN_DLL}
|
INSTALL(FILES ${CUDNN_OPS_DLL} ${CUDNN_CNN_DLL}
|
||||||
DESTINATION ${plugin_dest_dir}
|
DESTINATION ${thirdparty_dest_dir}
|
||||||
COMPONENT runtime)
|
COMPONENT runtime)
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(AUTHOR_WARNING "Using Torch with CUDA, but cudnn_ops_infer64_8.dll and cudnn_cnn_infer64_8.dll are not found on the PATH, so it won't be added to package.")
|
MESSAGE(AUTHOR_WARNING "Using Torch with CUDA, but cudnn_ops_infer64_8.dll and cudnn_cnn_infer64_8.dll are not found on the PATH, so it won't be added to package.")
|
||||||
@@ -154,64 +128,101 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
|||||||
ENDIF(WIN32 AND CUDA_FOUND)
|
ENDIF(WIN32 AND CUDA_FOUND)
|
||||||
ENDIF(Torch_FOUND)
|
ENDIF(Torch_FOUND)
|
||||||
|
|
||||||
# Install needed Qt plugins by copying directories from the qt installation
|
IF(Qt6_FOUND)
|
||||||
# One can cull what gets copied by using 'REGEX "..." EXCLUDE'
|
# Reference: https://doc-snapshots.qt.io/qt6-6.4/qt-deploy-runtime-dependencies.html
|
||||||
# Exclude debug libraries
|
# The following script must only be executed at install time
|
||||||
IF(QT_PLUGINS_DIR)
|
set(deploy_script "${CMAKE_CURRENT_BINARY_DIR}/deploy_app$<CONFIG>.cmake")
|
||||||
INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
|
file(GENERATE OUTPUT ${deploy_script} CONTENT "
|
||||||
DESTINATION ${plugin_dest_dir}/plugins
|
# Including the file pointed to by QT_DEPLOY_SUPPORT ensures the generated
|
||||||
COMPONENT runtime
|
# deployment script has access to qt_deploy_runtime_dependencies()
|
||||||
REGEX ".*d4.dll" EXCLUDE
|
include(\"${QT_DEPLOY_SUPPORT}\")
|
||||||
REGEX ".*d4.a" EXCLUDE)
|
qt_deploy_runtime_dependencies(
|
||||||
ELSE()
|
EXECUTABLE \"${APPS}\"
|
||||||
#Qt5
|
PLUGINS_DIR ${plugin_dest_dir}
|
||||||
foreach(plugin ${Qt5Gui_PLUGINS})
|
GENERATE_QT_CONF
|
||||||
get_target_property(plugin_loc ${plugin} LOCATION)
|
NO_TRANSLATIONS
|
||||||
get_filename_component(plugin_dir ${plugin_loc} DIRECTORY)
|
VERBOSE
|
||||||
string(REPLACE "plugins" ";" loc_list ${plugin_dir})
|
)")
|
||||||
list(GET loc_list 1 plugin_type)
|
IF("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||||
IF(NOT plugin_root)
|
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/deploy_appDebug.cmake"
|
||||||
get_filename_component(plugin_root ${plugin_dir} DIRECTORY)
|
CONFIGURATIONS Debug
|
||||||
ENDIF(NOT plugin_root)
|
COMPONENT runtime)
|
||||||
#MESSAGE(STATUS "Qt5 plugin \"${plugin_loc}\" installed in \"${plugin_dest_dir}/plugins${plugin_type}\"")
|
ENDIF()
|
||||||
INSTALL(FILES ${plugin_loc}
|
IF("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||||
DESTINATION ${plugin_dest_dir}/plugins${plugin_type}
|
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/deploy_appRelease.cmake"
|
||||||
|
CONFIGURATIONS Release
|
||||||
|
COMPONENT runtime)
|
||||||
|
ENDIF()
|
||||||
|
IF("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
|
||||||
|
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/deploy_appRelWithDebInfo.cmake"
|
||||||
|
CONFIGURATIONS RelWithDebInfo
|
||||||
|
COMPONENT runtime)
|
||||||
|
ENDIF()
|
||||||
|
IF("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
|
||||||
|
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/deploy_appMinSizeRel.cmake"
|
||||||
|
CONFIGURATIONS MinSizeRel
|
||||||
|
COMPONENT runtime)
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(Qt5_FOUND)
|
||||||
|
#Qt5
|
||||||
|
foreach(plugin ${Qt5Gui_PLUGINS})
|
||||||
|
get_target_property(plugin_loc ${plugin} LOCATION)
|
||||||
|
get_filename_component(plugin_dir ${plugin_loc} DIRECTORY)
|
||||||
|
string(REPLACE "plugins" ";" loc_list ${plugin_dir})
|
||||||
|
list(GET loc_list 1 plugin_type)
|
||||||
|
IF(NOT plugin_root)
|
||||||
|
get_filename_component(plugin_root ${plugin_dir} DIRECTORY)
|
||||||
|
ENDIF(NOT plugin_root)
|
||||||
|
#MESSAGE(STATUS "Qt5 plugin \"${plugin_loc}\" installed in \"${plugin_dest_dir}${plugin_type}\"")
|
||||||
|
INSTALL(FILES ${plugin_loc}
|
||||||
|
DESTINATION ${plugin_dest_dir}${plugin_type}
|
||||||
COMPONENT runtime)
|
COMPONENT runtime)
|
||||||
endforeach()
|
endforeach()
|
||||||
IF(NOT Qt5Widgets_VERSION VERSION_LESS 5.10.0)
|
IF(NOT Qt5Widgets_VERSION VERSION_LESS 5.10.0)
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET(plugin_loc "${plugin_root}/styles/qwindowsvistastyle.dll")
|
SET(plugin_loc "${plugin_root}/styles/qwindowsvistastyle.dll")
|
||||||
ELSEIF(APPLE)
|
ELSEIF(APPLE)
|
||||||
SET(plugin_loc "${plugin_root}/styles/libqmacstyle.dylib")
|
SET(plugin_loc "${plugin_root}/styles/libqmacstyle.dylib")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(EXISTS ${plugin_loc})
|
IF(EXISTS ${plugin_loc})
|
||||||
get_filename_component(plugin_dir ${plugin_loc} DIRECTORY)
|
get_filename_component(plugin_dir ${plugin_loc} DIRECTORY)
|
||||||
string(REPLACE "plugins" ";" loc_list ${plugin_dir})
|
string(REPLACE "plugins" ";" loc_list ${plugin_dir})
|
||||||
list(GET loc_list 1 plugin_type)
|
list(GET loc_list 1 plugin_type)
|
||||||
INSTALL(FILES ${plugin_loc}
|
INSTALL(FILES ${plugin_loc}
|
||||||
DESTINATION ${plugin_dest_dir}/plugins${plugin_type}
|
DESTINATION ${plugin_dest_dir}/plugins${plugin_type}
|
||||||
COMPONENT runtime)
|
COMPONENT runtime)
|
||||||
#MESSAGE(STATUS "Qt5 plugin \"${plugin_loc}\" installed in \"${plugin_dest_dir}/plugins${plugin_type}\"")
|
#MESSAGE(STATUS "Qt5 plugin \"${plugin_loc}\" installed in \"${plugin_dest_dir}${plugin_type}\"")
|
||||||
ENDIF(EXISTS ${plugin_loc})
|
ENDIF(EXISTS ${plugin_loc})
|
||||||
ENDIF(NOT Qt5Widgets_VERSION VERSION_LESS 5.10.0)
|
ENDIF(NOT Qt5Widgets_VERSION VERSION_LESS 5.10.0)
|
||||||
|
ELSEIF(QT_PLUGINS_DIR) # Qt4
|
||||||
|
# Install needed Qt plugins by copying directories from the qt installation
|
||||||
|
# One can cull what gets copied by using 'REGEX "..." EXCLUDE'
|
||||||
|
# Exclude debug libraries
|
||||||
|
INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
|
||||||
|
DESTINATION ${plugin_dest_dir}
|
||||||
|
COMPONENT runtime
|
||||||
|
REGEX ".*d4.dll" EXCLUDE
|
||||||
|
REGEX ".*d4.a" EXCLUDE)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# install a qt.conf file
|
IF(Qt5_FOUND OR QT4_FOUND)
|
||||||
# this inserts some cmake code into the install script to write the file
|
# install a qt.conf file
|
||||||
SET(QT_CONF_FILE [Paths]\nPlugins=plugins)
|
# this inserts some cmake code into the install script to write the file
|
||||||
IF(APPLE)
|
SET(QT_CONF_FILE [Paths]\nPlugins=plugins)
|
||||||
SET(QT_CONF_FILE [Paths]\nPlugins=MacOS/plugins)
|
IF(APPLE)
|
||||||
ENDIF(APPLE)
|
SET(QT_CONF_FILE [Paths]\nPlugins=MacOS/plugins)
|
||||||
INSTALL(CODE "
|
ENDIF(APPLE)
|
||||||
file(WRITE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"${QT_CONF_FILE}\")
|
INSTALL(CODE "
|
||||||
" COMPONENT runtime)
|
file(WRITE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"${QT_CONF_FILE}\")
|
||||||
|
" COMPONENT runtime)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# directories to look for dependencies
|
# directories to look for dependencies
|
||||||
SET(DIRS ${QT_LIBRARY_DIRS} ${PROJECT_SOURCE_DIR}/bin)
|
SET(DIRS "${QT_LIBRARY_DIRS}" "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib")
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
SET(DIRS ${DIRS} /usr/local /usr/local/lib)
|
SET(DIRS ${DIRS} /usr/local /usr/local/lib /opt/homebrew /opt/homebrew/lib /opt/homebrew/lib/gcc/current)
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
# Now the work of copying dependencies into the bundle/package
|
# Now the work of copying dependencies into the bundle/package
|
||||||
# The quotes are escaped and variables to use at install time have their $ escaped
|
# The quotes are escaped and variables to use at install time have their $ escaped
|
||||||
# An alternative is the do a configure_file() on a script and use install(SCRIPT ...).
|
# An alternative is the do a configure_file() on a script and use install(SCRIPT ...).
|
||||||
@@ -219,10 +230,11 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
|||||||
# over.
|
# over.
|
||||||
# To find dependencies, cmake use "otool" on Apple and "dumpbin" on Windows (make sure you have one of them).
|
# To find dependencies, cmake use "otool" on Apple and "dumpbin" on Windows (make sure you have one of them).
|
||||||
install(CODE "
|
install(CODE "
|
||||||
file(GLOB_RECURSE QTPLUGINS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
|
file(GLOB_RECURSE QTPLUGINS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
|
||||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||||
include(\"BundleUtilities\")
|
include(\"BundleUtilities\")
|
||||||
fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
|
fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
|
||||||
" COMPONENT runtime)
|
" COMPONENT runtime)
|
||||||
|
|
||||||
ENDIF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
ENDIF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,13 @@ 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 <vtkVersionMacros.h>
|
||||||
#include <vtkObject.h>
|
#include <vtkObject.h>
|
||||||
|
|
||||||
|
#if VTK_MAJOR_VERSION > 9 || (VTK_MAJOR_VERSION==9 && VTK_MINOR_VERSION >= 1)
|
||||||
|
#include <QVTKRenderWidget.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace rtabmap;
|
using namespace rtabmap;
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
@@ -50,8 +55,9 @@ int main(int argc, char* argv[])
|
|||||||
CoInitialize(nullptr);
|
CoInitialize(nullptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if VTK_MAJOR_VERSION >= 8
|
#if VTK_MAJOR_VERSION > 9 || (VTK_MAJOR_VERSION==9 && VTK_MINOR_VERSION >= 1)
|
||||||
vtkObject::GlobalWarningDisplayOff();
|
// needed to ensure appropriate OpenGL context is created for VTK rendering.
|
||||||
|
QSurfaceFormat::setDefaultFormat(QVTKRenderWidget::defaultFormat());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Create tasks */
|
/* Create tasks */
|
||||||
|
|||||||
25
archive/2010-LoopClosure/README.md
Normal file
25
archive/2010-LoopClosure/README.md
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
To reproduce results (based on parameters of this [paper](https://introlab.3it.usherbrooke.ca/mediawiki-introlab/images/b/bc/TRO2013.pdf)):
|
||||||
|
|
||||||
|
```
|
||||||
|
rtabmap-console \
|
||||||
|
--Rtabmap/StatisticLogged true\
|
||||||
|
--Rtabmap/StatisticLoggedHeaders false\
|
||||||
|
--Kp/DetectorStrategy 0\
|
||||||
|
--Rtabmap/MemoryThr 300\
|
||||||
|
--Rtabmap/LoopRatio 0.9\
|
||||||
|
--SURF/HessianThreshold 150\
|
||||||
|
--Mem/STMSize 30\
|
||||||
|
--Vis/MaxFeatures 400\
|
||||||
|
--Kp/TfIdfLikelihoodUsed false\
|
||||||
|
--Kp/MaxFeatures 400\
|
||||||
|
--Kp/BadSignRatio 0.25\
|
||||||
|
--Mem/BadSignaturesIgnored true\
|
||||||
|
--Mem/RehearsalSimilarity 0.20\
|
||||||
|
--Mem/RecentWmRatio 0.2\
|
||||||
|
-gt "~/Downloads/UdeS_1Hz.png"\
|
||||||
|
~/Downloads/UdeS_1Hz
|
||||||
|
```
|
||||||
|
Adding the ground truth file here is optional to show recall at 100% precision at the end of the process directly without using the octave/MATLAB script below. For NewCollege and CityCentre datasets, `rtabmap-imagesJoiner` can be used to assemble the left and right images together.
|
||||||
|
|
||||||
|
To analyze with Octave/MATLAB, drop `LogF.txt` and `LogI.txt` generated files from command above in ShowLogs directly, then execute `showLogs.m`.
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
This directory contains some basic concepts on Bayes filtering.
|
|
||||||
Main scripts :
|
|
||||||
RecursivesBayes.m
|
|
||||||
RecursivesBayesAvpd.m
|
|
||||||
@@ -32,8 +32,7 @@ if ~isempty(GroundTruth)
|
|||||||
if size(GroundTruth, 1) ~= length(LogF(:,1)) || size(GroundTruth, 1) ~= length(LogI(:,1))
|
if size(GroundTruth, 1) ~= length(LogF(:,1)) || size(GroundTruth, 1) ~= length(LogI(:,1))
|
||||||
error(['The ground truth size doesn''t match the log files (LogI=' num2str(length(LogI(:,1))) ', LogF=' num2str(length(LogF(:,1))) ', GT=' num2str(size(GroundTruth, 1)) ')'])
|
error(['The ground truth size doesn''t match the log files (LogI=' num2str(length(LogI(:,1))) ', LogF=' num2str(length(LogF(:,1))) ', GT=' num2str(size(GroundTruth, 1)) ')'])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
%[highestHypot, CorrespondingID, GT, Accepted, Good, Index, UnderLoopRatio] descending order
|
%[highestHypot, CorrespondingID, GT, Accepted, Good, Index, UnderLoopRatio] descending order
|
||||||
if(sum(LogI(:,8) == 10) > 0)
|
if(sum(LogI(:,8) == 10) > 0)
|
||||||
%OLD
|
%OLD
|
||||||
@@ -111,14 +110,14 @@ if ~isempty(GroundTruth)
|
|||||||
index = find(PR(:,1) == 1);
|
index = find(PR(:,1) == 1);
|
||||||
if ~isempty(index)
|
if ~isempty(index)
|
||||||
maxRecall = PR(index(end),2) * 100;
|
maxRecall = PR(index(end),2) * 100;
|
||||||
display(['Recall max (Precision=100%) = ' num2str(maxRecall) '% (p=' num2str(lc(index(end),1)) '), accepted=' num2str(sum(lc(1:index(end),5) & ~lc(1:index(end),7) & lc(1:index(end),2)))])
|
display(['Recall max (Precision=100%) = ' num2str(maxRecall) '% (p=' num2str(lc(index(end),1)) '), accepted=' num2str(sum(lc(1:index(end),5) & ~lc(1:index(end),7) & lc(1:index(end),2))) '/' num2str(GT_total_positives)])
|
||||||
else
|
else
|
||||||
display('Recall max (Precision=100%) = 0')
|
display('Recall max (Precision=100%) = 0')
|
||||||
end
|
end
|
||||||
indexAccepted = find(PR(:,3) == 1);
|
indexAccepted = find(PR(:,3) == 1);
|
||||||
if ~isempty(indexAccepted)
|
if ~isempty(indexAccepted)
|
||||||
maxRecall = PR(indexAccepted(end),2) * 100;
|
maxRecall = PR(indexAccepted(end),2) * 100;
|
||||||
display(['Recall max accepted (Precision=100%) = ' num2str(maxRecall) '% (p=' num2str(lc(indexAccepted(end),1)) '), accepted=' num2str(sum(lc(1:indexAccepted(end),5) & ~lc(1:indexAccepted(end),7) & lc(1:indexAccepted(end),2)))])
|
display(['Recall max accepted (Precision=100%) = ' num2str(maxRecall) '% (p=' num2str(lc(indexAccepted(end),1)) '), accepted=' num2str(sum(lc(1:indexAccepted(end),5) & ~lc(1:indexAccepted(end),7) & lc(1:indexAccepted(end),2))) '/' num2str(GT_total_positives)])
|
||||||
else
|
else
|
||||||
display('Recall max accepted (Precision=100%) = 0')
|
display('Recall max accepted (Precision=100%) = 0')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ function [LogF LogI] = showlogs(PathPrefix, GT_file)
|
|||||||
set(0,'defaultAxesFontName', 'Times')
|
set(0,'defaultAxesFontName', 'Times')
|
||||||
set(0,'defaultTextFontName', 'Times')
|
set(0,'defaultTextFontName', 'Times')
|
||||||
|
|
||||||
|
close all
|
||||||
|
|
||||||
if nargin < 2, GT_file = ''; end
|
if nargin < 2, GT_file = ''; end
|
||||||
if nargin < 1, PathPrefix = '.'; end
|
if nargin < 1, PathPrefix = '.'; end
|
||||||
|
|
||||||
@@ -325,7 +327,7 @@ y(LogI(:, 1) == 0) = [];
|
|||||||
x(LogI(:, 1) == 0) = [];
|
x(LogI(:, 1) == 0) = [];
|
||||||
plot(x,y, 'g.')
|
plot(x,y, 'g.')
|
||||||
|
|
||||||
set(datacursormode,'UpdateFcn',@(Y,X){sprintf('X: %0.2f',X.Position(1)),sprintf('Y: %0.2f',X.Position(2))})
|
%set(datacursormode,'UpdateFcn',@(Y,X){sprintf('X: %0.2f',X.Position(1)),sprintf('Y: %0.2f',X.Position(2))})
|
||||||
% %matched sign words
|
% %matched sign words
|
||||||
% y = LogI(:,2);
|
% y = LogI(:,2);
|
||||||
% x = 1:length(y);
|
% x = 1:length(y);
|
||||||
|
|||||||
8
archive/2010-LoopClosure/run_all.sh
Executable file
8
archive/2010-LoopClosure/run_all.sh
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
|
|
||||||
|
$SCRIPT_DIR/run_bow.sh ~/loop_closure_detection_datasets/NewCollege ~/loop_closure_detection_datasets/NewCollege.png
|
||||||
|
$SCRIPT_DIR/run_bow.sh ~/loop_closure_detection_datasets/CityCentre ~/loop_closure_detection_datasets/CityCentre.png
|
||||||
|
$SCRIPT_DIR/run_bow.sh ~/loop_closure_detection_datasets/UdeS_1Hz ~/loop_closure_detection_datasets/UdeS_1Hz.png
|
||||||
|
|
||||||
32
archive/2010-LoopClosure/run_bow.sh
Executable file
32
archive/2010-LoopClosure/run_bow.sh
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DATASET_FOLDER=""
|
||||||
|
GT_FILE=""
|
||||||
|
if [ $# -eq 2 ]
|
||||||
|
then
|
||||||
|
DATASET_FOLDER=$1
|
||||||
|
GT_FILE=$2
|
||||||
|
else
|
||||||
|
echo "Usage: run_bow.sh \"dataset folder\" \"ground truth file\""
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
rtabmap-console \
|
||||||
|
-quiet \
|
||||||
|
--Rtabmap/StatisticLogged true\
|
||||||
|
--Rtabmap/StatisticLoggedHeaders false\
|
||||||
|
--Kp/DetectorStrategy 0\
|
||||||
|
--SURF/HessianThreshold 150\
|
||||||
|
--Rtabmap/MemoryThr 300\
|
||||||
|
--Rtabmap/LoopRatio 0.9\
|
||||||
|
--Mem/STMSize 30\
|
||||||
|
--Vis/MaxFeatures 400\
|
||||||
|
--Kp/TfIdfLikelihoodUsed false\
|
||||||
|
--Kp/MaxFeatures 400\
|
||||||
|
--Kp/BadSignRatio 0.25\
|
||||||
|
--Mem/BadSignaturesIgnored true\
|
||||||
|
--Mem/RehearsalSimilarity 0.20\
|
||||||
|
--Mem/RecentWmRatio 0.20\
|
||||||
|
-gt "$GT_FILE"\
|
||||||
|
"$DATASET_FOLDER"
|
||||||
|
|
||||||
@@ -25,14 +25,14 @@ The following image shows when we do the same localization experiment at differe
|
|||||||
|
|
||||||
We provide two formats: the first one is more general and the second one is used to produce the results in this paper with RTAB-Map. Please open issue if the links are outdated.
|
We provide two formats: the first one is more general and the second one is used to produce the results in this paper with RTAB-Map. Please open issue if the links are outdated.
|
||||||
|
|
||||||
* [Images](https://usherbrooke-my.sharepoint.com/:u:/g/personal/labm2414_usherbrooke_ca/EV8F4PZUxOxLhwAyEehlzKwBjF-9xNuxR32Q4mUjx5u-rA?e=eCJ3TW):
|
* [Images](https://drive.google.com/file/d/1fUm1m8oW6q8qlThx7BjrBH2vrVbNQ9bQ/view?usp=drive_link):
|
||||||
* `rgb`: folder containing *.jpg color camera images
|
* `rgb`: folder containing *.jpg color camera images
|
||||||
* `depth`: folder containing *.png 16bits mm depth images
|
* `depth`: folder containing *.png 16bits mm depth images
|
||||||
* `calib`: folder containing calibration for each color image. Each calibration contains also the transform between `device` and `camera` frames as `local_transform`.
|
* `calib`: folder containing calibration for each color image. Each calibration contains also the transform between `device` and `camera` frames as `local_transform`.
|
||||||
* `device_poses.txt`: VIO poses of each image in `device` frame
|
* `device_poses.txt`: VIO poses of each image in `device` frame
|
||||||
* `camera_poses.txt`: VIO poses of each image in `camera` frame
|
* `camera_poses.txt`: VIO poses of each image in `camera` frame
|
||||||
* [RTAB-Map Databases](https://usherbrooke-my.sharepoint.com/:u:/g/personal/labm2414_usherbrooke_ca/EU5fb0jEKzlGhPK3OWjMGLUBnDo1BRAoZwtB2czyeVLE_A?e=Y0JyXY)
|
* [RTAB-Map Databases](https://drive.google.com/file/d/1TklUcTKFSrcg8b0t0U80G_IpFRMVRlY5/view?usp=drive_link)
|
||||||
|
* Dataset now also available on [Federated Research Data Repository (FRDR)](https://doi.org/10.20383/103.0931) (if links above don't work)
|
||||||
|
|
||||||
|
|
||||||
## How reproduce results shown in the paper
|
## How reproduce results shown in the paper
|
||||||
|
|||||||
2
build/.gitignore
vendored
2
build/.gitignore
vendored
@@ -1,4 +1,4 @@
|
|||||||
# Ignore everything in this directory
|
# Ignore everything in this directory
|
||||||
*
|
*
|
||||||
# Except this file
|
# Except this file
|
||||||
!.gitignore
|
!.gitignore
|
||||||
107
cmake_modules/FindEigen3.cmake
Normal file
107
cmake_modules/FindEigen3.cmake
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
# - Try to find Eigen3 lib
|
||||||
|
#
|
||||||
|
# This module supports requiring a minimum version, e.g. you can do
|
||||||
|
# find_package(Eigen3 3.1.2)
|
||||||
|
# to require version 3.1.2 or newer of Eigen3.
|
||||||
|
#
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# EIGEN3_FOUND - system has eigen lib with correct version
|
||||||
|
# EIGEN3_INCLUDE_DIR - the eigen include directory
|
||||||
|
# EIGEN3_VERSION - eigen version
|
||||||
|
#
|
||||||
|
# and the following imported target:
|
||||||
|
#
|
||||||
|
# Eigen3::Eigen - The header-only Eigen library
|
||||||
|
#
|
||||||
|
# This module reads hints about search locations from
|
||||||
|
# the following environment variables:
|
||||||
|
#
|
||||||
|
# EIGEN3_ROOT
|
||||||
|
# EIGEN3_ROOT_DIR
|
||||||
|
|
||||||
|
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
|
||||||
|
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
|
||||||
|
# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
|
||||||
|
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
|
||||||
|
|
||||||
|
if(NOT Eigen3_FIND_VERSION)
|
||||||
|
if(NOT Eigen3_FIND_VERSION_MAJOR)
|
||||||
|
set(Eigen3_FIND_VERSION_MAJOR 2)
|
||||||
|
endif()
|
||||||
|
if(NOT Eigen3_FIND_VERSION_MINOR)
|
||||||
|
set(Eigen3_FIND_VERSION_MINOR 91)
|
||||||
|
endif()
|
||||||
|
if(NOT Eigen3_FIND_VERSION_PATCH)
|
||||||
|
set(Eigen3_FIND_VERSION_PATCH 0)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
macro(_eigen3_check_version)
|
||||||
|
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
|
||||||
|
|
||||||
|
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
|
||||||
|
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
|
||||||
|
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
|
||||||
|
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||||
|
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
|
||||||
|
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||||
|
|
||||||
|
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
|
||||||
|
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
|
||||||
|
set(EIGEN3_VERSION_OK FALSE)
|
||||||
|
else()
|
||||||
|
set(EIGEN3_VERSION_OK TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT EIGEN3_VERSION_OK)
|
||||||
|
|
||||||
|
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
|
||||||
|
"but at least version ${Eigen3_FIND_VERSION} is required")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
if (EIGEN3_INCLUDE_DIR)
|
||||||
|
|
||||||
|
# in cache already
|
||||||
|
_eigen3_check_version()
|
||||||
|
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
|
||||||
|
set(Eigen3_FOUND ${EIGEN3_VERSION_OK})
|
||||||
|
|
||||||
|
else ()
|
||||||
|
|
||||||
|
# search first if an Eigen3Config.cmake is available in the system,
|
||||||
|
# if successful this would set EIGEN3_INCLUDE_DIR and the rest of
|
||||||
|
# the script will work as usual
|
||||||
|
find_package(Eigen3 ${Eigen3_FIND_VERSION} NO_MODULE QUIET)
|
||||||
|
|
||||||
|
if(NOT EIGEN3_INCLUDE_DIR)
|
||||||
|
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
|
||||||
|
HINTS
|
||||||
|
ENV EIGEN3_ROOT
|
||||||
|
ENV EIGEN3_ROOT_DIR
|
||||||
|
PATHS
|
||||||
|
${CMAKE_INSTALL_PREFIX}/include
|
||||||
|
${KDE4_INCLUDE_DIR}
|
||||||
|
PATH_SUFFIXES eigen3 eigen
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(EIGEN3_INCLUDE_DIR)
|
||||||
|
_eigen3_check_version()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
|
||||||
|
|
||||||
|
mark_as_advanced(EIGEN3_INCLUDE_DIR)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(EIGEN3_FOUND AND NOT TARGET Eigen3::Eigen)
|
||||||
|
add_library(Eigen3::Eigen INTERFACE IMPORTED)
|
||||||
|
set_target_properties(Eigen3::Eigen PROPERTIES
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_INCLUDE_DIR}")
|
||||||
|
endif()
|
||||||
@@ -12,6 +12,7 @@ find_path(ORB_SLAM_INCLUDE_DIR NAMES System.h PATHS $ENV{ORB_SLAM_ROOT_DIR}/incl
|
|||||||
find_library(ORB_SLAM2_LIBRARY NAMES ORB_SLAM2 PATHS $ENV{ORB_SLAM_ROOT_DIR}/lib)
|
find_library(ORB_SLAM2_LIBRARY NAMES ORB_SLAM2 PATHS $ENV{ORB_SLAM_ROOT_DIR}/lib)
|
||||||
find_library(ORB_SLAM3_LIBRARY NAMES ORB_SLAM3 PATHS $ENV{ORB_SLAM_ROOT_DIR}/lib)
|
find_library(ORB_SLAM3_LIBRARY NAMES ORB_SLAM3 PATHS $ENV{ORB_SLAM_ROOT_DIR}/lib)
|
||||||
find_path(g2o_INCLUDE_DIR NAMES g2o/core/sparse_optimizer.h PATHS $ENV{ORB_SLAM_ROOT_DIR}/Thirdparty/g2o NO_DEFAULT_PATH)
|
find_path(g2o_INCLUDE_DIR NAMES g2o/core/sparse_optimizer.h PATHS $ENV{ORB_SLAM_ROOT_DIR}/Thirdparty/g2o NO_DEFAULT_PATH)
|
||||||
|
find_path(sophus_INCLUDE_DIR NAMES sophus/se3.hpp PATHS $ENV{ORB_SLAM_ROOT_DIR}/Thirdparty/Sophus NO_DEFAULT_PATH)
|
||||||
find_library(g2o_LIBRARY NAMES g2o PATHS $ENV{ORB_SLAM_ROOT_DIR}/Thirdparty/g2o/lib NO_DEFAULT_PATH)
|
find_library(g2o_LIBRARY NAMES g2o PATHS $ENV{ORB_SLAM_ROOT_DIR}/Thirdparty/g2o/lib NO_DEFAULT_PATH)
|
||||||
find_library(DBoW2_LIBRARY NAMES DBoW2 PATHS $ENV{ORB_SLAM_ROOT_DIR}/Thirdparty/DBoW2/lib NO_DEFAULT_PATH)
|
find_library(DBoW2_LIBRARY NAMES DBoW2 PATHS $ENV{ORB_SLAM_ROOT_DIR}/Thirdparty/DBoW2/lib NO_DEFAULT_PATH)
|
||||||
|
|
||||||
@@ -21,6 +22,9 @@ IF(ORB_SLAM2_LIBRARY)
|
|||||||
ELSEIF(ORB_SLAM3_LIBRARY)
|
ELSEIF(ORB_SLAM3_LIBRARY)
|
||||||
SET(ORB_SLAM_VERSION 3)
|
SET(ORB_SLAM_VERSION 3)
|
||||||
SET(ORB_SLAM_LIBRARY ${ORB_SLAM3_LIBRARY})
|
SET(ORB_SLAM_LIBRARY ${ORB_SLAM3_LIBRARY})
|
||||||
|
IF(g2o_INCLUDE_DIR AND sophus_INCLUDE_DIR) # ORB_SLAM3 v1
|
||||||
|
SET(g2o_INCLUDE_DIR ${g2o_INCLUDE_DIR} ${sophus_INCLUDE_DIR})
|
||||||
|
ENDIF(g2o_INCLUDE_DIR AND sophus_INCLUDE_DIR)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF (ORB_SLAM_INCLUDE_DIR AND ORB_SLAM_LIBRARY AND DBoW2_LIBRARY AND g2o_INCLUDE_DIR AND g2o_LIBRARY)
|
IF (ORB_SLAM_INCLUDE_DIR AND ORB_SLAM_LIBRARY AND DBoW2_LIBRARY AND g2o_INCLUDE_DIR AND g2o_LIBRARY)
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
# - Find Sqlite3
|
|
||||||
# This module finds an installed Sqlite3 package.
|
|
||||||
#
|
|
||||||
# It sets the following variables:
|
|
||||||
# Sqlite3_FOUND - Set to false, or undefined, if Sqlite3 isn't found.
|
|
||||||
# Sqlite3_INCLUDE_DIR - The Sqlite3 include directory.
|
|
||||||
# Sqlite3_LIBRARY - The Sqlite3 library to link against.
|
|
||||||
|
|
||||||
FIND_PATH(Sqlite3_INCLUDE_DIR sqlite3.h PATHS $ENV{Sqlite3_ROOT_DIR}/include $ENV{Sqlite3_ROOT_DIR})
|
|
||||||
|
|
||||||
FIND_LIBRARY(Sqlite3_LIBRARY NAMES sqlite3 PATHS $ENV{Sqlite3_ROOT_DIR}/lib $ENV{Sqlite3_ROOT_DIR})
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
IF (Sqlite3_FOUND)
|
|
||||||
# show which Sqlite3 was found only if not quiet
|
|
||||||
IF (NOT Sqlite3_FIND_QUIETLY)
|
|
||||||
MESSAGE(STATUS "Found Sqlite3: ${Sqlite3_INCLUDE_DIRS} ${Sqlite3_LIBRARIES}")
|
|
||||||
ENDIF (NOT Sqlite3_FIND_QUIETLY)
|
|
||||||
ELSE (Sqlite3_FOUND)
|
|
||||||
# fatal error if Sqlite3 is required but not found
|
|
||||||
IF (Sqlite3_FIND_REQUIRED)
|
|
||||||
MESSAGE(FATAL_ERROR "Could not find Sqlite3")
|
|
||||||
ENDIF (Sqlite3_FIND_REQUIRED)
|
|
||||||
ENDIF (Sqlite3_FOUND)
|
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ ENDIF (ZEDOC_INCLUDE_DIR AND ZEDOC_LIBRARY)
|
|||||||
|
|
||||||
IF (ZEDOC_FOUND)
|
IF (ZEDOC_FOUND)
|
||||||
# show which ZEDOC was found only if not quiet
|
# show which ZEDOC was found only if not quiet
|
||||||
IF (NOT _FIND_QUIETLY)
|
IF (NOT ZEDOC_FIND_QUIETLY)
|
||||||
MESSAGE(STATUS "Found ZEDOC: ${ZEDOC_LIBRARIES}")
|
MESSAGE(STATUS "Found ZEDOC: ${ZEDOC_LIBRARIES}")
|
||||||
ENDIF (NOT ZEDOC_FIND_QUIETLY)
|
ENDIF (NOT ZEDOC_FIND_QUIETLY)
|
||||||
ELSE (ZEDOC_FOUND)
|
ELSE (ZEDOC_FOUND)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef BAYESFILTER_H_
|
#ifndef BAYESFILTER_H_
|
||||||
#define BAYESFILTER_H_
|
#define BAYESFILTER_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <opencv2/core/core.hpp>
|
#include <opencv2/core/core.hpp>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -41,7 +41,7 @@ namespace rtabmap {
|
|||||||
class Memory;
|
class Memory;
|
||||||
class Signature;
|
class Signature;
|
||||||
|
|
||||||
class RTABMAP_EXP BayesFilter
|
class RTABMAP_CORE_EXPORT BayesFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BayesFilter(const ParametersMap & parameters = ParametersMap());
|
BayesFilter(const ParametersMap & parameters = ParametersMap());
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
Copyright (c) 2010-2022, 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
|
||||||
@@ -27,48 +27,33 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
#include <rtabmap/core/SensorCapture.h>
|
||||||
#include <opencv2/highgui/highgui.hpp>
|
#include <rtabmap/core/IMU.h>
|
||||||
#include "rtabmap/core/SensorData.h"
|
|
||||||
#include "rtabmap/core/CameraInfo.h"
|
|
||||||
#include <set>
|
|
||||||
#include <stack>
|
|
||||||
#include <list>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
class UDirectory;
|
|
||||||
class UTimer;
|
|
||||||
|
|
||||||
namespace rtabmap
|
namespace rtabmap
|
||||||
{
|
{
|
||||||
|
|
||||||
|
class IMUFilter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Camera
|
* Class Camera
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class RTABMAP_EXP Camera
|
class RTABMAP_CORE_EXPORT Camera : public SensorCapture
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Camera();
|
virtual ~Camera();
|
||||||
SensorData takeImage(CameraInfo * info = 0);
|
|
||||||
|
SensorData takeImage(SensorCaptureInfo * info = 0) {return takeData(info);}
|
||||||
|
float getImageRate() const {return getFrameRate();}
|
||||||
|
void setImageRate(float imageRate) {setFrameRate(imageRate);}
|
||||||
|
void setInterIMUPublishing(bool enabled, IMUFilter * filter = 0); // Take ownership of filter
|
||||||
|
bool isInterIMUPublishing() const {return publishInterIMU_;}
|
||||||
|
|
||||||
bool initFromFile(const std::string & calibrationPath);
|
bool initFromFile(const std::string & calibrationPath);
|
||||||
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "") = 0;
|
|
||||||
virtual bool isCalibrated() const = 0;
|
virtual bool isCalibrated() const = 0;
|
||||||
virtual std::string getSerial() const = 0;
|
|
||||||
virtual bool odomProvided() const { return false; }
|
|
||||||
virtual bool getPose(double stamp, Transform & pose, cv::Mat & covariance) { return false; }
|
|
||||||
|
|
||||||
//getters
|
|
||||||
float getImageRate() const {return _imageRate;}
|
|
||||||
const Transform & getLocalTransform() const {return _localTransform;}
|
|
||||||
|
|
||||||
//setters
|
|
||||||
void setImageRate(float imageRate) {_imageRate = imageRate;}
|
|
||||||
void setLocalTransform(const Transform & localTransform) {_localTransform= localTransform;}
|
|
||||||
|
|
||||||
void resetTimer();
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@@ -78,19 +63,16 @@ protected:
|
|||||||
*/
|
*/
|
||||||
Camera(float imageRate = 0, const Transform & localTransform = Transform::getIdentity());
|
Camera(float imageRate = 0, const Transform & localTransform = Transform::getIdentity());
|
||||||
|
|
||||||
/**
|
virtual SensorData captureImage(SensorCaptureInfo * info = 0) = 0;
|
||||||
* returned rgb and depth images should be already rectified if calibration was loaded
|
|
||||||
*/
|
|
||||||
virtual SensorData captureImage(CameraInfo * info = 0) = 0;
|
|
||||||
|
|
||||||
int getNextSeqID() {return ++_seq;}
|
void postInterIMU(const IMU & imu, double stamp);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float _imageRate;
|
virtual SensorData captureData(SensorCaptureInfo * info = 0) {return captureImage(info);}
|
||||||
Transform _localTransform;
|
|
||||||
cv::Size _targetImageSize;
|
private:
|
||||||
UTimer * _frameRateTimer;
|
IMUFilter * imuFilter_;
|
||||||
int _seq;
|
bool publishInterIMU_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,65 +27,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <rtabmap/utilite/UEvent.h>
|
#include "rtabmap/core/SensorEvent.h"
|
||||||
#include "rtabmap/core/SensorData.h"
|
|
||||||
#include "rtabmap/core/CameraInfo.h"
|
|
||||||
|
|
||||||
namespace rtabmap
|
|
||||||
{
|
|
||||||
|
|
||||||
class CameraEvent :
|
|
||||||
public UEvent
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
enum Code {
|
|
||||||
kCodeData,
|
|
||||||
kCodeNoMoreImages
|
|
||||||
};
|
|
||||||
|
|
||||||
public:
|
|
||||||
CameraEvent(const cv::Mat & image, int seq=0, double stamp = 0.0, const std::string & cameraName = std::string()) :
|
|
||||||
UEvent(kCodeData),
|
|
||||||
data_(image, seq, stamp)
|
|
||||||
{
|
|
||||||
cameraInfo_.cameraName = cameraName;
|
|
||||||
}
|
|
||||||
|
|
||||||
CameraEvent() :
|
|
||||||
UEvent(kCodeNoMoreImages)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
CameraEvent(const SensorData & data) :
|
|
||||||
UEvent(kCodeData),
|
|
||||||
data_(data)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
CameraEvent(const SensorData & data, const std::string & cameraName) :
|
|
||||||
UEvent(kCodeData),
|
|
||||||
data_(data)
|
|
||||||
{
|
|
||||||
cameraInfo_.cameraName = cameraName;
|
|
||||||
}
|
|
||||||
CameraEvent(const SensorData & data, const CameraInfo & cameraInfo) :
|
|
||||||
UEvent(kCodeData),
|
|
||||||
data_(data),
|
|
||||||
cameraInfo_(cameraInfo)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// Image or descriptors
|
|
||||||
const SensorData & data() const {return data_;}
|
|
||||||
const std::string & cameraName() const {return cameraInfo_.cameraName;}
|
|
||||||
const CameraInfo & info() const {return cameraInfo_;}
|
|
||||||
|
|
||||||
virtual ~CameraEvent() {}
|
|
||||||
virtual std::string getClassName() const {return std::string("CameraEvent");}
|
|
||||||
|
|
||||||
private:
|
|
||||||
SensorData data_;
|
|
||||||
CameraInfo cameraInfo_;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace rtabmap
|
|
||||||
|
|||||||
@@ -27,48 +27,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include "rtabmap/core/SensorCaptureInfo.h"
|
||||||
|
|
||||||
namespace rtabmap
|
|
||||||
{
|
|
||||||
|
|
||||||
class CameraInfo
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
CameraInfo() :
|
|
||||||
cameraName(""),
|
|
||||||
id(0),
|
|
||||||
stamp(0.0),
|
|
||||||
timeCapture(0.0f),
|
|
||||||
timeDisparity(0.0f),
|
|
||||||
timeMirroring(0.0f),
|
|
||||||
timeStereoExposureCompensation(0.0f),
|
|
||||||
timeImageDecimation(0.0f),
|
|
||||||
timeScanFromDepth(0.0f),
|
|
||||||
timeUndistortDepth(0.0f),
|
|
||||||
timeBilateralFiltering(0.0f),
|
|
||||||
timeTotal(0.0f),
|
|
||||||
odomCovariance(cv::Mat::eye(6,6,CV_64FC1))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
virtual ~CameraInfo() {}
|
|
||||||
|
|
||||||
std::string cameraName;
|
|
||||||
int id;
|
|
||||||
double stamp;
|
|
||||||
float timeCapture;
|
|
||||||
float timeDisparity;
|
|
||||||
float timeMirroring;
|
|
||||||
float timeStereoExposureCompensation;
|
|
||||||
float timeImageDecimation;
|
|
||||||
float timeScanFromDepth;
|
|
||||||
float timeUndistortDepth;
|
|
||||||
float timeBilateralFiltering;
|
|
||||||
float timeTotal;
|
|
||||||
Transform odomPose;
|
|
||||||
cv::Mat odomCovariance;
|
|
||||||
std::vector<float> odomVelocity;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace rtabmap
|
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#include <opencv2/opencv.hpp>
|
#include <opencv2/opencv.hpp>
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
#include "rtabmap/core/Transform.h"
|
#include "rtabmap/core/Transform.h"
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
class RTABMAP_EXP CameraModel
|
class RTABMAP_CORE_EXPORT CameraModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
@@ -159,7 +159,7 @@ private:
|
|||||||
Transform localTransform_;
|
Transform localTransform_;
|
||||||
};
|
};
|
||||||
|
|
||||||
RTABMAP_EXP std::ostream& operator<<(std::ostream& os, const CameraModel& model);
|
RTABMAP_CORE_EXPORT std::ostream& operator<<(std::ostream& os, const CameraModel& model);
|
||||||
|
|
||||||
} /* namespace rtabmap */
|
} /* namespace rtabmap */
|
||||||
#endif /* CAMERAMODEL_H_ */
|
#endif /* CAMERAMODEL_H_ */
|
||||||
|
|||||||
@@ -37,4 +37,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <rtabmap/core/camera/CameraRealSense2.h>
|
#include <rtabmap/core/camera/CameraRealSense2.h>
|
||||||
#include <rtabmap/core/camera/CameraRGBDImages.h>
|
#include <rtabmap/core/camera/CameraRGBDImages.h>
|
||||||
#include <rtabmap/core/camera/CameraK4A.h>
|
#include <rtabmap/core/camera/CameraK4A.h>
|
||||||
|
#include <rtabmap/core/camera/CameraSeerSense.h>
|
||||||
|
|||||||
@@ -27,128 +27,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/SensorCaptureThread.h"
|
||||||
|
|
||||||
#include <rtabmap/core/Parameters.h>
|
|
||||||
#include <rtabmap/core/Transform.h>
|
|
||||||
#include <rtabmap/utilite/UThread.h>
|
|
||||||
#include <rtabmap/utilite/UEventsSender.h>
|
|
||||||
|
|
||||||
namespace clams
|
|
||||||
{
|
|
||||||
class DiscreteDepthDistortionModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace rtabmap
|
|
||||||
{
|
|
||||||
|
|
||||||
class Camera;
|
|
||||||
class CameraInfo;
|
|
||||||
class SensorData;
|
|
||||||
class StereoDense;
|
|
||||||
class IMUFilter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class CameraThread
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class RTABMAP_EXP CameraThread :
|
|
||||||
public UThread,
|
|
||||||
public UEventsSender
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// ownership transferred
|
|
||||||
CameraThread(Camera * camera, const ParametersMap & parameters = ParametersMap());
|
|
||||||
/**
|
|
||||||
* @param camera the camera to take images from
|
|
||||||
* @param odomSensor an odometry sensor to get a pose
|
|
||||||
* @param extrinsics the static transform between odometry sensor's left lens frame to camera's left lens frame
|
|
||||||
*/
|
|
||||||
CameraThread(Camera * camera,
|
|
||||||
Camera * odomSensor,
|
|
||||||
const Transform & extrinsics,
|
|
||||||
double poseTimeOffset = 0.0,
|
|
||||||
float poseScaleFactor = 1.0f,
|
|
||||||
bool odomAsGt = false,
|
|
||||||
const ParametersMap & parameters = ParametersMap());
|
|
||||||
CameraThread(Camera * camera,
|
|
||||||
bool odomAsGt,
|
|
||||||
const ParametersMap & parameters = ParametersMap());
|
|
||||||
virtual ~CameraThread();
|
|
||||||
|
|
||||||
void setMirroringEnabled(bool enabled) {_mirroring = enabled;}
|
|
||||||
void setStereoExposureCompensation(bool enabled) {_stereoExposureCompensation = enabled;}
|
|
||||||
void setColorOnly(bool colorOnly) {_colorOnly = colorOnly;}
|
|
||||||
void setImageDecimation(int decimation) {_imageDecimation = decimation;}
|
|
||||||
void setStereoToDepth(bool enabled) {_stereoToDepth = enabled;}
|
|
||||||
void setImageRate(float imageRate);
|
|
||||||
void setDistortionModel(const std::string & path);
|
|
||||||
void enableBilateralFiltering(float sigmaS, float sigmaR);
|
|
||||||
void disableBilateralFiltering() {_bilateralFiltering = false;}
|
|
||||||
void enableIMUFiltering(int filteringStrategy=1, const ParametersMap & parameters = ParametersMap(), bool baseFrameConversion = false);
|
|
||||||
void disableIMUFiltering();
|
|
||||||
|
|
||||||
RTABMAP_DEPRECATED(void setScanParameters(
|
|
||||||
bool fromDepth,
|
|
||||||
int downsampleStep, // decimation of the depth image in case the scan is from depth image
|
|
||||||
float rangeMin,
|
|
||||||
float rangeMax,
|
|
||||||
float voxelSize,
|
|
||||||
int normalsK,
|
|
||||||
int normalsRadius,
|
|
||||||
bool forceGroundNormalsUp) , "Use new version of this function with groundNormalsUp=0.8 for forceGroundNormalsUp=True and groundNormalsUp=0.0 for forceGroundNormalsUp=False.");
|
|
||||||
void setScanParameters(
|
|
||||||
bool fromDepth,
|
|
||||||
int downsampleStep=1, // decimation of the depth image in case the scan is from depth image
|
|
||||||
float rangeMin=0.0f,
|
|
||||||
float rangeMax=0.0f,
|
|
||||||
float voxelSize = 0.0f,
|
|
||||||
int normalsK = 0,
|
|
||||||
int normalsRadius = 0.0f,
|
|
||||||
float groundNormalsUp = 0.0f);
|
|
||||||
|
|
||||||
void postUpdate(SensorData * data, CameraInfo * info = 0) const;
|
|
||||||
|
|
||||||
//getters
|
|
||||||
bool isPaused() const {return !this->isRunning();}
|
|
||||||
bool isCapturing() const {return this->isRunning();}
|
|
||||||
bool odomProvided() const;
|
|
||||||
|
|
||||||
Camera * camera() {return _camera;} // return null if not set, valid until CameraThread is deleted
|
|
||||||
Camera * odomSensor() {return _odomSensor;} // return null if not set, valid until CameraThread is deleted
|
|
||||||
|
|
||||||
private:
|
|
||||||
virtual void mainLoopBegin();
|
|
||||||
virtual void mainLoop();
|
|
||||||
virtual void mainLoopKill();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Camera * _camera;
|
|
||||||
Camera * _odomSensor;
|
|
||||||
Transform _extrinsicsOdomToCamera;
|
|
||||||
bool _odomAsGt;
|
|
||||||
double _poseTimeOffset;
|
|
||||||
float _poseScaleFactor;
|
|
||||||
bool _mirroring;
|
|
||||||
bool _stereoExposureCompensation;
|
|
||||||
bool _colorOnly;
|
|
||||||
int _imageDecimation;
|
|
||||||
bool _stereoToDepth;
|
|
||||||
bool _scanFromDepth;
|
|
||||||
int _scanDownsampleStep;
|
|
||||||
float _scanRangeMin;
|
|
||||||
float _scanRangeMax;
|
|
||||||
float _scanVoxelSize;
|
|
||||||
int _scanNormalsK;
|
|
||||||
float _scanNormalsRadius;
|
|
||||||
float _scanForceGroundNormalsUp;
|
|
||||||
StereoDense * _stereoDense;
|
|
||||||
clams::DiscreteDepthDistortionModel * _distortionModel;
|
|
||||||
bool _bilateralFiltering;
|
|
||||||
float _bilateralSigmaS;
|
|
||||||
float _bilateralSigmaR;
|
|
||||||
IMUFilter * _imuFilter;
|
|
||||||
bool _imuBaseFrameConversion;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace rtabmap
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef COMPRESSION_H_
|
#ifndef COMPRESSION_H_
|
||||||
#define COMPRESSION_H_
|
#define COMPRESSION_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <rtabmap/utilite/UThread.h>
|
#include <rtabmap/utilite/UThread.h>
|
||||||
#include <opencv2/opencv.hpp>
|
#include <opencv2/opencv.hpp>
|
||||||
@@ -52,7 +52,7 @@ namespace rtabmap {
|
|||||||
* ct.join();
|
* ct.join();
|
||||||
* cv::Mat image = ct.getUncompressedData();
|
* cv::Mat image = ct.getUncompressedData();
|
||||||
*/
|
*/
|
||||||
class RTABMAP_EXP CompressionThread : public UThread
|
class RTABMAP_CORE_EXPORT CompressionThread : public UThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// format : ".png" ".jpg" "" (empty is general)
|
// format : ".png" ".jpg" "" (empty is general)
|
||||||
@@ -70,21 +70,21 @@ private:
|
|||||||
bool compressMode_;
|
bool compressMode_;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<unsigned char> RTABMAP_EXP compressImage(const cv::Mat & image, const std::string & format = ".png");
|
std::vector<unsigned char> RTABMAP_CORE_EXPORT compressImage(const cv::Mat & image, const std::string & format = ".png");
|
||||||
cv::Mat RTABMAP_EXP compressImage2(const cv::Mat & image, const std::string & format = ".png");
|
cv::Mat RTABMAP_CORE_EXPORT compressImage2(const cv::Mat & image, const std::string & format = ".png");
|
||||||
|
|
||||||
cv::Mat RTABMAP_EXP uncompressImage(const cv::Mat & bytes);
|
cv::Mat RTABMAP_CORE_EXPORT uncompressImage(const cv::Mat & bytes);
|
||||||
cv::Mat RTABMAP_EXP uncompressImage(const std::vector<unsigned char> & bytes);
|
cv::Mat RTABMAP_CORE_EXPORT uncompressImage(const std::vector<unsigned char> & bytes);
|
||||||
|
|
||||||
std::vector<unsigned char> RTABMAP_EXP compressData(const cv::Mat & data);
|
std::vector<unsigned char> RTABMAP_CORE_EXPORT compressData(const cv::Mat & data);
|
||||||
cv::Mat RTABMAP_EXP compressData2(const cv::Mat & data);
|
cv::Mat RTABMAP_CORE_EXPORT compressData2(const cv::Mat & data);
|
||||||
|
|
||||||
cv::Mat RTABMAP_EXP uncompressData(const cv::Mat & bytes);
|
cv::Mat RTABMAP_CORE_EXPORT uncompressData(const cv::Mat & bytes);
|
||||||
cv::Mat RTABMAP_EXP uncompressData(const std::vector<unsigned char> & bytes);
|
cv::Mat RTABMAP_CORE_EXPORT uncompressData(const std::vector<unsigned char> & bytes);
|
||||||
cv::Mat RTABMAP_EXP uncompressData(const unsigned char * bytes, unsigned long size);
|
cv::Mat RTABMAP_CORE_EXPORT uncompressData(const unsigned char * bytes, unsigned long size);
|
||||||
|
|
||||||
cv::Mat RTABMAP_EXP compressString(const std::string & str);
|
cv::Mat RTABMAP_CORE_EXPORT compressString(const std::string & str);
|
||||||
std::string RTABMAP_EXP uncompressString(const cv::Mat & bytes);
|
std::string RTABMAP_CORE_EXPORT uncompressString(const cv::Mat & bytes);
|
||||||
|
|
||||||
} /* namespace rtabmap */
|
} /* namespace rtabmap */
|
||||||
#endif /* COMPRESSION_H_ */
|
#endif /* COMPRESSION_H_ */
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef DBDRIVER_H_
|
#ifndef DBDRIVER_H_
|
||||||
#define DBDRIVER_H_
|
#define DBDRIVER_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -59,7 +59,7 @@ class VisualWord;
|
|||||||
//but never, never try to use the same connection simultaneously in
|
//but never, never try to use the same connection simultaneously in
|
||||||
//two or more threads."
|
//two or more threads."
|
||||||
//
|
//
|
||||||
class RTABMAP_EXP DBDriver : public UThreadNode
|
class RTABMAP_CORE_EXPORT DBDriver : public UThreadNode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static DBDriver * create(const ParametersMap & parameters = ParametersMap());
|
static DBDriver * create(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -96,6 +96,10 @@ public:
|
|||||||
const cv::Mat & empty,
|
const cv::Mat & empty,
|
||||||
float cellSize,
|
float cellSize,
|
||||||
const cv::Point3f & viewpoint);
|
const cv::Point3f & viewpoint);
|
||||||
|
void updateCalibration(
|
||||||
|
int nodeId,
|
||||||
|
const std::vector<CameraModel> & models,
|
||||||
|
const std::vector<StereoCameraModel> & stereoModels);
|
||||||
void updateDepthImage(int nodeId, const cv::Mat & image);
|
void updateDepthImage(int nodeId, const cv::Mat & image);
|
||||||
void updateLaserScan(int nodeId, const LaserScan & scan);
|
void updateLaserScan(int nodeId, const LaserScan & scan);
|
||||||
|
|
||||||
@@ -231,6 +235,11 @@ protected:
|
|||||||
float cellSize,
|
float cellSize,
|
||||||
const cv::Point3f & viewpoint) const = 0;
|
const cv::Point3f & viewpoint) const = 0;
|
||||||
|
|
||||||
|
virtual void updateCalibrationQuery(
|
||||||
|
int nodeId,
|
||||||
|
const std::vector<CameraModel> & models,
|
||||||
|
const std::vector<StereoCameraModel> & stereoModels) const = 0;
|
||||||
|
|
||||||
virtual void updateDepthImageQuery(
|
virtual void updateDepthImageQuery(
|
||||||
int nodeId,
|
int nodeId,
|
||||||
const cv::Mat & image) const = 0;
|
const cv::Mat & image) const = 0;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef DBDRIVERSQLITE3_H_
|
#ifndef DBDRIVERSQLITE3_H_
|
||||||
#define DBDRIVERSQLITE3_H_
|
#define DBDRIVERSQLITE3_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.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>
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ typedef struct sqlite3 sqlite3;
|
|||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
class RTABMAP_EXP DBDriverSqlite3: public DBDriver {
|
class RTABMAP_CORE_EXPORT DBDriverSqlite3: public DBDriver {
|
||||||
public:
|
public:
|
||||||
DBDriverSqlite3(const ParametersMap & parameters = ParametersMap());
|
DBDriverSqlite3(const ParametersMap & parameters = ParametersMap());
|
||||||
virtual ~DBDriverSqlite3();
|
virtual ~DBDriverSqlite3();
|
||||||
@@ -96,6 +96,11 @@ protected:
|
|||||||
float cellSize,
|
float cellSize,
|
||||||
const cv::Point3f & viewpoint) const;
|
const cv::Point3f & viewpoint) const;
|
||||||
|
|
||||||
|
virtual void updateCalibrationQuery(
|
||||||
|
int nodeId,
|
||||||
|
const std::vector<CameraModel> & models,
|
||||||
|
const std::vector<StereoCameraModel> & stereoModels) const;
|
||||||
|
|
||||||
virtual void updateDepthImageQuery(
|
virtual void updateDepthImageQuery(
|
||||||
int nodeId,
|
int nodeId,
|
||||||
const cv::Mat & image) const;
|
const cv::Mat & image) const;
|
||||||
@@ -153,6 +158,7 @@ private:
|
|||||||
std::string queryStepNode() const;
|
std::string queryStepNode() const;
|
||||||
std::string queryStepImage() const;
|
std::string queryStepImage() const;
|
||||||
std::string queryStepDepth() const;
|
std::string queryStepDepth() const;
|
||||||
|
std::string queryStepCalibrationUpdate() const;
|
||||||
std::string queryStepDepthUpdate() const;
|
std::string queryStepDepthUpdate() const;
|
||||||
std::string queryStepScanUpdate() const;
|
std::string queryStepScanUpdate() const;
|
||||||
std::string queryStepSensorData() const;
|
std::string queryStepSensorData() const;
|
||||||
@@ -165,6 +171,7 @@ private:
|
|||||||
void stepNode(sqlite3_stmt * ppStmt, const Signature * s) const;
|
void stepNode(sqlite3_stmt * ppStmt, const Signature * s) const;
|
||||||
void stepImage(sqlite3_stmt * ppStmt, int id, const cv::Mat & imageBytes) const;
|
void stepImage(sqlite3_stmt * ppStmt, int id, const cv::Mat & imageBytes) const;
|
||||||
void stepDepth(sqlite3_stmt * ppStmt, const SensorData & sensorData) const;
|
void stepDepth(sqlite3_stmt * ppStmt, const SensorData & sensorData) const;
|
||||||
|
void stepCalibrationUpdate(sqlite3_stmt * ppStmt, int nodeId, const std::vector<CameraModel> & models, const std::vector<StereoCameraModel> & stereoModels) const;
|
||||||
void stepDepthUpdate(sqlite3_stmt * ppStmt, int nodeId, const cv::Mat & imageCompressed) const;
|
void stepDepthUpdate(sqlite3_stmt * ppStmt, int nodeId, const cv::Mat & imageCompressed) const;
|
||||||
void stepScanUpdate(sqlite3_stmt * ppStmt, int nodeId, const LaserScan & image) const;
|
void stepScanUpdate(sqlite3_stmt * ppStmt, int nodeId, const LaserScan & image) const;
|
||||||
void stepSensorData(sqlite3_stmt * ppStmt, const SensorData & sensorData) const;
|
void stepSensorData(sqlite3_stmt * ppStmt, const SensorData & sensorData) const;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef DBREADER_H_
|
#ifndef DBREADER_H_
|
||||||
#define DBREADER_H_
|
#define DBREADER_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <rtabmap/utilite/UTimer.h>
|
#include <rtabmap/utilite/UTimer.h>
|
||||||
#include <rtabmap/core/Transform.h>
|
#include <rtabmap/core/Transform.h>
|
||||||
@@ -43,7 +43,7 @@ namespace rtabmap {
|
|||||||
|
|
||||||
class DBDriver;
|
class DBDriver;
|
||||||
|
|
||||||
class RTABMAP_EXP DBReader : public Camera {
|
class RTABMAP_CORE_EXPORT DBReader : public Camera {
|
||||||
public:
|
public:
|
||||||
DBReader(const std::string & databasePath,
|
DBReader(const std::string & databasePath,
|
||||||
float frameRate = 0.0f, // -1 = use Database stamps, 0 = inf
|
float frameRate = 0.0f, // -1 = use Database stamps, 0 = inf
|
||||||
@@ -55,7 +55,10 @@ public:
|
|||||||
int stopId = 0,
|
int stopId = 0,
|
||||||
bool intermediateNodesIgnored = false,
|
bool intermediateNodesIgnored = false,
|
||||||
bool landmarksIgnored = false,
|
bool landmarksIgnored = false,
|
||||||
bool featuresIgnored = false);
|
bool featuresIgnored = false,
|
||||||
|
int startMapId = 0,
|
||||||
|
int stopMapId = -1,
|
||||||
|
bool priorsIgnored = false);
|
||||||
DBReader(const std::list<std::string> & databasePaths,
|
DBReader(const std::list<std::string> & databasePaths,
|
||||||
float frameRate = 0.0f, // -1 = use Database stamps, 0 = inf
|
float frameRate = 0.0f, // -1 = use Database stamps, 0 = inf
|
||||||
bool odometryIgnored = false,
|
bool odometryIgnored = false,
|
||||||
@@ -66,7 +69,10 @@ public:
|
|||||||
int stopId = 0,
|
int stopId = 0,
|
||||||
bool intermediateNodesIgnored = false,
|
bool intermediateNodesIgnored = false,
|
||||||
bool landmarksIgnored = false,
|
bool landmarksIgnored = false,
|
||||||
bool featuresIgnored = false);
|
bool featuresIgnored = false,
|
||||||
|
int startMapId = 0,
|
||||||
|
int stopMapId = -1,
|
||||||
|
bool priorsIgnored = false);
|
||||||
virtual ~DBReader();
|
virtual ~DBReader();
|
||||||
|
|
||||||
virtual bool init(
|
virtual bool init(
|
||||||
@@ -76,12 +82,15 @@ public:
|
|||||||
virtual bool isCalibrated() const;
|
virtual bool isCalibrated() const;
|
||||||
virtual std::string getSerial() const;
|
virtual std::string getSerial() const;
|
||||||
virtual bool odomProvided() const {return !_odometryIgnored;}
|
virtual bool odomProvided() const {return !_odometryIgnored;}
|
||||||
|
virtual bool getPose(double stamp, Transform & pose, cv::Mat & covariance, double maxWaitTime = 0.06);
|
||||||
|
|
||||||
|
const DBDriver * driver() const {return _dbDriver;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual SensorData captureImage(CameraInfo * info = 0);
|
virtual SensorData captureImage(SensorCaptureInfo * info = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SensorData getNextData(CameraInfo * info = 0);
|
SensorData getNextData(SensorCaptureInfo * info = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::list<std::string> _paths;
|
std::list<std::string> _paths;
|
||||||
@@ -94,6 +103,9 @@ private:
|
|||||||
bool _intermediateNodesIgnored;
|
bool _intermediateNodesIgnored;
|
||||||
bool _landmarksIgnored;
|
bool _landmarksIgnored;
|
||||||
bool _featuresIgnored;
|
bool _featuresIgnored;
|
||||||
|
bool _priorsIgnored;
|
||||||
|
int _startMapId;
|
||||||
|
int _stopMapId;
|
||||||
|
|
||||||
DBDriver * _dbDriver;
|
DBDriver * _dbDriver;
|
||||||
UTimer _timer;
|
UTimer _timer;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
#include "rtabmap/core/Parameters.h"
|
#include "rtabmap/core/Parameters.h"
|
||||||
#include "rtabmap/utilite/UStl.h"
|
#include "rtabmap/utilite/UStl.h"
|
||||||
#include <opencv2/core/core.hpp>
|
#include <opencv2/core/core.hpp>
|
||||||
@@ -42,7 +42,7 @@ namespace rtabmap
|
|||||||
|
|
||||||
class Signature;
|
class Signature;
|
||||||
|
|
||||||
class RTABMAP_EXP EpipolarGeometry
|
class RTABMAP_CORE_EXPORT EpipolarGeometry
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EpipolarGeometry(const ParametersMap & parameters = ParametersMap());
|
EpipolarGeometry(const ParametersMap & parameters = ParametersMap());
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef FEATURES2D_H_
|
#ifndef FEATURES2D_H_
|
||||||
#define FEATURES2D_H_
|
#define FEATURES2D_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <opencv2/highgui/highgui.hpp>
|
#include <opencv2/highgui/highgui.hpp>
|
||||||
#include <opencv2/core/core.hpp>
|
#include <opencv2/core/core.hpp>
|
||||||
@@ -103,7 +103,7 @@ class CV_ORB;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Feature2D
|
// Feature2D
|
||||||
class RTABMAP_EXP Feature2D {
|
class RTABMAP_CORE_EXPORT Feature2D {
|
||||||
public:
|
public:
|
||||||
enum Type {kFeatureUndef=-1,
|
enum Type {kFeatureUndef=-1,
|
||||||
kFeatureSurf=0,
|
kFeatureSurf=0,
|
||||||
@@ -192,16 +192,17 @@ public:
|
|||||||
const cv::Mat & disparity,
|
const cv::Mat & disparity,
|
||||||
float minDisparity);
|
float minDisparity);
|
||||||
|
|
||||||
static void limitKeypoints(std::vector<cv::KeyPoint> & keypoints, int maxKeypoints);
|
static void limitKeypoints(std::vector<cv::KeyPoint> & keypoints, int maxKeypoints, const cv::Size & imageSize = cv::Size(), bool ssc = false);
|
||||||
static void limitKeypoints(std::vector<cv::KeyPoint> & keypoints, cv::Mat & descriptors, int maxKeypoints);
|
static void limitKeypoints(std::vector<cv::KeyPoint> & keypoints, cv::Mat & descriptors, int maxKeypoints, const cv::Size & imageSize = cv::Size(), bool ssc = false);
|
||||||
static void limitKeypoints(std::vector<cv::KeyPoint> & keypoints, std::vector<cv::Point3f> & keypoints3D, cv::Mat & descriptors, int maxKeypoints);
|
static void limitKeypoints(std::vector<cv::KeyPoint> & keypoints, std::vector<cv::Point3f> & keypoints3D, cv::Mat & descriptors, int maxKeypoints, const cv::Size & imageSize = cv::Size(), bool ssc = false);
|
||||||
static void limitKeypoints(const std::vector<cv::KeyPoint> & keypoints, std::vector<bool> & inliers, int maxKeypoints);
|
static void limitKeypoints(const std::vector<cv::KeyPoint> & keypoints, std::vector<bool> & inliers, int maxKeypoints, const cv::Size & imageSize = cv::Size(), bool ssc = false);
|
||||||
static void limitKeypoints(const std::vector<cv::KeyPoint> & keypoints, std::vector<bool> & inliers, int maxKeypoints, const cv::Size & imageSize, int gridRows, int gridCols);
|
static void limitKeypoints(const std::vector<cv::KeyPoint> & keypoints, std::vector<bool> & inliers, int maxKeypoints, const cv::Size & imageSize, int gridRows, int gridCols, bool ssc = false);
|
||||||
|
|
||||||
static cv::Rect computeRoi(const cv::Mat & image, const std::string & roiRatios);
|
static cv::Rect computeRoi(const cv::Mat & image, const std::string & roiRatios);
|
||||||
static cv::Rect computeRoi(const cv::Mat & image, const std::vector<float> & roiRatios);
|
static cv::Rect computeRoi(const cv::Mat & image, const std::vector<float> & roiRatios);
|
||||||
|
|
||||||
int getMaxFeatures() const {return maxFeatures_;}
|
int getMaxFeatures() const {return maxFeatures_;}
|
||||||
|
bool getSSC() const {return SSC_;}
|
||||||
float getMinDepth() const {return _minDepth;}
|
float getMinDepth() const {return _minDepth;}
|
||||||
float getMaxDepth() const {return _maxDepth;}
|
float getMaxDepth() const {return _maxDepth;}
|
||||||
int getGridRows() const {return gridRows_;}
|
int getGridRows() const {return gridRows_;}
|
||||||
@@ -234,6 +235,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
ParametersMap parameters_;
|
ParametersMap parameters_;
|
||||||
int maxFeatures_;
|
int maxFeatures_;
|
||||||
|
bool SSC_;
|
||||||
float _maxDepth; // 0=inf
|
float _maxDepth; // 0=inf
|
||||||
float _minDepth;
|
float _minDepth;
|
||||||
std::vector<float> _roiRatios; // size 4
|
std::vector<float> _roiRatios; // size 4
|
||||||
@@ -247,7 +249,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//SURF
|
//SURF
|
||||||
class RTABMAP_EXP SURF : public Feature2D
|
class RTABMAP_CORE_EXPORT SURF : public Feature2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SURF(const ParametersMap & parameters = ParametersMap());
|
SURF(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -274,7 +276,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//SIFT
|
//SIFT
|
||||||
class RTABMAP_EXP SIFT : public Feature2D
|
class RTABMAP_CORE_EXPORT SIFT : public Feature2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SIFT(const ParametersMap & parameters = ParametersMap());
|
SIFT(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -298,7 +300,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//ORB
|
//ORB
|
||||||
class RTABMAP_EXP ORB : public Feature2D
|
class RTABMAP_CORE_EXPORT ORB : public Feature2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ORB(const ParametersMap & parameters = ParametersMap());
|
ORB(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -329,7 +331,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//FAST
|
//FAST
|
||||||
class RTABMAP_EXP FAST : public Feature2D
|
class RTABMAP_CORE_EXPORT FAST : public Feature2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FAST(const ParametersMap & parameters = ParametersMap());
|
FAST(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -365,7 +367,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//FAST_BRIEF
|
//FAST_BRIEF
|
||||||
class RTABMAP_EXP FAST_BRIEF : public FAST
|
class RTABMAP_CORE_EXPORT FAST_BRIEF : public FAST
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FAST_BRIEF(const ParametersMap & parameters = ParametersMap());
|
FAST_BRIEF(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -384,7 +386,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//FAST_FREAK
|
//FAST_FREAK
|
||||||
class RTABMAP_EXP FAST_FREAK : public FAST
|
class RTABMAP_CORE_EXPORT FAST_FREAK : public FAST
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FAST_FREAK(const ParametersMap & parameters = ParametersMap());
|
FAST_FREAK(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -406,7 +408,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//GFTT
|
//GFTT
|
||||||
class RTABMAP_EXP GFTT : public Feature2D
|
class RTABMAP_CORE_EXPORT GFTT : public Feature2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GFTT(const ParametersMap & parameters = ParametersMap());
|
GFTT(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -428,7 +430,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//GFTT_BRIEF
|
//GFTT_BRIEF
|
||||||
class RTABMAP_EXP GFTT_BRIEF : public GFTT
|
class RTABMAP_CORE_EXPORT GFTT_BRIEF : public GFTT
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GFTT_BRIEF(const ParametersMap & parameters = ParametersMap());
|
GFTT_BRIEF(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -447,7 +449,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//GFTT_FREAK
|
//GFTT_FREAK
|
||||||
class RTABMAP_EXP GFTT_FREAK : public GFTT
|
class RTABMAP_CORE_EXPORT GFTT_FREAK : public GFTT
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GFTT_FREAK(const ParametersMap & parameters = ParametersMap());
|
GFTT_FREAK(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -469,7 +471,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//SURF_FREAK
|
//SURF_FREAK
|
||||||
class RTABMAP_EXP SURF_FREAK : public SURF
|
class RTABMAP_CORE_EXPORT SURF_FREAK : public SURF
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SURF_FREAK(const ParametersMap & parameters = ParametersMap());
|
SURF_FREAK(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -491,7 +493,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//GFTT_ORB
|
//GFTT_ORB
|
||||||
class RTABMAP_EXP GFTT_ORB : public GFTT
|
class RTABMAP_CORE_EXPORT GFTT_ORB : public GFTT
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GFTT_ORB(const ParametersMap & parameters = ParametersMap());
|
GFTT_ORB(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -508,7 +510,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//BRISK
|
//BRISK
|
||||||
class RTABMAP_EXP BRISK : public Feature2D
|
class RTABMAP_CORE_EXPORT BRISK : public Feature2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BRISK(const ParametersMap & parameters = ParametersMap());
|
BRISK(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -530,7 +532,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//KAZE
|
//KAZE
|
||||||
class RTABMAP_EXP KAZE : public Feature2D
|
class RTABMAP_CORE_EXPORT KAZE : public Feature2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
KAZE(const ParametersMap & parameters = ParametersMap());
|
KAZE(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -557,7 +559,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//ORB OCTREE
|
//ORB OCTREE
|
||||||
class RTABMAP_EXP ORBOctree : public Feature2D
|
class RTABMAP_CORE_EXPORT ORBOctree : public Feature2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ORBOctree(const ParametersMap & parameters = ParametersMap());
|
ORBOctree(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -583,7 +585,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//SuperPointTorch
|
//SuperPointTorch
|
||||||
class RTABMAP_EXP SuperPointTorch : public Feature2D
|
class RTABMAP_CORE_EXPORT SuperPointTorch : public Feature2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SuperPointTorch(const ParametersMap & parameters = ParametersMap());
|
SuperPointTorch(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -606,7 +608,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//GFTT_DAISY
|
//GFTT_DAISY
|
||||||
class RTABMAP_EXP GFTT_DAISY : public GFTT
|
class RTABMAP_CORE_EXPORT GFTT_DAISY : public GFTT
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GFTT_DAISY(const ParametersMap & parameters = ParametersMap());
|
GFTT_DAISY(const ParametersMap & parameters = ParametersMap());
|
||||||
@@ -630,7 +632,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//SURF_DAISY
|
//SURF_DAISY
|
||||||
class RTABMAP_EXP SURF_DAISY : public SURF
|
class RTABMAP_CORE_EXPORT SURF_DAISY : public SURF
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SURF_DAISY(const ParametersMap & parameters = ParametersMap());
|
SURF_DAISY(const ParametersMap & parameters = ParametersMap());
|
||||||
|
|||||||
@@ -28,23 +28,23 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef CORELIB_SRC_FLANNINDEX_H_
|
#ifndef CORELIB_SRC_FLANNINDEX_H_
|
||||||
#define CORELIB_SRC_FLANNINDEX_H_
|
#define CORELIB_SRC_FLANNINDEX_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <opencv2/opencv.hpp>
|
#include <opencv2/opencv.hpp>
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
class RTABMAP_EXP FlannIndex
|
class RTABMAP_CORE_EXPORT FlannIndex
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FlannIndex();
|
FlannIndex();
|
||||||
virtual ~FlannIndex();
|
virtual ~FlannIndex();
|
||||||
|
|
||||||
void release();
|
void release();
|
||||||
unsigned int indexedFeatures() const;
|
size_t indexedFeatures() const;
|
||||||
|
|
||||||
// return Bytes
|
// return Bytes
|
||||||
unsigned long memoryUsed() const;
|
size_t memoryUsed() const;
|
||||||
|
|
||||||
// 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(
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef CORELIB_SRC_GAINCOMPENSATOR_H_
|
#ifndef CORELIB_SRC_GAINCOMPENSATOR_H_
|
||||||
#define CORELIB_SRC_GAINCOMPENSATOR_H_
|
#define CORELIB_SRC_GAINCOMPENSATOR_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <pcl/point_cloud.h>
|
#include <pcl/point_cloud.h>
|
||||||
#include <pcl/point_types.h>
|
#include <pcl/point_types.h>
|
||||||
@@ -41,7 +41,7 @@ namespace rtabmap {
|
|||||||
/**
|
/**
|
||||||
* Works like cv::GainCompensator but with point clouds
|
* Works like cv::GainCompensator but with point clouds
|
||||||
*/
|
*/
|
||||||
class RTABMAP_EXP GainCompensator {
|
class RTABMAP_CORE_EXPORT GainCompensator {
|
||||||
public:
|
public:
|
||||||
GainCompensator(double maxCorrespondenceDistance = 0.02, double minOverlap = 0.0, double alpha = 0.01, double beta = 10);
|
GainCompensator(double maxCorrespondenceDistance = 0.02, double minOverlap = 0.0, double alpha = 0.01, double beta = 10);
|
||||||
virtual ~GainCompensator();
|
virtual ~GainCompensator();
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef GEODETICCOORDS_H_
|
#ifndef GEODETICCOORDS_H_
|
||||||
#define GEODETICCOORDS_H_
|
#define GEODETICCOORDS_H_
|
||||||
|
|
||||||
#include <rtabmap/core/RtabmapExp.h>
|
#include <rtabmap/core/rtabmap_core_export.h>
|
||||||
|
|
||||||
#include <opencv2/core/core.hpp>
|
#include <opencv2/core/core.hpp>
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
class RTABMAP_EXP GeodeticCoords
|
class RTABMAP_CORE_EXPORT GeodeticCoords
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GeodeticCoords();
|
GeodeticCoords();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2010-2020, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
Copyright (c) 2010-2024, 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
|
||||||
|
|||||||
73
corelib/include/rtabmap/core/GlobalDescriptorExtractor.h
Normal file
73
corelib/include/rtabmap/core/GlobalDescriptorExtractor.h
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2010-2024, 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 GLOBAL_DESCRIPTOR_EXTRACTOR_H_
|
||||||
|
#define GLOBAL_DESCRIPTOR_EXTRACTOR_H_
|
||||||
|
|
||||||
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
|
#include "rtabmap/core/Parameters.h"
|
||||||
|
#include "rtabmap/core/SensorData.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace rtabmap {
|
||||||
|
|
||||||
|
// Feature2D
|
||||||
|
class RTABMAP_CORE_EXPORT GlobalDescriptorExtractor {
|
||||||
|
public:
|
||||||
|
enum Type {
|
||||||
|
kUndef=0,
|
||||||
|
kPyDescriptor=1};
|
||||||
|
|
||||||
|
static std::string typeName(Type type)
|
||||||
|
{
|
||||||
|
switch(type){
|
||||||
|
case kPyDescriptor:
|
||||||
|
return "PyDescriptor";
|
||||||
|
default:
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static GlobalDescriptorExtractor * create(const ParametersMap & parameters = ParametersMap());
|
||||||
|
static GlobalDescriptorExtractor * create(GlobalDescriptorExtractor::Type type, const ParametersMap & parameters = ParametersMap()); // for convenience
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual ~GlobalDescriptorExtractor();
|
||||||
|
|
||||||
|
virtual GlobalDescriptor extract(const SensorData & data) const = 0;
|
||||||
|
|
||||||
|
virtual void parseParameters(const ParametersMap & parameters) {}
|
||||||
|
virtual GlobalDescriptorExtractor::Type getType() const = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
GlobalDescriptorExtractor(const ParametersMap & parameters = ParametersMap());
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* GLOBAL_DESCRIPTOR_EXTRACTOR_H_ */
|
||||||
102
corelib/include/rtabmap/core/GlobalMap.h
Normal file
102
corelib/include/rtabmap/core/GlobalMap.h
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2010-2023, 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 SRC_MAP_H_
|
||||||
|
#define SRC_MAP_H_
|
||||||
|
|
||||||
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
|
#include <rtabmap/core/LocalGrid.h>
|
||||||
|
#include <rtabmap/core/Parameters.h>
|
||||||
|
#include <rtabmap/core/Transform.h>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
namespace rtabmap {
|
||||||
|
|
||||||
|
class RTABMAP_CORE_EXPORT GlobalMap
|
||||||
|
{
|
||||||
|
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:
|
||||||
|
virtual ~GlobalMap();
|
||||||
|
|
||||||
|
bool update(const std::map<int, Transform> & poses); // return true if map has changed
|
||||||
|
|
||||||
|
virtual void clear();
|
||||||
|
|
||||||
|
float getCellSize() const {return cellSize_;}
|
||||||
|
float getUpdateError() const {return updateError_;}
|
||||||
|
const std::map<int, Transform> & addedNodes() const {return addedNodes_;}
|
||||||
|
|
||||||
|
void getGridMin(double & x, double & y) const {x=minValues_[0];y=minValues_[1];}
|
||||||
|
void getGridMax(double & x, double & y) const {x=maxValues_[0];y=maxValues_[1];}
|
||||||
|
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];}
|
||||||
|
|
||||||
|
virtual unsigned long getMemoryUsed() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
GlobalMap(const LocalGridCache * cache, const ParametersMap & parameters = ParametersMap());
|
||||||
|
|
||||||
|
virtual void assemble(const std::list<std::pair<int, Transform> > & newPoses) = 0;
|
||||||
|
|
||||||
|
const std::map<int, LocalGrid> & cache() const {return cache_->localGrids();}
|
||||||
|
|
||||||
|
const std::map<int, Transform> & assembledNodes() const {return addedNodes_;}
|
||||||
|
bool isNodeAssembled(int id) {return addedNodes_.find(id) != addedNodes_.end();}
|
||||||
|
void addAssembledNode(int id, const Transform & pose);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
float cellSize_;
|
||||||
|
float updateError_;
|
||||||
|
|
||||||
|
float occupancyThr_;
|
||||||
|
float logOddsHit_;
|
||||||
|
float logOddsMiss_;
|
||||||
|
float logOddsClampingMin_;
|
||||||
|
float logOddsClampingMax_;
|
||||||
|
|
||||||
|
double minValues_[3];
|
||||||
|
double maxValues_[3];
|
||||||
|
|
||||||
|
private:
|
||||||
|
const LocalGridCache * cache_;
|
||||||
|
std::map<int, Transform> addedNodes_;
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace rtabmap */
|
||||||
|
|
||||||
|
#endif /* SRC_MAP_H_ */
|
||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef GRAPH_H_
|
#ifndef GRAPH_H_
|
||||||
#define GRAPH_H_
|
#define GRAPH_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -46,7 +46,7 @@ namespace graph {
|
|||||||
// Graph utilities
|
// Graph utilities
|
||||||
////////////////////////////////////////////
|
////////////////////////////////////////////
|
||||||
|
|
||||||
bool RTABMAP_EXP exportPoses(
|
bool RTABMAP_CORE_EXPORT exportPoses(
|
||||||
const std::string & filePath,
|
const std::string & filePath,
|
||||||
int format, // 0=Raw (*.txt), 1=RGBD-SLAM motion capture (*.txt) (10=without change of coordinate frame, 11=10+ID), 2=KITTI (*.txt), 3=TORO (*.graph), 4=g2o (*.g2o)
|
int format, // 0=Raw (*.txt), 1=RGBD-SLAM motion capture (*.txt) (10=without change of coordinate frame, 11=10+ID), 2=KITTI (*.txt), 3=TORO (*.graph), 4=g2o (*.g2o)
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
@@ -54,14 +54,14 @@ bool RTABMAP_EXP exportPoses(
|
|||||||
const std::map<int, double> & stamps = std::map<int, double>(), // required for format 1
|
const std::map<int, double> & stamps = std::map<int, double>(), // required for format 1
|
||||||
const ParametersMap & parameters = ParametersMap()); // optional for formats 3 and 4
|
const ParametersMap & parameters = ParametersMap()); // optional for formats 3 and 4
|
||||||
|
|
||||||
bool RTABMAP_EXP importPoses(
|
bool RTABMAP_CORE_EXPORT importPoses(
|
||||||
const std::string & filePath,
|
const std::string & filePath,
|
||||||
int format, // 0=Raw, 1=RGBD-SLAM motion capture (10=without change of coordinate frame, 11=10+ID), 2=KITTI, 3=TORO, 4=g2o, 5=NewCollege(t,x,y), 6=Malaga Urban GPS, 7=St Lucia INS, 8=Karlsruhe, 9=EuRoC MAV
|
int format, // 0=Raw, 1=RGBD-SLAM motion capture (10=without change of coordinate frame, 11=10+ID), 2=KITTI, 3=TORO, 4=g2o, 5=NewCollege(t,x,y), 6=Malaga Urban GPS, 7=St Lucia INS, 8=Karlsruhe, 9=EuRoC MAV
|
||||||
std::map<int, Transform> & poses,
|
std::map<int, Transform> & poses,
|
||||||
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 and 9
|
std::map<int, double> * stamps = 0); // optional for format 1 and 9
|
||||||
|
|
||||||
bool RTABMAP_EXP exportGPS(
|
bool RTABMAP_CORE_EXPORT exportGPS(
|
||||||
const std::string & filePath,
|
const std::string & filePath,
|
||||||
const std::map<int, GPS> & gpsValues,
|
const std::map<int, GPS> & gpsValues,
|
||||||
unsigned int rgba = 0xFFFFFFFF);
|
unsigned int rgba = 0xFFFFFFFF);
|
||||||
@@ -74,7 +74,7 @@ bool RTABMAP_EXP exportGPS(
|
|||||||
* @param t_err, Output translation error (%)
|
* @param t_err, Output translation error (%)
|
||||||
* @param r_err, Output rotation error (deg/m)
|
* @param r_err, Output rotation error (deg/m)
|
||||||
*/
|
*/
|
||||||
void RTABMAP_EXP calcKittiSequenceErrors(
|
void RTABMAP_CORE_EXPORT calcKittiSequenceErrors(
|
||||||
const std::vector<Transform> &poses_gt,
|
const std::vector<Transform> &poses_gt,
|
||||||
const std::vector<Transform> &poses_result,
|
const std::vector<Transform> &poses_result,
|
||||||
float & t_err,
|
float & t_err,
|
||||||
@@ -87,7 +87,7 @@ void RTABMAP_EXP calcKittiSequenceErrors(
|
|||||||
* @param t_err, Output translation error (m)
|
* @param t_err, Output translation error (m)
|
||||||
* @param r_err, Output rotation error (deg)
|
* @param r_err, Output rotation error (deg)
|
||||||
*/
|
*/
|
||||||
void RTABMAP_EXP calcRelativeErrors (
|
void RTABMAP_CORE_EXPORT calcRelativeErrors (
|
||||||
const std::vector<Transform> &poses_gt,
|
const std::vector<Transform> &poses_gt,
|
||||||
const std::vector<Transform> &poses_result,
|
const std::vector<Transform> &poses_result,
|
||||||
float & t_err,
|
float & t_err,
|
||||||
@@ -101,7 +101,7 @@ void RTABMAP_EXP calcRelativeErrors (
|
|||||||
* @param poses, Estimated poses
|
* @param poses, Estimated poses
|
||||||
* @return Gt to Map transform
|
* @return Gt to Map transform
|
||||||
*/
|
*/
|
||||||
Transform RTABMAP_EXP calcRMSE(
|
Transform RTABMAP_CORE_EXPORT calcRMSE(
|
||||||
const std::map<int, Transform> &groundTruth,
|
const std::map<int, Transform> &groundTruth,
|
||||||
const std::map<int, Transform> &poses,
|
const std::map<int, Transform> &poses,
|
||||||
float & translational_rmse,
|
float & translational_rmse,
|
||||||
@@ -117,7 +117,7 @@ Transform RTABMAP_EXP calcRMSE(
|
|||||||
float & rotational_min,
|
float & rotational_min,
|
||||||
float & rotational_max);
|
float & rotational_max);
|
||||||
|
|
||||||
void RTABMAP_EXP computeMaxGraphErrors(
|
void RTABMAP_CORE_EXPORT computeMaxGraphErrors(
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
const std::multimap<int, Link> & links,
|
const std::multimap<int, Link> & links,
|
||||||
float & maxLinearErrorRatio,
|
float & maxLinearErrorRatio,
|
||||||
@@ -128,53 +128,65 @@ void RTABMAP_EXP computeMaxGraphErrors(
|
|||||||
const Link ** maxAngularErrorLink = 0,
|
const Link ** maxAngularErrorLink = 0,
|
||||||
bool for3DoF = false);
|
bool for3DoF = false);
|
||||||
|
|
||||||
std::vector<double> RTABMAP_EXP getMaxOdomInf(const std::multimap<int, Link> & links);
|
std::vector<double> RTABMAP_CORE_EXPORT getMaxOdomInf(const std::multimap<int, Link> & links);
|
||||||
|
|
||||||
std::multimap<int, Link>::iterator RTABMAP_EXP findLink(
|
std::multimap<int, Link>::iterator RTABMAP_CORE_EXPORT findLink(
|
||||||
std::multimap<int, Link> & links,
|
std::multimap<int, Link> & links,
|
||||||
int from,
|
int from,
|
||||||
int to,
|
int to,
|
||||||
bool checkBothWays = true,
|
bool checkBothWays = true,
|
||||||
Link::Type type = Link::kUndef);
|
Link::Type type = Link::kUndef);
|
||||||
std::multimap<int, int>::iterator RTABMAP_EXP findLink(
|
std::multimap<int, std::pair<int, Link::Type> >::iterator RTABMAP_CORE_EXPORT findLink(
|
||||||
|
std::multimap<int, std::pair<int, Link::Type> > & links,
|
||||||
|
int from,
|
||||||
|
int to,
|
||||||
|
bool checkBothWays = true,
|
||||||
|
Link::Type type = Link::kUndef);
|
||||||
|
std::multimap<int, int>::iterator RTABMAP_CORE_EXPORT findLink(
|
||||||
std::multimap<int, int> & links,
|
std::multimap<int, int> & links,
|
||||||
int from,
|
int from,
|
||||||
int to,
|
int to,
|
||||||
bool checkBothWays = true);
|
bool checkBothWays = true);
|
||||||
std::multimap<int, Link>::const_iterator RTABMAP_EXP findLink(
|
std::multimap<int, Link>::const_iterator RTABMAP_CORE_EXPORT findLink(
|
||||||
const std::multimap<int, Link> & links,
|
const std::multimap<int, Link> & links,
|
||||||
int from,
|
int from,
|
||||||
int to,
|
int to,
|
||||||
bool checkBothWays = true,
|
bool checkBothWays = true,
|
||||||
Link::Type type = Link::kUndef);
|
Link::Type type = Link::kUndef);
|
||||||
std::multimap<int, int>::const_iterator RTABMAP_EXP findLink(
|
std::multimap<int, std::pair<int, Link::Type> >::const_iterator RTABMAP_CORE_EXPORT findLink(
|
||||||
|
const std::multimap<int, std::pair<int, Link::Type> > & links,
|
||||||
|
int from,
|
||||||
|
int to,
|
||||||
|
bool checkBothWays = true,
|
||||||
|
Link::Type type = Link::kUndef);
|
||||||
|
std::multimap<int, int>::const_iterator RTABMAP_CORE_EXPORT findLink(
|
||||||
const std::multimap<int, int> & links,
|
const std::multimap<int, int> & links,
|
||||||
int from,
|
int from,
|
||||||
int to,
|
int to,
|
||||||
bool checkBothWays = true);
|
bool checkBothWays = true);
|
||||||
std::list<Link> RTABMAP_EXP findLinks(
|
std::list<Link> RTABMAP_CORE_EXPORT findLinks(
|
||||||
const std::multimap<int, Link> & links,
|
const std::multimap<int, Link> & links,
|
||||||
int from);
|
int from);
|
||||||
|
|
||||||
std::multimap<int, Link> RTABMAP_EXP filterDuplicateLinks(
|
std::multimap<int, Link> RTABMAP_CORE_EXPORT filterDuplicateLinks(
|
||||||
const std::multimap<int, Link> & links);
|
const std::multimap<int, Link> & links);
|
||||||
/**
|
/**
|
||||||
* Return links not of type "filteredType". If inverted=true, return links of type "filteredType".
|
* Return links not of type "filteredType". If inverted=true, return links of type "filteredType".
|
||||||
*/
|
*/
|
||||||
std::multimap<int, Link> RTABMAP_EXP filterLinks(
|
std::multimap<int, Link> RTABMAP_CORE_EXPORT filterLinks(
|
||||||
const std::multimap<int, Link> & links,
|
const std::multimap<int, Link> & links,
|
||||||
Link::Type filteredType,
|
Link::Type filteredType,
|
||||||
bool inverted = false);
|
bool inverted = false);
|
||||||
/**
|
/**
|
||||||
* Return links not of type "filteredType". If inverted=true, return links of type "filteredType".
|
* Return links not of type "filteredType". If inverted=true, return links of type "filteredType".
|
||||||
*/
|
*/
|
||||||
std::map<int, Link> RTABMAP_EXP filterLinks(
|
std::map<int, Link> RTABMAP_CORE_EXPORT filterLinks(
|
||||||
const std::map<int, Link> & links,
|
const std::map<int, Link> & links,
|
||||||
Link::Type filteredType,
|
Link::Type filteredType,
|
||||||
bool inverted = false);
|
bool inverted = 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.
|
||||||
std::map<int, Transform> RTABMAP_EXP frustumPosesFiltering(
|
std::map<int, Transform> RTABMAP_CORE_EXPORT frustumPosesFiltering(
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
const Transform & cameraPose,
|
const Transform & cameraPose,
|
||||||
float horizontalFOV = 45.0f, // in degrees, xfov = atan((image_width/2)/fx)*2
|
float horizontalFOV = 45.0f, // in degrees, xfov = atan((image_width/2)/fx)*2
|
||||||
@@ -191,7 +203,7 @@ std::map<int, Transform> RTABMAP_EXP frustumPosesFiltering(
|
|||||||
* @param keepLatest keep the latest node if true, otherwise the oldest node is kept
|
* @param keepLatest keep the latest node if true, otherwise the oldest node is kept
|
||||||
* @return A map containing only most recent or older poses in the the defined radius
|
* @return A map containing only most recent or older poses in the the defined radius
|
||||||
*/
|
*/
|
||||||
std::map<int, Transform> RTABMAP_EXP radiusPosesFiltering(
|
std::map<int, Transform> RTABMAP_CORE_EXPORT radiusPosesFiltering(
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
float radius,
|
float radius,
|
||||||
float angle,
|
float angle,
|
||||||
@@ -204,7 +216,7 @@ std::map<int, Transform> RTABMAP_EXP radiusPosesFiltering(
|
|||||||
* @param angle Maximum angle (rad, [0,PI]) of accepted neighbor nodes in the radius (0 means ignore angle)
|
* @param angle Maximum angle (rad, [0,PI]) of accepted neighbor nodes in the radius (0 means ignore angle)
|
||||||
* @return A map between each pose id and its neighbors found in the radius
|
* @return A map between each pose id and its neighbors found in the radius
|
||||||
*/
|
*/
|
||||||
std::multimap<int, int> RTABMAP_EXP radiusPosesClustering(
|
std::multimap<int, int> RTABMAP_CORE_EXPORT radiusPosesClustering(
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
float radius,
|
float radius,
|
||||||
float angle);
|
float angle);
|
||||||
@@ -224,7 +236,7 @@ void reduceGraph(
|
|||||||
* @param updateNewCosts Keep up-to-date costs while traversing the graph.
|
* @param updateNewCosts Keep up-to-date costs while traversing the graph.
|
||||||
* @return the path ids from id "from" to id "to" including initial and final nodes.
|
* @return the path ids from id "from" to id "to" including initial and final nodes.
|
||||||
*/
|
*/
|
||||||
std::list<std::pair<int, Transform> > RTABMAP_EXP computePath(
|
std::list<std::pair<int, Transform> > RTABMAP_CORE_EXPORT computePath(
|
||||||
const std::map<int, rtabmap::Transform> & poses,
|
const std::map<int, rtabmap::Transform> & poses,
|
||||||
const std::multimap<int, int> & links,
|
const std::multimap<int, int> & links,
|
||||||
int from,
|
int from,
|
||||||
@@ -241,7 +253,7 @@ std::list<std::pair<int, Transform> > RTABMAP_EXP computePath(
|
|||||||
* @param useSameCostForAllLinks Ignore distance between nodes
|
* @param useSameCostForAllLinks Ignore distance between nodes
|
||||||
* @return the path ids from id "from" to id "to" including initial and final nodes.
|
* @return the path ids from id "from" to id "to" including initial and final nodes.
|
||||||
*/
|
*/
|
||||||
std::list<int> RTABMAP_EXP computePath(
|
std::list<int> RTABMAP_CORE_EXPORT computePath(
|
||||||
const std::multimap<int, Link> & links,
|
const std::multimap<int, Link> & links,
|
||||||
int from,
|
int from,
|
||||||
int to,
|
int to,
|
||||||
@@ -257,7 +269,7 @@ std::list<int> RTABMAP_EXP computePath(
|
|||||||
* @param updateNewCosts Keep up-to-date costs while traversing the graph.
|
* @param updateNewCosts Keep up-to-date costs while traversing the graph.
|
||||||
* @return the path ids from id "fromId" to id "toId" including initial and final nodes (Identity pose for the first node).
|
* @return the path ids from id "fromId" to id "toId" including initial and final nodes (Identity pose for the first node).
|
||||||
*/
|
*/
|
||||||
std::list<std::pair<int, Transform> > RTABMAP_EXP computePath(
|
std::list<std::pair<int, Transform> > RTABMAP_CORE_EXPORT computePath(
|
||||||
int fromId,
|
int fromId,
|
||||||
int toId,
|
int toId,
|
||||||
const Memory * memory,
|
const Memory * memory,
|
||||||
@@ -273,7 +285,7 @@ std::list<std::pair<int, Transform> > RTABMAP_EXP computePath(
|
|||||||
* @param distance squared distance of the nearest node found (optional)
|
* @param distance squared distance of the nearest node found (optional)
|
||||||
* @return the node id.
|
* @return the node id.
|
||||||
*/
|
*/
|
||||||
int RTABMAP_EXP findNearestNode(
|
int RTABMAP_CORE_EXPORT findNearestNode(
|
||||||
const std::map<int, rtabmap::Transform> & poses,
|
const std::map<int, rtabmap::Transform> & poses,
|
||||||
const rtabmap::Transform & targetPose,
|
const rtabmap::Transform & targetPose,
|
||||||
float * distance = 0);
|
float * distance = 0);
|
||||||
@@ -286,54 +298,56 @@ int RTABMAP_EXP findNearestNode(
|
|||||||
* @param k max nearest neighbors (0=all inside the radius)
|
* @param k max nearest neighbors (0=all inside the radius)
|
||||||
* @return the nodes with squared distance to query node.
|
* @return the nodes with squared distance to query node.
|
||||||
*/
|
*/
|
||||||
std::map<int, float> RTABMAP_EXP findNearestNodes(
|
std::map<int, float> RTABMAP_CORE_EXPORT findNearestNodes(
|
||||||
int nodeId,
|
int nodeId,
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
float radius,
|
float radius,
|
||||||
float angle = 0.0f,
|
float angle = 0.0f,
|
||||||
int k=0);
|
int k=0);
|
||||||
std::map<int, float> RTABMAP_EXP findNearestNodes(
|
std::map<int, float> RTABMAP_CORE_EXPORT findNearestNodes(
|
||||||
const Transform & targetPose,
|
const Transform & targetPose,
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
float radius,
|
float radius,
|
||||||
float angle = 0.0f,
|
float angle = 0.0f,
|
||||||
int k=0);
|
int k=0);
|
||||||
std::map<int, Transform> RTABMAP_EXP findNearestPoses(
|
std::map<int, Transform> RTABMAP_CORE_EXPORT findNearestPoses(
|
||||||
int nodeId,
|
int nodeId,
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
float radius,
|
float radius,
|
||||||
float angle = 0.0f,
|
float angle = 0.0f,
|
||||||
int k=0);
|
int k=0);
|
||||||
std::map<int, Transform> RTABMAP_EXP findNearestPoses(
|
std::map<int, Transform> RTABMAP_CORE_EXPORT findNearestPoses(
|
||||||
const Transform & targetPose,
|
const Transform & targetPose,
|
||||||
const std::map<int, Transform> & poses,
|
const std::map<int, Transform> & poses,
|
||||||
float radius,
|
float radius,
|
||||||
float angle = 0.0f,
|
float angle = 0.0f,
|
||||||
int k=0);
|
int k=0);
|
||||||
|
|
||||||
// typedef hack to avoid error with RTABMAP_DEPRECATED
|
// Use new findNearestNodes() interface with radius=0, angle=0.
|
||||||
typedef std::map<int, float> _mapIntFloat;
|
RTABMAP_DEPRECATED std::map<int, float> RTABMAP_CORE_EXPORT findNearestNodes(const std::map<int, rtabmap::Transform> & nodes, const rtabmap::Transform & targetPose, int k);
|
||||||
typedef std::map<int, Transform> _mapIntTransform;
|
// Renamed to findNearestNodes()
|
||||||
RTABMAP_DEPRECATED(_mapIntFloat RTABMAP_EXP findNearestNodes(const std::map<int, rtabmap::Transform> & nodes, const rtabmap::Transform & targetPose, int k), "Use new findNearestNodes() interface with radius=0, angle=0.");
|
RTABMAP_DEPRECATED std::map<int, float> RTABMAP_CORE_EXPORT getNodesInRadius(int nodeId, const std::map<int, Transform> & nodes, float radius);
|
||||||
RTABMAP_DEPRECATED(_mapIntFloat RTABMAP_EXP getNodesInRadius(int nodeId, const std::map<int, Transform> & nodes, float radius), "Renamed to findNearestNodes()");
|
// Renamed to findNearestNodes()
|
||||||
RTABMAP_DEPRECATED(_mapIntFloat RTABMAP_EXP getNodesInRadius(const Transform & targetPose, const std::map<int, Transform> & nodes, float radius), "Renamed to findNearestNodes()");
|
RTABMAP_DEPRECATED std::map<int, float> RTABMAP_CORE_EXPORT getNodesInRadius(const Transform & targetPose, const std::map<int, Transform> & nodes, float radius);
|
||||||
RTABMAP_DEPRECATED(_mapIntTransform RTABMAP_EXP getPosesInRadius(int nodeId, const std::map<int, Transform> & nodes, float radius, float angle = 0.0f), "Renamed to findNearestNodes()");
|
// Renamed to findNearestNodes()
|
||||||
RTABMAP_DEPRECATED(_mapIntTransform RTABMAP_EXP getPosesInRadius(const Transform & targetPose, const std::map<int, Transform> & nodes, float radius, float angle = 0.0f), "Renamed to findNearestNodes()");
|
RTABMAP_DEPRECATED std::map<int, Transform> RTABMAP_CORE_EXPORT getPosesInRadius(int nodeId, const std::map<int, Transform> & nodes, float radius, float angle = 0.0f);
|
||||||
|
// Renamed to findNearestNodes()
|
||||||
|
RTABMAP_DEPRECATED std::map<int, Transform> RTABMAP_CORE_EXPORT getPosesInRadius(const Transform & targetPose, const std::map<int, Transform> & nodes, float radius, float angle = 0.0f);
|
||||||
|
|
||||||
float RTABMAP_EXP computePathLength(
|
float RTABMAP_CORE_EXPORT computePathLength(
|
||||||
const std::vector<std::pair<int, Transform> > & path,
|
const std::vector<std::pair<int, Transform> > & path,
|
||||||
unsigned int fromIndex = 0,
|
unsigned int fromIndex = 0,
|
||||||
unsigned int toIndex = 0);
|
unsigned int toIndex = 0);
|
||||||
|
|
||||||
// assuming they are all linked in map order
|
// assuming they are all linked in map order
|
||||||
float RTABMAP_EXP computePathLength(
|
float RTABMAP_CORE_EXPORT computePathLength(
|
||||||
const std::map<int, Transform> & path);
|
const std::map<int, Transform> & path);
|
||||||
|
|
||||||
std::list<std::map<int, Transform> > RTABMAP_EXP getPaths(
|
std::list<std::map<int, Transform> > RTABMAP_CORE_EXPORT getPaths(
|
||||||
std::map<int, Transform> poses,
|
std::map<int, Transform> poses,
|
||||||
const std::multimap<int, Link> & links);
|
const std::multimap<int, Link> & links);
|
||||||
|
|
||||||
void RTABMAP_EXP computeMinMax(const std::map<int, Transform> & poses,
|
void RTABMAP_CORE_EXPORT computeMinMax(const std::map<int, Transform> & poses,
|
||||||
cv::Vec3f & min,
|
cv::Vec3f & min,
|
||||||
cv::Vec3f & max);
|
cv::Vec3f & max);
|
||||||
|
|
||||||
|
|||||||
@@ -28,12 +28,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef CORELIB_INCLUDE_RTABMAP_CORE_IMUFILTER_H_
|
#ifndef CORELIB_INCLUDE_RTABMAP_CORE_IMUFILTER_H_
|
||||||
#define CORELIB_INCLUDE_RTABMAP_CORE_IMUFILTER_H_
|
#define CORELIB_INCLUDE_RTABMAP_CORE_IMUFILTER_H_
|
||||||
|
|
||||||
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
#include <rtabmap/core/Parameters.h>
|
#include <rtabmap/core/Parameters.h>
|
||||||
#include <Eigen/Geometry>
|
#include <Eigen/Geometry>
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
class IMUFilter
|
class RTABMAP_CORE_EXPORT IMUFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Type {
|
enum Type {
|
||||||
|
|||||||
@@ -27,9 +27,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <rtabmap/core/Transform.h>
|
#include <rtabmap/core/Transform.h>
|
||||||
|
#include <rtabmap/core/Parameters.h>
|
||||||
#include <rtabmap/utilite/UThread.h>
|
#include <rtabmap/utilite/UThread.h>
|
||||||
#include <rtabmap/utilite/UEventsSender.h>
|
#include <rtabmap/utilite/UEventsSender.h>
|
||||||
#include <rtabmap/utilite/UTimer.h>
|
#include <rtabmap/utilite/UTimer.h>
|
||||||
@@ -39,11 +40,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
namespace rtabmap
|
namespace rtabmap
|
||||||
{
|
{
|
||||||
|
|
||||||
|
class IMUFilter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class IMUThread
|
* Class IMUThread
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class RTABMAP_EXP IMUThread :
|
class RTABMAP_CORE_EXPORT IMUThread :
|
||||||
public UThread,
|
public UThread,
|
||||||
public UEventsSender
|
public UEventsSender
|
||||||
{
|
{
|
||||||
@@ -53,6 +56,8 @@ public:
|
|||||||
|
|
||||||
bool init(const std::string & path);
|
bool init(const std::string & path);
|
||||||
void setRate(int rate);
|
void setRate(int rate);
|
||||||
|
void enableIMUFiltering(int filteringStrategy=1, const ParametersMap & parameters = ParametersMap(), bool baseFrameConversion = false);
|
||||||
|
void disableIMUFiltering();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void mainLoopBegin();
|
virtual void mainLoopBegin();
|
||||||
@@ -65,6 +70,8 @@ private:
|
|||||||
UTimer frameRateTimer_;
|
UTimer frameRateTimer_;
|
||||||
double captureDelay_;
|
double captureDelay_;
|
||||||
double previousStamp_;
|
double previousStamp_;
|
||||||
|
IMUFilter * _imuFilter;
|
||||||
|
bool _imuBaseFrameConversion;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rtabmap
|
} // namespace rtabmap
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef CORELIB_INCLUDE_RTABMAP_CORE_LANDMARK_H_
|
#ifndef CORELIB_INCLUDE_RTABMAP_CORE_LANDMARK_H_
|
||||||
#define CORELIB_INCLUDE_RTABMAP_CORE_LANDMARK_H_
|
#define CORELIB_INCLUDE_RTABMAP_CORE_LANDMARK_H_
|
||||||
|
|
||||||
#include <rtabmap/core/RtabmapExp.h>
|
#include <rtabmap/core/rtabmap_core_export.h>
|
||||||
#include <rtabmap/core/Transform.h>
|
#include <rtabmap/core/Transform.h>
|
||||||
#include <rtabmap/utilite/ULogger.h>
|
#include <rtabmap/utilite/ULogger.h>
|
||||||
#include <rtabmap/utilite/UMath.h>
|
#include <rtabmap/utilite/UMath.h>
|
||||||
@@ -59,7 +59,8 @@ public:
|
|||||||
UASSERT_MSG(uIsFinite(covariance_.at<double>(4,4)) && covariance_.at<double>(4,4)>0, uFormat("Angular covariance should not be null! Value=%f (set to 9999 if unknown).", covariance_.at<double>(4,4)).c_str());
|
UASSERT_MSG(uIsFinite(covariance_.at<double>(4,4)) && covariance_.at<double>(4,4)>0, uFormat("Angular covariance should not be null! Value=%f (set to 9999 if unknown).", covariance_.at<double>(4,4)).c_str());
|
||||||
UASSERT_MSG(uIsFinite(covariance_.at<double>(5,5)) && covariance_.at<double>(5,5)>0, uFormat("Angular covariance should not be null! Value=%f (set to 9999 if unknown).", covariance_.at<double>(5,5)).c_str());
|
UASSERT_MSG(uIsFinite(covariance_.at<double>(5,5)) && covariance_.at<double>(5,5)>0, uFormat("Angular covariance should not be null! Value=%f (set to 9999 if unknown).", covariance_.at<double>(5,5)).c_str());
|
||||||
}
|
}
|
||||||
RTABMAP_DEPRECATED(Landmark(const int & id, const Transform & pose, const cv::Mat & covariance), "Use constructor with size=0 instead.");
|
// Use constructor with size=0 instead.
|
||||||
|
RTABMAP_DEPRECATED Landmark(const int & id, const Transform & pose, const cv::Mat & covariance);
|
||||||
|
|
||||||
virtual ~Landmark() {}
|
virtual ~Landmark() {}
|
||||||
|
|
||||||
|
|||||||
@@ -28,13 +28,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef CORELIB_INCLUDE_RTABMAP_CORE_LASERSCAN_H_
|
#ifndef CORELIB_INCLUDE_RTABMAP_CORE_LASERSCAN_H_
|
||||||
#define 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/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <rtabmap/core/Transform.h>
|
#include <rtabmap/core/Transform.h>
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
class RTABMAP_EXP LaserScan
|
class RTABMAP_CORE_EXPORT LaserScan
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Format{kUnknown=0,
|
enum Format{kUnknown=0,
|
||||||
@@ -47,7 +47,8 @@ public:
|
|||||||
kXYZRGB=7,
|
kXYZRGB=7,
|
||||||
kXYZNormal=8,
|
kXYZNormal=8,
|
||||||
kXYZINormal=9,
|
kXYZINormal=9,
|
||||||
kXYZRGBNormal=10};
|
kXYZRGBNormal=10,
|
||||||
|
kXYZIT=11};
|
||||||
|
|
||||||
static std::string formatName(const Format & format);
|
static std::string formatName(const Format & format);
|
||||||
static int channels(const Format & format);
|
static int channels(const Format & format);
|
||||||
@@ -55,6 +56,7 @@ public:
|
|||||||
static bool isScanHasNormals(const Format & format);
|
static bool isScanHasNormals(const Format & format);
|
||||||
static bool isScanHasRGB(const Format & format);
|
static bool isScanHasRGB(const Format & format);
|
||||||
static bool isScanHasIntensity(const Format & format);
|
static bool isScanHasIntensity(const Format & format);
|
||||||
|
static bool isScanHasTime(const Format & format);
|
||||||
static LaserScan backwardCompatibility(
|
static LaserScan backwardCompatibility(
|
||||||
const cv::Mat & oldScanFormat,
|
const cv::Mat & oldScanFormat,
|
||||||
int maxPoints = 0,
|
int maxPoints = 0,
|
||||||
@@ -75,24 +77,26 @@ public:
|
|||||||
int maxPoints,
|
int maxPoints,
|
||||||
float maxRange,
|
float maxRange,
|
||||||
const Transform & localTransform = Transform::getIdentity());
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
RTABMAP_DEPRECATED(LaserScan(const LaserScan & data,
|
// Use version without \"format\" argument.
|
||||||
|
RTABMAP_DEPRECATED LaserScan(const LaserScan & data,
|
||||||
int maxPoints,
|
int maxPoints,
|
||||||
float maxRange,
|
float maxRange,
|
||||||
Format format,
|
Format format,
|
||||||
const Transform & localTransform = Transform::getIdentity()), "Use version without \"format\" argument.");
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
LaserScan(const cv::Mat & data,
|
LaserScan(const cv::Mat & data,
|
||||||
int maxPoints,
|
int maxPoints,
|
||||||
float maxRange,
|
float maxRange,
|
||||||
Format format,
|
Format format,
|
||||||
const Transform & localTransform = Transform::getIdentity());
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
RTABMAP_DEPRECATED(LaserScan(const LaserScan & data,
|
// Use version without \"format\" argument.
|
||||||
|
RTABMAP_DEPRECATED LaserScan(const LaserScan & data,
|
||||||
Format format,
|
Format format,
|
||||||
float minRange,
|
float minRange,
|
||||||
float maxRange,
|
float maxRange,
|
||||||
float angleMin,
|
float angleMin,
|
||||||
float angleMax,
|
float angleMax,
|
||||||
float angleIncrement,
|
float angleIncrement,
|
||||||
const Transform & localTransform = Transform::getIdentity()), "Use version without \"format\" argument.");
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
LaserScan(const LaserScan & data,
|
LaserScan(const LaserScan & data,
|
||||||
float minRange,
|
float minRange,
|
||||||
float maxRange,
|
float maxRange,
|
||||||
@@ -119,22 +123,27 @@ public:
|
|||||||
float angleMin() const {return angleMin_;}
|
float angleMin() const {return angleMin_;}
|
||||||
float angleMax() const {return angleMax_;}
|
float angleMax() const {return angleMax_;}
|
||||||
float angleIncrement() const {return angleIncrement_;}
|
float angleIncrement() const {return angleIncrement_;}
|
||||||
|
void setLocalTransform(const Transform & t) {localTransform_ = t;}
|
||||||
Transform localTransform() const {return localTransform_;}
|
Transform localTransform() const {return localTransform_;}
|
||||||
|
|
||||||
bool empty() const {return data_.empty();}
|
bool empty() const {return data_.empty();}
|
||||||
bool isEmpty() const {return data_.empty();}
|
bool isEmpty() const {return data_.empty();}
|
||||||
int size() const {return data_.cols;}
|
int size() const {return data_.total();}
|
||||||
int dataType() const {return data_.type();}
|
int dataType() const {return data_.type();}
|
||||||
bool is2d() const {return isScan2d(format_);}
|
bool is2d() const {return isScan2d(format_);}
|
||||||
bool hasNormals() const {return isScanHasNormals(format_);}
|
bool hasNormals() const {return isScanHasNormals(format_);}
|
||||||
bool hasRGB() const {return isScanHasRGB(format_);}
|
bool hasRGB() const {return isScanHasRGB(format_);}
|
||||||
bool hasIntensity() const {return isScanHasIntensity(format_);}
|
bool hasIntensity() const {return isScanHasIntensity(format_);}
|
||||||
|
bool hasTime() const {return isScanHasTime(format_);}
|
||||||
bool isCompressed() const {return !data_.empty() && data_.type()==CV_8UC1;}
|
bool isCompressed() const {return !data_.empty() && data_.type()==CV_8UC1;}
|
||||||
|
bool isOrganized() const {return data_.rows > 1;}
|
||||||
LaserScan clone() const;
|
LaserScan clone() const;
|
||||||
|
LaserScan densify() const;
|
||||||
|
|
||||||
int getIntensityOffset() const {return hasIntensity()?(is2d()?2:3):-1;}
|
int getIntensityOffset() const {return hasIntensity()?(is2d()?2:3):-1;}
|
||||||
int getRGBOffset() const {return hasRGB()?(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;}
|
int getNormalsOffset() const {return hasNormals()?(2 + (is2d()?0:1) + ((hasRGB() || hasIntensity())?1:0)):-1;}
|
||||||
|
int getTimeOffset() const {return hasTime()?4:-1;}
|
||||||
|
|
||||||
float & field(unsigned int pointIndex, unsigned int channelOffset);
|
float & field(unsigned int pointIndex, unsigned int channelOffset);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
Copyright (c) 2010-2022, 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
|
||||||
@@ -25,26 +25,33 @@ 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef RTABMAPEXP_H
|
#pragma once
|
||||||
#define RTABMAPEXP_H
|
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
#if defined(rtabmap_core_EXPORTS)
|
#include <rtabmap/core/SensorCapture.h>
|
||||||
#define RTABMAP_EXP __declspec( dllexport )
|
|
||||||
#else
|
|
||||||
#define RTABMAP_EXP __declspec( dllimport )
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define RTABMAP_EXP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
namespace rtabmap
|
||||||
#define RTABMAP_DEPRECATED(func, msg) func __attribute__ ((deprecated(msg)))
|
{
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#define RTABMAP_DEPRECATED(func, msg) __declspec(deprecated(msg)) func
|
|
||||||
#else
|
|
||||||
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
|
|
||||||
#define RTABMAP_DEPRECATED(func, msg) func
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // RTABMAPEXP_H
|
/**
|
||||||
|
* Class Lidar
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class RTABMAP_CORE_EXPORT Lidar : public SensorCapture
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~Lidar() {}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param lidarRate the frame rate (Hz), 0 for fast as the lidar can
|
||||||
|
* @param localTransform the transform from base frame to lidar frame
|
||||||
|
*/
|
||||||
|
Lidar(float lidarRate = 0, const Transform & localTransform = Transform::getIdentity()) :
|
||||||
|
SensorCapture(lidarRate, localTransform) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace rtabmap
|
||||||
@@ -28,14 +28,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef LINK_H_
|
#ifndef LINK_H_
|
||||||
#define LINK_H_
|
#define LINK_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <rtabmap/core/Transform.h>
|
#include <rtabmap/core/Transform.h>
|
||||||
#include <opencv2/core/core.hpp>
|
#include <opencv2/core/core.hpp>
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
class RTABMAP_EXP Link
|
class RTABMAP_CORE_EXPORT Link
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Type {
|
enum Type {
|
||||||
|
|||||||
90
corelib/include/rtabmap/core/LocalGrid.h
Normal file
90
corelib/include/rtabmap/core/LocalGrid.h
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2010-2023, 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 SRC_LOCALGRID_H_
|
||||||
|
#define SRC_LOCALGRID_H_
|
||||||
|
|
||||||
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
|
#include <opencv2/core.hpp>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
namespace rtabmap {
|
||||||
|
|
||||||
|
class RTABMAP_CORE_EXPORT LocalGrid
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LocalGrid(const cv::Mat & ground,
|
||||||
|
const cv::Mat & obstacles,
|
||||||
|
const cv::Mat & empty,
|
||||||
|
float cellSize,
|
||||||
|
const cv::Point3f & viewPoint = cv::Point3f(0,0,0));
|
||||||
|
virtual ~LocalGrid() {}
|
||||||
|
bool is3D() const;
|
||||||
|
public:
|
||||||
|
cv::Mat groundCells;
|
||||||
|
cv::Mat obstacleCells;
|
||||||
|
cv::Mat emptyCells;
|
||||||
|
float cellSize;
|
||||||
|
cv::Point3f viewPoint;
|
||||||
|
};
|
||||||
|
|
||||||
|
class RTABMAP_CORE_EXPORT LocalGridCache
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LocalGridCache() {}
|
||||||
|
virtual ~LocalGridCache() {}
|
||||||
|
|
||||||
|
void add(int nodeId,
|
||||||
|
const cv::Mat & ground,
|
||||||
|
const cv::Mat & obstacles,
|
||||||
|
const cv::Mat & empty,
|
||||||
|
float cellSize,
|
||||||
|
const cv::Point3f & viewPoint = cv::Point3f(0,0,0));
|
||||||
|
|
||||||
|
void add(int nodeId, const LocalGrid & localGrid);
|
||||||
|
|
||||||
|
bool shareTo(int nodeId, LocalGridCache & anotherCache) const;
|
||||||
|
|
||||||
|
unsigned long getMemoryUsed() const;
|
||||||
|
void clear(bool temporaryOnly = false);
|
||||||
|
|
||||||
|
size_t size() const {return localGrids_.size();}
|
||||||
|
bool empty() const {return localGrids_.empty();}
|
||||||
|
const std::map<int, LocalGrid> & localGrids() const {return localGrids_;}
|
||||||
|
|
||||||
|
std::map<int, LocalGrid>::const_iterator find(int nodeId) const {return localGrids_.find(nodeId);}
|
||||||
|
std::map<int, LocalGrid>::const_iterator begin() const {return localGrids_.begin();}
|
||||||
|
std::map<int, LocalGrid>::const_iterator end() const {return localGrids_.end();}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::map<int, LocalGrid> localGrids_;
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace rtabmap */
|
||||||
|
|
||||||
|
#endif /* SRC_LOCALGRID_H_ */
|
||||||
115
corelib/include/rtabmap/core/LocalGridMaker.h
Normal file
115
corelib/include/rtabmap/core/LocalGridMaker.h
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2010-2023, 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 SRC_LOCAL_MAP_H_
|
||||||
|
#define SRC_LOCAL_MAP_H_
|
||||||
|
|
||||||
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
|
#include <pcl/pcl_base.h>
|
||||||
|
#include <pcl/point_types.h>
|
||||||
|
|
||||||
|
#include <rtabmap/core/Transform.h>
|
||||||
|
#include <rtabmap/core/Parameters.h>
|
||||||
|
#include <rtabmap/core/Signature.h>
|
||||||
|
|
||||||
|
namespace rtabmap {
|
||||||
|
|
||||||
|
class RTABMAP_CORE_EXPORT LocalGridMaker
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LocalGridMaker(const ParametersMap & parameters = ParametersMap());
|
||||||
|
virtual ~LocalGridMaker();
|
||||||
|
virtual void parseParameters(const ParametersMap & parameters);
|
||||||
|
|
||||||
|
float getCellSize() const {return cellSize_;}
|
||||||
|
bool isGridFromDepth() const {return occupancySensor_;}
|
||||||
|
bool isMapFrameProjection() const {return projMapFrame_;}
|
||||||
|
|
||||||
|
template<typename PointT>
|
||||||
|
typename pcl::PointCloud<PointT>::Ptr segmentCloud(
|
||||||
|
const typename pcl::PointCloud<PointT>::Ptr & cloud,
|
||||||
|
const pcl::IndicesPtr & indices,
|
||||||
|
const Transform & pose,
|
||||||
|
const cv::Point3f & viewPoint,
|
||||||
|
pcl::IndicesPtr & groundIndices, // output cloud indices
|
||||||
|
pcl::IndicesPtr & obstaclesIndices, // output cloud indices
|
||||||
|
pcl::IndicesPtr * flatObstacles = 0) const; // output cloud indices
|
||||||
|
|
||||||
|
void createLocalMap(
|
||||||
|
const Signature & node,
|
||||||
|
cv::Mat & groundCells,
|
||||||
|
cv::Mat & obstacleCells,
|
||||||
|
cv::Mat & emptyCells,
|
||||||
|
cv::Point3f & viewPoint);
|
||||||
|
|
||||||
|
void createLocalMap(
|
||||||
|
const LaserScan & cloud,
|
||||||
|
const Transform & pose,
|
||||||
|
cv::Mat & groundCells,
|
||||||
|
cv::Mat & obstacleCells,
|
||||||
|
cv::Mat & emptyCells,
|
||||||
|
cv::Point3f & viewPointInOut) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
ParametersMap parameters_;
|
||||||
|
|
||||||
|
unsigned int cloudDecimation_;
|
||||||
|
float rangeMax_;
|
||||||
|
float rangeMin_;
|
||||||
|
std::vector<float> roiRatios_;
|
||||||
|
float footprintLength_;
|
||||||
|
float footprintWidth_;
|
||||||
|
float footprintHeight_;
|
||||||
|
int scanDecimation_;
|
||||||
|
float cellSize_;
|
||||||
|
bool preVoxelFiltering_;
|
||||||
|
int occupancySensor_;
|
||||||
|
bool projMapFrame_;
|
||||||
|
float maxObstacleHeight_;
|
||||||
|
int normalKSearch_;
|
||||||
|
float groundNormalsUp_;
|
||||||
|
float maxGroundAngle_;
|
||||||
|
float clusterRadius_;
|
||||||
|
int minClusterSize_;
|
||||||
|
bool flatObstaclesDetected_;
|
||||||
|
float minGroundHeight_;
|
||||||
|
float maxGroundHeight_;
|
||||||
|
bool normalsSegmentation_;
|
||||||
|
bool grid3D_;
|
||||||
|
bool groundIsObstacle_;
|
||||||
|
float noiseFilteringRadius_;
|
||||||
|
int noiseFilteringMinNeighbors_;
|
||||||
|
bool scan2dUnknownSpaceFilled_;
|
||||||
|
bool rayTracing_;
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace rtabmap */
|
||||||
|
|
||||||
|
#include <rtabmap/core/impl/LocalMapMaker.hpp>
|
||||||
|
|
||||||
|
#endif /* SRC_MAP_H_ */
|
||||||
@@ -56,19 +56,20 @@ private:
|
|||||||
Transform pose_;
|
Transform pose_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RTABMAP_EXP MarkerDetector {
|
class RTABMAP_CORE_EXPORT MarkerDetector {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MarkerDetector(const ParametersMap & parameters = ParametersMap());
|
MarkerDetector(const ParametersMap & parameters = ParametersMap());
|
||||||
virtual ~MarkerDetector();
|
virtual ~MarkerDetector();
|
||||||
void parseParameters(const ParametersMap & parameters);
|
void parseParameters(const ParametersMap & parameters);
|
||||||
|
|
||||||
RTABMAP_DEPRECATED(
|
// Use the other detect(), in which the returned map contains the length of each marker detected.
|
||||||
|
RTABMAP_DEPRECATED
|
||||||
MapIdPose detect(const cv::Mat & image,
|
MapIdPose detect(const cv::Mat & image,
|
||||||
const CameraModel & model,
|
const CameraModel & model,
|
||||||
const cv::Mat & depth = cv::Mat(),
|
const cv::Mat & depth = cv::Mat(),
|
||||||
float * estimatedMarkerLength = 0,
|
float * estimatedMarkerLength = 0,
|
||||||
cv::Mat * imageWithDetections = 0), "Use the other detect(), in which the returned map contains the length of each marker detected.");
|
cv::Mat * imageWithDetections = 0);
|
||||||
|
|
||||||
std::map<int, MarkerInfo> detect(const cv::Mat & image,
|
std::map<int, MarkerInfo> detect(const cv::Mat & image,
|
||||||
const std::vector<CameraModel> & models,
|
const std::vector<CameraModel> & models,
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef MEMORY_H_
|
#ifndef MEMORY_H_
|
||||||
#define MEMORY_H_
|
#define MEMORY_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include "rtabmap/utilite/UEventsHandler.h"
|
#include "rtabmap/utilite/UEventsHandler.h"
|
||||||
#include "rtabmap/core/Parameters.h"
|
#include "rtabmap/core/Parameters.h"
|
||||||
@@ -57,10 +57,11 @@ class RegistrationInfo;
|
|||||||
class RegistrationIcp;
|
class RegistrationIcp;
|
||||||
class RegistrationVis;
|
class RegistrationVis;
|
||||||
class Stereo;
|
class Stereo;
|
||||||
class OccupancyGrid;
|
class LocalGridMaker;
|
||||||
class MarkerDetector;
|
class MarkerDetector;
|
||||||
|
class GlobalDescriptorExtractor;
|
||||||
|
|
||||||
class RTABMAP_EXP Memory
|
class RTABMAP_CORE_EXPORT Memory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const int kIdStart;
|
static const int kIdStart;
|
||||||
@@ -330,8 +331,10 @@ private:
|
|||||||
bool _rehearsalWeightIgnoredWhileMoving;
|
bool _rehearsalWeightIgnoredWhileMoving;
|
||||||
bool _useOdometryFeatures;
|
bool _useOdometryFeatures;
|
||||||
bool _useOdometryGravity;
|
bool _useOdometryGravity;
|
||||||
|
bool _rotateImagesUpsideUp;
|
||||||
bool _createOccupancyGrid;
|
bool _createOccupancyGrid;
|
||||||
int _visMaxFeatures;
|
int _visMaxFeatures;
|
||||||
|
bool _visSSC;
|
||||||
bool _imagesAlreadyRectified;
|
bool _imagesAlreadyRectified;
|
||||||
bool _rectifyOnlyFeatures;
|
bool _rectifyOnlyFeatures;
|
||||||
bool _covOffDiagonalIgnored;
|
bool _covOffDiagonalIgnored;
|
||||||
@@ -371,9 +374,11 @@ private:
|
|||||||
RegistrationIcp * _registrationIcpMulti;
|
RegistrationIcp * _registrationIcpMulti;
|
||||||
RegistrationVis * _registrationVis;
|
RegistrationVis * _registrationVis;
|
||||||
|
|
||||||
OccupancyGrid * _occupancy;
|
LocalGridMaker * _localMapMaker;
|
||||||
|
|
||||||
MarkerDetector * _markerDetector;
|
MarkerDetector * _markerDetector;
|
||||||
|
|
||||||
|
GlobalDescriptorExtractor * _globalDescriptorExtractor;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rtabmap
|
} // namespace rtabmap
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
Copyright (c) 2010-2023, 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
|
||||||
@@ -25,144 +25,14 @@ 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CORELIB_SRC_OCCUPANCYGRID_H_
|
#ifndef CORELIB_INCLUDE_RTABMAP_CORE_OCCUPANCYGRID_H_
|
||||||
#define CORELIB_SRC_OCCUPANCYGRID_H_
|
#define CORELIB_INCLUDE_RTABMAP_CORE_OCCUPANCYGRID_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
/*
|
||||||
|
* Deprecated header, use the one below directly!
|
||||||
|
*/
|
||||||
|
|
||||||
#include <pcl/point_cloud.h>
|
#include <rtabmap/core/global_map/OccupancyGrid.h>
|
||||||
#include <pcl/pcl_base.h>
|
|
||||||
#include <rtabmap/core/Parameters.h>
|
|
||||||
#include <rtabmap/core/Signature.h>
|
|
||||||
|
|
||||||
namespace rtabmap {
|
|
||||||
|
|
||||||
class RTABMAP_EXP OccupancyGrid
|
#endif /* CORELIB_INCLUDE_RTABMAP_CORE_OCCUPANCYGRID_H_ */
|
||||||
{
|
|
||||||
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:
|
|
||||||
OccupancyGrid(const ParametersMap & parameters = ParametersMap());
|
|
||||||
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);
|
|
||||||
float getCellSize() const {return cellSize_;}
|
|
||||||
void setCloudAssembling(bool enabled);
|
|
||||||
float getMinMapSize() const {return minMapSize_;}
|
|
||||||
bool isGridFromDepth() const {return occupancySensor_;}
|
|
||||||
bool isFullUpdate() const {return fullUpdate_;}
|
|
||||||
float getUpdateError() const {return updateError_;}
|
|
||||||
bool isMapFrameProjection() const {return projMapFrame_;}
|
|
||||||
const std::map<int, Transform> & addedNodes() const {return addedNodes_;}
|
|
||||||
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>
|
|
||||||
typename pcl::PointCloud<PointT>::Ptr segmentCloud(
|
|
||||||
const typename pcl::PointCloud<PointT>::Ptr & cloud,
|
|
||||||
const pcl::IndicesPtr & indices,
|
|
||||||
const Transform & pose,
|
|
||||||
const cv::Point3f & viewPoint,
|
|
||||||
pcl::IndicesPtr & groundIndices, // output cloud indices
|
|
||||||
pcl::IndicesPtr & obstaclesIndices, // output cloud indices
|
|
||||||
pcl::IndicesPtr * flatObstacles = 0) const; // output cloud indices
|
|
||||||
|
|
||||||
void createLocalMap(
|
|
||||||
const Signature & node,
|
|
||||||
cv::Mat & groundCells,
|
|
||||||
cv::Mat & obstacleCells,
|
|
||||||
cv::Mat & emptyCells,
|
|
||||||
cv::Point3f & viewPoint);
|
|
||||||
|
|
||||||
void createLocalMap(
|
|
||||||
const LaserScan & cloud,
|
|
||||||
const Transform & pose,
|
|
||||||
cv::Mat & groundCells,
|
|
||||||
cv::Mat & obstacleCells,
|
|
||||||
cv::Mat & emptyCells,
|
|
||||||
cv::Point3f & viewPointInOut) const;
|
|
||||||
|
|
||||||
void clear();
|
|
||||||
void addToCache(
|
|
||||||
int nodeId,
|
|
||||||
const cv::Mat & ground,
|
|
||||||
const cv::Mat & obstacles,
|
|
||||||
const cv::Mat & empty);
|
|
||||||
bool update(const std::map<int, Transform> & poses); // return true if map has changed
|
|
||||||
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_;}
|
|
||||||
|
|
||||||
unsigned long getMemoryUsed() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
ParametersMap parameters_;
|
|
||||||
unsigned int cloudDecimation_;
|
|
||||||
float cloudMaxDepth_;
|
|
||||||
float cloudMinDepth_;
|
|
||||||
std::vector<float> roiRatios_;
|
|
||||||
float footprintLength_;
|
|
||||||
float footprintWidth_;
|
|
||||||
float footprintHeight_;
|
|
||||||
int scanDecimation_;
|
|
||||||
float cellSize_;
|
|
||||||
bool preVoxelFiltering_;
|
|
||||||
int occupancySensor_;
|
|
||||||
bool projMapFrame_;
|
|
||||||
float maxObstacleHeight_;
|
|
||||||
int normalKSearch_;
|
|
||||||
float groundNormalsUp_;
|
|
||||||
float maxGroundAngle_;
|
|
||||||
float clusterRadius_;
|
|
||||||
int minClusterSize_;
|
|
||||||
bool flatObstaclesDetected_;
|
|
||||||
float minGroundHeight_;
|
|
||||||
float maxGroundHeight_;
|
|
||||||
bool normalsSegmentation_;
|
|
||||||
bool grid3D_;
|
|
||||||
bool groundIsObstacle_;
|
|
||||||
float noiseFilteringRadius_;
|
|
||||||
int noiseFilteringMinNeighbors_;
|
|
||||||
bool scan2dUnknownSpaceFilled_;
|
|
||||||
bool rayTracing_;
|
|
||||||
bool fullUpdate_;
|
|
||||||
float minMapSize_;
|
|
||||||
bool erode_;
|
|
||||||
float footprintRadius_;
|
|
||||||
float updateError_;
|
|
||||||
float occupancyThr_;
|
|
||||||
float probHit_;
|
|
||||||
float probMiss_;
|
|
||||||
float probClampingMin_;
|
|
||||||
float probClampingMax_;
|
|
||||||
|
|
||||||
std::map<int, std::pair<std::pair<cv::Mat, cv::Mat>, cv::Mat> > cache_; //<node id, < <ground, obstacles>, empty> >
|
|
||||||
cv::Mat map_;
|
|
||||||
cv::Mat mapInfo_;
|
|
||||||
std::map<int, std::pair<int, int> > cellCount_; //<node Id, cells>
|
|
||||||
float xMin_;
|
|
||||||
float yMin_;
|
|
||||||
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_;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <rtabmap/core/impl/OccupancyGrid.hpp>
|
|
||||||
|
|
||||||
#endif /* CORELIB_SRC_OCCUPANCYGRID_H_ */
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
Copyright (c) 2010-2023, 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
|
||||||
@@ -25,223 +25,14 @@ 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SRC_OCTOMAP_H_
|
#ifndef CORELIB_INCLUDE_RTABMAP_CORE_OCTOMAP_H_
|
||||||
#define SRC_OCTOMAP_H_
|
#define CORELIB_INCLUDE_RTABMAP_CORE_OCTOMAP_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
/*
|
||||||
|
* Deprecated header, use the one below directly!
|
||||||
|
*/
|
||||||
|
|
||||||
#include <octomap/ColorOcTree.h>
|
#include <rtabmap/core/global_map/OctoMap.h>
|
||||||
#include <octomap/OcTreeKey.h>
|
|
||||||
|
|
||||||
#include <pcl/pcl_base.h>
|
|
||||||
#include <pcl/point_types.h>
|
|
||||||
|
|
||||||
#include <rtabmap/core/Transform.h>
|
#endif /* CORELIB_INCLUDE_RTABMAP_CORE_OCTOMAP_H_ */
|
||||||
#include <rtabmap/core/Parameters.h>
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include <unordered_set>
|
|
||||||
#include <string>
|
|
||||||
#include <queue>
|
|
||||||
|
|
||||||
namespace rtabmap {
|
|
||||||
|
|
||||||
// forward declaraton for "friend"
|
|
||||||
class RtabmapColorOcTree;
|
|
||||||
|
|
||||||
class RtabmapColorOcTreeNode : public octomap::ColorOcTreeNode
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
enum OccupancyType {kTypeUnknown=-1, kTypeEmpty=0, kTypeGround=1, kTypeObstacle=100};
|
|
||||||
|
|
||||||
public:
|
|
||||||
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);
|
|
||||||
|
|
||||||
void updateOccupancyTypeChildren();
|
|
||||||
|
|
||||||
private:
|
|
||||||
int nodeRefId_;
|
|
||||||
int type_; // -1=undefined, 0=empty, 100=obstacle, 1=ground
|
|
||||||
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 ~RtabmapColorOcTree() {}
|
|
||||||
|
|
||||||
/// 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 {
|
|
||||||
public:
|
|
||||||
OctoMap(const ParametersMap & parameters = ParametersMap());
|
|
||||||
|
|
||||||
const std::map<int, Transform> & addedNodes() const {return addedNodes_;}
|
|
||||||
void addToCache(int nodeId,
|
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & ground,
|
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & obstacles,
|
|
||||||
const pcl::PointXYZ & viewPoint);
|
|
||||||
void addToCache(int nodeId,
|
|
||||||
const cv::Mat & ground,
|
|
||||||
const cv::Mat & obstacles,
|
|
||||||
const cv::Mat & empty,
|
|
||||||
const cv::Point3f & viewPoint);
|
|
||||||
bool update(const std::map<int, Transform> & poses); // return true if map has changed
|
|
||||||
|
|
||||||
const RtabmapColorOcTree * octree() const {return octree_;}
|
|
||||||
|
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr createCloud(
|
|
||||||
unsigned int treeDepth = 0,
|
|
||||||
std::vector<int> * obstacleIndices = 0,
|
|
||||||
std::vector<int> * emptyIndices = 0,
|
|
||||||
std::vector<int> * groundIndices = 0,
|
|
||||||
bool originalRefPoints = true,
|
|
||||||
std::vector<int> * frontierIndices = 0,
|
|
||||||
std::vector<double> * cloudProb = 0) const;
|
|
||||||
|
|
||||||
cv::Mat createProjectionMap(
|
|
||||||
float & xMin,
|
|
||||||
float & yMin,
|
|
||||||
float & gridCellSize,
|
|
||||||
float minGridSize = 0.0f,
|
|
||||||
unsigned int treeDepth = 0);
|
|
||||||
|
|
||||||
bool writeBinary(const std::string & path);
|
|
||||||
|
|
||||||
virtual ~OctoMap();
|
|
||||||
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_;}
|
|
||||||
|
|
||||||
static std::unordered_set<octomap::OcTreeKey, octomap::OcTreeKey::KeyHash> findEmptyNode(RtabmapColorOcTree* octree_, unsigned int treeDepth, octomap::point3d startPosition);
|
|
||||||
static void floodFill(RtabmapColorOcTree* octree_, unsigned int treeDepth,octomap::point3d startPosition, std::unordered_set<octomap::OcTreeKey, octomap::OcTreeKey::KeyHash> & EmptyNodes,std::queue<octomap::point3d>& positionToExplore);
|
|
||||||
static bool isNodeVisited(std::unordered_set<octomap::OcTreeKey,octomap::OcTreeKey::KeyHash> const & EmptyNodes,octomap::OcTreeKey const key);
|
|
||||||
static octomap::point3d findCloseEmpty(RtabmapColorOcTree* octree_, unsigned int treeDepth,octomap::point3d startPosition);
|
|
||||||
static bool isValidEmpty(RtabmapColorOcTree* octree_, unsigned int treeDepth,octomap::point3d startPosition);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void updateMinMax(const octomap::point3d & point);
|
|
||||||
|
|
||||||
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_;
|
|
||||||
RtabmapColorOcTree * octree_;
|
|
||||||
std::map<int, Transform> addedNodes_;
|
|
||||||
bool hasColor_;
|
|
||||||
bool fullUpdate_;
|
|
||||||
float updateError_;
|
|
||||||
float rangeMax_;
|
|
||||||
bool rayTracing_;
|
|
||||||
unsigned int emptyFloodFillDepth_;
|
|
||||||
double minValues_[3];
|
|
||||||
double maxValues_[3];
|
|
||||||
};
|
|
||||||
|
|
||||||
} /* namespace rtabmap */
|
|
||||||
|
|
||||||
#endif /* SRC_OCTOMAP_H_ */
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef ODOMETRY_H_
|
#ifndef ODOMETRY_H_
|
||||||
#define ODOMETRY_H_
|
#define ODOMETRY_H_
|
||||||
|
|
||||||
#include <rtabmap/core/RtabmapExp.h>
|
#include <rtabmap/core/rtabmap_core_export.h>
|
||||||
|
|
||||||
#include <rtabmap/core/Transform.h>
|
#include <rtabmap/core/Transform.h>
|
||||||
#include <rtabmap/core/SensorData.h>
|
#include <rtabmap/core/SensorData.h>
|
||||||
@@ -39,7 +39,7 @@ namespace rtabmap {
|
|||||||
class OdometryInfo;
|
class OdometryInfo;
|
||||||
class ParticleFilter;
|
class ParticleFilter;
|
||||||
|
|
||||||
class RTABMAP_EXP Odometry
|
class RTABMAP_CORE_EXPORT Odometry
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Type {
|
enum Type {
|
||||||
@@ -75,7 +75,8 @@ public:
|
|||||||
//getters
|
//getters
|
||||||
const Transform & getPose() const {return _pose;}
|
const Transform & getPose() const {return _pose;}
|
||||||
bool isInfoDataFilled() const {return _fillInfoData;}
|
bool isInfoDataFilled() const {return _fillInfoData;}
|
||||||
RTABMAP_DEPRECATED(const Transform & previousVelocityTransform() const, "Use getVelocityGuess() instead.");
|
// Use getVelocityGuess() instead.
|
||||||
|
RTABMAP_DEPRECATED const Transform & previousVelocityTransform() const;
|
||||||
const Transform & getVelocityGuess() const {return velocityGuess_;}
|
const Transform & getVelocityGuess() const {return velocityGuess_;}
|
||||||
double previousStamp() const {return previousStamp_;}
|
double previousStamp() const {return previousStamp_;}
|
||||||
unsigned int framesProcessed() const {return framesProcessed_;}
|
unsigned int framesProcessed() const {return framesProcessed_;}
|
||||||
@@ -110,6 +111,7 @@ private:
|
|||||||
bool _alignWithGround;
|
bool _alignWithGround;
|
||||||
bool _publishRAMUsage;
|
bool _publishRAMUsage;
|
||||||
bool _imagesAlreadyRectified;
|
bool _imagesAlreadyRectified;
|
||||||
|
bool _deskewing;
|
||||||
Transform _pose;
|
Transform _pose;
|
||||||
int _resetCurrentCount;
|
int _resetCurrentCount;
|
||||||
double previousStamp_;
|
double previousStamp_;
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public:
|
|||||||
localBundleConstraints(0),
|
localBundleConstraints(0),
|
||||||
localBundleTime(0),
|
localBundleTime(0),
|
||||||
keyFrameAdded(false),
|
keyFrameAdded(false),
|
||||||
|
timeDeskewing(0.0f),
|
||||||
timeEstimation(0.0f),
|
timeEstimation(0.0f),
|
||||||
timeParticleFiltering(0.0f),
|
timeParticleFiltering(0.0f),
|
||||||
stamp(0),
|
stamp(0),
|
||||||
@@ -76,6 +77,7 @@ public:
|
|||||||
output.localBundlePoses = localBundlePoses;
|
output.localBundlePoses = localBundlePoses;
|
||||||
output.localBundleModels = localBundleModels;
|
output.localBundleModels = localBundleModels;
|
||||||
output.keyFrameAdded = keyFrameAdded;
|
output.keyFrameAdded = keyFrameAdded;
|
||||||
|
output.timeDeskewing = timeDeskewing;
|
||||||
output.timeEstimation = timeEstimation;
|
output.timeEstimation = timeEstimation;
|
||||||
output.timeParticleFiltering = timeParticleFiltering;
|
output.timeParticleFiltering = timeParticleFiltering;
|
||||||
output.stamp = stamp;
|
output.stamp = stamp;
|
||||||
@@ -105,6 +107,7 @@ public:
|
|||||||
std::map<int, Transform> localBundlePoses;
|
std::map<int, Transform> localBundlePoses;
|
||||||
std::map<int, std::vector<CameraModel> > localBundleModels;
|
std::map<int, std::vector<CameraModel> > localBundleModels;
|
||||||
bool keyFrameAdded;
|
bool keyFrameAdded;
|
||||||
|
float timeDeskewing;
|
||||||
float timeEstimation;
|
float timeEstimation;
|
||||||
float timeParticleFiltering;
|
float timeParticleFiltering;
|
||||||
double stamp;
|
double stamp;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef ODOMETRYTHREAD_H_
|
#ifndef ODOMETRYTHREAD_H_
|
||||||
#define ODOMETRYTHREAD_H_
|
#define ODOMETRYTHREAD_H_
|
||||||
|
|
||||||
#include <rtabmap/core/RtabmapExp.h>
|
#include <rtabmap/core/rtabmap_core_export.h>
|
||||||
#include <rtabmap/core/SensorData.h>
|
#include <rtabmap/core/SensorData.h>
|
||||||
#include <rtabmap/utilite/UThread.h>
|
#include <rtabmap/utilite/UThread.h>
|
||||||
#include <rtabmap/utilite/UEventsHandler.h>
|
#include <rtabmap/utilite/UEventsHandler.h>
|
||||||
@@ -38,7 +38,7 @@ namespace rtabmap {
|
|||||||
|
|
||||||
class Odometry;
|
class Odometry;
|
||||||
|
|
||||||
class RTABMAP_EXP OdometryThread : public UThread, public UEventsHandler {
|
class RTABMAP_CORE_EXPORT OdometryThread : public UThread, public UEventsHandler {
|
||||||
public:
|
public:
|
||||||
// take ownership of Odometry
|
// take ownership of Odometry
|
||||||
OdometryThread(Odometry * odometry, unsigned int dataBufferMaxSize = 1);
|
OdometryThread(Odometry * odometry, unsigned int dataBufferMaxSize = 1);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef OPTIMIZER_H_
|
#ifndef OPTIMIZER_H_
|
||||||
#define OPTIMIZER_H_
|
#define OPTIMIZER_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
////////////////////////////////////////////
|
////////////////////////////////////////////
|
||||||
// Graph optimizers
|
// Graph optimizers
|
||||||
////////////////////////////////////////////
|
////////////////////////////////////////////
|
||||||
class RTABMAP_EXP Optimizer
|
class RTABMAP_CORE_EXPORT Optimizer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Type {
|
enum Type {
|
||||||
@@ -79,8 +79,7 @@ public:
|
|||||||
const std::map<int, Transform> & posesIn,
|
const std::map<int, Transform> & posesIn,
|
||||||
const std::multimap<int, Link> & linksIn,
|
const std::multimap<int, Link> & linksIn,
|
||||||
std::map<int, Transform> & posesOut,
|
std::map<int, Transform> & posesOut,
|
||||||
std::multimap<int, Link> & linksOut,
|
std::multimap<int, Link> & linksOut) const;
|
||||||
bool adjustPosesWithConstraints = true) const;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~Optimizer() {}
|
virtual ~Optimizer() {}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#define PARAMETERS_H_
|
#define PARAMETERS_H_
|
||||||
|
|
||||||
// default parameters
|
// default parameters
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
#include "rtabmap/core/Version.h" // DLL export/import defines
|
#include "rtabmap/core/Version.h" // DLL export/import defines
|
||||||
#include <rtabmap/utilite/UConversion.h>
|
#include <rtabmap/utilite/UConversion.h>
|
||||||
#include <opencv2/core/version.hpp>
|
#include <opencv2/core/version.hpp>
|
||||||
@@ -167,7 +167,7 @@ typedef std::pair<std::string, std::string> ParametersPair;
|
|||||||
* @see getDefaultParameters()
|
* @see getDefaultParameters()
|
||||||
* TODO Add a detailed example with simple classes
|
* TODO Add a detailed example with simple classes
|
||||||
*/
|
*/
|
||||||
class RTABMAP_EXP Parameters
|
class RTABMAP_CORE_EXPORT Parameters
|
||||||
{
|
{
|
||||||
// Rtabmap parameters
|
// Rtabmap parameters
|
||||||
RTABMAP_PARAM(Rtabmap, PublishStats, bool, true, "Publishing statistics.");
|
RTABMAP_PARAM(Rtabmap, PublishStats, bool, true, "Publishing statistics.");
|
||||||
@@ -183,7 +183,8 @@ class RTABMAP_EXP Parameters
|
|||||||
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()));
|
||||||
RTABMAP_PARAM_STR(Rtabmap, WorkingDirectory, "", "Working directory.");
|
RTABMAP_PARAM_STR(Rtabmap, WorkingDirectory, "", "Working directory.");
|
||||||
RTABMAP_PARAM(Rtabmap, MaxRetrieved, unsigned int, 2, "Maximum locations retrieved at the same time from LTM.");
|
RTABMAP_PARAM(Rtabmap, MaxRetrieved, unsigned int, 2, "Maximum nodes retrieved at the same time from LTM.");
|
||||||
|
RTABMAP_PARAM(Rtabmap, MaxRepublished, unsigned int, 2, uFormat("Maximum nodes republished when requesting missing data. When %s=false, only loop closure data is republished, otherwise the closest nodes from the current localization are republished first. Ignored if %s=false.", kRGBDEnabled().c_str(), kRtabmapPublishLastSignature().c_str()));
|
||||||
RTABMAP_PARAM(Rtabmap, StatisticLogsBufferedInRAM, bool, true, "Statistic logs buffered in RAM instead of written to hard drive after each iteration.");
|
RTABMAP_PARAM(Rtabmap, StatisticLogsBufferedInRAM, bool, true, "Statistic logs buffered in RAM instead of written to hard drive after each iteration.");
|
||||||
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.");
|
||||||
@@ -196,6 +197,7 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(Rtabmap, LoopThr, float, 0.11, "Loop closing threshold.");
|
RTABMAP_PARAM(Rtabmap, LoopThr, float, 0.11, "Loop closing threshold.");
|
||||||
RTABMAP_PARAM(Rtabmap, LoopRatio, float, 0, "The loop closure hypothesis must be over LoopRatio x lastHypothesisValue.");
|
RTABMAP_PARAM(Rtabmap, LoopRatio, float, 0, "The loop closure hypothesis must be over LoopRatio x lastHypothesisValue.");
|
||||||
RTABMAP_PARAM(Rtabmap, LoopGPS, bool, true, uFormat("Use GPS to filter likelihood (if GPS is recorded). Only locations inside the local radius \"%s\" of the current GPS location are considered for loop closure detection.", kRGBDLocalRadius().c_str()));
|
RTABMAP_PARAM(Rtabmap, LoopGPS, bool, true, uFormat("Use GPS to filter likelihood (if GPS is recorded). Only locations inside the local radius \"%s\" of the current GPS location are considered for loop closure detection.", kRGBDLocalRadius().c_str()));
|
||||||
|
RTABMAP_PARAM(Rtabmap, VirtualPlaceLikelihoodRatio, int, 0, "Likelihood ratio for virtual place (for no loop closure hypothesis): 0=Mean / StdDev, 1=StdDev / (Max-Mean)");
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
RTABMAP_PARAM(Mem, RehearsalSimilarity, float, 0.6, "Rehearsal similarity.");
|
RTABMAP_PARAM(Mem, RehearsalSimilarity, float, 0.6, "Rehearsal similarity.");
|
||||||
@@ -230,6 +232,8 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(Mem, UseOdomFeatures, bool, true, "Use odometry features instead of regenerating them.");
|
RTABMAP_PARAM(Mem, UseOdomFeatures, bool, true, "Use odometry features instead of regenerating them.");
|
||||||
RTABMAP_PARAM(Mem, UseOdomGravity, bool, false, uFormat("Use odometry instead of IMU orientation to add gravity links to new nodes created. We assume that odometry is already aligned with gravity (e.g., we are using a VIO approach). Gravity constraints are used by graph optimization only if \"%s\" is not zero.", kOptimizerGravitySigma().c_str()));
|
RTABMAP_PARAM(Mem, UseOdomGravity, bool, false, uFormat("Use odometry instead of IMU orientation to add gravity links to new nodes created. We assume that odometry is already aligned with gravity (e.g., we are using a VIO approach). Gravity constraints are used by graph optimization only if \"%s\" is not zero.", kOptimizerGravitySigma().c_str()));
|
||||||
RTABMAP_PARAM(Mem, CovOffDiagIgnored, bool, true, "Ignore off diagonal values of the covariance matrix.");
|
RTABMAP_PARAM(Mem, CovOffDiagIgnored, bool, true, "Ignore off diagonal values of the covariance matrix.");
|
||||||
|
RTABMAP_PARAM(Mem, GlobalDescriptorStrategy, int, 0, "Extract global descriptor from sensor data. 0=disabled, 1=PyDescriptor");
|
||||||
|
RTABMAP_PARAM(Mem, RotateImagesUpsideUp, bool, false, "Rotate images so that upside is up if they are not already. This can be useful in case the robots don't have all same camera orientation but are using the same map, so that not rotation-invariant visual features can still be used across the fleet.");
|
||||||
|
|
||||||
// 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");
|
||||||
@@ -240,6 +244,7 @@ class RTABMAP_EXP Parameters
|
|||||||
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, 500, "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, SSC, bool, false, "If true, SSC (Suppression via Square Covering) is applied to limit keypoints.");
|
||||||
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.)");
|
||||||
#if CV_MAJOR_VERSION > 2 && !defined(HAVE_OPENCV_XFEATURES2D)
|
#if CV_MAJOR_VERSION > 2 && !defined(HAVE_OPENCV_XFEATURES2D)
|
||||||
@@ -352,10 +357,12 @@ class RTABMAP_EXP Parameters
|
|||||||
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, 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, 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, AngularSpeedUpdate, float, 0.0, "Maximum angular speed (rad/s) to update the map (0 means not limit).");
|
||||||
|
RTABMAP_PARAM(RGBD, AggressiveLoopThr, float, 0.05, uFormat("Loop closure threshold used (overriding %s) when a new mapping session is not yet linked to a map of the highest loop closure hypothesis. In localization mode, this threshold is used when there are no loop closure constraints with any map in the cache (%s). In all cases, the goal is to aggressively loop on a previous map in the database. Only used when %s is enabled. Set 1 to disable.", kRtabmapLoopThr().c_str(), kRGBDMaxOdomCacheSize().c_str(), kRGBDEnabled().c_str()));
|
||||||
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, 3.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, OptimizeMaxError, float, 3.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, MaxLoopClosureDistance, float, 0.0, "Reject loop closures/localizations if the distance from the map is over this distance (0=disabled).");
|
RTABMAP_PARAM(RGBD, MaxLoopClosureDistance, float, 0.0, "Reject loop closures/localizations if the distance from the map is over this distance (0=disabled).");
|
||||||
|
RTABMAP_PARAM(RGBD, ForceOdom3DoF, bool, true, uFormat("Force odometry pose to be 3DoF if %s=true.", kRegForce3DoF().c_str()));
|
||||||
RTABMAP_PARAM(RGBD, StartAtOrigin, bool, false, uFormat("If true, rtabmap will assume the robot is starting from origin of the map. If false, rtabmap will assume the robot is restarting from the last saved localization pose from previous session (the place where it shut down previously). Used only in localization mode (%s=false).", kMemIncrementalMemory().c_str()));
|
RTABMAP_PARAM(RGBD, StartAtOrigin, bool, false, uFormat("If true, rtabmap will assume the robot is starting from origin of the map. If false, rtabmap will assume the robot is restarting from the last saved localization pose from previous session (the place where it shut down previously). Used only in localization mode (%s=false).", kMemIncrementalMemory().c_str()));
|
||||||
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.");
|
||||||
@@ -375,6 +382,8 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(RGBD, MarkerDetection, bool, false, "Detect static markers to be added as landmarks for graph optimization. If input data have already landmarks, this will be ignored. See \"Marker\" group for parameters.");
|
RTABMAP_PARAM(RGBD, MarkerDetection, bool, false, "Detect static markers to be added as landmarks for graph optimization. If input data have already landmarks, this will be ignored. See \"Marker\" group for parameters.");
|
||||||
RTABMAP_PARAM(RGBD, LoopCovLimited, bool, false, "Limit covariance of non-neighbor links to minimum covariance of neighbor links. In other words, if covariance of a loop closure link is smaller than the minimum covariance of odometry links, its covariance is set to minimum covariance of odometry links.");
|
RTABMAP_PARAM(RGBD, LoopCovLimited, bool, false, "Limit covariance of non-neighbor links to minimum covariance of neighbor links. In other words, if covariance of a loop closure link is smaller than the minimum covariance of odometry links, its covariance is set to minimum covariance of odometry links.");
|
||||||
RTABMAP_PARAM(RGBD, MaxOdomCacheSize, int, 10, uFormat("Maximum odometry cache size. Used only in localization mode (when %s=false). This is used to get smoother localizations and to verify localization transforms (when %s!=0) to make sure we don't teleport to a location very similar to one we previously localized on. Set 0 to disable caching.", kMemIncrementalMemory().c_str(), kRGBDOptimizeMaxError().c_str()));
|
RTABMAP_PARAM(RGBD, MaxOdomCacheSize, int, 10, uFormat("Maximum odometry cache size. Used only in localization mode (when %s=false). This is used to get smoother localizations and to verify localization transforms (when %s!=0) to make sure we don't teleport to a location very similar to one we previously localized on. Set 0 to disable caching.", kMemIncrementalMemory().c_str(), kRGBDOptimizeMaxError().c_str()));
|
||||||
|
RTABMAP_PARAM(RGBD, LocalizationSmoothing, bool, true, uFormat("Adjust localization constraints based on optimized odometry cache poses (when %s>0).", kRGBDMaxOdomCacheSize().c_str()));
|
||||||
|
RTABMAP_PARAM(RGBD, LocalizationPriorError, double, 0.001, uFormat("The corresponding variance (error x error) set to priors of the map's poses during localization (when %s>0).", kRGBDMaxOdomCacheSize().c_str()));
|
||||||
|
|
||||||
// Local/Proximity loop closure detection
|
// Local/Proximity loop closure detection
|
||||||
RTABMAP_PARAM(RGBD, ProximityByTime, bool, false, "Detection over all locations in STM.");
|
RTABMAP_PARAM(RGBD, ProximityByTime, bool, false, "Detection over all locations in STM.");
|
||||||
@@ -432,6 +441,9 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(g2o, Baseline, double, 0.075, "When doing bundle adjustment with RGB-D data, we can set a fake baseline (m) to do stereo bundle adjustment (if 0, mono bundle adjustment is done). For stereo data, the baseline in the calibration is used directly.");
|
RTABMAP_PARAM(g2o, Baseline, double, 0.075, "When doing bundle adjustment with RGB-D data, we can set a fake baseline (m) to do stereo bundle adjustment (if 0, mono bundle adjustment is done). For stereo data, the baseline in the calibration is used directly.");
|
||||||
|
|
||||||
RTABMAP_PARAM(GTSAM, Optimizer, int, 1, "0=Levenberg 1=GaussNewton 2=Dogleg");
|
RTABMAP_PARAM(GTSAM, Optimizer, int, 1, "0=Levenberg 1=GaussNewton 2=Dogleg");
|
||||||
|
RTABMAP_PARAM(GTSAM, Incremental, bool, false, uFormat("Do graph optimization incrementally (iSAM2) to increase optimization speed on loop closures. Note that only GaussNewton and Dogleg optimization algorithms are supported (%s) in this mode.", kGTSAMOptimizer().c_str()));
|
||||||
|
RTABMAP_PARAM(GTSAM, IncRelinearizeThreshold, double, 0.01, "Only relinearize variables whose linear delta magnitude is greater than this threshold. See GTSAM::ISAM2 doc for more info.");
|
||||||
|
RTABMAP_PARAM(GTSAM, IncRelinearizeSkip, int, 1, "Only relinearize any variables every X calls to ISAM2::update(). See GTSAM::ISAM2 doc for more info.");
|
||||||
|
|
||||||
// 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 6=OKVIS 7=LOAM 8=MSCKF_VIO 9=VINS-Fusion 10=OpenVINS 11=FLOAM 12=Open3D");
|
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 9=VINS-Fusion 10=OpenVINS 11=FLOAM 12=Open3D");
|
||||||
@@ -454,6 +466,7 @@ class RTABMAP_EXP Parameters
|
|||||||
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, 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, unsigned int, 1, uFormat("Decimation of the RGB image before registration. If depth size is larger than decimated RGB size, depth is decimated to be always at most equal to RGB size. If %s is true and if depth is smaller than decimated RGB, depth may be interpolated to match RGB size for feature detection.", kVisDepthAsMask().c_str()));
|
RTABMAP_PARAM(Odom, ImageDecimation, unsigned int, 1, uFormat("Decimation of the RGB image before registration. If depth size is larger than decimated RGB size, depth is decimated to be always at most equal to RGB size. If %s is true and if depth is smaller than decimated RGB, depth may be interpolated to match RGB size for feature detection.", kVisDepthAsMask().c_str()));
|
||||||
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.");
|
||||||
|
RTABMAP_PARAM(Odom, Deskewing, bool, true, "Lidar deskewing. If input lidar has time channel, it will be deskewed with a constant motion model (with IMU orientation and/or guess if provided).");
|
||||||
|
|
||||||
// Odometry Frame-to-Map
|
// Odometry Frame-to-Map
|
||||||
RTABMAP_PARAM(OdomF2M, MaxSize, int, 2000, "[Visual] Local map size: If > 0 (example 5000), the odometry will maintain a local map of X maximum words.");
|
RTABMAP_PARAM(OdomF2M, MaxSize, int, 2000, "[Visual] Local map size: If > 0 (example 5000), the odometry will maintain a local map of X maximum words.");
|
||||||
@@ -524,12 +537,19 @@ 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(OdomORBSLAM, VocPath, "", "Path to ORB vocabulary (*.txt).");
|
RTABMAP_PARAM_STR(OdomORBSLAM, VocPath, "", "Path to ORB vocabulary (*.txt).");
|
||||||
RTABMAP_PARAM(OdomORBSLAM, Bf, double, 0.076, "Fake IR projector baseline (m) used only when stereo is not used.");
|
RTABMAP_PARAM(OdomORBSLAM, Bf, double, 0.076, "Fake IR projector baseline (m) used only when stereo is not used.");
|
||||||
RTABMAP_PARAM(OdomORBSLAM, ThDepth, double, 40.0, "Close/Far threshold. Baseline times.");
|
RTABMAP_PARAM(OdomORBSLAM, ThDepth, double, 40.0, "Close/Far threshold. Baseline times.");
|
||||||
RTABMAP_PARAM(OdomORBSLAM, Fps, float, 0.0, "Camera FPS.");
|
RTABMAP_PARAM(OdomORBSLAM, Fps, float, 0.0, "Camera FPS (0 to estimate from input data).");
|
||||||
RTABMAP_PARAM(OdomORBSLAM, MaxFeatures, int, 1000, "Maximum ORB features extracted per frame.");
|
RTABMAP_PARAM(OdomORBSLAM, MaxFeatures, int, 1000, "Maximum ORB features extracted per frame.");
|
||||||
RTABMAP_PARAM(OdomORBSLAM, MapSize, int, 3000, "Maximum size of the feature map (0 means infinite).");
|
RTABMAP_PARAM(OdomORBSLAM, MapSize, int, 3000, "Maximum size of the feature map (0 means infinite). Only supported with ORB_SLAM2.");
|
||||||
|
RTABMAP_PARAM(OdomORBSLAM, Inertial, bool, false, "Enable IMU. Only supported with ORB_SLAM3.");
|
||||||
|
RTABMAP_PARAM(OdomORBSLAM, GyroNoise, double, 0.01, "IMU gyroscope \"white noise\".");
|
||||||
|
RTABMAP_PARAM(OdomORBSLAM, AccNoise, double, 0.1, "IMU accelerometer \"white noise\".");
|
||||||
|
RTABMAP_PARAM(OdomORBSLAM, GyroWalk, double, 0.000001, "IMU gyroscope \"random walk\".");
|
||||||
|
RTABMAP_PARAM(OdomORBSLAM, AccWalk, double, 0.0001, "IMU accelerometer \"random walk\".");
|
||||||
|
RTABMAP_PARAM(OdomORBSLAM, SamplingRate, double, 0, "IMU sampling rate (0 to estimate from input data).");
|
||||||
|
|
||||||
|
|
||||||
// Odometry OKVIS
|
// Odometry OKVIS
|
||||||
RTABMAP_PARAM_STR(OdomOKVIS, ConfigPath, "", "Path of OKVIS config file.");
|
RTABMAP_PARAM_STR(OdomOKVIS, ConfigPath, "", "Path of OKVIS config file.");
|
||||||
@@ -574,6 +594,68 @@ class RTABMAP_EXP Parameters
|
|||||||
// Odometry VINS
|
// Odometry VINS
|
||||||
RTABMAP_PARAM_STR(OdomVINS, ConfigPath, "", "Path of VINS config file.");
|
RTABMAP_PARAM_STR(OdomVINS, ConfigPath, "", "Path of VINS config file.");
|
||||||
|
|
||||||
|
// Odometry OpenVINS
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, UseStereo, bool, true, "If we have more than 1 camera, if we should try to track stereo constraints between pairs");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, UseKLT, bool, true, "If true we will use KLT, otherwise use a ORB descriptor + robust matching");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, NumPts, int, 200, "Number of points (per camera) we will extract and try to track");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, MinPxDist, int, 15, "Eistance between features (features near each other provide less information)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, FiTriangulate1d, bool, false, "If we should perform 1d triangulation instead of 3d");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, FiRefineFeatures, bool, true, "If we should perform Levenberg-Marquardt refinement");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, FiMaxRuns, int, 5, "Max runs for Levenberg-Marquardt");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, FiMaxBaseline, double, 40, "Max baseline ratio to accept triangulated features");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, FiMaxCondNumber, double, 10000, "Max condition number of linear triangulation matrix accept triangulated features");
|
||||||
|
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, UseFEJ, bool, true, "If first-estimate Jacobians should be used (enable for good consistency)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, Integration, int, 1, "0=discrete, 1=rk4, 2=analytical (if rk4 or analytical used then analytical covariance propagation is used)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, CalibCamExtrinsics, bool, false, "Bool to determine whether or not to calibrate imu-to-camera pose");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, CalibCamIntrinsics, bool, false, "Bool to determine whether or not to calibrate camera intrinsics");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, CalibCamTimeoffset, bool, false, "Bool to determine whether or not to calibrate camera to IMU time offset");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, CalibIMUIntrinsics, bool, false, "Bool to determine whether or not to calibrate the IMU intrinsics");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, CalibIMUGSensitivity, bool, false, "Bool to determine whether or not to calibrate the Gravity sensitivity");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, MaxClones, int, 11, "Max clone size of sliding window");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, MaxSLAM, int, 50, "Max number of estimated SLAM features");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, MaxSLAMInUpdate, int, 25, "Max number of SLAM features we allow to be included in a single EKF update.");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, MaxMSCKFInUpdate, int, 50, "Max number of MSCKF features we will use at a given image timestep.");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, FeatRepMSCKF, int, 0, "What representation our features are in (msckf features)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, FeatRepSLAM, int, 4, "What representation our features are in (slam features)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, DtSLAMDelay, double, 0.0, "Delay, in seconds, that we should wait from init before we start estimating SLAM features");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, GravityMag, double, 9.81, "Gravity magnitude in the global frame (i.e. should be 9.81 typically)");
|
||||||
|
RTABMAP_PARAM_STR(OdomOpenVINS, LeftMaskPath, "", "Mask for left image");
|
||||||
|
RTABMAP_PARAM_STR(OdomOpenVINS, RightMaskPath, "", "Mask for right image");
|
||||||
|
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitWindowTime, double, 2.0, "Amount of time we will initialize over (seconds)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitIMUThresh, double, 1.0, "Variance threshold on our acceleration to be classified as moving");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitMaxDisparity, double, 10.0, "Max disparity to consider the platform stationary (dependent on resolution)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitMaxFeatures, int, 50, "How many features to track during initialization (saves on computation)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitDynUse, bool, false, "If dynamic initialization should be used");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitDynMLEOptCalib, bool, false, "If we should optimize calibration during intialization (not recommended)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitDynMLEMaxIter, int, 50, "How many iterations the MLE refinement should use (zero to skip the MLE)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitDynMLEMaxTime, double, 0.05, "How many seconds the MLE should be completed in");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitDynMLEMaxThreads, int, 6, "How many threads the MLE should use");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitDynNumPose, int, 6, "Number of poses to use within our window time (evenly spaced)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitDynMinDeg, double, 10.0, "Orientation change needed to try to init");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitDynInflationOri, double, 10.0, "What to inflate the recovered q_GtoI covariance by");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitDynInflationVel, double, 100.0, "What to inflate the recovered v_IinG covariance by");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitDynInflationBg, double, 10.0, "What to inflate the recovered bias_g covariance by");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitDynInflationBa, double, 100.0, "What to inflate the recovered bias_a covariance by");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, InitDynMinRecCond, double, 1e-15, "Reciprocal condition number thresh for info inversion");
|
||||||
|
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, TryZUPT, bool, true, "If we should try to use zero velocity update");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, ZUPTChi2Multiplier, double, 0.0, "Chi2 multiplier for zero velocity");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, ZUPTMaxVelodicy, double, 0.1, "Max velocity we will consider to try to do a zupt (i.e. if above this, don't do zupt)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, ZUPTNoiseMultiplier, double, 10.0, "Multiplier of our zupt measurement IMU noise matrix (default should be 1.0)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, ZUPTMaxDisparity, double, 0.5, "Max disparity we will consider to try to do a zupt (i.e. if above this, don't do zupt)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, ZUPTOnlyAtBeginning, bool, false, "If we should only use the zupt at the very beginning static initialization phase");
|
||||||
|
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, AccelerometerNoiseDensity, double, 0.01, "[m/s^2/sqrt(Hz)] (accel \"white noise\")");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, AccelerometerRandomWalk, double, 0.001, "[m/s^3/sqrt(Hz)] (accel bias diffusion)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, GyroscopeNoiseDensity, double, 0.001, "[rad/s/sqrt(Hz)] (gyro \"white noise\")");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, GyroscopeRandomWalk, double, 0.0001, "[rad/s^2/sqrt(Hz)] (gyro bias diffusion)");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, UpMSCKFSigmaPx, double, 1.0, "Pixel noise for MSCKF features");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, UpMSCKFChi2Multiplier, double, 1.0, "Chi2 multiplier for MSCKF features");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, UpSLAMSigmaPx, double, 1.0, "Pixel noise for SLAM features");
|
||||||
|
RTABMAP_PARAM(OdomOpenVINS, UpSLAMChi2Multiplier, double, 1.0, "Chi2 multiplier for SLAM features");
|
||||||
|
|
||||||
// Odometry Open3D
|
// Odometry Open3D
|
||||||
RTABMAP_PARAM(OdomOpen3D, MaxDepth, float, 3.0, "Maximum depth.");
|
RTABMAP_PARAM(OdomOpen3D, MaxDepth, float, 3.0, "Maximum depth.");
|
||||||
RTABMAP_PARAM(OdomOpen3D, Method, int, 0, "Registration method: 0=PointToPlane, 1=Intensity, 2=Hybrid.");
|
RTABMAP_PARAM(OdomOpen3D, Method, int, 0, "Registration method: 0=PointToPlane, 1=Intensity, 2=Hybrid.");
|
||||||
@@ -584,54 +666,58 @@ class RTABMAP_EXP Parameters
|
|||||||
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.");
|
||||||
|
|
||||||
// Visual registration parameters
|
// Visual registration parameters
|
||||||
RTABMAP_PARAM(Vis, EstimationType, int, 1, "Motion estimation approach: 0:3D->3D, 1:3D->2D (PnP), 2:2D->2D (Epipolar Geometry)");
|
RTABMAP_PARAM(Vis, EstimationType, int, 1, "Motion estimation approach: 0:3D->3D, 1:3D->2D (PnP), 2:2D->2D (Epipolar Geometry)");
|
||||||
RTABMAP_PARAM(Vis, ForwardEstOnly, bool, true, "Forward estimation only (A->B). If false, a transformation is also computed in backward direction (B->A), then the two resulting transforms are merged (middle interpolation between the transforms).");
|
RTABMAP_PARAM(Vis, ForwardEstOnly, bool, true, "Forward estimation only (A->B). If false, a transformation is also computed in backward direction (B->A), then the two resulting transforms are merged (middle interpolation between the transforms).");
|
||||||
RTABMAP_PARAM(Vis, InlierDistance, float, 0.1, uFormat("[%s = 0] Maximum distance for feature correspondences. Used by 3D->3D estimation approach.", kVisEstimationType().c_str()));
|
RTABMAP_PARAM(Vis, InlierDistance, float, 0.1, uFormat("[%s = 0] Maximum distance for feature correspondences. Used by 3D->3D estimation approach.", 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, 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()));
|
||||||
#if defined(RTABMAP_G2O) || defined(RTABMAP_ORB_SLAM)
|
#if defined(RTABMAP_G2O) || defined(RTABMAP_ORB_SLAM)
|
||||||
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()));
|
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
|
#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()));
|
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
|
#endif
|
||||||
RTABMAP_PARAM(Vis, PnPMaxVariance, float, 0.0, uFormat("[%s = 1] Max linear variance between 3D point correspondences after PnP. 0 means disabled.", kVisEstimationType().c_str()));
|
RTABMAP_PARAM(Vis, PnPVarianceMedianRatio, int, 4, uFormat("[%s = 1] Ratio used to compute variance of the estimated transformation if 3D correspondences are provided (should be > 1). The higher it is, the smaller the covariance will be. With accurate depth estimation, this could be set to 2. For depth estimated by stereo, 4 or more maybe used to ignore large errors of very far points.", kVisEstimationType().c_str()));
|
||||||
|
RTABMAP_PARAM(Vis, PnPMaxVariance, float, 0.0, uFormat("[%s = 1] Max linear variance between 3D point correspondences after PnP. 0 means disabled.", kVisEstimationType().c_str()));
|
||||||
|
RTABMAP_PARAM(Vis, PnPSamplingPolicy, unsigned int, 1, uFormat("[%s = 1] Multi-camera random sampling policy: 0=AUTO, 1=ANY, 2=HOMOGENEOUS. With HOMOGENEOUS policy, RANSAC will be done uniformly against all cameras, so at least 2 matches per camera are required. With ANY policy, RANSAC is not constraint to sample on all cameras at the same time. AUTO policy will use HOMOGENEOUS if there are at least 2 matches per camera, otherwise it will fallback to ANY policy.", kVisEstimationType().c_str()).c_str());
|
||||||
|
RTABMAP_PARAM(Vis, PnPSplitLinearCovComponents, bool, false, uFormat("[%s = 1] Compute variance for each linear component instead of using the combined XYZ variance for all linear components.", kVisEstimationType().c_str()).c_str());
|
||||||
|
|
||||||
RTABMAP_PARAM(Vis, EpipolarGeometryVar, float, 0.1, uFormat("[%s = 2] Epipolar geometry maximum variance to accept the transformation.", kVisEstimationType().c_str()));
|
RTABMAP_PARAM(Vis, EpipolarGeometryVar, float, 0.1, 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, MeanInliersDistance, float, 0.0, "Maximum distance (m) of the mean distance of inliers from the camera to accept the transformation. 0 means disabled.");
|
RTABMAP_PARAM(Vis, MeanInliersDistance, float, 0.0, "Maximum distance (m) of the mean distance of inliers from the camera to accept the transformation. 0 means disabled.");
|
||||||
RTABMAP_PARAM(Vis, MinInliersDistribution, float, 0.0, "Minimum distribution value of the inliers in the image to accept the transformation. The distribution is the second eigen value of the PCA (Principal Component Analysis) on the keypoints of the normalized image [-0.5, 0.5]. The value would be between 0 and 0.5. 0 means disabled.");
|
RTABMAP_PARAM(Vis, MinInliersDistribution, float, 0.0, "Minimum distribution value of the inliers in the image to accept the transformation. The distribution is the second eigen value of the PCA (Principal Component Analysis) on the keypoints of the normalized image [-0.5, 0.5]. The value would be between 0 and 0.5. 0 means disabled.");
|
||||||
|
|
||||||
RTABMAP_PARAM(Vis, Iterations, int, 300, "Maximum iterations to compute the transform.");
|
RTABMAP_PARAM(Vis, Iterations, int, 300, "Maximum iterations to compute the transform.");
|
||||||
#if CV_MAJOR_VERSION > 2 && !defined(HAVE_OPENCV_XFEATURES2D)
|
#if CV_MAJOR_VERSION > 2 && !defined(HAVE_OPENCV_XFEATURES2D)
|
||||||
// OpenCV>2 without xFeatures2D module doesn't have BRIEF
|
// OpenCV>2 without xFeatures2D module doesn't have BRIEF
|
||||||
RTABMAP_PARAM(Vis, FeatureType, 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 10=ORB-OCTREE 11=SuperPoint 12=SURF/FREAK 13=GFTT/DAISY 14=SURF/DAISY 15=PyDetector");
|
RTABMAP_PARAM(Vis, FeatureType, 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 10=ORB-OCTREE 11=SuperPoint 12=SURF/FREAK 13=GFTT/DAISY 14=SURF/DAISY 15=PyDetector");
|
||||||
#else
|
#else
|
||||||
RTABMAP_PARAM(Vis, FeatureType, 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 10=ORB-OCTREE 11=SuperPoint 12=SURF/FREAK 13=GFTT/DAISY 14=SURF/DAISY 15=PyDetector");
|
RTABMAP_PARAM(Vis, FeatureType, 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 10=ORB-OCTREE 11=SuperPoint 12=SURF/FREAK 13=GFTT/DAISY 14=SURF/DAISY 15=PyDetector");
|
||||||
#endif
|
#endif
|
||||||
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, SSC, bool, false, "If true, SSC (Suppression via Square Covering) is applied to limit keypoints.");
|
||||||
RTABMAP_PARAM(Vis, MinDepth, float, 0, "Min 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, DepthAsMask, bool, true, "Use depth image as mask when extracting features.");
|
RTABMAP_PARAM(Vis, MinDepth, float, 0, "Min depth of the features (0 means no limit).");
|
||||||
RTABMAP_PARAM_STR(Vis, RoiRatios, "0.0 0.0 0.0 0.0", "Region of interest ratios [left, right, top, bottom].");
|
RTABMAP_PARAM(Vis, DepthAsMask, bool, true, "Use depth image as mask when extracting features.");
|
||||||
RTABMAP_PARAM(Vis, SubPixWinSize, int, 3, "See cv::cornerSubPix().");
|
RTABMAP_PARAM_STR(Vis, RoiRatios, "0.0 0.0 0.0 0.0", "Region of interest ratios [left, right, top, bottom].");
|
||||||
RTABMAP_PARAM(Vis, SubPixIterations, int, 0, "See cv::cornerSubPix(). 0 disables sub pixel refining.");
|
RTABMAP_PARAM(Vis, SubPixWinSize, int, 3, "See cv::cornerSubPix().");
|
||||||
RTABMAP_PARAM(Vis, SubPixEps, float, 0.02, "See cv::cornerSubPix().");
|
RTABMAP_PARAM(Vis, SubPixIterations, int, 0, "See cv::cornerSubPix(). 0 disables sub pixel refining.");
|
||||||
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, SubPixEps, float, 0.02, "See cv::cornerSubPix().");
|
||||||
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, 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, CorType, int, 0, "Correspondences computation approach: 0=Features Matching, 1=Optical Flow");
|
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, CorNNType, int, 1, uFormat("[%s=0] kNNFlannNaive=0, kNNFlannKdTree=1, kNNFlannLSH=2, kNNBruteForce=3, kNNBruteForceGPU=4, BruteForceCrossCheck=5, SuperGlue=6, GMS=7. Used for features matching approach.", kVisCorType().c_str()));
|
RTABMAP_PARAM(Vis, CorType, int, 0, "Correspondences computation approach: 0=Features Matching, 1=Optical Flow");
|
||||||
RTABMAP_PARAM(Vis, CorNNDR, float, 0.8, uFormat("[%s=0] NNDR: nearest neighbor distance ratio. Used for knn 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, BruteForceCrossCheck=5, SuperGlue=6, GMS=7. Used for features matching approach.", kVisCorType().c_str()));
|
||||||
RTABMAP_PARAM(Vis, CorGuessWinSize, int, 40, 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, CorNNDR, float, 0.8, uFormat("[%s=0] NNDR: nearest neighbor distance ratio. Used for knn features matching approach.", 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, CorGuessWinSize, int, 40, 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, CorFlowWinSize, int, 16, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", 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, CorFlowIterations, int, 30, 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, CorFlowEps, float, 0.01, 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, CorFlowMaxLevel, int, 3, 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()));
|
||||||
#if defined(RTABMAP_G2O) || defined(RTABMAP_ORB_SLAM)
|
#if defined(RTABMAP_G2O) || defined(RTABMAP_ORB_SLAM)
|
||||||
RTABMAP_PARAM(Vis, BundleAdjustment, int, 1, "Optimization with bundle adjustment: 0=disabled, 1=g2o, 2=cvsba, 3=Ceres.");
|
RTABMAP_PARAM(Vis, BundleAdjustment, int, 1, "Optimization with bundle adjustment: 0=disabled, 1=g2o, 2=cvsba, 3=Ceres.");
|
||||||
#else
|
#else
|
||||||
RTABMAP_PARAM(Vis, BundleAdjustment, int, 0, "Optimization with bundle adjustment: 0=disabled, 1=g2o, 2=cvsba, 3=Ceres.");
|
RTABMAP_PARAM(Vis, BundleAdjustment, int, 0, "Optimization with bundle adjustment: 0=disabled, 1=g2o, 2=cvsba, 3=Ceres.");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Features matching approaches
|
// Features matching approaches
|
||||||
@@ -645,6 +731,10 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(GMS, WithScale, bool, false, "Take scale transformation into account.");
|
RTABMAP_PARAM(GMS, WithScale, bool, false, "Take scale transformation into account.");
|
||||||
RTABMAP_PARAM(GMS, ThresholdFactor, double, 6.0, "The higher, the less matches.");
|
RTABMAP_PARAM(GMS, ThresholdFactor, double, 6.0, "The higher, the less matches.");
|
||||||
|
|
||||||
|
// Global descriptor approaches
|
||||||
|
RTABMAP_PARAM_STR(PyDescriptor, Path, "", "Path to python script file (see available ones in rtabmap/corelib/src/pydescriptor/*). See the header to see where the script should be used.");
|
||||||
|
RTABMAP_PARAM(PyDescriptor, Dim, int, 4096, "Descriptor dimension.");
|
||||||
|
|
||||||
// ICP registration parameters
|
// ICP registration parameters
|
||||||
#ifdef RTABMAP_POINTMATCHER
|
#ifdef RTABMAP_POINTMATCHER
|
||||||
RTABMAP_PARAM(Icp, Strategy, int, 1, "ICP implementation: 0=Point Cloud Library, 1=libpointmatcher, 2=CCCoreLib (CloudCompare).");
|
RTABMAP_PARAM(Icp, Strategy, int, 1, "ICP implementation: 0=Point Cloud Library, 1=libpointmatcher, 2=CCCoreLib (CloudCompare).");
|
||||||
@@ -662,10 +752,12 @@ class RTABMAP_EXP Parameters
|
|||||||
#else
|
#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
|
#endif
|
||||||
RTABMAP_PARAM(Icp, Iterations, int, 30, "Max iterations.");
|
RTABMAP_PARAM(Icp, ReciprocalCorrespondences, bool, true, "To be a valid correspondence, the corresponding point in target cloud to point in source cloud should be both their closest closest correspondence.");
|
||||||
|
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.1, "Ratio of matching correspondences to accept the transform.");
|
RTABMAP_PARAM(Icp, CorrespondenceRatio, float, 0.1, "Ratio of matching correspondences to accept the transform.");
|
||||||
RTABMAP_PARAM(Icp, Force4DoF, bool, false, uFormat("Limit ICP to x, y, z and yaw DoF. Available if %s > 0.", kIcpStrategy().c_str()));
|
RTABMAP_PARAM(Icp, Force4DoF, bool, false, uFormat("Limit ICP to x, y, z and yaw DoF. Available if %s > 0.", kIcpStrategy().c_str()));
|
||||||
|
RTABMAP_PARAM(Icp, FiltersEnabled, int, 3, "Flag to enable filters: 1=\"from\" cloud only, 2=\"to\" cloud only, 3=both.");
|
||||||
#ifdef RTABMAP_POINTMATCHER
|
#ifdef RTABMAP_POINTMATCHER
|
||||||
RTABMAP_PARAM(Icp, PointToPlane, bool, true, "Use point to plane ICP.");
|
RTABMAP_PARAM(Icp, PointToPlane, bool, true, "Use point to plane ICP.");
|
||||||
#else
|
#else
|
||||||
@@ -761,8 +853,6 @@ class RTABMAP_EXP Parameters
|
|||||||
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, 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, 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, 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, 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(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, 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).");
|
||||||
@@ -847,6 +937,7 @@ public:
|
|||||||
static ParametersMap filterParameters(const ParametersMap & parameters, const std::string & group, bool remove = false);
|
static ParametersMap filterParameters(const ParametersMap & parameters, const std::string & group, bool remove = false);
|
||||||
|
|
||||||
static void readINI(const std::string & configFile, ParametersMap & parameters, bool modifiedOnly = false);
|
static void readINI(const std::string & configFile, ParametersMap & parameters, bool modifiedOnly = false);
|
||||||
|
static void readINIStr(const std::string & configContent, 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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,31 +11,31 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <rtabmap/utilite/UMutex.h>
|
#include <rtabmap/utilite/UMutex.h>
|
||||||
#include <Python.h>
|
|
||||||
|
namespace pybind11 {
|
||||||
|
class scoped_interpreter;
|
||||||
|
class gil_scoped_release;
|
||||||
|
}
|
||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a single PythonInterface on main thread at
|
||||||
|
* global scope before any Python classes.
|
||||||
|
*/
|
||||||
class PythonInterface
|
class PythonInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PythonInterface();
|
PythonInterface();
|
||||||
virtual ~PythonInterface();
|
virtual ~PythonInterface();
|
||||||
|
|
||||||
protected:
|
|
||||||
std::string getTraceback(); // should be called between lock() and unlock()
|
|
||||||
void lock();
|
|
||||||
void unlock();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static UMutex mutex_;
|
pybind11::scoped_interpreter* guard_;
|
||||||
static int refCount_;
|
pybind11::gil_scoped_release* release_;
|
||||||
|
|
||||||
protected:
|
|
||||||
static PyThreadState * mainThreadState_;
|
|
||||||
static unsigned long mainThreadID_;
|
|
||||||
PyThreadState * threadState_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::string getPythonTraceback();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CORELIB_SRC_PYTHON_PYTHONINTERFACE_H_ */
|
#endif /* CORELIB_SRC_PYTHON_PYTHONINTERFACE_H_ */
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef RECOVERY_H_
|
#ifndef RECOVERY_H_
|
||||||
#define RECOVERY_H_
|
#define RECOVERY_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ class ProgressState;
|
|||||||
* @param errorMsg error message if the function returns false
|
* @param errorMsg error message if the function returns false
|
||||||
* @param progressState A ProgressState object used to get status of the recovery process
|
* @param progressState A ProgressState object used to get status of the recovery process
|
||||||
*/
|
*/
|
||||||
bool RTABMAP_EXP databaseRecovery(
|
bool RTABMAP_CORE_EXPORT databaseRecovery(
|
||||||
const std::string & corruptedDatabase,
|
const std::string & corruptedDatabase,
|
||||||
bool keepCorruptedDatabase = true,
|
bool keepCorruptedDatabase = true,
|
||||||
std::string * errorMsg = 0,
|
std::string * errorMsg = 0,
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef RTABMAP_REGISTRATION_H_
|
#ifndef RTABMAP_REGISTRATION_H_
|
||||||
#define RTABMAP_REGISTRATION_H_
|
#define RTABMAP_REGISTRATION_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <rtabmap/core/Parameters.h>
|
#include <rtabmap/core/Parameters.h>
|
||||||
#include <rtabmap/core/Signature.h>
|
#include <rtabmap/core/Signature.h>
|
||||||
@@ -36,7 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
class RTABMAP_EXP Registration
|
class RTABMAP_CORE_EXPORT Registration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Type {
|
enum Type {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef REGISTRATIONICP_H_
|
#ifndef REGISTRATIONICP_H_
|
||||||
#define REGISTRATIONICP_H_
|
#define REGISTRATIONICP_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <rtabmap/core/Registration.h>
|
#include <rtabmap/core/Registration.h>
|
||||||
#include <rtabmap/core/Signature.h>
|
#include <rtabmap/core/Signature.h>
|
||||||
@@ -36,7 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
namespace rtabmap {
|
namespace rtabmap {
|
||||||
|
|
||||||
// Geometrical registration
|
// Geometrical registration
|
||||||
class RTABMAP_EXP RegistrationIcp : public Registration
|
class RTABMAP_CORE_EXPORT RegistrationIcp : public Registration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// take ownership of child
|
// take ownership of child
|
||||||
@@ -64,10 +64,12 @@ private:
|
|||||||
float _rangeMin;
|
float _rangeMin;
|
||||||
float _rangeMax;
|
float _rangeMax;
|
||||||
float _maxCorrespondenceDistance;
|
float _maxCorrespondenceDistance;
|
||||||
|
bool _reciprocalCorrespondences;
|
||||||
int _maxIterations;
|
int _maxIterations;
|
||||||
float _epsilon;
|
float _epsilon;
|
||||||
float _correspondenceRatio;
|
float _correspondenceRatio;
|
||||||
bool _force4DoF;
|
bool _force4DoF;
|
||||||
|
int _filtersEnabled;
|
||||||
bool _pointToPlane;
|
bool _pointToPlane;
|
||||||
int _pointToPlaneK;
|
int _pointToPlaneK;
|
||||||
float _pointToPlaneRadius;
|
float _pointToPlaneRadius;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef REGISTRATIONVIS_H_
|
#ifndef REGISTRATIONVIS_H_
|
||||||
#define REGISTRATIONVIS_H_
|
#define REGISTRATIONVIS_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include <rtabmap/core/Registration.h>
|
#include <rtabmap/core/Registration.h>
|
||||||
#include <rtabmap/core/Signature.h>
|
#include <rtabmap/core/Signature.h>
|
||||||
@@ -42,7 +42,7 @@ class PyMatcher;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Visual registration
|
// Visual registration
|
||||||
class RTABMAP_EXP RegistrationVis : public Registration
|
class RTABMAP_CORE_EXPORT RegistrationVis : public Registration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// take ownership of child
|
// take ownership of child
|
||||||
@@ -82,7 +82,10 @@ private:
|
|||||||
float _PnPReprojError;
|
float _PnPReprojError;
|
||||||
int _PnPFlags;
|
int _PnPFlags;
|
||||||
int _PnPRefineIterations;
|
int _PnPRefineIterations;
|
||||||
|
int _PnPVarMedianRatio;
|
||||||
float _PnPMaxVar;
|
float _PnPMaxVar;
|
||||||
|
bool _PnPSplitLinearCovarianceComponents;
|
||||||
|
unsigned int _multiSamplingPolicy;
|
||||||
int _correspondencesApproach;
|
int _correspondencesApproach;
|
||||||
int _flowWinSize;
|
int _flowWinSize;
|
||||||
int _flowIterations;
|
int _flowIterations;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef RTABMAP_H_
|
#ifndef RTABMAP_H_
|
||||||
#define RTABMAP_H_
|
#define RTABMAP_H_
|
||||||
|
|
||||||
#include "rtabmap/core/RtabmapExp.h" // DLL export/import defines
|
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
|
||||||
|
|
||||||
#include "rtabmap/core/Parameters.h"
|
#include "rtabmap/core/Parameters.h"
|
||||||
#include "rtabmap/core/SensorData.h"
|
#include "rtabmap/core/SensorData.h"
|
||||||
@@ -51,7 +51,7 @@ class Signature;
|
|||||||
class Optimizer;
|
class Optimizer;
|
||||||
class PythonInterface;
|
class PythonInterface;
|
||||||
|
|
||||||
class RTABMAP_EXP Rtabmap
|
class RTABMAP_CORE_EXPORT Rtabmap
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum VhStrategy {kVhNone, kVhEpipolar, kVhUndef};
|
enum VhStrategy {kVhNone, kVhEpipolar, kVhUndef};
|
||||||
@@ -151,6 +151,8 @@ 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
|
||||||
|
int getMemoryThreshold() const {return _maxMemoryAllowed;} // in nodes
|
||||||
|
void setMemoryThreshold(int maxMemoryAllowed); // in nodes
|
||||||
|
|
||||||
void setInitialPose(const Transform & initialPose);
|
void setInitialPose(const Transform & initialPose);
|
||||||
int triggerNewMap();
|
int triggerNewMap();
|
||||||
@@ -180,12 +182,13 @@ public:
|
|||||||
void deleteLastLocation();
|
void deleteLastLocation();
|
||||||
void setOptimizedPoses(const std::map<int, Transform> & poses, const std::multimap<int, Link> & constraints);
|
void setOptimizedPoses(const std::map<int, Transform> & poses, const std::multimap<int, Link> & constraints);
|
||||||
Signature getSignatureCopy(int id, bool images, bool scan, bool userData, bool occupancyGrid, bool withWords, bool withGlobalDescriptors) const;
|
Signature getSignatureCopy(int id, bool images, bool scan, bool userData, bool occupancyGrid, bool withWords, bool withGlobalDescriptors) const;
|
||||||
RTABMAP_DEPRECATED(
|
// Use getGraph() instead with withImages=true, withScan=true, withUserData=true and withGrid=true.
|
||||||
|
RTABMAP_DEPRECATED
|
||||||
void get3DMap(std::map<int, Signature> & signatures,
|
void get3DMap(std::map<int, Signature> & signatures,
|
||||||
std::map<int, Transform> & poses,
|
std::map<int, Transform> & poses,
|
||||||
std::multimap<int, Link> & constraints,
|
std::multimap<int, Link> & constraints,
|
||||||
bool optimized,
|
bool optimized,
|
||||||
bool global) const, "Use getGraph() instead with withImages=true, withScan=true, withUserData=true and withGrid=true.");
|
bool global) const;
|
||||||
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,
|
||||||
@@ -223,6 +226,7 @@ public:
|
|||||||
int refineLinks();
|
int refineLinks();
|
||||||
bool addLink(const Link & link);
|
bool addLink(const Link & link);
|
||||||
cv::Mat getInformation(const cv::Mat & covariance) const;
|
cv::Mat getInformation(const cv::Mat & covariance) const;
|
||||||
|
void addNodesToRepublish(const std::vector<int> & ids);
|
||||||
|
|
||||||
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
|
||||||
@@ -280,10 +284,13 @@ private:
|
|||||||
unsigned int _maxMemoryAllowed; // signatures count in WM
|
unsigned int _maxMemoryAllowed; // signatures count in WM
|
||||||
float _loopThr;
|
float _loopThr;
|
||||||
float _loopRatio;
|
float _loopRatio;
|
||||||
|
float _aggressiveLoopThr;
|
||||||
|
int _virtualPlaceLikelihoodRatio;
|
||||||
float _maxLoopClosureDistance;
|
float _maxLoopClosureDistance;
|
||||||
bool _verifyLoopClosureHypothesis;
|
bool _verifyLoopClosureHypothesis;
|
||||||
unsigned int _maxRetrieved;
|
unsigned int _maxRetrieved;
|
||||||
unsigned int _maxLocalRetrieved;
|
unsigned int _maxLocalRetrieved;
|
||||||
|
unsigned int _maxRepublished;
|
||||||
bool _rawDataKept;
|
bool _rawDataKept;
|
||||||
bool _statisticLogsBufferedInRAM;
|
bool _statisticLogsBufferedInRAM;
|
||||||
bool _statisticLogged;
|
bool _statisticLogged;
|
||||||
@@ -319,10 +326,13 @@ private:
|
|||||||
int _pathStuckIterations;
|
int _pathStuckIterations;
|
||||||
float _pathLinearVelocity;
|
float _pathLinearVelocity;
|
||||||
float _pathAngularVelocity;
|
float _pathAngularVelocity;
|
||||||
|
bool _forceOdom3doF;
|
||||||
bool _restartAtOrigin;
|
bool _restartAtOrigin;
|
||||||
bool _loopCovLimited;
|
bool _loopCovLimited;
|
||||||
bool _loopGPS;
|
bool _loopGPS;
|
||||||
int _maxOdomCacheSize;
|
int _maxOdomCacheSize;
|
||||||
|
bool _localizationSmoothing;
|
||||||
|
double _localizationPriorInf;
|
||||||
bool _createGlobalScanMap;
|
bool _createGlobalScanMap;
|
||||||
float _markerPriorsLinearVariance;
|
float _markerPriorsLinearVariance;
|
||||||
float _markerPriorsAngularVariance;
|
float _markerPriorsAngularVariance;
|
||||||
@@ -359,15 +369,17 @@ private:
|
|||||||
Transform _mapCorrectionBackup; // used in localization mode when odom is lost
|
Transform _mapCorrectionBackup; // used in localization mode when odom is lost
|
||||||
Transform _lastLocalizationPose; // Corrected odometry pose. In mapping mode, this corresponds to last pose return by getLocalOptimizedPoses().
|
Transform _lastLocalizationPose; // Corrected odometry pose. In mapping mode, this corresponds to last pose return by getLocalOptimizedPoses().
|
||||||
int _lastLocalizationNodeId; // for localization mode
|
int _lastLocalizationNodeId; // for localization mode
|
||||||
|
cv::Mat _localizationCovariance;
|
||||||
std::map<int, std::pair<cv::Point3d, Transform> > _gpsGeocentricCache;
|
std::map<int, std::pair<cv::Point3d, Transform> > _gpsGeocentricCache;
|
||||||
bool _currentSessionHasGPS;
|
bool _currentSessionHasGPS;
|
||||||
LaserScan _globalScanMap;
|
LaserScan _globalScanMap;
|
||||||
std::map<int, Transform> _globalScanMapPoses;
|
std::map<int, Transform> _globalScanMapPoses;
|
||||||
std::map<int, Transform> _odomCachePoses; // used in localization mode to reject loop closures
|
std::map<int, Transform> _odomCachePoses; // used in localization mode to reject loop closures
|
||||||
std::multimap<int, Link> _odomCacheConstraints; // used in localization mode to reject loop closures
|
std::multimap<int, Link> _odomCacheConstraints; // used in localization mode to reject loop closures
|
||||||
std::vector<float> _odomCorrectionAcc;
|
|
||||||
std::map<int, Transform> _markerPriors;
|
std::map<int, Transform> _markerPriors;
|
||||||
|
|
||||||
|
std::set<int> _nodesToRepublish;
|
||||||
|
|
||||||
// Planning stuff
|
// Planning stuff
|
||||||
int _pathStatus;
|
int _pathStatus;
|
||||||
std::vector<std::pair<int,Transform> > _path;
|
std::vector<std::pair<int,Transform> > _path;
|
||||||
|
|||||||
@@ -59,15 +59,18 @@ class RtabmapEventCmd : public UEvent
|
|||||||
public:
|
public:
|
||||||
enum dummy {d}; // Hack, to fix Eclipse complaining about not defined Cmd enum ?!
|
enum dummy {d}; // Hack, to fix Eclipse complaining about not defined Cmd enum ?!
|
||||||
enum Cmd {
|
enum Cmd {
|
||||||
|
kCmdUndef,
|
||||||
kCmdInit, // params: [string] database path + ParametersMap
|
kCmdInit, // params: [string] database path + ParametersMap
|
||||||
kCmdResetMemory,
|
kCmdResetMemory,
|
||||||
kCmdClose, // params: [bool] database saved (default true), [string] output database path (empty=use same database to save, only work when Db/Sqlite3InMemory=true)
|
kCmdClose, // params: [bool] database saved (default true), [string] output database path (empty=use same database to save, only work when Db/Sqlite3InMemory=true)
|
||||||
|
kCmdUpdateParams, // params: ParametersMap
|
||||||
kCmdDumpMemory,
|
kCmdDumpMemory,
|
||||||
kCmdDumpPrediction,
|
kCmdDumpPrediction,
|
||||||
kCmdGenerateDOTGraph, // params: [bool] global, [string] path, if global=false: [int] id, [int] margin
|
kCmdGenerateDOTGraph, // params: [bool] global, [string] path, if global=false: [int] id, [int] margin
|
||||||
kCmdExportPoses, // params: [bool] global, [bool] optimized, [string] path, [int] type (0=raw format, 1=RGBD-SLAM format, 2=KITTI format, 3=TORO, 4=g2o)
|
kCmdExportPoses, // params: [bool] global, [bool] optimized, [string] path, [int] type (0=raw format, 1=RGBD-SLAM format, 2=KITTI format, 3=TORO, 4=g2o)
|
||||||
kCmdCleanDataBuffer,
|
kCmdCleanDataBuffer,
|
||||||
kCmdPublish3DMap, // params: [bool] global, [bool] optimized, [bool] graphOnly
|
kCmdPublish3DMap, // params: [bool] global, [bool] optimized, [bool] graphOnly
|
||||||
|
kCmdRepublishData, // params: [vector<int>] ids
|
||||||
kCmdTriggerNewMap,
|
kCmdTriggerNewMap,
|
||||||
kCmdPause,
|
kCmdPause,
|
||||||
kCmdResume,
|
kCmdResume,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user