Compare commits

..

352 Commits

Author SHA1 Message Date
matlabbe
d4e55c3a1d Merge branch 'master' of github.com:introlab/rtabmap into jazzy-devel 2025-02-12 19:47:19 -08:00
matlabbe
15be406509 bump 0.21.10 2025-02-12 19:18:54 -08:00
laurence-diack-pk
618e839999 fixed ORB_SLAM preproc breaking gui conditionals (#1445) 2025-02-03 20:18:17 -08:00
matlabbe
ddaf2f5271 DBViewer: refactored how poses are aligned with GPS to be able to make KMZ files (OBJ/DAE origin matching with first KML pose) 2025-02-02 15:09:59 -08:00
matlabbe
fcfadfe489 sql: use single quoted strings #1436 2025-02-01 14:19:41 -08:00
matlabbe
6aa188d2af g2o: fixed iterative optimization (when epsilon>0) not converging as fast as like batch optimization (and not converging at all in some cases). 2025-01-27 14:20:41 -08:00
Borong Yuan
3ab9a69fbb fix build with ceres<2.1 (#1437) 2025-01-19 13:58:07 -08:00
matlabbe
7baf435600 Fixed #1439 2025-01-19 13:39:17 -08:00
matlabbe
853f603898 OptimizerGTSAM: keep iterating even if error is very large (aarch64 issue), but only when Optimizer/Epsilon is 0. 2025-01-17 10:31:06 -08:00
matlabbe
f8b1d50656 Fixed #1434 (gtsam very huge error estimated on aarch64), also decreased log level of voxel filtering to debug. 2025-01-09 16:57:51 -08:00
matlabbe
2f431ce385 Export: added gps/gt export options 2024-12-22 11:33:41 -08:00
Borong Yuan
89849ae245 add support for RVL depth image compression (#1409)
* add rvl_codec

* add support for RVL deep image compression

* DBViewer: edit depth re-using same compression format than the one in database.

* Fixing windows ci

* 💄

* missing dll export (windows)

* typo

---------

Co-authored-by: matlabbe <matlabbe@gmail.com>
2024-12-15 18:35:05 -08:00
matlabbe
02e30ffc69 Fixed #1413 2024-12-15 17:51:15 -08:00
matlabbe
97c56361f8 Export CLI tool memory optimization (#1391)
* Stashing changes so far

* Tested and working

* removed unused options

* Added density_radius and density_angle options

* improved description

* backward compatibility fixes, matching texture exported file names with base name

* Setting global full opt by default, updated preferences defaulting to g2o or gtsam if one or the other is unavailable
2024-12-15 13:08:15 -08:00
matlabbe
340248fed0 Refactored gravity links visualization (fixed rotation in some cases). 2024-12-14 16:33:29 -08:00
Johannes Schönberger
626bf64983 Support Ceres 2.1+ Manifolds in backwards-compatible manner (#1405)
* Support Ceres 2.1+ Manifolds in backwards-compatible manner

* d

* d
2024-12-14 10:27:21 -08:00
matlabbe
38cacb7978 Added floor filtering options for features extraction (#1408)
* Added floor filtering options for features extraction

* cleanup
2024-12-10 12:36:21 -08:00
matlabbe
a613998652 Updated cmake target for latest grid_map_core version 2024-12-08 09:58:37 -08:00
matlabbe
d33e98a540 Preferences: making local grid ROI editable 2024-12-06 18:31:27 -08:00
matlabbe
0445ae7c33 mergd master, disabled grid_map_core for jazzy 2024-11-30 19:51:41 -08:00
matlabbe
5988f0bb3b CI: only keeping oldest ROS1 and ROS2 not EOL versions (with all working deps) 2024-11-30 19:47:15 -08:00
matlabbe
ce1e91b9f1 Just build jazzy in jazzy-devel branch 2024-11-30 18:28:31 -08:00
matlabbe
8f46cc7370 Revert "CI: added builds when pushing to ***-devel branches"
This reverts commit 10eea91044.
2024-11-30 18:26:26 -08:00
matlabbe
a19163fc75 CI: use contains 2024-11-30 18:11:51 -08:00
matlabbe
eba90c1869 Merge branch 'master' of github.com:introlab/rtabmap into jazzy-devel 2024-11-30 18:07:10 -08:00
matlabbe
10eea91044 CI: added builds when pushing to ***-devel branches 2024-11-30 18:06:41 -08:00
matlabbe
b55759174d CI: upgrading ros-tooling to 0.7 2024-11-30 17:57:01 -08:00
matlabbe
13ed9137a5 Re-enabling jazzy CI build 2024-11-30 17:43:12 -08:00
matlabbe
4af0e7dbea grid_core_map now available on jazzy 2024-11-30 17:38:43 -08:00
matlabbe
344fe4e4cf Merge branch 'master' of github.com:introlab/rtabmap into jazzy-devel 2024-11-30 17:31:59 -08:00
matlabbe
ca877041e3 Revert "ULogger console: using std::cerr by default to avoid ROS2 default buffering on cout/printf."
This reverts commit 3eda219f1d.
2024-11-29 19:49:49 -08:00
matlabbe
3eda219f1d ULogger console: using std::cerr by default to avoid ROS2 default buffering on cout/printf. 2024-11-29 18:59:12 -08:00
matlabbe
13bc3c5c2c bump ros package version 2024-11-29 16:26:12 -08:00
matlabbe
8a26f42687 0.21.9: Grid's noise filtering only done on indices below Grid/RangeMax (when set). We can then keep very far points that would be filtered otherwise, which are useful for ray tracing. 2024-11-28 20:58:40 -08:00
matlabbe
968b9f8609 docker: updated latest deps Dockerfile example 2024-11-24 15:12:55 -08:00
matlabbe
afde4af3a7 Fixed OpenVINS build if openvins is built on ROS2 (#1379) 2024-11-24 14:41:41 -08:00
matlabbe
cbd3995b60 Applying suggestion of #1388 (#1390) 2024-11-23 20:17:39 -08:00
matlabbe
5fff349623 android: fixed app exiting when about to show toast 2024-11-23 09:30:53 -08:00
matlabbe
b2e26e81c1 Fixed #1380 2024-11-16 14:54:15 -08:00
Charles Ellison
f10dee4175 Concise layout (#1381)
* created concise layout

* Hiding matching lines and always update graphics view A when clicking on a node in the graph in concise view mode

---------

Co-authored-by: Chuck-Ellison <charles.c.ellison@erdc.dren.mil>
Co-authored-by: matlabbe <matlabbe@gmail.com>
2024-11-16 12:13:07 -08:00
matlabbe
a584245029 Fixed all -Wtype-limits warnings 2024-11-15 14:13:13 -08:00
matlabbe
966feefb35 DBViewer: fixed Refine links menu not showing up if there are landmark links 2024-11-14 20:15:04 -08:00
matlabbe
fd27380be7 CudaSift: switch to SIFT CPU if no cuda devices were found (instead of asserting). 2024-11-12 15:00:19 -08:00
Borong Yuan
75ac722996 draw "1 - Loop Thr" along with posterior (#1373) 2024-11-02 12:51:05 -07:00
matlabbe
374df24ac9 report tool: fixed localization session not detected 2024-10-31 19:19:34 -07:00
matlabbe
6b313257f2 Reg/OpticalFlow: fixed missing pt reprojection for last camera 2024-10-30 14:14:29 -07:00
matlabbe
8b21c27f5f Adding FOURCC usb camera support (#1366)
* Adding FOURCC usb camera support

* Improved warnings

* more checks and warnings
2024-10-27 18:09:07 -07:00
Borong Yuan
2454b04f1f Sort keypoints before SSC (#1364)
* Sort keypoints before SSC

* avoid using vector<bool>
2024-10-26 14:44:22 -07:00
matlabbe
e3fde4ecdd DBViewer: update main slider when index spinbox value changes 2024-10-26 12:04:34 -07:00
matlabbe
17c2142c98 iOS: updated settings information (#1355) 2024-10-13 14:10:29 -07:00
matlabbe
465ea85d91 Removed grid_map as public dependency 2024-10-08 20:01:38 -07:00
matlabbe
595f200a89 iOS various updates (#1340)
* Added Data Recording Mode. Added option to filter ARKit localization jumps.

* Implemented max acc relocalization filtering (working on iOS)

* Fixed android build, added re-localization max acceleration parameter

* ARCore Java: Fixed pose of depth not available at stamp requested

* Android log fix

* Added libLAS support

* ios: added LAS support

* updated dep install script to skip libraries already installed

* CameraMobile: Fixed origin not updated if updateOnRender() is used

* Default max opt error increased to 2x to reduce number of loop closures rejected. OptimizerGTSAM: updated gravity noise model to use same sigma for both parameters.

* Updated license

* bump 0.21.7

* updated license date
2024-10-06 17:16:22 -07:00
tomaja
409ef73e56 Update iOS app's install_deps.sh to remove PCL SSE dependency and make the script complete. (#1351) 2024-10-06 15:59:17 -07:00
Charles Ellison
538bc681d4 Node highlighting addition to previous pull request (#1348)
* Clicking Nodes\Links brings them up in viewer

* Removed duplicated feature, kept spin box and single click node event. Removed unrelated border option crashing.

* added code to highlight selected nodes

* Refactored: merged A-B functions into single one, fixed highlighted node color not reset after selecting another node, highlighting also when changing constraint sliders, change node color instead of border, added menu options to change color (added to settings).

* cleanup

* Fixed duplicates in neighbor and loop closure sliders, fixed WM checkbox not visible.

* Fixed forward neighbors slider scrolling showing only one color.

---------

Co-authored-by: Chuck Ellison <charles.c.ellison@erdc.dren.mil>
Co-authored-by: matlabbe <matlabbe@gmail.com>
Co-authored-by: Alex Perez <alex.s.perez@erdc.dren.mil>
2024-09-28 18:40:46 -07:00
matlabbe
8c0e57bc52 Landmark poses can be exported with format=11. Report: added option poses_raw to export poses not aligned with ground truth (default it is). 2024-09-22 19:53:27 -07:00
Charles Ellison
21abdddbff Clicking Nodes\Links brings them up in viewer (#1344)
* Clicking Nodes\Links brings them up in viewer

* Removed duplicated feature, kept spin box and single click node event. Removed unrelated border option crashing.

---------

Co-authored-by: Chuck Ellison <charles.c.ellison@erdc.dren.mil>
Co-authored-by: matlabbe <matlabbe@gmail.com>
2024-09-21 18:36:06 -07:00
matlabbe
379e11bd66 Supporting GTSAM bearing/range factors for landmarks (#1346)
* Supporting GTSAM bearing/range factors for landmarks

* refreshing initial covariance after being modified in same sessions
2024-09-21 18:14:52 -07:00
matlabbe
0e85bd849c Improved image view scene rect size when no images are there. Added warning when transform cannot be computed because some data are missing. 2024-09-16 15:55:38 -07:00
matlabbe
69ac21f811 Adding OpenCV's GPU GFTT/ OpticalFlow and CudaSift support (#1330)
* Adding GFTT and SIFT Cuda support

* Working CudaSift

* Disable cudasift option when not available

* Added check to avoid re-allocating gpu memory everytime parseParameters is called. Added workaround of to detect/ignore invalid descriptors

* Added SIFT/PreciseUpscale and SIFT/Upscale parameters. Adjusted max octave to behave more like opencv

* Refactored how maximum features are thresholded, to be more similar to OpenCV version

* Updated loop closure benchmark scripts

* Cuda optical flow tmp commit

* Added Stereo/Gpu Vis/CorFlowGpu parameters (optical flow gpu integration for F2F odom and stereo correspondences)

* Fixed build without opencv cuda

* Fixed build with Opencv 4.10

* ZED: updated parameters to match zed sdk 4

* MRPT requires C++17

* updated max octave limit CudaSift
2024-09-13 14:22:54 -07:00
matlabbe
f3ccfcb452 Fixed iOS install_deps.sh for Xcode15 (min target 11->12) 2024-09-07 22:00:05 -07:00
matlabbe
11a8057246 LocalGrid: fixed overestimated local grid size when Grid/RangeMax is used 2024-09-04 11:39:38 -07:00
matlabbe
12e2caf7d1 removed debug comment 2024-09-01 15:39:01 -07:00
matlabbe
5580e78273 Fixed ZED driver timestamp. Re-ordered build include dirs to keep opencv in front. Fixed build with OpenCV 4.7.0. 2024-09-01 03:55:29 -07:00
matlabbe
58b466288d Update README.md 2024-08-27 15:05:10 -07:00
matlabbe
f73e9c02b3 Added cmake option BUILD_WITH_RPATH_NOT_RUNPATH to use old RPATH behavior on build tree (#1308) 2024-08-25 20:48:27 -07:00
matlabbe
4df207acc3 Fixing ChArUco board support on opencv >= 4.7.0 (#1331)
Fixed https://github.com/introlab/rtabmap_ros/issues/1200
2024-08-25 19:35:19 -07:00
matlabbe
6ce85b4e55 Added missing freenect driver on docker images 2024-08-18 21:34:01 -07:00
Kem Chen
20734cade9 Remove bitcode support (#1326)
> Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14.
>
> Xcode no longer builds bitcode by default and generates a warning message if a project explicitly enables bitcode: “Building with bitcode is deprecated. Please update your project and/or target settings to disable bitcode.” The capability to build with bitcode will be removed in a future Xcode release. IPAs that contain bitcode will have the bitcode stripped before being submitted to the App Store. Debug symbols can only be downloaded from App Store Connect / TestFlight for existing bitcode submissions and are no longer available for submissions made with Xcode 14.

ref: https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes#Deprecations
2024-08-13 16:09:16 -07:00
matlabbe
4911dbe9bb With Mem/RotateImagesUpsideUp=true, do not clear features if none of the cameras are rotated. DBViewer: show local transform of all cameras in tooltip 2024-08-12 14:27:08 -07:00
matlabbe
cc5da376ec Fixed https://github.com/introlab/rtabmap_ros/issues/1187 2024-07-27 12:12:49 -07:00
matlabbe
9ef94f5a71 docker: fixed typo 2024-07-24 08:22:25 -07:00
matlabbe
41b1a87c34 Update README.md 2024-07-23 16:07:27 -07:00
matlabbe
7fd9646f2e removed ros octomap dep 2024-07-22 21:13:28 -07:00
matlabbe
5e79fc559b merged master->jazzy 2024-07-22 20:59:09 -07:00
matlabbe
24ca56248f bump patch 2024-07-22 20:47:59 -07:00
matlabbe
0efd3c6b62 Merge branch 'clalancette-clalancette/switch-octomap-dependency' 2024-07-22 20:44:51 -07:00
matlabbe
49d67302d5 removed jazzy/rolling specific patches 2024-07-22 20:41:05 -07:00
matlabbe
41dcddc48e Merge branch 'clalancette/switch-octomap-dependency' of https://github.com/clalancette/rtabmap into clalancette-clalancette/switch-octomap-dependency 2024-07-22 20:39:56 -07:00
Chris Lalancette
ccca53be03 Switch the octomap dependency to the system version.
We are shortly going to be removing octomap the package
from ROS 2 Rolling; that's because it's ABI conflicts with
the system package.  Instead, switch rtabmap to use the system
package, which should work fine.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
2024-07-22 19:25:27 +00:00
matlabbe
08a44ec44f DBViewer: added option to ignore optimized graph guess when detecting more loop closures 2024-07-19 14:02:03 -07:00
matlabbe
04fdc0d9e2 Merge branch 'jazzy-devel' of github.com:introlab/rtabmap into jazzy-devel 2024-06-30 19:50:45 -07:00
matlabbe
41fe47efdf Fixed build with OpenCV 3.2 (ubuntu bionic). Added more devcontainers for different ubuntu versions for convenience. 2024-06-30 19:11:14 -07:00
matlabbe
7641f28250 Fixed build with OpenCV >= 4.7 (charucoboard errors) 2024-06-30 18:15:56 -07:00
matlabbe
f5a477f0f4 Charuco calibration + depthai calibration support (#1302)
* In progress: adding charuco option

* DepthAI: added raw image publishing mode (added support rtabmap's calibration file). Calibration: working charuco board calibration (on opencv 4.5).

* fixed build with Qt<5.14

* Updated calibration options

* Removed depthai flashing delays

* depthai: fixed camera not detected as calibrated in Mono-depth mode. Calibration: added option to scale sampling factor.
2024-06-30 17:11:37 -07:00
matlabbe
2fbe31f7cb Split dev containers for standalone and android 2024-06-28 08:08:40 -07:00
matlabbe
623d056436 fixed android build 2024-06-26 05:43:17 +00:00
matlabbe
1611aa14f6 fixed typo 2024-06-25 13:21:02 -07:00
matlabbe
7d970ef020 Fixed DBReader odometry ignored 2024-06-25 12:04:37 -07:00
matlabbe
1ab0133f14 Added uPad function for convenience 2024-06-19 15:58:24 -07:00
matlabbe
4c1822683a Added new parameter: RGBD/AggressiveLoopThr 2024-06-19 10:28:17 -07:00
matlabbe
7c601bb6e8 Fixed #1300 (proximity sort by distance) 2024-06-16 11:11:39 -07:00
matlabbe
0d221a806f Update behavior of Odom/AlignWithGround when odmetry is already aligned with gravity (just update z value). 2024-06-15 17:24:00 -07:00
matlabbe
28fd696c18 Fixed WITH_QT=OFF (to not build with Qt even if any dependency included it) 2024-06-15 14:21:51 -07:00
Adam Serafin
c58fffe56d Add flags for OpenNI (#1299)
* update openni defines

* minor fix

* fixed build + minor changes

---------

Co-authored-by: matlabbe <matlabbe@gmail.com>
2024-06-15 14:12:07 -07:00
matlabbe
2a840fe340 Fixed https://github.com/introlab/rtabmap_ros/issues/1173 (edited optimized map regenerated in localization mode) 2024-06-09 20:46:51 -07:00
matlabbe
0f03db9d7f Disabling temporary cmake-ros workflow on ubuntu 24.04/jazzy because of setup-ros failing on that base image 2024-06-09 11:36:49 -07:00
matlabbe
4349f304d2 Merge branch 'borongyuan-xvisio' 2024-06-09 11:13:51 -07:00
matlabbe
80a4ce02c9 Fixed build without xvisio sdk, Added xvisio camera option in main menu. 2024-06-09 11:13:29 -07:00
matlabbe
b37f7d6351 docker: Fixed typo 2024-06-09 10:20:18 -07:00
matlabbe
35d4bd768c ci/noble: moved opengv to top image to be built on ci 2024-06-09 10:20:18 -07:00
matlabbe
e6691658bd Fixed compilation warnings on 22.04 (Qt 5.15.3) 2024-06-09 10:20:18 -07:00
matlabbe
3cfcccdb1d Added CI for Ubuntu Noble/24.04 + docker 2024-06-09 10:20:18 -07:00
matlabbe
8310925c81 Calibration tool: added support for rational model (8 coeff) 2024-06-09 10:20:18 -07:00
matlabbe
99cb02fdff ORB_SLAM3: fixed error if left image is color. SensorCaptureThread: stop thread if data cannot be captured (e.g., end of dataset) instead of skipping indefinitly with error log. 2024-06-09 10:20:18 -07:00
matlabbe
8b372b52ac arcore_java: fixed high speed filtering jumping (#1281) 2024-06-09 10:20:18 -07:00
matlabbe
c25add868a arcore_java: disabled max speed localization filtering by default #1281 2024-06-09 10:20:18 -07:00
matlabbe
91cbbc8238 arcore: fixed pose not updated correctly 2024-06-09 10:20:18 -07:00
matlabbe
ccdddfc83f Refactored android docker to easily re-use rtabmap.bash in a dev container to install Tango/ARCore/AREngine dependencies. 2024-06-09 10:19:22 -07:00
matlabbe
9b255d1f27 docker: Fixed typo 2024-06-03 20:12:17 -07:00
matlabbe
3ab8ae7eaf ci/noble: moved opengv to top image to be built on ci 2024-06-03 07:33:26 -07:00
Borong Yuan
a327c9530c add XVSDK VIO 2024-06-03 10:28:45 +08:00
matlabbe
5b810da73b Fixed compilation warnings on 22.04 (Qt 5.15.3) 2024-06-02 15:04:36 -07:00
matlabbe
098301e52c Added CI for Ubuntu Noble/24.04 + docker 2024-06-02 14:38:50 -07:00
matlabbe
f2df35be01 Disabling gtsam ros dep for now (internal version error) for ROS2 Jazzy 2024-06-02 14:06:16 -07:00
matlabbe
2f21d42555 Calibration tool: added support for rational model (8 coeff) 2024-05-31 10:28:14 -07:00
Borong Yuan
fc9dcd6b3d rectify xvDepthColor 2024-05-30 19:41:48 +08:00
Borong Yuan
0ad1d0ad69 add CameraSeerSense to guilib 2024-05-30 16:55:37 +08:00
Borong Yuan
ce0c806d75 add CameraSeerSense methods 2024-05-29 19:41:14 +08:00
Borong Yuan
fb37b3adba add xvDepthColor 2024-05-28 17:08:49 +08:00
matlabbe
0f961783c1 merged master->rolling 2024-05-27 11:42:12 -07:00
matlabbe
da9ff08198 Removed grid_map_core missing dep on jazzy 2024-05-27 10:49:18 -07:00
matlabbe
32e03aaf68 ORB_SLAM3: fixed error if left image is color. SensorCaptureThread: stop thread if data cannot be captured (e.g., end of dataset) instead of skipping indefinitly with error log. 2024-05-26 18:04:07 -07:00
matlabbe
03afb94d92 arcore_java: fixed high speed filtering jumping (#1281) 2024-05-25 15:54:57 -07:00
matlabbe
c5c190a2a0 arcore_java: disabled max speed localization filtering by default #1281 2024-05-25 14:42:54 -07:00
matlabbe
bc66060fab arcore: fixed pose not updated correctly 2024-05-25 13:50:01 -07:00
Borong Yuan
3d5f1ad5c2 add xvImu 2024-05-24 23:12:16 +08:00
Borong Yuan
41a7eff8fa init CameraSeerSense 2024-05-23 20:51:13 +08:00
Borong Yuan
6acec02dbe add xvsdk cmake configs 2024-05-23 17:02:38 +08:00
Borong Yuan
fbeabf0751 Add ANMS (SSC method) (#1276) 2024-05-19 18:21:00 -07:00
matlabbe
0d4e4730c7 Merge branch 'borongyuan-likelihood_experiment' 2024-05-19 17:46:47 -07:00
matlabbe
995f65b2ec Added parameter Rtabmap/VirtualPlaceLikelihoodRatio to select how likelihood is normalized/adjusted (0=default old approach used in paper). 2024-05-19 17:46:00 -07:00
matlabbe
c034a9631c Merge branch 'likelihood_experiment' of https://github.com/borongyuan/rtabmap into borongyuan-likelihood_experiment 2024-05-19 14:57:58 -07:00
matlabbe
256dcbded4 Added script to reproduce results from loop closure detection paper. Added option to show Recall at 100% precision directly from rtabmap-console. Fixed retrieval not working on loop closure detection mode-only. Fixed showLogs.m error with Octave. 2024-05-19 14:54:37 -07:00
matlabbe
812caeeb9a docker: added libtbb-dev 2024-05-12 22:15:20 -07:00
matlabbe
a66564f98f docker/jammy/jammy-iron: added WITH_TBB option for opencv 2024-05-12 20:36:27 -07:00
matlabbe
375597af00 docker/focal: added WITH_TBB option for opencv 2024-05-12 19:58:12 -07:00
matlabbe
72d7418011 Fixed build with pcl<1.8 2024-05-12 19:13:05 -07:00
matlabbe
9505a21a7e DBViewer/Matcher tool: Fixed crash when python feature/matcher is used 2024-04-28 17:40:37 -07:00
matlabbe
36304b2cd1 frontiers docker: added missing pybind-dev dep 2024-04-28 11:46:37 -07:00
Borong Yuan
f3cfa7831d adjust likelihood using z-score 2024-04-28 12:22:26 +08:00
matlabbe
99c4612c64 Fixed #1268. Fixed ui warnings of labels with same name. 2024-04-27 14:58:33 -07:00
matlabbe
27dea71398 Apply fix from #979 2024-04-15 20:51:50 -07:00
matlabbe
726bceb816 fixing bionic build 2024-04-14 19:46:34 -07:00
matlabbe
700704bec9 LiDAR capture support in standalone library (#1264)
* Working rtabmap_lidar-mapping example (live and pcap)

* finalizing merge, added some deprecated

* fixed build

* Working deskewing for Lidar + Camera/IMU (no camera pose correction yet) and Lidar + Odom Sensor in main UI.

* backward compatibility

* fixed some not used variable warnings, fixed qt build for lidar mapping example

* Refactored CameraMobile, added AREngine background support, fixed LidarVPL16 build error with PCL 1.8

* ARCoreJava: buffer last depth image in case its stamp i higher than pose stamp. CameraMobile: added pose buffer. SensorCaptureThread: to get pose, odomSensor should be explicitly set, but can be same as lidar or camera  inputs.

* Working external lidar on iOS

* util3d::commonFiltering()/adjustNormalsToViewPoint() added organized cloud support. MainWindow: updated odomSensor setup

* fixed winsock include order

* reverted camera tool

* disable imu filtering when odom sensor is used

* Updated package version

* fixed windows build

* fixing more windows build erros
2024-04-14 19:06:04 -07:00
matlabbe
6a6913c939 Fixed #1262 2024-04-13 16:42:58 -07:00
Borong Yuan
a55b4203cd copy global descriptor (#1263) 2024-04-13 14:56:28 -07:00
matlabbe
a3267c9da6 UI: Added option to change map resolution on UI side, save/restore thresholds in figures, fixed basic panel's slam/rgbd mode checkboxes not changing the state of corresponding parameters. 2024-04-12 17:12:23 -07:00
matlabbe
fbbab1c077 Update README.md 2024-04-11 17:12:11 -07:00
mathieu86
4e7110930c DbViewer: switch between left and right views when double-clicking on single nodes 2024-04-11 13:01:00 -07:00
matlabbe
9266926a4a docker: enabled focal linux/arm/v7 2024-04-10 09:13:24 -07:00
Dominic Létourneau
5a159cef04 Create scheduled-stats.yml (#1260)
GitHub Stats for IntRoLab.
2024-04-09 09:09:21 -07:00
matlabbe
5ed1bf0ca8 GlobalDescriptor (PyDescriptor / netvlad) (#1163)
* First commit for pydescriptor

* Fixed Python refactoring errors

* GUI: added PyDescriptor parameters

* reordered python3 includes

* updated rtabmap_netvlad.py test main

* fixed build from last merge

* integrated https://github.com/introlab/rtabmap/pull/1255

* rescaled dot product result

Closing https://github.com/introlab/rtabmap/issues/1105
2024-04-07 15:48:16 -07:00
matlabbe
c33e995e83 Landmark constraints can now be rejected (in case we see same landmark at two different spots or constraint is poorly estimated). Optimizer/Robust can now be used with landmark constraints with orientation. 2024-04-06 13:41:03 -07:00
matlabbe
92edae35fc Fixed map empty on start if there is no global loop closure yet in localization mode when RGBD/OptimizeFromGraphEnd is true 2024-04-06 11:46:26 -07:00
matlabbe
d794669ef9 DBViewer: added buttons to edit/add priors 2024-04-02 17:37:52 -07:00
matlabbe
9cb0046734 fixing build with gtsam 4.0 2024-04-02 15:32:04 -07:00
matlabbe
76f63ab79a Fixing build with gtsam 4.2 2024-04-02 13:29:51 -07:00
matlabbe
063ca9c8ee fixed gtsam 4.3 build error (https://github.com/introlab/rtabmap/pull/1033#issuecomment-2031002034) 2024-04-01 23:05:16 -07:00
matlabbe
11adbdcc9f Fixed #1253 2024-03-31 14:53:00 -07:00
matlabbe
8612ebba93 fixed https://github.com/introlab/rtabmap_ros/issues/1134 2024-03-31 13:06:52 -07:00
matlabbe
a0476af896 UI: Exposed more depthai options, setting default rectification alpha to -1 to avoid OAK-D Pro crash 2024-03-30 18:08:32 -07:00
matlabbe
3b735907c8 DbViewer tool: added database's parameter overriding from arguments 2024-03-29 13:30:12 -07:00
matlabbe
0ba79be461 depthai >=2.24 requirement 2024-03-28 14:27:17 -07:00
matlabbe
cc17ebe92b iSAM2 integration (#1249)
* isam2 integration

* fonctional iSAM2, added related parameters

* updated default params after testing large-scale enviroment

* proximity search optimization

* boost<1.68 fix

* boost version

* Fixed map not showing in graphview

* iSAM2: supporting MM/localization/multi-session modes
2024-03-27 17:18:02 -07:00
Borong Yuan
bfeb487dba OAK Internal Sync & DepthAI HF-Net Support (#1193)
* Using Sync Node

* Using normalized IR intensity

* Set IMU output frequency to 200 Hz

* set sync threshold properly

* add depthai hfnet local head

* fix DB error

* add depthai hfnet global head

* fix data delay if image rate is set manually
2024-03-27 12:29:06 -07:00
matlabbe
bc6d390fb6 bionic docker: fixing cmake version for arm 2024-03-24 18:49:11 -07:00
matlabbe
f8a63ecf10 Fixing bionic docker (with cmake>=3.14) 2024-03-23 14:41:10 -07:00
matlabbe
7183b43c2a missed part from last commit 2024-03-23 14:34:54 -07:00
matlabbe
fa3ece5183 Increased minimal cmake version to 3.14 to use cmake's official FindSQLite3.cmake (#1250) 2024-03-23 14:32:18 -07:00
matlabbe
2f132b3a40 GUI: adjusted max limit of Optimizer/Epsilon 2024-03-19 16:34:11 -07:00
matlabbe
79dc180bf4 Fixed Odom/ResetCountdown not resetting anymore if next frame is also bad. 2024-03-17 17:19:08 -07:00
matlabbe
264c560a2c reverted 87faea7a85 for #783 (just don't include OptimizerCeres if -DWITH_CERES=OFF even if floam or okvis did include it) 2024-03-16 17:10:34 -07:00
matlabbe
4ce36ef245 Updated appveyor gdown version 2024-03-13 23:27:47 -07:00
matlabbe
d0227694c5 small fix for qt6 2024-03-13 22:52:44 -07:00
matlabbe
a6d9425bce DBViewer: support doubleclick on node or link in graphview to update correpsonding image view and constraints view, also added "Show pixel depth" menu option in ImageView to show pixel depth and pixel coordinate in map frame. 2024-03-13 22:42:47 -07:00
matlabbe
e299505a64 Fixed ORB_SLAM3 config for stereo mode 2024-03-12 23:13:06 -07:00
matlabbe
57b4954cb3 Update README.md 2024-03-10 15:24:48 -07:00
matlabbe
2577c47e77 Fixed #1232 2024-03-09 15:14:01 -08:00
matlabbe
52e1b01597 Fixed assert when exporting textured mesh with both multiband and blending enabled with grayscale images 2024-03-04 17:05:17 -08:00
matlabbe
8019a2dc49 Fixed #1227 2024-03-02 16:17:10 -08:00
matlabbe
33b875ecbf GraphView: fixed mouse cursor tracking inverted x-y values 2024-03-01 10:13:53 -08:00
matlabbe
c24f95a8d9 ExportCloudsDialog: added option to filter off-axis points 2024-02-29 16:19:57 -08:00
matlabbe
6f7e5cc97b Removed RGB option from main menu (#640) 2024-02-26 19:06:39 -08:00
matlabbe
fccf33dd96 GraphViewer: added "Show mouse cursor position (m)" context menu option. 2024-02-26 17:13:50 -08:00
Long Vuong
752ca76cf5 not limitKps inside Feature2D::generateKeypoints when using pyDetector (#1223)
* not limitKps when using pyDetector

* update with upstream

---------

Co-authored-by: Long Vuong <vuong@wheel.me>
2024-02-26 15:21:15 -08:00
matlabbe
81e249b56c Update README.md 2024-02-18 19:02:40 -08:00
matlabbe
ff7c8af56f Mac: fixed cloud viewer pushed back behind main window after dialog closes 2024-02-18 13:43:52 -08:00
matlabbe
a11ea291d8 Fixed #1211 2024-02-10 18:27:02 -08:00
matlabbe
cd615c6e52 docker focal deps: removed gtsam as already installed by ros now (fixing downstream gtsam version conflict errors) 2024-02-10 14:06:41 -08:00
Borong Yuan
1bd2d9fe81 superpoint torch using simple nms (#1213) 2024-02-10 13:54:20 -08:00
matlabbe
510aef19e4 Added Vis/PnPSplitLinearCovComponents parameter (default false -> same as before) 2024-02-07 14:43:16 -08:00
matlabbe
1dadd50cf2 cmake: added VTK_GLOBAL_WARNING_DISPLAY option (default off) for VTK>=9 (https://github.com/introlab/rtabmap_ros/issues/1111) 2024-02-03 17:04:48 -08:00
matlabbe
b2a86d640a Fixed zed build errors (windows, #1207) 2024-01-31 07:17:04 -08:00
matlabbe
c27507bc77 Added missing Open3D status in --version and About. 2024-01-27 15:20:10 -08:00
matlabbe
b374c6cd8e docker: jammy humble dep fix 2024-01-21 15:49:59 -08:00
matlabbe
29dc6c67fa docker: fixing humble arm64 build 2024-01-21 13:26:43 -08:00
matlabbe
10de748531 DatabaseViewer: Fixed seg fault on Mac when opening db 2024-01-21 13:05:02 -08:00
Borong Yuan
dcd5994456 support color histogram equalization (#1203) 2024-01-21 12:38:34 -08:00
matlabbe
13cd5e7a5e Export Poses: Added support of landmarks. Fixed g2o export with 6DoF landmark constaints. Adjusted g2o export landmark id. (#1199) 2024-01-20 12:04:26 -08:00
matlabbe
856e372dde fixed bundle windows qt plugins destination 2024-01-15 23:53:27 -08:00
matlabbe
423e67558b fixed windows ci 2024-01-15 23:39:41 -08:00
matlabbe
ace653593b working qt6/mac deploy 2024-01-15 20:51:12 -08:00
matlabbe
7b31c737be Deploy fix 2024-01-15 20:45:58 -08:00
matlabbe
0b534c9427 Qt6 deploy fixes for Mac 2024-01-15 20:41:18 -08:00
matlabbe
cdbdcfe676 Fixing appveyor regression with gdown tool 2024-01-13 18:47:45 -08:00
matlabbe
b7239fdc84 Added parameter Mem/RotateImagesUpsideUp 2024-01-10 14:54:55 -08:00
matlabbe
a0559b156b Fixed #1196 2024-01-06 16:11:25 -08:00
matlabbe
79db6b2811 Fixed warning with vtk 7.1. Dont add target "uninstall" if already added from some cmake dependencies 2024-01-03 18:08:06 -08:00
Borong Yuan
096592e4fc reimplement NMS using morphological operations (#1192) 2024-01-02 15:38:39 -08:00
matlabbe
d135ef02e2 DBViewer: updated refine constraints menu action with more options, DBDriver: added updateCalibration for convenience 2023-12-20 14:39:49 -08:00
matlabbe
ee09e92496 Fixed build on xenial, VTK<=7. 2023-12-19 19:39:50 -08:00
matlabbe
e619c57759 Removing MRPT from bionic docker 2023-12-19 08:59:16 -08:00
matlabbe
f6a0323d46 remove rolling from CI 2023-12-19 00:35:38 -08:00
matlabbe
933d26f005 DbViewer/info tool: Updated number of links to report unique links. Added statistics about length of loop closures in info tool. 2023-12-18 16:27:18 -08:00
matlabbe
ec8f9fdcfd typo 2023-12-18 10:29:58 -08:00
matlabbe
f4a60f0b6f CI: fixed fail-fast 2023-12-17 22:57:59 -08:00
matlabbe
ade94cde1c disabling fail-fast on docker ci 2023-12-17 22:49:18 -08:00
matlabbe
71415992ac GridMap integration (#1180)
* GridMap integration

* Removed GridGlobal/FullUpdate parameter. Bump version 0.21.3. Mvoed specialized global map classes under global_map sub dir. Renamed Map -> GlobalMap.

* UI: Added elevation map visualization

* Added LocalGridCache class to share cache between global maps

* Fixed OctoMap nans. DbViewer: Added frontiers visualization.

* convenient functions for ros

* Small fix

* fixed build without GridMap

* CI disabled fail-fast

* CI updated checkout action to v4
2023-12-17 22:44:11 -08:00
Borong Yuan
45392fcfc6 Add RGBD mode for OAK camera (#1179)
* update depthai params

* add color+depth mode

* workarounds to avoid performance issues
2023-12-14 09:59:35 -08:00
matlabbe
be3e6c538c Adding util3d::cloudsFromSensorData to be able to show in DBViewer individual clouds for each camera (#1182)
* splitting multicam generated clouds

* make sure returned cloud is valid (can be empty)
2023-12-13 12:15:29 -08:00
matlabbe
f56875db4a Preferences: Fixed recursive param update bug 2023-11-29 05:28:30 -08:00
Borong Yuan
0876603325 improve NMS implementation (#1173) 2023-11-28 13:36:28 -08:00
matlabbe
3a7f88dc6c Updated error log that should not show up if Optimizer/Robust is true (#1172) 2023-11-28 13:29:33 -08:00
Borong Yuan
07c24e95ba start outputting data after static initialization (#1171)
* start outputting data after static initialization

* restore pixel noise to 1
2023-11-28 13:20:45 -08:00
matlabbe
7ab1ee0a0b Update docker.yml 2023-11-23 18:25:50 -08:00
matlabbe
fc8ead2237 Update docker.yml 2023-11-23 18:06:24 -08:00
matlabbe
a1d43d2353 Remove default AUTOUIC=ON from all non-ui targets. Fixed yaml target not added correctly on Vcpkg. Fixed gui odom processing time. 2023-11-19 19:40:20 -08:00
matlabbe
aaff1abc4f Updating orbslam3 v1 support (#1152)
* Refactoring ORB_SLAM3 integration. Fixed realsense2 inter IMU stamps.

* Renamed OdometryORBSLAM -> OdometryORBSLAM2

* revert a change

* Fixed build without orb_slam

* Source camera: added feature detection option

* Fixed jfr2018 docker files
2023-11-19 01:05:52 -08:00
matlabbe
9c56a429cc Localization: Refactored getConnectedGraph() for 2d slam and tags (https://github.com/introlab/rtabmap_ros/issues/1057). Transform: Fixed is3DoF() and is 4DoF() 2023-11-16 22:44:32 -08:00
Borong Yuan
757d3eb90b fix protocol detection for undiscoverable devices (#1159) 2023-11-15 19:50:07 -08:00
matlabbe
4812ce4eaf Optimizer: fixed some constraints between same nodes with different type ignored. GraphViewer: fixed display of links between same nodes with different type 2023-11-12 17:14:17 -08:00
matlabbe
56552afa6c Tuning localization priors (added RGBD/LocalizationPriorError parameter) (#1156)
* tuning localization priors (for https://github.com/introlab/rtabmap_ros/issues/1057)

* Set prior error value to same than old default value
2023-11-05 15:14:11 -08:00
Borong Yuan
45a3b59a23 transform features after source images decimation (#1154) 2023-11-02 08:10:02 -07:00
matlabbe
08d0ef7408 report: added --gt option to input external ground truth file. DBViewer: fixed crash when unchecking "Ignore intermediate nodes". 2023-10-27 17:10:10 -07:00
Borong Yuan
8da6ea1707 Add missing filterKeypointsByDepth step (#1150)
* add missing filterKeypointsByDepth step

* Fix ORBOctree not using the depth mask

---------

Co-authored-by: matlabbe <matlabbe@gmail.com>
2023-10-26 13:15:34 -07:00
matlabbe
64962e8e3d Added multicameras support for F2F odometry / OpticalFlow 2023-10-25 14:54:20 -07:00
matlabbe
71bb0cf226 ios/android: fixed database loading failing when one node doesn't have any depth or scan (#1147). 2023-10-21 14:52:29 -07:00
Borong Yuan
948e15c72c Supplement and Adjust OpenVINS Parameters (#1145)
* set the PrintLevel of OpenVINS to be equivalent to that of ULogger

* use global FAST settings

* add online calibration params

* add dynamic initialization params

* add necessary feature initializer options

* fix segfault of OdomImageDecimation

* add mask settings

* use depth as mask in OpenVINS

* set twist covariance

* restore default values of VisMinDepth and VisMaxDepth
2023-10-21 14:24:51 -07:00
Borong Yuan
f06cc0b17f OAK bug fixes and improvements (#1143)
* *fix distortion correction problem of small FOV devices
*remove deprecated IMU firmware update API
*add useSpecTranslation option

* reduce depth image noise and simplify calculation for compressed transport
2023-10-07 20:40:30 -07:00
Borong Yuan
2aa139b579 Update odometry info of OpenVINS (#1142)
* add msckf features visualization

* fill localMap with active tracked features
2023-10-07 20:36:00 -07:00
Borong Yuan
67c6a15b93 OpenVINS Update (#1107)
* fix openvins build

* Add OpenVINS params to UI

* update OdometryOpenVINS implementation

* the pixel noise of most cameras should be less than 3 after factory calibration

* propagation and update are only performed after camera measurement feeding

* fix openvins feature reprojection
2023-10-02 07:53:29 -07:00
matlabbe
78c029d833 fixed https://github.com/introlab/rtabmap_ros/issues/1038 2023-10-01 09:07:15 -07:00
Borong Yuan
afd10b1aa6 add histogram equalization (#1137) 2023-09-21 15:46:10 -07:00
matlabbe
f1cd819673 Fixed superglue deadlock on standalone (#896). Fixed some elemSize opencv asserts in debug build (876) 2023-09-17 01:19:59 -07:00
matlabbe
fb466a6a96 StereoBM/StereoSGBM: Thresholding output to zero when minDisparity is used 2023-09-16 17:43:00 -07:00
matlabbe
0b7181fc88 Updated minimum cmake version for https://github.com/introlab/rtabmap/pull/1135#issuecomment-1719701828 2023-09-16 16:32:21 -07:00
matlabbe
97f2b4b65d Fixed autogen cmake warnings. Fixed pytorch requiring c++17. 2023-09-16 14:26:17 -07:00
matlabbe
39dedba93a workflow: removing EOL xenial 2023-09-14 08:44:26 -07:00
cdb0y511
49daa211ea use CMAKE_AUTOUIC, CMAKE_AUTOMOC and CMAKE_AUTORCC (#1135) 2023-09-14 08:25:00 -07:00
matlabbe
01c2e70b11 rtabmap-info: added --dump ini option 2023-09-08 14:53:21 -07:00
matlabbe
fa4a2eb5e3 Fixed build on 22.04 caused by 9e86faa4ad 2023-09-07 10:29:18 -07:00
matlabbe
9e86faa4ad GraphView: added right-click option to export 2d grid map directly from the view 2023-09-07 09:10:04 -07:00
matlabbe
e31eec2c55 docker: fixed typo jammy-iron-deps 2023-09-05 09:07:16 -07:00
matlabbe
2d7d0ec424 Fixed backward compatibility (xenial) from #1117 2023-09-05 08:51:57 -07:00
matlabbe
191e4250ef docker: Fixing jammy-iron build without arm64 2023-09-04 17:18:43 -07:00
matlabbe
e56e0c37f7 Fixed https://github.com/introlab/rtabmap_ros/issues/1024 2023-09-04 11:55:52 -07:00
cdb0y511
6a5b844bac fix for Undefined symbols for architecture x86_64: "Nabo::NearestNeighbourSearch (#1117)
related to https://github.com/ethz-asl/libpointmatcher/issues/514
employ fix from https://github.com/ethz-asl/libpointmatcher/pull/513
2023-08-27 13:36:49 -07:00
matlabbe
20ad6cca2c ros2/iron docker: disabled arm64 build for now (arm64 binaries not available) 2023-08-27 13:35:27 -07:00
matlabbe
f90fede65c ci: added ros2 iron docker image 2023-08-27 12:38:24 -07:00
Borong Yuan
61dbe51ee3 Update OAK stereo config and IMU rate (#1116)
* update OAK stereo config and imu rate

* enable brightness filter
2023-08-19 16:29:05 -07:00
Pierre Wendling
f2687ed1ff CMake: Add compatibility for yaml-cpp 0.8.0. (#1115)
- Upstream uses YAML_CPP_INCLUDE_DIR
- yaml-cpp 0.8.0 does not set YAML_CPP_LIBRARIES to the new target name.
- Debug builds of yaml-cpp suffix the library with `d`.
2023-08-18 18:06:45 -07:00
matlabbe
cdd8cd9e34 ICP/intensity: Applying fix from #1111 2023-08-13 14:58:15 -07:00
matlabbe
6d36fc1fcd package.xml: Added ROS gtsam as dependency 2023-08-13 13:50:08 -07:00
matlabbe
ba5579f063 Only remove compressed raw data when publish data is false (keep features/occupancy grid) 2023-08-11 16:31:26 -07:00
matlabbe
6395487b58 Stats: distance from last localization not increasing if small motion 2023-08-10 15:17:15 -07:00
Borong Yuan
f0ba56bf5e fix ros gtsam 4.2a9 build (#1108) 2023-08-07 07:33:23 -07:00
matlabbe
a94a4c9802 adding ros2 iron CI / docker, fixing #1103 2023-08-05 14:38:39 -07:00
matlabbe
e2f037189a git push origin masterMerge branch 'borongyuan-msckf_vio_update' 2023-07-30 12:15:03 -07:00
matlabbe
bcb29cfb66 msckf: backward compatibility update for euroc dataset evaluation 2023-07-30 12:14:35 -07:00
matlabbe
d25bb758ca Merge branch 'msckf_vio_update' of https://github.com/borongyuan/rtabmap into borongyuan-msckf_vio_update 2023-07-30 11:43:06 -07:00
matlabbe
424dc90dce Added Vis/PnPVarianceMedianRatio parameter (to tune pnp computed covariance) 2023-07-27 16:13:30 -07:00
Borong Yuan
5d6875ed98 change for initial frame update 2023-07-24 21:10:55 +08:00
Borong Yuan
f8b761d79b msckf_vio now supports c++14 2023-07-24 14:08:04 +08:00
matlabbe
446590b19f Merge branch 'guoqingzh-guoqingz/multi_noncentral' 2023-07-22 11:06:14 -04:00
matlabbe
3feb03cf35 Added Vis/PnPSamplingPolicy parameter (opengv "multi" ransac) 2023-07-22 11:05:21 -04:00
matlabbe
a593b0d525 Merge branch 'guoqingz/multi_noncentral' of https://github.com/guoqingzh/rtabmap into guoqingzh-guoqingz/multi_noncentral 2023-07-21 11:35:26 -04:00
matlabbe
ca4276a951 Merge branch 'borongyuan-oak-d-poe-update' 2023-07-21 09:10:27 -04:00
matlabbe
e8b54de94a CameraDepthAi: Fixed buffered frames 2023-07-21 09:10:06 -04:00
Borong Yuan
f9719c197d disparityToDepthUseSpecTranslation is enabled by default as recommended 2023-07-20 00:28:36 +08:00
Borong Yuan
d391f237eb update imu callback 2023-07-17 23:35:03 +08:00
Borong Yuan
0b4f5d2925 remove unnecessary conversion function 2023-07-17 17:00:43 +08:00
Borong Yuan
7d2272beb3 fix ProtocolToStr() visibility 2023-07-17 10:09:49 +08:00
Borong Yuan
6d690a315a Using VideoEncoder on PoE devices 2023-07-17 03:32:18 +08:00
Borong Yuan
ce81fe445a specify device using MXID or IP/USB name 2023-07-15 20:58:00 +08:00
Borong Yuan
a2a75a28ba add imu local transform for oak-d poe models 2023-07-14 20:18:48 +08:00
Guoqing Zhang
ddeca4585d Motion estimation: use MultiNoncentralAbsolutePoseSacProblem to estimate camera pose 2023-07-11 16:35:55 +03:00
matlabbe
64f79813cd Added error log message when graph optimization error is huge (error ratio over > 100) and RGBD/OptimizeMaxError is disabled. 2023-07-03 18:04:54 -07:00
matlabbe
b8c298efd9 Added devcontainer 2023-07-02 23:49:02 -07:00
matlabbe
97be9d4ace Localization mode: Fixed proximity detection permanently disabled when Rtabmap/StartNewMapOnLoopClosure is true 2023-06-27 17:25:07 -07:00
Chris Lalancette
f8c4b62591 Remove dependency on qt_gui_cpp. (#1072)
There is no dependency in this package on qt_gui_cpp.
Instead, just use a dependency on qtbase5-dev

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
2023-06-27 13:07:47 -07:00
matlabbe
a1168ba8a9 docker: removed focal-foxy (EOL) 2023-06-27 12:14:00 -07:00
matlabbe
c307f5c65f Removing foxy from CI (EOL) 2023-06-27 12:11:07 -07:00
matlabbe
b0cf2e9927 Update cmake-ros.yml with setup-ros 0.6 2023-06-27 11:16:14 -07:00
matlabbe
c7e46c1431 rgbddatset tool: removed local covariance logic. DBViewer: fixed poses not aligned to groundtruth on start. 2023-06-25 17:42:54 -07:00
matlabbe
092f6abccc fixed downstream python cmake not found (#1063) 2023-06-21 21:04:29 -07:00
matlabbe
dcbad6a0aa NMS: optimized descriptor copy by rows 2023-06-20 21:52:43 -07:00
matlabbe
337832e1b8 Fixed NMS seg fault #1064 2023-06-20 20:53:32 -07:00
matlabbe
d901fb23e3 Merge branch 'depthai-superpoint' of https://github.com/borongyuan/rtabmap into borongyuan-depthai-superpoint 2023-06-19 18:39:15 -07:00
matlabbe
59d5675fe6 docker: remixed where deps are built for convenience 2023-06-19 15:17:02 -07:00
matlabbe
ab3ade0309 fixed #1051 2023-06-19 15:06:16 -07:00
Borong Yuan
720d50fe74 add depthai superpoint descriptor 2023-06-19 15:15:37 +08:00
matlabbe
33fb2f75ad Fixed Python.h not found error (#1054) 2023-06-17 15:46:44 -07:00
matlabbe
36c0054070 docker: focal-foxy-deps, switched opengv and opencv 2023-06-17 12:30:55 -07:00
Borong Yuan
55a84cfdaa add depthai superpoint detector 2023-06-17 16:53:25 +08:00
Borong Yuan
2dd64a6283 move NMS to util2d 2023-06-17 13:06:54 +08:00
matlabbe
f75839294a Fixes for rtabmap_viz info sub only (with local cache) 2023-06-16 16:30:07 -07:00
Borong Yuan
e219152e8f update to depthai-core v2.22.0 2023-06-15 14:02:09 +08:00
Borong Yuan
d031d79369 add depthai gftt detector (#1047)
* add depthai feature detector draft

* update depthai gftt config

* optimize to detect more features
2023-06-11 12:57:26 -07:00
matlabbe
0c476936e3 docker: added tegra path to LD_LIBRARY_PATH to images 2023-06-11 10:15:40 -07:00
matlabbe
d86193036f docker ros2: fixed entrypoint.sh not exec 2023-06-11 10:02:17 -07:00
matlabbe
0c3b202006 fixed build with MRPT 2023-06-06 08:51:40 -07:00
matlabbe
1cc7c2818f Localization covariance empty till localization 2023-06-05 20:08:21 -07:00
matlabbe
1e145550df Merge branch 'borongyuan-alphascaling' 2023-06-05 19:01:42 -07:00
matlabbe
2a3580e060 Merge branch 'master' of https://github.com/introlab/rtabmap into borongyuan-alphascaling 2023-06-05 19:00:44 -07:00
matlabbe
d3facb1a84 Added alpha=-1 option 2023-06-05 18:59:59 -07:00
matlabbe
bf5c70d2e2 docker: fixed copy of ros_entrypoint.sh 2023-06-05 08:24:07 -07:00
matlabbe
7f7609075f docker: fixed humble->jammy 2023-06-04 21:04:21 -07:00
matlabbe
cf49ebf238 Split ros2 docker images into 2 jobs for easier maintenance 2023-06-04 21:01:24 -07:00
matlabbe
879f0f6941 Merge branch 'alphascaling' of https://github.com/borongyuan/rtabmap into borongyuan-alphascaling 2023-06-04 16:14:24 -07:00
matlabbe
af481fc730 docker/foxy: re-enabled opencv 2023-06-04 16:12:43 -07:00
matlabbe
1b67d6a86a Triggering focal-foxy docker 2023-06-01 19:38:15 -07:00
Borong Yuan
31d975acd5 Add alphaScaling option 2023-05-31 22:15:16 +08:00
Borong Yuan
54c68f8e6c Updated disparity reprojection to account for cameras with different Fx and Fy values 2023-05-31 19:40:29 +08:00
Borong Yuan
aedfcdc576 alphaScaling test 2023-05-30 18:16:28 +08:00
matlabbe
bfc4e939d1 Docker: updated ros2 base image to support arm64 2023-05-29 23:24:47 -07:00
André Lison
67df99aa57 fixes for texture mesh export pcl > 1.13.0 (#1039)
Co-authored-by: FIRST_NAME LAST_NAME <MY_NAME@example.com>
2023-05-29 19:00:18 -07:00
matlabbe
d88c816ca1 Merge branch 'borongyuan-master' 2023-05-29 18:12:25 -07:00
matlabbe
5b1c9e7233 IMU board fix for original OAK-D 2023-05-29 17:02:53 -07:00
Borong Yuan
8d6c809c3c Update data sync implementation for DepthAI 2023-05-27 21:28:43 +08:00
Borong Yuan
52e417c313 Set IMU extrinsics to left camera optical frame 2023-05-25 12:19:07 +08:00
Borong Yuan
5592a1ebfe Update IMU local transform 2023-05-25 00:01:55 +08:00
Borong Yuan
42fbdda567 Merge branch 'introlab:master' into master 2023-05-23 10:08:21 +08:00
matlabbe
ae3fda37a9 Fixed not invertible error ofter wrong graph optimization (seen on localization mode, gtsam returning inf poses) 2023-05-22 17:56:59 -07:00
Borong Yuan
ffd89ead86 Get baseline using sdk method 2023-05-22 22:06:45 +08:00
Borong Yuan
937e9fbb3b Advanced parameter tuning for depth quality optimization 2023-05-22 20:29:44 +08:00
Borong Yuan
9ecf71e5ed Update DepthAI camera model 2023-05-22 18:37:08 +08:00
Borong Yuan
ff83b14b49 Add options to enable IR featues on OAK Pro models 2023-05-18 01:48:38 +08:00
matlabbe
263eb6fbde Update README.md 2023-05-15 11:10:28 -07:00
matlabbe
e7d61b3856 Update README.md 2023-05-15 10:45:16 -07:00
matlabbe
682d54725a Fixed build with gtsam 4.3.0 (#1033) 2023-05-14 13:14:53 -07:00
matlabbe
ba33c080bc Added RGBD/LocalizationSmoothing parameter and fixed related issues (#1032)
* removed code

* added landmark in graph optimization checks

* reverted smoothing, only if there is already a previous localization link

* Added RGBDLocalizationSmoothing parameter

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml

* Update .appveyor.yml
2023-05-14 13:03:52 -07:00
matlabbe
2da448f4ee Docker: updated latest_deps dockerfile 2023-05-14 12:20:00 -07:00
matlabbe
376c82325e docker/focal: re-enabling opencv for arm64 (CI time limit issue) 2023-05-09 09:05:49 -07:00
matlabbe
95f65e1599 docker/focal: temporary disable opencv on arm64 build 2023-05-08 23:40:36 -07:00
matlabbe
060af6f7bb docker: cleanup files with nvidia, see new instructions on the wiki (no need to make another image anymore). Added latest OpenCV with xfeatures2d+nonfree modules. 2023-05-07 18:41:44 -07:00
matlabbe
999c01d71d Fixed https://github.com/introlab/rtabmap_ros/issues/948 2023-05-06 12:45:36 -07:00
matlabbe
a54f76238b cmake: WITH_OPENGV=On by default 2023-04-30 14:33:58 -07:00
matlabbe
f8f6b7788a Fixed #1015 2023-04-16 18:59:18 -07:00
matlabbe
e54195c47f ZED SDK 4 support (#1013) 2023-04-16 18:47:15 -07:00
matlabbe
e300d4c5c1 Added IMU support for camera images source with odom approach not supporting async imu 2023-04-16 17:32:32 -07:00
matlabbe
b91addb261 GUI: create simple calibration->fixed optical rotation 2023-04-15 18:24:14 -07:00
matlabbe
0f221ba3cd ParametersToolbox: fixed unsigned int parameter type not showing in toolbox 2023-04-14 17:50:34 -07:00
377 changed files with 38848 additions and 19385 deletions

View File

@@ -17,6 +17,9 @@ init:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
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
- 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
@@ -73,7 +76,7 @@ install:
- ps: "ls \"C:/Program Files/PCL\""
- set PATH=%PATH%;C:\Program Files\PCL\bin
# zlib
- ps: wget 'https://docs.google.com/uc?authuser=0&id=0B46akLGdg-uaYm9MTTI4MUtUcmc&export=download' -outfile zlib-1.2.8-vc2010-x64.zip
- ps: gdown -q 0B46akLGdg-uaYm9MTTI4MUtUcmc
- ps: Expand-Archive zlib-1.2.8-vc2010-x64.zip -DestinationPath 'C:\Program Files'
- ECHO "Installed zlib:"
- ps: "ls \"C:/Program Files/zlib\""

View File

@@ -0,0 +1,9 @@
{
"image": "introlab3it/rtabmap:android-deps",
"customizations": {
"vscode": {
"extensions": ["ms-vscode.cpptools-themes", "ms-vscode.cmake-tools", "vscjava.vscode-java-pack"]
}
},
"runArgs": ["--privileged", "--network=host"]
}

View File

@@ -0,0 +1,8 @@
{
"image": "introlab3it/rtabmap:18.04",
"customizations": {
"vscode": {
"extensions": ["ms-vscode.cpptools-themes", "ms-vscode.cmake-tools"]
}
}
}

View File

@@ -0,0 +1,8 @@
{
"image": "introlab3it/rtabmap:20.04",
"customizations": {
"vscode": {
"extensions": ["ms-vscode.cpptools-themes", "ms-vscode.cmake-tools"]
}
}
}

View File

@@ -0,0 +1,8 @@
{
"image": "introlab3it/rtabmap:22.04",
"customizations": {
"vscode": {
"extensions": ["ms-vscode.cpptools-themes", "ms-vscode.cmake-tools"]
}
}
}

View File

@@ -0,0 +1,8 @@
{
"image": "introlab3it/rtabmap:24.04",
"customizations": {
"vscode": {
"extensions": ["ms-vscode.cpptools-themes", "ms-vscode.cmake-tools"]
}
}
}

View File

@@ -1 +1,2 @@
build/*
build_*

View File

@@ -3,7 +3,7 @@ name: CMake-ROS
on:
push:
branches:
- master
- jazzy-devel
pull_request:
branches:
- '**'
@@ -21,28 +21,19 @@ jobs:
name: Build on ros ${{ matrix.ros_distribution }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ros_distribution: [ noetic, foxy, humble, rolling]
ros_distribution: [jazzy]
include:
- ros_distribution: 'noetic'
os: ubuntu-20.04
- ros_distribution: 'foxy'
os: ubuntu-20.04
- ros_distribution: 'humble'
os: ubuntu-22.04
- ros_distribution: 'rolling'
os: ubuntu-22.04
- ros_distribution: 'jazzy'
os: ubuntu-24.04
steps:
- name: Workaround dpkg grub-efi-amd64-signed error
run: |
sudo apt-mark hold grub-efi-amd64-signed
- uses: ros-tooling/setup-ros@v0.5
- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: ${{ matrix.ros_distribution }}
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install dependencies
run: |

View File

@@ -16,8 +16,9 @@ jobs:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
steps:
- name: Install dependencies
@@ -26,7 +27,7 @@ jobs:
sudo apt-get update
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
run: |

View File

@@ -6,22 +6,82 @@ on:
- 'master'
jobs:
docker:
docker_deps:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
docker_tag: [xenial, bionic, focal, focal-foxy, jammy, android23, android24, android26, android30]
docker_tag: [focal-deps, jammy-deps, jammy-iron-deps, noble-deps]
include:
- docker_tag: xenial
- docker_tag: focal-deps
docker_tags: |
introlab3it/rtabmap:xenial
introlab3it/rtabmap:16.04
docker_args: |
NOT_USED=0
introlab3it/rtabmap:focal-deps
docker_platforms: |
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_tags: |
introlab3it/rtabmap:bionic
@@ -42,17 +102,8 @@ jobs:
docker_platforms: |
linux/amd64
linux/arm64
linux/arm/v7
docker_path: 'focal'
- docker_tag: focal-foxy
docker_tags: |
introlab3it/rtabmap:focal-foxy
introlab3it/rtabmap:20.04-foxy
docker_args: |
NOT_USED=0
docker_platforms: |
linux/amd64
linux/arm64
docker_path: 'focal-foxy'
- docker_tag: jammy
docker_tags: |
introlab3it/rtabmap:jammy
@@ -63,6 +114,24 @@ jobs:
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_tags: |
introlab3it/rtabmap:android23

16
.github/workflows/scheduled-stats.yml vendored Normal file
View 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 }}

View File

@@ -1,5 +1,5 @@
# Top-Level CmakeLists.txt
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.14)
PROJECT( RTABMap )
SET(PROJECT_PREFIX rtabmap)
@@ -20,7 +20,7 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
#######################
SET(RTABMAP_MAJOR_VERSION 0)
SET(RTABMAP_MINOR_VERSION 21)
SET(RTABMAP_PATCH_VERSION 1)
SET(RTABMAP_PATCH_VERSION 10)
SET(RTABMAP_VERSION
${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}.${RTABMAP_PATCH_VERSION})
@@ -61,7 +61,7 @@ IF(WIN32 AND NOT MINGW)
ADD_DEFINITIONS("-DNOMINMAX")
ADD_DEFINITIONS("-wd4100 -wd4127 -wd4150 -wd4191 -wd4242 -wd4244 -wd4251 -wd4305 -wd4365 -wd4512 -wd4514 -wd4548 -wd4571 -wd4619 -wd4625 -wd4626 -wd4628 -wd4668 -wd4710 -wd4711 -wd4738 -wd4820 -wd4946 -wd4986")
ELSE ()
ADD_DEFINITIONS( "-Wall" )
ADD_DEFINITIONS( "-Wall -Wtype-limits" )
ADD_DEFINITIONS("-Wno-unknown-pragmas")
ENDIF()
@@ -177,10 +177,13 @@ option(WITH_TORCH "Include Torch support (SuperPoint)" OFF)
option(WITH_PYTHON "Include Python3 support (PyMatcher, PyDetector)" OFF)
option(WITH_PYTHON_THREADING "Use more than one Python interpreter." OFF)
option(WITH_PDAL "Include PDAL support" ON)
option(WITH_LIBLAS "Include libLAS support" OFF)
option(WITH_CUDASIFT "Include CudaSift support (this fork https://github.com/matlabbe/CudaSift)" OFF)
option(WITH_FREENECT "Include Freenect support" ON)
option(WITH_FREENECT2 "Include Freenect2 support" ON)
option(WITH_K4W2 "Include Kinect for Windows v2 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_DC1394 "Include dc1394 support" ON)
option(WITH_G2O "Include g2o support" ON)
@@ -203,11 +206,13 @@ option(WITH_REALSENSE_SLAM "Include RealSenseSlam support" ON)
option(WITH_REALSENSE2 "Include RealSense support" ON)
option(WITH_MYNTEYE "Include mynteye-s support" ON)
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_OPENCHISEL "Include open_chisel 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_DVO "Include DVO support" OFF)
option(WITH_ORB_SLAM "Include ORB_SLAM2 or ORB_SLAM3 support" OFF)
@@ -218,17 +223,18 @@ option(WITH_OPENVINS "Include OpenVINS support" OFF)
option(WITH_MADGWICK "Include Madgwick IMU filtering support" ON)
option(WITH_FASTCV "Include FastCV 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)
option(PCL_OMP "With PCL OMP implementations" OFF)
ELSE()
option(PCL_OMP "With PCL OMP implementations" ON)
ENDIF()
option(BUILD_WITH_RPATH_NOT_RUNPATH "Explicitly disable usage of RUNPATH for the build tree on linux systems by adding --disable-new-dtags to linker (using old RPATH behavior instead)" OFF)
set(RTABMAP_QT_VERSION AUTO CACHE STRING "Force a specific Qt version.")
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 objdetect xfeatures2d nonfree gpu cudafeatures2d cudaoptflow cudaimgproc)
IF(WITH_QT)
FIND_PACKAGE(PCL 1.7 REQUIRED QUIET COMPONENTS common io kdtree search surface filters registration sample_consensus segmentation visualization)
@@ -251,10 +257,10 @@ endif()
FIND_PACKAGE(ZLIB REQUIRED QUIET)
FIND_PACKAGE(Sqlite3 QUIET)
IF(Sqlite3_FOUND)
MESSAGE(STATUS "Found Sqlite3: ${Sqlite3_INCLUDE_DIRS} ${Sqlite3_LIBRARIES}")
ENDIF(Sqlite3_FOUND)
FIND_PACKAGE(SQLite3 QUIET)
IF(SQLite3_FOUND)
MESSAGE(STATUS "Found SQLite3: ${SQLite3_INCLUDE_DIRS} ${SQLite3_LIBRARIES}")
ENDIF(SQLite3_FOUND)
if(NOT "${PCL_LIBRARIES}" STREQUAL "")
# fix libproj.so not found on Xenial
@@ -293,14 +299,20 @@ SET(ADD_VTK_GUI_SUPPORT_QT_TO_CONF FALSE)
IF(WITH_QT)
FIND_PACKAGE(VTK)
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)
# If Qt is here, the GUI will be built
IF(NOT(${VTK_MAJOR_VERSION} LESS 9))
IF(NOT VTK_QT_VERSION)
MESSAGE(FATAL_ERROR "WITH_QT option is ON, but VTK ${VTK_MAJOR_VERSION} has not been built with Qt support, disabling Qt.")
ENDIF()
IF(NOT VTK_QT_VERSION)
MESSAGE(FATAL_ERROR "WITH_QT option is ON, but VTK ${VTK_MAJOR_VERSION} has not been built with Qt support, disabling Qt.")
ENDIF()
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)
@@ -325,6 +337,11 @@ IF(WITH_QT)
ENDIF()
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)
FIND_PACKAGE(QVTK REQUIRED) # only for VTK 5
ELSE()
@@ -389,6 +406,7 @@ IF(WITH_PYTHON)
FIND_PACKAGE(Python3 COMPONENTS Interpreter Development NumPy)
IF(Python3_FOUND)
MESSAGE(STATUS "Found Python3")
FIND_PACKAGE(pybind11 REQUIRED)
ENDIF(Python3_FOUND)
ENDIF(WITH_PYTHON)
@@ -399,6 +417,20 @@ IF(WITH_PDAL)
ENDIF(PDAL_FOUND)
ENDIF(WITH_PDAL)
IF(WITH_LIBLAS)
FIND_PACKAGE(libLAS QUIET)
IF(libLAS_FOUND)
MESSAGE(STATUS "Found libLAS ${libLAS_VERSION}: ${libLAS_INCLUDE_DIRS}")
ENDIF(libLAS_FOUND)
ENDIF(WITH_LIBLAS)
IF(WITH_CUDASIFT)
FIND_PACKAGE(CudaSift 3 QUIET)
IF(CudaSift_FOUND)
MESSAGE(STATUS "Found CudaSift")
ENDIF(CudaSift_FOUND)
ENDIF(WITH_CUDASIFT)
IF(WITH_FREENECT)
FIND_PACKAGE(Freenect QUIET)
IF(Freenect_FOUND)
@@ -518,7 +550,19 @@ ENDIF(WITH_CVSBA)
IF(WITH_POINTMATCHER)
find_package(libpointmatcher QUIET)
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(WITH_POINTMATCHER)
@@ -631,12 +675,19 @@ IF(WITH_MYNTEYE)
ENDIF(WITH_MYNTEYE)
IF(WITH_DEPTHAI)
FIND_PACKAGE(depthai 2 QUIET)
FIND_PACKAGE(depthai 2.24 QUIET)
IF(depthai_FOUND)
MESSAGE(STATUS "Found depthai-core (targets)")
ENDIF(depthai_FOUND)
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)
FIND_PACKAGE(octomap QUIET)
IF(octomap_FOUND)
@@ -647,6 +698,13 @@ IF(WITH_OCTOMAP)
ENDIF(octomap_FOUND)
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)
FIND_PACKAGE(CPUTSDF QUIET)
IF(CPUTSDF_FOUND)
@@ -739,9 +797,21 @@ ENDIF(WITH_VINS)
IF(WITH_OPENVINS)
FIND_PACKAGE(ov_msckf QUIET)
IF(ov_msckf_FOUND)
MESSAGE(STATUS "Found ov_msckf: ${ov_msckf_INCLUDE_DIRS}")
ENDIF(ov_msckf_FOUND)
# On ROS2, the indirect includes and libraries
# are not forwarded by ov_msckf target, append them manually
FIND_PACKAGE(ov_core QUIET)
FIND_PACKAGE(ov_init QUIET)
IF(ov_msckf_FOUND AND ov_core_FOUND AND ov_init_FOUND)
SET(ov_msckf_INCLUDE_DIRS
${ov_msckf_INCLUDE_DIRS}
${ov_core_INCLUDE_DIRS}
${ov_init_INCLUDE_DIRS})
SET(ov_msckf_LIBRARIES
${ov_msckf_LIBRARIES}
${ov_core_LIBRARIES}
${ov_init_LIBRARIES})
MESSAGE(STATUS "Found OpenVINS: ${ov_msckf_INCLUDE_DIRS}")
ENDIF()
ENDIF(WITH_OPENVINS)
IF(WITH_FASTCV)
@@ -765,8 +835,13 @@ IF(WITH_ORB_SLAM AND NOT G2O_FOUND)
ENDIF(ORB_SLAM_FOUND)
ENDIF(WITH_ORB_SLAM AND NOT G2O_FOUND)
SET(DISABLE_NEW_DTAGS_FLAG "--disable-new-dtags")
IF(NOT (APPLE OR WIN32) AND BUILD_WITH_RPATH_NOT_RUNPATH)
ADD_LINK_OPTIONS(LINKER:${DISABLE_NEW_DTAGS_FLAG})
ENDIF()
IF(NOT MSVC)
IF(Qt6_FOUND OR (G2O_FOUND AND G2O_CPP11 EQUAL 1))
IF(Qt6_FOUND OR (G2O_FOUND AND G2O_CPP11 EQUAL 1) OR TORCH_FOUND OR MRPT_FOUND)
# Qt6 requires c++17
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
@@ -777,8 +852,8 @@ IF(NOT MSVC)
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()
IF((NOT (${CMAKE_CXX_STANDARD} STREQUAL "17")) AND ((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)))
#LOAM, PCL>=1.10, latest g2o and CCCoreLib require c++14, but MSCKF_VIO requires c++11
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)
@@ -789,22 +864,7 @@ IF(NOT MSVC)
ENDIF()
ENDIF()
IF( (NOT (${CMAKE_CXX_STANDARD} STREQUAL "17") AND NOT (${CMAKE_CXX_STANDARD} STREQUAL "14")) AND (
G2O_FOUND OR
GTSAM_FOUND OR
CERES_FOUND OR
ZED_FOUND OR
ZEDOC_FOUND OR
ANDROID OR
RealSense_FOUND OR
realsense2_FOUND OR
ORB_SLAM_FOUND OR
okvis_FOUND OR
open_chisel_FOUND OR
msckf_vio_FOUND OR
vins_FOUND OR
ov_msckf_FOUND OR
libpointmatcher_FOUND))
IF(NOT ("${CMAKE_CXX_STANDARD}" STREQUAL "17") AND NOT ("${CMAKE_CXX_STANDARD}" STREQUAL "14"))
#Newest versions require std11
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
@@ -819,6 +879,7 @@ IF(NOT MSVC)
ENDIF()
ENDIF()
####### OSX BUNDLE CMAKE_INSTALL_PREFIX #######
IF(APPLE AND BUILD_AS_BUNDLE)
IF(Qt6_FOUND OR Qt5_FOUND OR (QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND))
@@ -879,9 +940,9 @@ ENDIF()
IF(NOT MRPT_FOUND)
SET(MRPT "//")
ENDIF(NOT MRPT_FOUND)
IF(NOT CERES_FOUND)
IF(NOT WITH_CERES OR NOT CERES_FOUND)
SET(CERES "//")
ENDIF(NOT CERES_FOUND)
ENDIF(NOT WITH_CERES OR NOT CERES_FOUND)
IF(NOT WITH_TORO)
SET(TORO "//")
ENDIF(NOT WITH_TORO)
@@ -903,12 +964,18 @@ ENDIF(NOT Open3D_FOUND)
IF(NOT FastCV_FOUND)
SET(FASTCV "//")
ENDIF(NOT FastCV_FOUND)
IF(NOT opengv_FOUND)
IF(NOT opengv_FOUND OR NOT WITH_OPENGV)
SET(OPENGV "//")
ENDIF(NOT opengv_FOUND)
ENDIF(NOT opengv_FOUND OR NOT WITH_OPENGV)
IF(NOT PDAL_FOUND)
SET(PDAL "//")
ENDIF(NOT PDAL_FOUND)
IF(NOT libLAS_FOUND)
SET(LIBLAS "//")
ENDIF(NOT libLAS_FOUND)
IF(NOT CudaSift_FOUND)
SET(CUDASIFT "//")
ENDIF(NOT CudaSift_FOUND)
IF(NOT loam_velodyne_FOUND)
SET(LOAM "//")
ENDIF(NOT loam_velodyne_FOUND)
@@ -938,6 +1005,9 @@ ELSE()
)
ENDIF(WIN32)
ENDIF()
IF(NOT (OpenNI_FOUND AND WITH_OPENNI))
SET(OPENNI "//")
ENDIF()
IF(NOT OpenNI2_FOUND)
SET(OPENNI2 "//")
ENDIF()
@@ -977,10 +1047,16 @@ IF(NOT mynteye_FOUND)
SET(MYNTEYE "//")
ENDIF(NOT mynteye_FOUND)
IF(NOT depthai_FOUND)
SET(CONF_DEPTH_AI OFF)
SET(CONF_WITH_DEPTH_AI 0)
SET(DEPTHAI "//")
ELSE()
SET(CONF_DEPTH_AI ON)
SET(CONF_WITH_DEPTH_AI 1)
ENDIF()
IF(NOT xvsdk_FOUND)
SET(XVSDK "//")
SET(CONF_WITH_XVSDK 0)
ELSE()
SET(CONF_WITH_XVSDK 1)
ENDIF()
IF(NOT octomap_FOUND)
SET(OCTOMAP "//")
@@ -988,6 +1064,9 @@ IF(NOT octomap_FOUND)
ELSE()
SET(CONF_WITH_OCTOMAP 1)
ENDIF()
IF(NOT grid_map_core_FOUND)
SET(GRIDMAP "//")
ENDIF()
IF(NOT CPUTSDF_FOUND)
SET(CPUTSDF "//")
ENDIF()
@@ -1029,6 +1108,9 @@ IF(NOT TORCH_FOUND)
ENDIF()
IF(NOT WITH_PYTHON OR NOT Python3_FOUND)
SET(PYTHON "//")
SET(CONF_WITH_PYTHON 0)
ELSE()
SET(CONF_WITH_PYTHON 1)
ENDIF()
IF(ADD_VTK_GUI_SUPPORT_QT_TO_CONF)
SET(CONF_VTK_QT true)
@@ -1048,13 +1130,15 @@ IF(ANDROID)
IF(BUILD_APP)
ADD_SUBDIRECTORY( app )
ENDIF(BUILD_APP)
ELSEIF(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)
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()
IF(BUILD_TOOLS)
@@ -1067,6 +1151,7 @@ ENDIF(BUILD_EXAMPLES)
#######################
# Uninstall target, for "make uninstall"
#######################
IF (NOT TARGET uninstall)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
@@ -1074,13 +1159,14 @@ CONFIGURE_FILE(
ADD_CUSTOM_TARGET(uninstall
"${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(QT4_FOUND OR Qt5_FOUND OR Qt6_FOUND)
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)
@@ -1255,6 +1341,9 @@ IF(APPLE OR WIN32)
MESSAGE(STATUS " BUILD_AS_BUNDLE = ${BUILD_AS_BUNDLE}")
ENDIF(APPLE OR WIN32)
MESSAGE(STATUS " CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}")
IF(NOT (APPLE OR WIN32) AND BUILD_WITH_RPATH_NOT_RUNPATH)
MESSAGE(STATUS " LINKER FLAGS = ${DISABLE_NEW_DTAGS_FLAG}")
ENDIF()
MESSAGE(STATUS " FLANN_KDTREE_MEM_OPT = ${FLANN_KDTREE_MEM_OPT}")
MESSAGE(STATUS " PCL_DEFINITIONS = ${PCL_DEFINITIONS}")
MESSAGE(STATUS " PCL_VERSION = ${PCL_VERSION}")
@@ -1292,13 +1381,13 @@ IF(OpenCV_FOUND)
ENDIF()
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 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 VTK ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} = YES (License: BSD)")
ELSEIF(Qt6_FOUND)
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)")
@@ -1308,10 +1397,10 @@ ELSE()
MESSAGE(STATUS " With Qt = NO (Qt not found)")
ENDIF()
IF(Sqlite3_FOUND)
IF(SQLite3_FOUND)
MESSAGE(STATUS " With external SQLite3 = YES (License: Public Domain)")
ELSE()
MESSAGE(STATUS " With external SQLite3 = NO (sqlite3 not found, internal version is used for convenience)")
MESSAGE(STATUS " With external SQLite3 = NO (SQLite3 not found, internal version is used for convenience)")
ENDIF()
IF(WITH_ORB_OCTREE)
@@ -1358,6 +1447,22 @@ ELSE()
MESSAGE(STATUS " With PDAL = NO (PDAL not found)")
ENDIF()
IF(libLAS_FOUND)
MESSAGE(STATUS " With libLAS ${libLAS_VERSION} = YES (License: BSD)")
ELSEIF(NOT WITH_LIBLAS)
MESSAGE(STATUS " With libLAS = NO (WITH_LIBLAS=OFF)")
ELSE()
MESSAGE(STATUS " With libLAS = NO (libLAS not found)")
ENDIF()
IF(CudaSift_FOUND)
MESSAGE(STATUS " With CudaSift = YES (License: MIT)")
ELSEIF(NOT WITH_CUDASIFT)
MESSAGE(STATUS " With CudaSift = NO (WITH_CUDASIFT=OFF)")
ELSE()
MESSAGE(STATUS " With CudaSift = NO (CudaSift not found, use https://github.com/matlabbe/CudaSift fork)")
ENDIF()
MESSAGE(STATUS "")
MESSAGE(STATUS " Solvers:")
IF(WITH_TORO)
@@ -1382,12 +1487,8 @@ ELSE()
MESSAGE(STATUS " *With GTSAM = NO (GTSAM not found)")
ENDIF()
IF(CERES_FOUND)
IF(WITH_CERES)
IF(WITH_CERES AND CERES_FOUND)
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)
MESSAGE(STATUS " *With Ceres = NO (WITH_CERES=OFF)")
ELSE()
@@ -1446,7 +1547,7 @@ ELSE()
MESSAGE(STATUS " With Open3D = NO (Open3D not found)")
ENDIF()
IF(opengv_FOUND)
IF(opengv_FOUND AND WITH_OPENGV)
MESSAGE(STATUS " With OpenGV ${opengv_VERSION} = YES (License: BSD)")
ELSEIF(NOT WITH_OPENGV)
MESSAGE(STATUS " With OpenGV = NO (WITH_OPENGV=OFF)")
@@ -1457,11 +1558,19 @@ ENDIF()
MESSAGE(STATUS "")
MESSAGE(STATUS " Reconstruction Approaches:")
IF(octomap_FOUND)
MESSAGE(STATUS " With OCTOMAP ${octomap_VERSION} = YES (License: BSD)")
MESSAGE(STATUS " With OctoMap ${octomap_VERSION} = YES (License: BSD)")
ELSEIF(NOT WITH_OCTOMAP)
MESSAGE(STATUS " With OCTOMAP = NO (WITH_OCTOMAP=OFF)")
MESSAGE(STATUS " With OctoMap = NO (WITH_OCTOMAP=OFF)")
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()
IF(CPUTSDF_FOUND)
@@ -1498,6 +1607,14 @@ ELSE()
MESSAGE(STATUS " With Freenect = NO (libfreenect not found)")
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)
MESSAGE(STATUS " With OpenNI2 = YES (License: Apache v2)")
ELSEIF(NOT WITH_OPENNI2)
@@ -1605,6 +1722,14 @@ ELSE()
MESSAGE(STATUS " With DepthAI = NO (depthai-core not found)")
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 " Odometry Approaches:")
IF(loam_velodyne_FOUND)

View File

@@ -4,11 +4,15 @@ rtabmap
[![RTAB-Map Logo](https://raw.githubusercontent.com/introlab/rtabmap/master/guilib/src/images/RTAB-Map100.png)](http://introlab.github.io/rtabmap)
[![Release][release-image]][releases]
[![Downloads][downloads-image]][downloads]
[![License][license-image]][license]
[release-image]: https://img.shields.io/badge/release-0.20.16-green.svg?style=flat
[release-image]: https://img.shields.io/badge/release-0.21.4-green.svg?style=flat
[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]: https://github.com/introlab/rtabmap/blob/master/LICENSE
@@ -50,27 +54,29 @@ This project is supported by [IntRoLab - Intelligent / Interactive / Integrated
<table>
<tbody>
<tr>
<td rowspan="2">ROS 1</td>
<td>Melodic</td>
<td><a href="http://build.ros.org/job/Mbin_ubv8_uBv8__rtabmap__ubuntu_bionic_arm64__binary/"><img src="http://build.ros.org/buildStatus/icon?job=Mbin_ubv8_uBv8__rtabmap__ubuntu_bionic_arm64__binary" alt="Build Status"/></td>
</tr>
<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>Foxy</td>
<td><a href="http://build.ros2.org/job/Fbin_uF64__rtabmap__ubuntu_focal_amd64__binary/"><img src="http://build.ros2.org/buildStatus/icon?job=Fbin_uF64__rtabmap__ubuntu_focal_amd64__binary" alt="Build Status"/></td>
</tr>
<tr>
<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>

View File

@@ -1,7 +1,7 @@
include(CMakeFindDependencyMacro)
# Mandatory dependencies
find_dependency(OpenCV COMPONENTS core calib3d imgproc highgui stitching photo video OPTIONAL_COMPONENTS aruco xfeatures2d nonfree gpu cudafeatures2d)
find_dependency(OpenCV COMPONENTS core calib3d imgproc highgui stitching photo video OPTIONAL_COMPONENTS aruco objdetect xfeatures2d nonfree gpu cudafeatures2d)
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/RTABMap_guiTargets.cmake")
find_dependency(PCL 1.7 COMPONENTS common io kdtree search surface filters registration sample_consensus segmentation visualization)
@@ -42,10 +42,22 @@ IF(@CONF_WITH_K4A@)
ENDIF()
ENDIF()
IF(@CONF_WITH_DEPTH_AI@)
find_dependency(depthai 2.24)
ENDIF()
IF(@CONF_WITH_XVSDK@)
find_dependency(xvsdk)
ENDIF()
IF(@CONF_WITH_OCTOMAP@)
find_dependency(octomap)
ENDIF()
IF(@CONF_WITH_PYTHON@)
find_dependency(Python3 COMPONENTS Interpreter Development NumPy)
ENDIF()
# Provide those for backward compatibilities (e.g., catkin requires them to propagate dependencies)
set(RTABMap_INCLUDE_DIRS "")
set(RTABMap_LIBRARIES "")
@@ -81,8 +93,7 @@ endforeach()
include("${CMAKE_CURRENT_LIST_DIR}/RTABMapTargets.cmake")
foreach(_comp ${RTABMap_FIND_COMPONENTS})
if (NOT ";${_RTABMap_supported_components};" MATCHES ";${_comp};")
set(RTABMap_${_comp}_FOUND False)
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}")

View File

@@ -45,6 +45,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@CERES@#define RTABMAP_CERES
@MRPT@#define RTABMAP_MRPT
@VERTIGO@#define RTABMAP_VERTIGO
@OPENNI@#define RTABMAP_OPENNI
@OPENNI2@#define RTABMAP_OPENNI2
@FREENECT@#define RTABMAP_FREENECT
@FREENECT2@#define RTABMAP_FREENECT2
@@ -57,6 +58,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@FASTCV@#define RTABMAP_FASTCV
@OPENGV@#define RTABMAP_OPENGV
@PDAL@#define RTABMAP_PDAL
@LIBLAS@#define RTABMAP_LIBLAS
@CUDASIFT@#define RTABMAP_CUDASIFT
@LOAM@#define RTABMAP_LOAM
@FLOAM@#define RTABMAP_FLOAM
@DC1394@#define RTABMAP_DC1394
@@ -68,7 +71,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@REALSENSE2@#define RTABMAP_REALSENSE2
@MYNTEYE@#define RTABMAP_MYNTEYE
@DEPTHAI@#define RTABMAP_DEPTHAI
@XVSDK@#define RTABMAP_XVSDK
@OCTOMAP@#define RTABMAP_OCTOMAP
@GRIDMAP@#define RTABMAP_GRIDMAP
@CPUTSDF@#define RTABMAP_CPUTSDF
@ALICE_VISION@#define RTABMAP_ALICE_VISION
@OPENCHISEL@#define RTABMAP_OPENCHISEL

View File

@@ -37,8 +37,8 @@ namespace rtabmap {
//////////////////////////////
// CameraARCore
//////////////////////////////
CameraARCore::CameraARCore(void* env, void* context, void* activity, bool depthFromMotion, bool smoothing):
CameraMobile(smoothing),
CameraARCore::CameraARCore(void* env, void* context, void* activity, bool depthFromMotion, bool smoothing, float upstreamRelocalizationAccThr):
CameraMobile(smoothing, upstreamRelocalizationAccThr),
env_(env),
context_(context),
activity_(activity),
@@ -125,6 +125,8 @@ bool CameraARCore::init(const std::string & calibrationFolder, const std::string
{
close();
CameraMobile::init(calibrationFolder, cameraName);
UScopeMutex lock(arSessionMutex_);
ArInstallStatus install_status;
@@ -272,54 +274,6 @@ void CameraARCore::close()
CameraMobile::close();
}
LaserScan CameraARCore::scanFromPointCloudData(
const float * pointCloudData,
int points,
const Transform & pose,
const CameraModel & model,
const cv::Mat & rgb,
std::vector<cv::KeyPoint> * kpts,
std::vector<cv::Point3f> * kpts3D)
{
if(pointCloudData && points>0)
{
cv::Mat scanData(1, points, CV_32FC4);
float * ptr = scanData.ptr<float>();
for(unsigned int i=0;i<points; ++i)
{
cv::Point3f pt(pointCloudData[i*4], pointCloudData[i*4 + 1], pointCloudData[i*4 + 2]);
pt = util3d::transformPoint(pt, pose.inverse()*rtabmap_world_T_opengl_world);
ptr[i*4] = pt.x;
ptr[i*4 + 1] = pt.y;
ptr[i*4 + 2] = pt.z;
//get color from rgb image
cv::Point3f org= pt;
pt = util3d::transformPoint(pt, opticalRotationInv);
int u,v;
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];
g=rgb.at<cv::Vec3b>(v,u).val[1];
r=rgb.at<cv::Vec3b>(v,u).val[2];
if(kpts)
kpts->push_back(cv::KeyPoint(u,v,3));
if(kpts3D)
kpts3D->push_back(org);
}
*(int*)&ptr[i*4 + 3] = int(b) | (int(g) << 8) | (int(r) << 16);
//confidence
//*(int*)&ptr[i*4 + 3] = (int(pointCloudData[i*4 + 3] * 255.0f) << 8) | (int(255) << 16);
}
return LaserScan::backwardCompatibility(scanData, 0, 10, rtabmap::Transform::getIdentity());
}
return LaserScan();
}
void CameraARCore::setScreenRotationAndSize(ScreenRotation colorCameraToDisplayRotation, int width, int height)
{
CameraMobile::setScreenRotationAndSize(colorCameraToDisplayRotation, width, height);
@@ -334,11 +288,12 @@ void CameraARCore::setScreenRotationAndSize(ScreenRotation colorCameraToDisplayR
}
}
SensorData CameraARCore::captureImage(CameraInfo * info)
SensorData CameraARCore::updateDataOnRender(Transform & pose)
{
UScopeMutex lock(arSessionMutex_);
//LOGI("Capturing image...");
pose.setNull();
SensorData data;
if(!arSession_)
{
@@ -370,7 +325,7 @@ SensorData CameraARCore::captureImage(CameraInfo * info)
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,
BackgroundRenderer::kNumVertices, BackgroundRenderer_kVerticesDevice, AR_COORDINATES_2D_TEXTURE_NORMALIZED,
transformed_uvs_);
UASSERT(transformed_uvs_);
uvs_initialized_ = true;
@@ -384,16 +339,9 @@ SensorData CameraARCore::captureImage(CameraInfo * info)
/*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)
{
@@ -401,23 +349,13 @@ SensorData CameraARCore::captureImage(CameraInfo * info)
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]);
pose = rtabmap::rtabmap_world_T_opengl_world * pose * rtabmap::opengl_world_T_rtabmap_world;
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 * poseArCore * rtabmap::opengl_world_T_rtabmap_world;
Transform poseArCore = pose;
if(pose.isNull())
{
LOGE("CameraARCore: Pose is null");
}
else
{
this->poseReceived(pose);
// adjust origin
if(!getOriginOffset().isNull())
{
pose = getOriginOffset() * pose;
}
info->odomPose = pose;
return data;
}
// Get calibration parameters
@@ -541,7 +479,11 @@ SensorData CameraARCore::captureImage(CameraInfo * info)
#endif
if(pointCloudData && points>0)
{
scan = scanFromPointCloudData(pointCloudData, points, poseArCore, model, rgb, &kpts, &kpts3);
cv::Mat pointCloudDataMat(1, points, CV_32FC4, (void *)pointCloudData);
scan = scanFromPointCloudData(pointCloudDataMat, pose, model, rgb, &kpts, &kpts3);
#ifndef DISABLE_LOG
LOGI("valid scan points = %d", scan.size());
#endif
}
}
else
@@ -551,6 +493,11 @@ SensorData CameraARCore::captureImage(CameraInfo * info)
data = SensorData(scan, rgb, depthFromMotion_?getOcclusionImage():cv::Mat(), model, 0, stamp);
data.setFeatures(kpts, kpts3, cv::Mat());
if(!pose.isNull())
{
this->poseReceived(pose, stamp);
}
}
}
else
@@ -571,134 +518,6 @@ SensorData CameraARCore::captureImage(CameraInfo * info)
ArCamera_release(ar_camera);
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 */

View File

@@ -50,36 +50,17 @@ namespace rtabmap {
class CameraARCore : public CameraMobile {
public:
static LaserScan scanFromPointCloudData(
const float * pointCloudData,
int points,
const Transform & pose,
const CameraModel & model,
const cv::Mat & rgb,
std::vector<cv::KeyPoint> * kpts = 0,
std::vector<cv::Point3f> * kpts3D = 0);
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, float upstreamRelocalizationAccThr = 0.0f);
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 bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
void setupGL();
virtual void close(); // close Tango connection
virtual void close(); // close ARCore connection
virtual std::string getSerial() const;
GLuint getTextureId() const {return textureId_;}
void imageCallback(AImageReader *reader);
protected:
virtual SensorData captureImage(CameraInfo * info = 0); // should be called in opengl thread
virtual void capturePoseOnly();
virtual SensorData updateDataOnRender(Transform & pose); // should be called in opengl thread
private:
rtabmap::Transform getPoseAtTimestamp(double timestamp);

View File

@@ -40,8 +40,8 @@ namespace rtabmap {
//////////////////////////////
// CameraAREngine
//////////////////////////////
CameraAREngine::CameraAREngine(void* env, void* context, void* activity, bool smoothing):
CameraMobile(smoothing),
CameraAREngine::CameraAREngine(void* env, void* context, void* activity, bool smoothing, float upstreamRelocalizationAccThr):
CameraMobile(smoothing, upstreamRelocalizationAccThr),
env_(env),
context_(context),
activity_(activity),
@@ -66,6 +66,8 @@ bool CameraAREngine::init(const std::string & calibrationFolder, const std::stri
{
close();
CameraMobile::init(calibrationFolder, cameraName);
UScopeMutex lock(arSessionMutex_);
HwArInstallStatus install_status;
@@ -117,9 +119,6 @@ bool CameraAREngine::init(const std::string & calibrationFolder, const std::stri
deviceTColorCamera_ = opticalRotation;
// Required as ArSession_update does some off-screen OpenGL stuff...
HwArSession_setCameraTextureName(arSession_, textureId_);
if (HwArSession_resume(arSession_) != HWAR_SUCCESS)
{
UERROR("Cannot resume camera!");
@@ -169,38 +168,81 @@ void CameraAREngine::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_);
//LOGI("Capturing image...");
pose.setNull();
SensorData data;
if(!arSession_)
{
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.
if (HwArSession_update(arSession_, arFrame_) != HWAR_SUCCESS) {
LOGE("CameraAREngine::captureImage() ArSession_update error");
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;
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_));
HwArTrackingState camera_tracking_state;
HwArCamera_getTrackingState(arSession_, ar_camera, &camera_tracking_state);
Transform pose;
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
// FIXME: Hard-coded as getting intrinsics with the api fails
float fx=492.689667,fy=492.606201, cx=323.594849, cy=234.659744;
@@ -274,6 +316,21 @@ SensorData CameraAREngine::captureImage(CameraInfo * info)
double stamp = double(timestamp_ns)/10e8;
CameraModel model = CameraModel(fx, fy, cx, cy, deviceTColorCamera_, 0, cv::Size(camWidth, camHeight));
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);
}
}
}
else
@@ -291,66 +348,8 @@ SensorData CameraAREngine::captureImage(CameraInfo * info)
}
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;
}
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 */

View File

@@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <rtabmap/utilite/UEvent.h>
#include <rtabmap/utilite/UTimer.h>
#include <boost/thread/mutex.hpp>
#include <background_renderer.h>
#include <huawei_arengine_interface.h>
@@ -45,16 +46,17 @@ namespace rtabmap {
class CameraAREngine : public CameraMobile {
public:
CameraAREngine(void* env, void* context, void* activity, bool smoothing = false);
CameraAREngine(void* env, void* context, void* activity, bool smoothing = false, float upstreamRelocalizationAccThr = 0.0f);
virtual ~CameraAREngine();
virtual void setScreenRotationAndSize(ScreenRotation colorCameraToDisplayRotation, int width, int height);
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;
protected:
virtual SensorData captureImage(CameraInfo * info = 0);
virtual void capturePoseOnly();
virtual SensorData updateDataOnRender(Transform & pose);
private:
rtabmap::Transform getPoseAtTimestamp(double timestamp);
@@ -69,7 +71,6 @@ private:
HwArCameraIntrinsics *arCameraIntrinsics_ = nullptr;
HwArPose * arPose_ = nullptr;
bool arInstallRequested_;
GLuint textureId_;
UMutex arSessionMutex_;
};

View File

@@ -18,6 +18,7 @@ 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
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
@@ -52,17 +53,18 @@ const rtabmap::Transform CameraMobile::opticalRotationInv = Transform(
0.0f, 0.0f, -1.0f, 0.0f,
1.0f, 0.0f, 0.0f, 0.0f);
CameraMobile::CameraMobile(bool smoothing) :
CameraMobile::CameraMobile(bool smoothing, float upstreamRelocalizationAccThr) :
Camera(10),
deviceTColorCamera_(Transform::getIdentity()),
spinOncePreviousStamp_(0.0),
textureId_(0),
uvs_initialized_(false),
previousStamp_(0.0),
stampEpochOffset_(0.0),
smoothing_(smoothing),
colorCameraToDisplayRotation_(ROTATION_0),
originUpdate_(false)
originUpdate_(true),
upstreamRelocalizationAccThr_(upstreamRelocalizationAccThr),
previousAnchorStamp_(0.0),
dataGoodTracking_(true)
{
}
@@ -74,58 +76,214 @@ CameraMobile::~CameraMobile() {
bool CameraMobile::init(const std::string &, const std::string &)
{
deviceTColorCamera_ = opticalRotation;
// clear semaphore
if(dataReady_.value() > 0) {
dataReady_.acquire(dataReady_.value());
}
return true;
}
void CameraMobile::close()
{
previousPose_.setNull();
previousStamp_ = 0.0;
UScopeMutex lock(dataMutex_);
firstFrame_ = true;
lastKnownGPS_ = GPS();
lastEnvSensors_.clear();
originOffset_ = Transform();
originUpdate_ = false;
pose_ = Transform();
originUpdate_ = true;
dataPose_ = Transform();
data_ = SensorData();
dataGoodTracking_ = true;
previousAnchorPose_.setNull();
previousAnchorLinearVelocity_.clear();
previousAnchorStamp_ = 0.0;
if(textureId_ != 0)
{
glDeleteTextures(1, &textureId_);
textureId_ = 0;
}
// in case someone is waiting on captureImage()
dataReady_.release();
}
void CameraMobile::resetOrigin()
{
previousPose_.setNull();
previousStamp_ = 0.0;
lastKnownGPS_ = GPS();
lastEnvSensors_.clear();
pose_ = Transform();
data_ = SensorData();
originUpdate_ = true;
}
void CameraMobile::poseReceived(const Transform & pose)
bool CameraMobile::getPose(double epochStamp, Transform & pose, cv::Mat & covariance, double maxWaitTime)
{
if(!pose.isNull())
{
// send pose of the camera (without optical rotation)
Transform p = pose*deviceTColorCamera_;
if(originUpdate_)
{
originOffset_ = p.translation().inverse();
originUpdate_ = false;
}
pose.setNull();
if(!originOffset_.isNull())
int maxWaitTimeMs = maxWaitTime * 1000;
// Interpolate pose
if(!poseBuffer_.empty())
{
poseMutex_.lock();
int waitTry = 0;
while(maxWaitTimeMs>0 && poseBuffer_.rbegin()->first < epochStamp && waitTry < maxWaitTimeMs)
{
this->post(new PoseEvent(originOffset_*p));
poseMutex_.unlock();
++waitTry;
uSleep(1);
poseMutex_.lock();
}
if(poseBuffer_.rbegin()->first < epochStamp)
{
if(maxWaitTimeMs > 0)
{
UWARN("Could not find poses to interpolate at time %f after waiting %d ms (latest is %f)...", epochStamp, maxWaitTimeMs, poseBuffer_.rbegin()->first);
}
else
{
UWARN("Could not find poses to interpolate at time %f (latest is %f)...", epochStamp, poseBuffer_.rbegin()->first);
}
}
else
{
this->post(new PoseEvent(p));
std::map<double, Transform>::const_iterator iterB = poseBuffer_.lower_bound(epochStamp);
std::map<double, Transform>::const_iterator iterA = iterB;
if(iterA != poseBuffer_.begin())
{
iterA = --iterA;
}
if(iterB == poseBuffer_.end())
{
iterB = --iterB;
}
if(iterA == iterB && epochStamp == iterA->first)
{
pose = iterA->second;
}
else if(epochStamp >= iterA->first && epochStamp <= iterB->first)
{
pose = iterA->second.interpolate((epochStamp-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?", epochStamp, iterA->first);
}
}
poseMutex_.unlock();
}
return !pose.isNull();
}
void CameraMobile::poseReceived(const Transform & pose, double deviceStamp)
{
// Pose reveived is the pose of the device in rtabmap coordinate
if(!pose.isNull())
{
Transform p = pose;
if(stampEpochOffset_ == 0.0)
{
stampEpochOffset_ = UTimer::now() - deviceStamp;
}
if(originUpdate_)
{
firstFrame_ = true;
lastKnownGPS_ = GPS();
lastEnvSensors_.clear();
dataGoodTracking_ = true;
previousAnchorPose_.setNull();
previousAnchorLinearVelocity_.clear();
previousAnchorStamp_ = 0.0;
originOffset_ = pose.translation().inverse();
originUpdate_ = false;
}
double epochStamp = stampEpochOffset_ + deviceStamp;
if(!originOffset_.isNull())
{
// Filter re-localizations from poses received
rtabmap::Transform rawPose = originOffset_ * pose.translation(); // remove rotation to keep position in fixed frame
// Remove upstream localization corrections by integrating pose from previous frame anchor
bool showLog = false;
if(upstreamRelocalizationAccThr_>0.0f && !previousAnchorPose_.isNull())
{
float dt = epochStamp - previousAnchorStamp_;
std::vector<float> currentLinearVelocity(3);
float dx = rawPose.x()-previousAnchorPose_.x();
float dy = rawPose.y()-previousAnchorPose_.y();
float dz = rawPose.z()-previousAnchorPose_.z();
currentLinearVelocity[0] = dx / dt;
currentLinearVelocity[1] = dy / dt;
currentLinearVelocity[2] = dz / dt;
if(!previousAnchorLinearVelocity_.empty() && uNorm(dx, dy, dz)>0.02)
{
float ax = (currentLinearVelocity[0] - previousAnchorLinearVelocity_[0]) / dt;
float ay = (currentLinearVelocity[1] - previousAnchorLinearVelocity_[1]) / dt;
float az = (currentLinearVelocity[2] - previousAnchorLinearVelocity_[2]) / dt;
float acceleration = sqrt(ax*ax + ay*ay + az*az);
if(acceleration>=upstreamRelocalizationAccThr_)
{
// Only correct the translation to not lose rotation aligned
// with gravity.
// Use constant motion model to update current pose.
rtabmap::Transform offset(previousAnchorLinearVelocity_[0] * dt,
previousAnchorLinearVelocity_[1] * dt,
previousAnchorLinearVelocity_[2] * dt,
0, 0, 0, 1);
rtabmap::Transform newRawPose = offset * previousAnchorPose_;
currentLinearVelocity = previousAnchorLinearVelocity_;
originOffset_.x() += newRawPose.x() - rawPose.x();
originOffset_.y() += newRawPose.y() - rawPose.y();
originOffset_.z() += newRawPose.z() - rawPose.z();
UERROR("Upstream re-localization has been suppressed because of "
"high acceleration detected (%f m/s^2) causing a jump!",
acceleration);
dataGoodTracking_ = false;
post(new CameraInfoEvent(0, "UpstreamRelocationFiltered", uFormat("%.1f m/s^2", acceleration).c_str()));
showLog = true;
}
}
previousAnchorLinearVelocity_ = currentLinearVelocity;
}
p = originOffset_*pose;
previousAnchorPose_ = p;
previousAnchorStamp_ = epochStamp;
if(upstreamRelocalizationAccThr_>0.0f) {
relocalizationDebugBuffer_.insert(std::make_pair(epochStamp, std::make_pair(pose, p)));
if(relocalizationDebugBuffer_.size() > 60)
{
relocalizationDebugBuffer_.erase(relocalizationDebugBuffer_.begin());
}
if(showLog) {
std::stringstream stream;
for(auto iter=relocalizationDebugBuffer_.begin(); iter!=relocalizationDebugBuffer_.end(); ++iter)
{
stream << iter->first - relocalizationDebugBuffer_.begin()->first
<< " " << iter->second.first.x()
<< " " << iter->second.first.y()
<< " " << iter->second.first.z()
<< " " << iter->second.second.x()
<< " " << iter->second.second.y()
<< " " << iter->second.second.z() << std::endl;
}
UERROR("timestamp original_xyz corrected_xyz:\n%s", stream.str().c_str());
}
}
}
{
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,22 +297,25 @@ void CameraMobile::setGPS(const GPS & 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_);
LOGD("CameraMobile::update pose=%s stamp=%f", pose.prettyPrint().c_str(), data.stamp());
bool notify = !data_.isValid();
data_ = data;
pose_ = pose;
dataPose_ = pose;
viewMatrix_ = viewMatrix;
projectionMatrix_ = projectionMatrix;
// adjust origin
if(!originOffset_.isNull())
{
pose_ = originOffset_ * pose_;
viewMatrix_ = glm::inverse(rtabmap::glmFromTransform(rtabmap::opengl_world_T_rtabmap_world * originOffset_ *rtabmap::rtabmap_world_T_opengl_world)*glm::inverse(viewMatrix_));
}
if(textureId_ == 0)
{
glGenTextures(1, &textureId_);
@@ -166,7 +327,7 @@ void CameraMobile::setData(const SensorData & data, const Transform & pose, cons
uvs_initialized_ = true;
}
LOGD("CameraMobile::setData textureId_=%d", (int)textureId_);
LOGD("CameraMobile::update textureId_=%d", (int)textureId_);
if(textureId_ != 0 && texCoord != 0)
{
@@ -193,78 +354,73 @@ void CameraMobile::setData(const SensorData & data, const Transform & pose, cons
return;
}
}
if(data_.isValid())
{
postUpdate();
if(notify)
{
dataReady_.release();
}
}
}
void CameraMobile::addEnvSensor(int type, float value)
void CameraMobile::updateOnRender()
{
lastEnvSensors_.insert(std::make_pair((EnvSensor::Type)type, EnvSensor((EnvSensor::Type)type, value)));
}
UScopeMutex lock(dataMutex_);
bool notify = !data_.isValid();
void CameraMobile::spinOnce()
{
if(!this->isRunning())
data_ = updateDataOnRender(dataPose_);
if(data_.isValid())
{
bool ignoreFrame = false;
//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;
}
}*/
postUpdate();
if(!ignoreFrame)
if(notify)
{
spinOnceFrameRateTimer_.start();
spinOncePreviousStamp_ = now;
mainLoop();
}
else
{
// just send pose
capturePoseOnly();
dataReady_.release();
}
}
}
void CameraMobile::mainLoopBegin()
SensorData CameraMobile::updateDataOnRender(Transform & pose)
{
double t = cameraStartedTime_.elapsed();
if(t < 5.0)
{
uSleep((5.0-t)*1000); // just to make sure that the camera is started
}
LOGE("To use CameraMobile::updateOnRender(), CameraMobile::updateDataOnRender() "
"should be overridden by inherited classes. Returning empty data!\n");
return SensorData();
}
void CameraMobile::mainLoop()
void CameraMobile::postUpdate()
{
CameraInfo info;
SensorData data = this->captureImage(&info);
if(data.isValid() && !info.odomPose.isNull())
if(data_.isValid())
{
if(lastKnownGPS_.stamp() > 0.0 && data.stamp()-lastKnownGPS_.stamp()<1.0)
// adjust origin
if(!originOffset_.isNull())
{
data.setGPS(lastKnownGPS_);
dataPose_ = originOffset_ * dataPose_;
viewMatrix_ = glm::inverse(rtabmap::glmFromTransform(rtabmap::opengl_world_T_rtabmap_world * originOffset_ *rtabmap::rtabmap_world_T_opengl_world)*glm::inverse(viewMatrix_));
occlusionModel_.setLocalTransform(originOffset_ * occlusionModel_.localTransform());
}
if(lastKnownGPS_.stamp() > 0.0 && data_.stamp()-lastKnownGPS_.stamp()<1.0)
{
data_.setGPS(lastKnownGPS_);
}
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())
{
data.setEnvSensors(lastEnvSensors_);
data_.setEnvSensors(lastEnvSensors_);
lastEnvSensors_.clear();
}
if(smoothing_ && !data.depthRaw().empty())
if(smoothing_ && !data_.depthRaw().empty())
{
//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());
}
@@ -273,15 +429,15 @@ void CameraMobile::mainLoop()
{
UDEBUG("ROTATION_90");
cv::Mat rgb, depth;
cv::Mat rgbt(data.imageRaw().cols, data.imageRaw().rows, data.imageRaw().type());
cv::flip(data.imageRaw(),rgb,1);
cv::Mat rgbt(data_.imageRaw().cols, data_.imageRaw().rows, data_.imageRaw().type());
cv::flip(data_.imageRaw(),rgb,1);
cv::transpose(rgb,rgbt);
rgb = rgbt;
cv::Mat deptht(data.depthRaw().cols, data.depthRaw().rows, data.depthRaw().type());
cv::flip(data.depthRaw(),depth,1);
cv::Mat deptht(data_.depthRaw().cols, data_.depthRaw().rows, data_.depthRaw().type());
cv::flip(data_.depthRaw(),depth,1);
cv::transpose(depth,deptht);
depth = deptht;
CameraModel model = data.cameraModels()[0];
CameraModel model = data_.cameraModels()[0];
cv::Size sizet(model.imageHeight(), model.imageWidth());
model = CameraModel(
model.fy(),
@@ -290,25 +446,25 @@ void CameraMobile::mainLoop()
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.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)
{
keypoints[i].pt.x = data.keypoints()[i].pt.y;
keypoints[i].pt.y = rgb.rows - data.keypoints()[i].pt.x;
keypoints[i].pt.x = data_.keypoints()[i].pt.y;
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)
{
UDEBUG("ROTATION_180");
cv::Mat rgb, depth;
cv::flip(data.imageRaw(),rgb,1);
cv::flip(data_.imageRaw(),rgb,1);
cv::flip(rgb,rgb,0);
cv::flip(data.depthOrRightRaw(),depth,1);
cv::flip(data_.depthOrRightRaw(),depth,1);
cv::flip(depth,depth,0);
CameraModel model = data.cameraModels()[0];
CameraModel model = data_.cameraModels()[0];
cv::Size sizet(model.imageWidth(), model.imageHeight());
model = CameraModel(
model.fx(),
@@ -317,26 +473,26 @@ void CameraMobile::mainLoop()
model.cy()>0?model.imageHeight()-model.cy():0,
model.localTransform()*rtabmap::Transform(0,0,0,0,0,1,0));
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)
{
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.x = rgb.cols - data_.keypoints()[i].pt.x;
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)
{
UDEBUG("ROTATION_270");
cv::Mat rgb(data.imageRaw().cols, data.imageRaw().rows, data.imageRaw().type());
cv::transpose(data.imageRaw(),rgb);
cv::Mat rgb(data_.imageRaw().cols, data_.imageRaw().rows, data_.imageRaw().type());
cv::transpose(data_.imageRaw(),rgb);
cv::flip(rgb,rgb,1);
cv::Mat depth(data.depthOrRightRaw().cols, data.depthOrRightRaw().rows, data.depthOrRightRaw().type());
cv::transpose(data.depthOrRightRaw(),depth);
cv::Mat depth(data_.depthOrRightRaw().cols, data_.depthOrRightRaw().rows, data_.depthOrRightRaw().type());
cv::transpose(data_.depthOrRightRaw(),depth);
cv::flip(depth,depth,1);
CameraModel model = data.cameraModels()[0];
CameraModel model = data_.cameraModels()[0];
cv::Size sizet(model.imageHeight(), model.imageWidth());
model = CameraModel(
model.fy(),
@@ -345,66 +501,75 @@ void CameraMobile::mainLoop()
model.cx(),
model.localTransform()*rtabmap::Transform(0,1,0,0, -1,0,0,0, 0,0,1,0));
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)
{
keypoints[i].pt.x = rgb.cols - data.keypoints()[i].pt.y;
keypoints[i].pt.y = data.keypoints()[i].pt.x;
keypoints[i].pt.x = rgb.cols - data_.keypoints()[i].pt.y;
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;
bool firstFrame = true;
bool dataGoodTracking = true;
rtabmap::Transform dataPose;
if(dataReady_.acquire(1, 15000))
{
info->odomPose = pose_;
UScopeMutex lock(dataMutex_);
data = data_;
dataPose = dataPose_;
firstFrame = firstFrame_;
dataGoodTracking = dataGoodTracking_;
firstFrame_ = false;
dataGoodTracking_ = true;
data_ = SensorData();
dataPose_.setNull();
}
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.00001);
if(!firstFrame)
{
// angular cov = 0.000001
// roll/pitch should be fairly accurate with VIO input
info->odomCovariance.at<double>(3,3) *= 0.01; // roll
info->odomCovariance.at<double>(4,4) *= 0.01; // pitch
if(!dataGoodTracking)
{
UERROR("not good tracking!");
// add slightly more error on translation
// 0.001
info->odomCovariance.at<double>(0,0) *= 10; // x
info->odomCovariance.at<double>(1,1) *= 10; // y
info->odomCovariance.at<double>(2,2) *= 10; // z
info->odomCovariance.at<double>(5,5) *= 10; // yaw
}
}
info->odomPose = dataPose;
}
}
else
{
UWARN("CameraMobile::captureImage() invalid data!");
}
return data;
}
LaserScan CameraMobile::scanFromPointCloudData(
const cv::Mat & pointCloudData,
int points,
const Transform & pose,
const CameraModel & model,
const cv::Mat & rgb,
@@ -421,7 +586,7 @@ LaserScan CameraMobile::scanFromPointCloudData(
UASSERT(pointCloudData.depth() == CV_32F && ic >= 3);
int oi = 0;
for(unsigned int i=0;i<points; ++i)
for(unsigned int i=0;i<pointCloudData.cols; ++i)
{
cv::Point3f pt(inPtr[i*ic], inPtr[i*ic + 1], inPtr[i*ic + 2]);
pt = util3d::transformPoint(pt, pose.inverse()*rtabmap_world_T_opengl_world);

View File

@@ -68,7 +68,7 @@ private:
Transform pose_;
};
class CameraMobile : public Camera, public UThread, public UEventsSender {
class CameraMobile : public Camera, public UEventsSender {
public:
static const float bilateralFilteringSigmaS;
static const float bilateralFilteringSigmaR;
@@ -79,7 +79,6 @@ public:
public:
static LaserScan scanFromPointCloudData(
const cv::Mat & pointCloudData,
int points,
const Transform & pose,
const CameraModel & model,
const cv::Mat & rgb,
@@ -88,19 +87,26 @@ public:
int kptsSize = 3);
public:
CameraMobile(bool smoothing = false);
CameraMobile(bool smoothing = false, float upstreamRelocalizationAccThr = 0.0f);
virtual ~CameraMobile();
// abstract functions
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";}
const Transform & getOriginOffset() const {return originOffset_;} // in rtabmap frame
// original pose of device in rtabmap frame (without origin offset), stamp of the device (may be not epoch), viewMatrix in opengl frame (without origin offset)
void update(const SensorData & data, const Transform & pose, const glm::mat4 & viewMatrix, const glm::mat4 & projectionMatrix, const float * texCoord);
void updateOnRender();
void resetOrigin();
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
// original pose of device in rtabmap frame (without origin offset), stamp of the device (may be not epoch)
void poseReceived(const Transform & pose, double deviceStamp);
double getStampEpochOffset() const {return stampEpochOffset_;}
const CameraModel & getCameraModel() const {return model_;}
const Transform & getDeviceTColorCamera() const {return deviceTColorCamera_;}
@@ -108,9 +114,6 @@ public:
virtual void setScreenRotationAndSize(ScreenRotation colorCameraToDisplayRotation, int width, int height) {colorCameraToDisplayRotation_ = colorCameraToDisplayRotation;}
void setGPS(const GPS & gps);
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_;}
bool uvsInitialized() const {return uvs_initialized_;}
@@ -122,17 +125,15 @@ public:
const cv::Mat & getOcclusionImage(CameraModel * model=0) const {if(model)*model=occlusionModel_; return occlusionImage_; }
protected:
virtual SensorData captureImage(CameraInfo * info = 0);
virtual void capturePoseOnly() {}
virtual SensorData updateDataOnRender(Transform & pose);
virtual void mainLoopBegin();
virtual void mainLoop();
private:
virtual SensorData captureImage(SensorCaptureInfo * info = 0);
void postUpdate(); // Should be called while being protected by dataMutex_
protected:
CameraModel model_; // local transform is the device to camera optical rotation in rtabmap frame
Transform deviceTColorCamera_; // device to camera optical rotation in rtabmap frame
UTimer spinOnceFrameRateTimer_;
double spinOncePreviousStamp_;
GLuint textureId_;
glm::mat4 viewMatrix_;
@@ -141,9 +142,7 @@ protected:
bool uvs_initialized_ = false;
private:
Transform previousPose_;
double previousStamp_;
UTimer cameraStartedTime_;
bool firstFrame_;
double stampEpochOffset_;
bool smoothing_;
ScreenRotation colorCameraToDisplayRotation_;
@@ -151,9 +150,20 @@ private:
EnvSensors lastEnvSensors_;
Transform originOffset_;
bool originUpdate_;
float upstreamRelocalizationAccThr_;
rtabmap::Transform previousAnchorPose_;
std::vector<float> previousAnchorLinearVelocity_;
double previousAnchorStamp_;
std::map<double, std::pair<rtabmap::Transform, rtabmap::Transform> > relocalizationDebugBuffer_;
USemaphore dataReady_;
UMutex dataMutex_;
SensorData data_;
Transform pose_;
Transform dataPose_;
bool dataGoodTracking_;
UMutex poseMutex_;
std::map<double, Transform> poseBuffer_; // <stamp, Pose>
cv::Mat occlusionImage_;
CameraModel occlusionModel_;

View File

@@ -101,7 +101,7 @@ void onPoseAvailableRouter(void* context, const TangoPoseData* pose)
if(pose->status_code == TANGO_POSE_VALID)
{
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);
}
}
@@ -194,6 +194,8 @@ bool CameraTango::init(const std::string & calibrationFolder, const std::string
{
close();
CameraMobile::init(calibrationFolder, cameraName);
TangoSupport_initialize(TangoService_getPoseAtTime, TangoService_getCameraIntrinsics);
// Connect to Tango
@@ -444,7 +446,7 @@ void CameraTango::cloudReceived(const cv::Mat & cloud, double timestamp)
//LOGD("Depth received! %fs (%d points)", timestamp, cloud.cols);
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
// "In the current version of Project Tango Tablet RGB IR camera
@@ -463,7 +465,7 @@ void CameraTango::cloudReceived(const cv::Mat & cloud, double timestamp)
if(dt >= 0.0 && dt < 0.5)
{
bool notify = !data_.isValid();
bool notify = !tangoData_.isValid();
cv::Mat tangoImage = tangoColor_;
cv::Mat rgb;
@@ -495,7 +497,7 @@ void CameraTango::cloudReceived(const cv::Mat & cloud, double timestamp)
else
{
LOGE("Not supported color format : %d.", tangoColorType);
data_ = SensorData();
tangoData_ = SensorData();
return;
}
@@ -657,12 +659,6 @@ void CameraTango::cloudReceived(const cv::Mat & cloud, double timestamp)
//LOGD("tango = %s", poseDevice.prettyPrint().c_str());
//LOGD("opengl(t)= %s", (opengl_world_T_tango_world * poseDevice).prettyPrint().c_str());
// adjust origin
if(!getOriginOffset().isNull())
{
odom = getOriginOffset() * odom;
}
// occlusion depth
if(!depth.empty())
{
@@ -678,24 +674,24 @@ void CameraTango::cloudReceived(const cv::Mat & cloud, double timestamp)
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
{
data_ = SensorData(rgb, depth, model, this->getNextSeqID(), rgbStamp);
tangoData_ = SensorData(rgb, depth, model, this->getNextSeqID(), rgbStamp);
}
data_.setGroundTruth(odom);
tangoData_.setGroundTruth(odom);
}
else
{
LOGE("Could not get depth and rgb images!?!");
data_ = SensorData();
tangoData_ = SensorData();
return;
}
if(notify)
{
dataReady_.release();
tangoDataReady_.release();
}
LOGD("process cloud received %fs", timer.ticks());
}
@@ -709,7 +705,7 @@ void CameraTango::rgbReceived(const cv::Mat & tangoImage, int type, double times
{
//LOGD("RGB received! %fs", timestamp);
boost::mutex::scoped_lock lock(dataMutex_);
boost::mutex::scoped_lock lock(tangoDataMutex_);
tangoColor_ = tangoImage.clone();
tangoColorStamp_ = timestamp;
@@ -775,10 +771,11 @@ rtabmap::Transform CameraTango::getPoseAtTimestamp(double timestamp)
return pose;
}
SensorData CameraTango::captureImage(CameraInfo * info)
SensorData CameraTango::updateDataOnRender(Transform & pose)
{
//LOGI("Capturing image...");
pose.setNull();
if(textureId_ == 0)
{
glGenTextures(1, &textureId_);
@@ -797,10 +794,7 @@ SensorData CameraTango::captureImage(CameraInfo * info)
if (status == TANGO_SUCCESS)
{
if(info)
{
info->odomPose = getPoseAtTimestamp(video_overlay_timestamp);
}
pose = getPoseAtTimestamp(video_overlay_timestamp);
int rotation = static_cast<int>(getScreenRotation()) + 1; // remove 90deg camera rotation
if (rotation > 3) {
@@ -834,10 +828,6 @@ SensorData CameraTango::captureImage(CameraInfo * info)
float cy = static_cast<float>(color_camera_intrinsics.cy);
viewMatrix_ = glm::make_mat4(matrix_transform.matrix);
if(!getOriginOffset().isNull())
{
viewMatrix_ = glm::inverse(rtabmap::glmFromTransform(rtabmap::opengl_world_T_rtabmap_world * getOriginOffset() *rtabmap::rtabmap_world_T_opengl_world)*glm::inverse(viewMatrix_));
}
projectionMatrix_ = tango_gl::Camera::ProjectionMatrixForCameraIntrinsics(
image_width, image_height, fx, fy, cx, cy, 0.3, 50);
@@ -876,16 +866,13 @@ SensorData CameraTango::captureImage(CameraInfo * info)
}
SensorData data;
if(dataReady_.acquireTry(1))
if(tangoDataReady_.acquireTry(1))
{
boost::mutex::scoped_lock lock(dataMutex_);
data = data_;
data_ = SensorData();
if(info)
{
info->odomPose = data.groundTruth();
data.setGroundTruth(Transform());
}
boost::mutex::scoped_lock lock(tangoDataMutex_);
data = tangoData_;
tangoData_ = SensorData();
pose = data.groundTruth();
data.setGroundTruth(Transform());
}
return data;

View File

@@ -52,7 +52,6 @@ public:
virtual void close(); // close Tango connection
virtual std::string getSerial() const;
rtabmap::Transform tangoPoseToTransform(const TangoPoseData * tangoPose) const;
void setColorCamera(bool enabled) {if(!this->isRunning()) colorCamera_ = enabled;}
void setDecimation(int value) {decimation_ = value;}
void setRawScanPublished(bool enabled) {rawScanPublished_ = enabled;}
@@ -61,7 +60,7 @@ public:
void tangoEventReceived(int type, const char * key, const char * value);
protected:
virtual SensorData captureImage(CameraInfo * info = 0);
virtual SensorData updateDataOnRender(Transform & pose);
private:
rtabmap::Transform getPoseAtTimestamp(double timestamp);
@@ -71,12 +70,12 @@ private:
bool colorCamera_;
int decimation_;
bool rawScanPublished_;
SensorData data_;
SensorData tangoData_;
cv::Mat tangoColor_;
int tangoColorType_;
double tangoColorStamp_;
boost::mutex dataMutex_;
USemaphore dataReady_;
boost::mutex tangoDataMutex_;
USemaphore tangoDataReady_;
cv::Mat fisheyeRectifyMapX_;
cv::Mat fisheyeRectifyMapY_;
};

View File

@@ -65,6 +65,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <rtabmap/core/GainCompensator.h>
#include <rtabmap/core/DBDriver.h>
#include <rtabmap/core/Recovery.h>
#include <rtabmap/core/lidar/LidarVLP16.h>
#include <pcl/common/common.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/io/ply_io.h>
@@ -72,9 +73,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <pcl/surface/poisson.h>
#include <pcl/surface/vtk_smoothing/vtk_mesh_quadric_decimation.h>
#ifdef RTABMAP_PDAL
#include <rtabmap/core/PDALWriter.h>
#elif defined(RTABMAP_LIBLAS)
#include <rtabmap/core/LASWriter.h>
#endif
#define LOW_RES_PIX 2
//#define DEBUG_RENDERING_PERFORMANCE
#define DEBUG_RENDERING_PERFORMANCE
const int g_optMeshId = -100;
@@ -133,7 +139,8 @@ rtabmap::ParametersMap RTABMapApp::getRtabmapParameters()
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRtabmapTimeThr(), std::string("800")));
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::kRtabmapStartNewMapOnLoopClosure(), uBool2Str(!localizationMode_ && appendMode_)));
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRtabmapStartNewMapOnLoopClosure(), uBool2Str(!localizationMode_ && appendMode_ && !dataRecorderMode_)));
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDAggressiveLoopThr(), "0.0"));
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kMemBinDataKept(), uBool2Str(!trajectoryMode_)));
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kOptimizerIterations(), "10"));
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kMemIncrementalMemory(), uBool2Str(!localizationMode_)));
@@ -186,10 +193,18 @@ rtabmap::ParametersMap RTABMapApp::getRtabmapParameters()
parameters.insert(*rtabmap::Parameters::getDefaultParameters().find(rtabmap::Parameters::kMemMapLabelsAdded()));
if(dataRecorderMode_)
{
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kKpMaxFeatures(), std::string("-1")));
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kMemRehearsalSimilarity(), std::string("1.0"))); // deactivate rehearsal
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kMemMapLabelsAdded(), "false")); // don't create map labels
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kMemNotLinkedNodesKept(), std::string("true")));
// Example taken from https://github.com/introlab/rtabmap_ros/blob/master/rtabmap_launch/launch/data_recorder.launch
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kMemRehearsalSimilarity(), "1.0")); // deactivate rehearsal
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kKpMaxFeatures(), "-1")); // deactivate keypoints extraction
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kRtabmapMaxRetrieved(), "0")); // deactivate global retrieval
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kRGBDMaxLocalRetrieved(), "0")); // deactivate local retrieval
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kMemMapLabelsAdded(), "false")); // don't create map labels
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kRtabmapMemoryThr(), "2")); // keep the WM empty
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kMemSTMSize(), "1")); // STM=1 -->
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kRGBDProximityBySpace(), "false"));
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kRGBDLinearUpdate(), "0"));
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kRGBDAngularUpdate(), "0"));
uInsert(parameters, rtabmap::ParametersPair(rtabmap::Parameters::kMemNotLinkedNodesKept(), std::string("true")));
}
return parameters;
@@ -202,6 +217,7 @@ RTABMapApp::RTABMapApp() :
#endif
cameraDriver_(0),
camera_(0),
sensorCaptureThread_(0),
rtabmapThread_(0),
rtabmap_(0),
logHandler_(0),
@@ -216,6 +232,7 @@ RTABMapApp::RTABMapApp() :
cameraColor_(true),
fullResolution_(false),
appendMode_(true),
useExternalLidar_(false),
maxCloudDepth_(2.5),
minCloudDepth_(0.0),
cloudDensityLevel_(1),
@@ -227,6 +244,8 @@ RTABMapApp::RTABMapApp() :
renderingTextureDecimation_(4),
backgroundColor_(0.2f),
depthConfidence_(2),
upstreamRelocalizationMaxAcc_(0.0f),
exportPointCloudFormat_("ply"),
dataRecorderMode_(false),
clearSceneOnNextRender_(false),
openingDatabase_(false),
@@ -303,12 +322,14 @@ void RTABMapApp::setupSwiftCallbacks(void * classPtr,
int,
float, float, float, float,
int, int,
float, float, float, float, float, float))
float, float, float, float, float, float),
void(*cameraInfoEventCallback)(void *, int, const char*, const char*))
{
swiftClassPtr_ = classPtr;
progressionStatus_.setSwiftCallback(classPtr, progressCallback);
swiftInitCallback = initCallback;
swiftStatsUpdatedCallback = statsUpdatedCallback;
swiftCameraInfoEventCallback = cameraInfoEventCallback;
}
#endif
@@ -382,6 +403,7 @@ int RTABMapApp::openDatabase(const std::string & databasePath, bool databaseInMe
lastPostRenderEventTime_ = 0.0;
lastPoseEventTime_ = 0.0;
bufferedStatsData_.clear();
graphOptimization_ = true;
this->registerToEventsManager();
@@ -471,7 +493,7 @@ int RTABMapApp::openDatabase(const std::string & databasePath, bool databaseInMe
rtabmap_ = new rtabmap::Rtabmap();
rtabmap::ParametersMap parameters = getRtabmapParameters();
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kDbSqlite3InMemory(), uBool2Str(databaseInMemory)));
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kDbSqlite3InMemory(), uBool2Str(databaseInMemory && !dataRecorderMode_)));
LOGI("Initializing database...");
rtabmap_->init(parameters, databasePath);
rtabmapThread_ = new rtabmap::RtabmapThread(rtabmap_);
@@ -537,7 +559,7 @@ int RTABMapApp::openDatabase(const std::string & databasePath, bool databaseInMe
// Voxelize and filter depending on the previous cloud?
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
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);
@@ -649,9 +671,9 @@ int RTABMapApp::openDatabase(const std::string & databasePath, bool databaseInMe
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;
}
}
@@ -741,8 +763,19 @@ int RTABMapApp::openDatabase(const std::string & databasePath, bool databaseInMe
{
boost::mutex::scoped_lock lock(cameraMutex_);
if(camera_)
{
camera_->resetOrigin();
{
camera_->resetOrigin();
if(dataRecorderMode_)
{
// Don't update faster than we record, so that we see is what is recorded
camera_->setFrameRate(rtabmapThread_->getDetectorRate());
rtabmapThread_->setDetectorRate(0);
}
else
{
// set default 10
camera_->setFrameRate(10);
}
}
}
@@ -904,7 +937,7 @@ bool RTABMapApp::startCamera()
else if(cameraDriver_ == 1)
{
#ifdef RTABMAP_ARCORE
camera_ = new rtabmap::CameraARCore(env, context, activity, depthFromMotion_, smoothing_);
camera_ = new rtabmap::CameraARCore(env, context, activity, depthFromMotion_, smoothing_, upstreamRelocalizationMaxAcc_);
#else
UERROR("RTAB-Map is not built with ARCore support!");
#endif
@@ -912,14 +945,14 @@ bool RTABMapApp::startCamera()
else if(cameraDriver_ == 2)
{
#ifdef RTABMAP_ARENGINE
camera_ = new rtabmap::CameraAREngine(env, context, activity, smoothing_);
camera_ = new rtabmap::CameraAREngine(env, context, activity, smoothing_, upstreamRelocalizationMaxAcc_);
#else
UERROR("RTAB-Map is not built with AREngine support!");
#endif
}
else if(cameraDriver_ == 3)
{
camera_ = new rtabmap::CameraMobile(smoothing_);
camera_ = new rtabmap::CameraMobile(smoothing_, upstreamRelocalizationMaxAcc_);
}
if(camera_ == 0)
@@ -928,6 +961,13 @@ bool RTABMapApp::startCamera()
return false;
}
if(rtabmapThread_ && dataRecorderMode_)
{
// Don't update faster than we record, so that we see is what is recorded
camera_->setFrameRate(rtabmapThread_->getDetectorRate());
rtabmapThread_->setDetectorRate(0);
}
if(camera_->init())
{
camera_->setScreenRotationAndSize(main_scene_.getScreenRotation(), main_scene_.getViewPortWidth(), main_scene_.getViewPortHeight());
@@ -937,6 +977,19 @@ bool RTABMapApp::startCamera()
LOGI("Start camera thread");
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;
}
UERROR("Failed camera initialization!");
@@ -948,13 +1001,13 @@ void RTABMapApp::stopCamera()
LOGI("stopCamera()");
{
boost::mutex::scoped_lock lock(cameraMutex_);
if(camera_!=0)
if(sensorCaptureThread_!=0)
{
camera_->join(true);
camera_->close();
delete camera_;
camera_->close();
sensorCaptureThread_->join(true);
delete sensorCaptureThread_; // camera_ is closed and deleted inside
sensorCaptureThread_ = 0;
camera_ = 0;
poseBuffer_.clear();
}
}
{
@@ -1241,7 +1294,7 @@ int RTABMapApp::Render()
std::list<rtabmap::RtabmapEvent*> rtabmapEvents;
try
{
if(camera_ == 0)
if(sensorCaptureThread_ == 0)
{
// We are not doing continous drawing, just measure single draw
fpsTime_.restart();
@@ -1272,53 +1325,49 @@ int RTABMapApp::Render()
{
if(cameraDriver_ <= 2)
{
camera_->spinOnce();
camera_->updateOnRender();
}
#ifdef DEBUG_RENDERING_PERFORMANCE
LOGW("Camera spinOnce %fs", time.ticks());
LOGD("Camera updateOnRender %fs", time.ticks());
#endif
if(cameraDriver_ != 2)
if(main_scene_.background_renderer_ == 0 && camera_->getTextureId() != 0)
{
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();
main_scene_.background_renderer_->InitializeGlContent(((rtabmap::CameraMobile*)camera_)->getTextureId(), cameraDriver_ == 0 || cameraDriver_ == 1);
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(camera_->uvsInitialized())
{
uvsTransformed = ((rtabmap::CameraMobile*)camera_)->uvsTransformed();
((rtabmap::CameraMobile*)camera_)->getVPMatrices(arViewMatrix, arProjectionMatrix);
if(graphOptimization_ && !mapToOdom_.isIdentity())
{
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(!visualizingMesh_ && !dataRecorderMode_ && main_scene_.GetCameraType() == tango_gl::GestureCamera::kFirstPerson)
{
rtabmap::CameraModel occlusionModel;
cv::Mat occlusionImage = ((rtabmap::CameraMobile*)camera_)->getOcclusionImage(&occlusionModel);
if(occlusionModel.isValidForProjection())
{
pcl::IndicesPtr indices(new std::vector<int>);
int meshDecimation = updateMeshDecimation(occlusionImage.cols, occlusionImage.rows);
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());
occlusionMesh.cloud.reset(new pcl::PointCloud<pcl::PointXYZRGB>());
pcl::copyPointCloud(*cloud, *occlusionMesh.cloud);
occlusionMesh.indices = indices;
occlusionMesh.polygons = rtabmap::util3d::organizedFastMesh(cloud, 1.0*M_PI/180.0, false, meshTrianglePix_);
}
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());
}
if(occlusionModel.isValidForProjection())
{
pcl::IndicesPtr indices(new std::vector<int>);
int meshDecimation = updateMeshDecimation(occlusionImage.cols, occlusionImage.rows);
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());
occlusionMesh.cloud.reset(new pcl::PointCloud<pcl::PointXYZRGB>());
pcl::copyPointCloud(*cloud, *occlusionMesh.cloud);
occlusionMesh.indices = indices;
occlusionMesh.polygons = rtabmap::util3d::organizedFastMesh(cloud, 1.0*M_PI/180.0, false, meshTrianglePix_);
}
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());
}
}
#ifdef DEBUG_RENDERING_PERFORMANCE
LOGW("Update background and occlusion mesh %fs", time.ticks());
LOGD("Update background and occlusion mesh %fs", time.ticks());
#endif
}
}
@@ -1334,14 +1383,14 @@ int RTABMapApp::Render()
}
}
rtabmap::OdometryEvent odomEvent;
rtabmap::SensorEvent sensorEvent;
{
boost::mutex::scoped_lock lock(odomMutex_);
if(odomEvents_.size())
boost::mutex::scoped_lock lock(sensorMutex_);
if(sensorEvents_.size())
{
LOGI("Process odom events");
odomEvent = odomEvents_.back();
odomEvents_.clear();
LOGI("Process sensor events");
sensorEvent = sensorEvents_.back();
sensorEvents_.clear();
if(cameraJustInitialized_)
{
notifyCameraStarted = true;
@@ -1361,7 +1410,7 @@ int RTABMapApp::Render()
{
main_scene_.SetCameraPose(rtabmap::opengl_world_T_rtabmap_world*pose*rtabmap::optical_T_opengl);
}
if(camera_!=0 && cameraJustInitialized_)
if(sensorCaptureThread_!=0 && cameraJustInitialized_)
{
notifyCameraStarted = true;
cameraJustInitialized_ = false;
@@ -1562,9 +1611,9 @@ int RTABMapApp::Render()
if(clearSceneOnNextRender_)
{
LOGI("Clearing all rendering data...");
odomMutex_.lock();
odomEvents_.clear();
odomMutex_.unlock();
sensorMutex_.lock();
sensorEvents_.clear();
sensorMutex_.unlock();
poseMutex_.lock();
poseEvents_.clear();
@@ -1734,7 +1783,7 @@ int RTABMapApp::Render()
// Transform pose in OpenGL world
for(std::map<int, rtabmap::Transform>::iterator iter=posesWithMarkers.begin(); iter!=posesWithMarkers.end(); ++iter)
{
if(!graphOptimization_)
if(!graphOptimization_ && !dataRecorderMode_)
{
std::map<int, rtabmap::Transform>::iterator jter = rawPoses_.find(iter->first);
if(jter != rawPoses_.end())
@@ -1800,7 +1849,7 @@ int RTABMapApp::Render()
// Voxelize and filter depending on the previous cloud?
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
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);
cloud = rtabmap::util3d::cloudRGBFromSensorData(data, meshDecimation, maxCloudDepth_, minCloudDepth_, indices.get());
@@ -2002,28 +2051,29 @@ int RTABMapApp::Render()
}
}
}
else
if(dataRecorderMode_ || !rtabmapEvents.size())
{
main_scene_.setCloudVisible(-1, odomCloudShown_ && !trajectoryMode_ && camera_!=0);
main_scene_.setCloudVisible(-1, odomCloudShown_ && !trajectoryMode_ && sensorCaptureThread_!=0);
//just process the last one
if(!odomEvent.pose().isNull())
if(!sensorEvent.info().odomPose.isNull())
{
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::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);
cloud = rtabmap::util3d::cloudRGBFromSensorData(odomEvent.data(), meshDecimation, maxCloudDepth_, minCloudDepth_, indices.get());
int meshDecimation = updateMeshDecimation(sensorEvent.data().depthRaw().cols, sensorEvent.data().depthRaw().rows);
cloud = rtabmap::util3d::cloudRGBFromSensorData(sensorEvent.data(), meshDecimation, maxCloudDepth_, minCloudDepth_, indices.get());
}
else
{
//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());
for(unsigned int i=0; i<cloud->size(); ++i)
{
@@ -2034,10 +2084,10 @@ int RTABMapApp::Render()
if(cloud->size() && indices->size())
{
LOGI("Created odom cloud (rgb=%dx%d depth=%dx%d cloud=%dx%d)",
odomEvent.data().imageRaw().cols, odomEvent.data().imageRaw().rows,
odomEvent.data().depthRaw().cols, odomEvent.data().depthRaw().rows,
sensorEvent.data().imageRaw().cols, sensorEvent.data().imageRaw().rows,
sensorEvent.data().depthRaw().cols, sensorEvent.data().depthRaw().rows,
(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);
}
else
@@ -2127,7 +2177,7 @@ int RTABMapApp::Render()
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");
UEventsManager::post(new rtabmap::CameraInfoEvent(10, "TangoPoseEventNotReceived", uNumber2Str(UTimer::now()-lastPoseEventTime_, 6)));
@@ -2319,7 +2369,7 @@ void RTABMapApp::setTrajectoryMode(bool enabled)
void RTABMapApp::setGraphOptimization(bool 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::multimap<int, rtabmap::Link> links;
@@ -2405,6 +2455,11 @@ void RTABMapApp::setAppendMode(bool enabled)
}
}
void RTABMapApp::setUpstreamRelocalizationAccThr(float value)
{
upstreamRelocalizationMaxAcc_ = value;
}
void RTABMapApp::setDataRecorderMode(bool enabled)
{
if(dataRecorderMode_ != enabled)
@@ -2480,6 +2535,22 @@ void RTABMapApp::setDepthConfidence(int value)
}
}
void RTABMapApp::setExportPointCloudFormat(const std::string & format)
{
#if defined(RTABMAP_PDAL) || defined(RTABMAP_LIBLAS)
if(format == "las") {
exportPointCloudFormat_ = format;
}
else
#endif
if(format != "ply") {
UERROR("Not supported point cloud format %s", format.c_str());
}
else {
exportPointCloudFormat_ = format;
}
}
int RTABMapApp::setMappingParameter(const std::string & key, const std::string & value)
{
std::string compatibleKey = key;
@@ -2587,11 +2658,14 @@ void RTABMapApp::save(const std::string & databasePath)
std::multimap<int, rtabmap::Link> links = rtabmap_->getLocalConstraints();
rtabmap_->close(true, databasePath);
rtabmap_->init(getRtabmapParameters(), dataRecorderMode_?"":databasePath);
rtabmap_->setOptimizedPoses(poses, links);
if(dataRecorderMode_)
{
clearSceneOnNextRender_ = true;
}
else
{
rtabmap_->setOptimizedPoses(poses, links);
}
}
bool RTABMapApp::recover(const std::string & from, const std::string & to)
@@ -3531,18 +3605,43 @@ bool RTABMapApp::writeExportedMesh(const std::string & directory, const std::str
if(polygonMesh->cloud.data.size())
{
// Point cloud PLY
std::string filePath = directory + UDirectory::separator() + name + ".ply";
LOGI("Saving ply (%d vertices, %d polygons) to %s.", (int)polygonMesh->cloud.data.size()/polygonMesh->cloud.point_step, (int)polygonMesh->polygons.size(), filePath.c_str());
success = pcl::io::savePLYFileBinary(filePath, *polygonMesh) == 0;
if(success)
{
LOGI("Saved ply to %s!", filePath.c_str());
}
else
{
UERROR("Failed saving ply to %s!", filePath.c_str());
}
#if defined(RTABMAP_PDAL) || defined(RTABMAP_LIBLAS)
if(polygonMesh->polygons.empty() && exportPointCloudFormat_ == "las") {
// Point cloud LAS
std::string filePath = directory + UDirectory::separator() + name + ".las";
LOGI("Saving las (%d vertices) to %s.", (int)polygonMesh->cloud.data.size()/polygonMesh->cloud.point_step, filePath.c_str());
pcl::PointCloud<pcl::PointXYZRGB> output;
pcl::fromPCLPointCloud2(polygonMesh->cloud, output);
#ifdef RTABMAP_PDAL
success = rtabmap::savePDALFile(filePath, output) == 0;
#else
success = rtabmap::saveLASFile(filePath, output) == 0;
#endif
if(success)
{
LOGI("Saved las to %s!", filePath.c_str());
}
else
{
UERROR("Failed saving las to %s!", filePath.c_str());
}
}
else
#endif
{
// Point cloud PLY
std::string filePath = directory + UDirectory::separator() + name + ".ply";
LOGI("Saving ply (%d vertices, %d polygons) to %s.", (int)polygonMesh->cloud.data.size()/polygonMesh->cloud.point_step, (int)polygonMesh->polygons.size(), filePath.c_str());
success = pcl::io::savePLYFileBinary(filePath, *polygonMesh) == 0;
if(success)
{
LOGI("Saved ply to %s!", filePath.c_str());
}
else
{
UERROR("Failed saving ply to %s!", filePath.c_str());
}
}
}
else if(textureMesh->cloud.data.size())
{
@@ -3700,31 +3799,6 @@ int RTABMapApp::postProcessing(int approach)
return returnedValue;
}
void RTABMapApp::postCameraPoseEvent(
float x, float y, float z, float qx, float qy, float qz, float qw, double stamp)
{
boost::mutex::scoped_lock lock(cameraMutex_);
if(cameraDriver_ == 3 && camera_)
{
if(qx==0 && qy==0 && qz==0 && qw==0)
{
// Lost! clear buffer
poseBuffer_.clear();
camera_->resetOrigin(); // we are lost, create new session on next valid frame
return;
}
rtabmap::Transform pose(x,y,z,qx,qy,qz,qw);
pose = rtabmap::rtabmap_world_T_opengl_world * pose * rtabmap::opengl_world_T_rtabmap_world;
camera_->poseReceived(pose);
poseBuffer_.insert(std::make_pair(stamp, pose));
if(poseBuffer_.size() > 1000)
{
poseBuffer_.erase(poseBuffer_.begin());
}
}
}
void RTABMapApp::postOdometryEvent(
rtabmap::Transform pose,
float rgb_fx, float rgb_fy, float rgb_cx, float rgb_cy,
@@ -3737,7 +3811,7 @@ void RTABMapApp::postOdometryEvent(
const void * depth, int depthLen, int depthWidth, int depthHeight, int depthFormat,
const void * conf, int confLen, int confWidth, int confHeight, int confFormat,
const float * points, int pointsLen, int pointsChannels,
const rtabmap::Transform & viewMatrix,
rtabmap::Transform viewMatrix,
float p00, float p11, float p02, float p12, float p22, float p32, float p23,
float t0, float t1, float t2, float t3, float t4, float t5, float t6, float t7)
{
@@ -3745,6 +3819,12 @@ void RTABMapApp::postOdometryEvent(
boost::mutex::scoped_lock lock(cameraMutex_);
if(cameraDriver_ == 3 && camera_)
{
if(pose.isNull())
{
// We are lost, trigger a new map on next update
camera_->resetOrigin();
return;
}
if(rgb_fx > 0.0f && rgb_fy > 0.0f && rgb_cx > 0.0f && rgb_cy > 0.0f && stamp > 0.0f && yPlane && vPlane && yPlaneLen == rgbWidth*rgbHeight)
{
#ifndef DISABLE_LOG
@@ -3755,7 +3835,7 @@ void RTABMapApp::postOdometryEvent(
(depth==0 || depthFormat == AIMAGE_FORMAT_DEPTH16))
#else //__APPLE__
if(rgbFormat == 875704422 &&
(depth==0 || depthFormat == 1717855600))
(depth==0 || depthFormat == 1717855600))
#endif
{
cv::Mat outputRGB;
@@ -3831,68 +3911,46 @@ void RTABMapApp::postOdometryEvent(
if(!outputRGB.empty())
{
// Convert in our coordinate frame
pose = rtabmap::rtabmap_world_T_opengl_world * pose * rtabmap::opengl_world_T_rtabmap_world;
// We should update the pose before querying poses for depth below (if not same stamp than rgb)
camera_->poseReceived(pose, stamp);
// Registration depth to rgb
if(!outputDepth.empty() && !depthFrame.isNull() && depth_fx!=0 && (rgbFrame != depthFrame || depthStamp!=stamp))
{
UTimer time;
rtabmap::Transform motion = rtabmap::Transform::getIdentity();
if(depthStamp != stamp && !poseBuffer_.empty())
if(depthStamp != stamp)
{
// Interpolate pose
if(!poseBuffer_.empty())
rtabmap::Transform poseRgb;
rtabmap::Transform poseDepth;
cv::Mat cov;
if(!camera_->getPose(camera_->getStampEpochOffset()+stamp, poseRgb, cov, 0.0))
{
UERROR("Could not find pose at rgb stamp %f (epoch %f)!", stamp, camera_->getStampEpochOffset()+stamp);
}
else if(!camera_->getPose(camera_->getStampEpochOffset()+depthStamp, poseDepth, cov, 0.0))
{
UERROR("Could not find pose at depth stamp %f (epoch %f) last rgb is %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
UDEBUG("poseRGB =%s (stamp=%f)", pose.prettyPrint().c_str(), depthStamp);
UDEBUG("poseDepth=%s (stamp=%f)", poseDepth.prettyPrint().c_str(), depthStamp);
UDEBUG("poseRGB =%s (stamp=%f)", poseRgb.prettyPrint().c_str(), stamp);
UDEBUG("poseDepth=%s (stamp=%f)", poseDepth.prettyPrint().c_str(), depthStamp);
#endif
motion = pose.inverse()*poseDepth;
// transform in camera frame
motion = poseRgb.inverse()*poseDepth;
// transform in camera frame
#ifndef DISABLE_LOG
UDEBUG("motion=%s", motion.prettyPrint().c_str());
UDEBUG("motion=%s", motion.prettyPrint().c_str());
#endif
motion = rtabmap::CameraModel::opticalRotation().inverse() * motion * rtabmap::CameraModel::opticalRotation();
motion = rtabmap::CameraModel::opticalRotation().inverse() * motion * rtabmap::CameraModel::opticalRotation();
#ifndef DISABLE_LOG
UDEBUG("motion=%s", motion.prettyPrint().c_str());
UDEBUG("motion=%s", motion.prettyPrint().c_str());
#endif
}
}
}
}
rtabmap::Transform rgbToDepth = motion*rgbFrame.inverse()*depthFrame;
@@ -3930,24 +3988,19 @@ void RTABMapApp::postOdometryEvent(
if(outputDepth.empty())
{
int kptsSize = fullResolution_ ? 12 : 6;
scan = rtabmap::CameraMobile::scanFromPointCloudData(pointsMat, pointsLen, pose, model, outputRGB, &kpts, &kpts3, kptsSize);
scan = rtabmap::CameraMobile::scanFromPointCloudData(pointsMat, pose, model, outputRGB, &kpts, &kpts3, kptsSize);
}
else
{
// We will recompute features if depth is available
scan = rtabmap::CameraMobile::scanFromPointCloudData(pointsMat, pointsLen, pose, model, outputRGB);
scan = rtabmap::CameraMobile::scanFromPointCloudData(pointsMat, pose, model, outputRGB);
}
}
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()));
depthModel.setLocalTransform(poseWithOriginOffset*model.localTransform());
depthModel.setLocalTransform(pose*model.localTransform());
camera_->setOcclusionImage(outputDepth, depthModel);
}
@@ -3971,8 +4024,7 @@ void RTABMapApp::postOdometryEvent(
texCoords[5] = t5;
texCoords[6] = t6;
texCoords[7] = t7;
camera_->setData(data, pose, viewMatrixMat, projectionMatrix, main_scene_.GetCameraType() == tango_gl::GestureCamera::kFirstPerson?texCoords:0);
camera_->spinOnce();
camera_->update(data, pose, viewMatrixMat, projectionMatrix, main_scene_.GetCameraType() == tango_gl::GestureCamera::kFirstPerson?texCoords:0);
}
}
}
@@ -3989,17 +4041,17 @@ void RTABMapApp::postOdometryEvent(
bool RTABMapApp::handleEvent(UEvent * event)
{
if(camera_!=0)
if(sensorCaptureThread_!=0)
{
// called from events manager thread, so protect the data
if(event->getClassName().compare("OdometryEvent") == 0)
if(event->getClassName().compare("SensorEvent") == 0)
{
LOGI("Received OdometryEvent!");
if(odomMutex_.try_lock())
LOGI("Received SensorEvent!");
if(sensorMutex_.try_lock())
{
odomEvents_.clear();
odomEvents_.push_back(*((rtabmap::OdometryEvent*)(event)));
odomMutex_.unlock();
sensorEvents_.clear();
sensorEvents_.push_back(*((rtabmap::SensorEvent*)(event)));
sensorMutex_.unlock();
}
}
if(event->getClassName().compare("RtabmapEvent") == 0)
@@ -4057,6 +4109,15 @@ bool RTABMapApp::handleEvent(UEvent * event)
}
jvm->DetachCurrentThread();
}
#else
if(swiftClassPtr_)
{
std::function<void()> actualCallback = [&](){
swiftCameraInfoEventCallback(swiftClassPtr_, tangoEvent->type(), tangoEvent->key().c_str(), tangoEvent->value().c_str());
};
actualCallback();
success = true;
}
#endif
if(!success)
{

View File

@@ -40,7 +40,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "util.h"
#include "ProgressionStatus.h"
#include <rtabmap/core/SensorCaptureThread.h>
#include <rtabmap/core/RtabmapThread.h>
#include <rtabmap/core/SensorEvent.h>
#include <rtabmap/utilite/UEventsHandler.h>
#include <boost/thread/mutex.hpp>
#include <pcl/pcl_base.h>
@@ -68,7 +70,8 @@ class RTABMapApp : public UEventsHandler {
int,
float, float, float, float,
int, int,
float, float, float, float, float, float));
float, float, float, float, float, float),
void(*cameraInfoCallback)(void *, int, const char*, const char*));
#endif
~RTABMapApp();
@@ -136,6 +139,7 @@ class RTABMapApp : public UEventsHandler {
void setSmoothing(bool enabled);
void setDepthFromMotion(bool enabled);
void setAppendMode(bool enabled);
void setUpstreamRelocalizationAccThr(float value);
void setDataRecorderMode(bool enabled);
void setMaxCloudDepth(float value);
void setMinCloudDepth(float value);
@@ -148,6 +152,7 @@ class RTABMapApp : public UEventsHandler {
void setRenderingTextureDecimation(int value);
void setBackgroundColor(float gray);
void setDepthConfidence(int value);
void setExportPointCloudFormat(const std::string & format);
int setMappingParameter(const std::string & key, const std::string & value);
void setGPS(const rtabmap::GPS & gps);
void addEnvSensor(int type, float value);
@@ -176,9 +181,6 @@ class RTABMapApp : public UEventsHandler {
bool writeExportedMesh(const std::string & directory, const std::string & name);
int postProcessing(int approach);
void postCameraPoseEvent(
float x, float y, float z, float qx, float qy, float qz, float qw, double stamp);
void postOdometryEvent(
rtabmap::Transform pose,
float rgb_fx, float rgb_fy, float rgb_cx, float rgb_cy,
@@ -191,7 +193,7 @@ class RTABMapApp : public UEventsHandler {
const void * depth, int depthLen, int depthWidth, int depthHeight, int depthFormat,
const void * conf, int confLen, int confWidth, int confHeight, int confFormat,
const float * points, int pointsLen, int pointsChannels,
const rtabmap::Transform & viewMatrix, //view matrix
rtabmap::Transform viewMatrix, //view matrix
float p00, float p11, float p02, float p12, float p22, float p32, float p23, // projection matrix
float t0, float t1, float t2, float t3, float t4, float t5, float t6, float t7); // tex coord
@@ -209,6 +211,7 @@ class RTABMapApp : public UEventsHandler {
private:
int cameraDriver_;
rtabmap::CameraMobile * camera_;
rtabmap::SensorCaptureThread * sensorCaptureThread_;
rtabmap::RtabmapThread * rtabmapThread_;
rtabmap::Rtabmap * rtabmap_;
rtabmap::LogHandler * logHandler_;
@@ -224,6 +227,7 @@ class RTABMapApp : public UEventsHandler {
bool cameraColor_;
bool fullResolution_;
bool appendMode_;
bool useExternalLidar_;
float maxCloudDepth_;
float minCloudDepth_;
int cloudDensityLevel_;
@@ -235,6 +239,8 @@ class RTABMapApp : public UEventsHandler {
int renderingTextureDecimation_;
float backgroundColor_;
int depthConfidence_;
float upstreamRelocalizationMaxAcc_;
std::string exportPointCloudFormat_;
rtabmap::ParametersMap mappingParameters_;
@@ -270,16 +276,15 @@ class RTABMapApp : public UEventsHandler {
UTimer fpsTime_;
std::list<rtabmap::RtabmapEvent*> rtabmapEvents_;
std::list<rtabmap::OdometryEvent> odomEvents_;
std::list<rtabmap::SensorEvent> sensorEvents_;
std::list<rtabmap::Transform> poseEvents_;
std::map<double, rtabmap::Transform> poseBuffer_;
rtabmap::Transform mapToOdom_;
boost::mutex cameraMutex_;
boost::mutex rtabmapMutex_;
boost::mutex meshesMutex_;
boost::mutex odomMutex_;
boost::mutex sensorMutex_;
boost::mutex poseMutex_;
boost::mutex renderingMutex_;
@@ -306,6 +311,7 @@ class RTABMapApp : public UEventsHandler {
float, float, float, float,
int, int,
float, float, float, float, float, float);
void(*swiftCameraInfoEventCallback)(void *, int, const char *, const char *);
#endif
};

View File

@@ -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) {
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];
@@ -191,7 +191,7 @@ void BackgroundRenderer::Draw(const float * transformed_uvs, const GLuint & dept
GLuint attributeVertices = glGetAttribLocation(program, "a_Position");
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);
glEnableVertexAttribArray(attributeVertices);

View File

@@ -28,9 +28,15 @@
#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,
};
//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[] = {
1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
};

View File

@@ -550,6 +550,20 @@ Java_com_introlab_rtabmap_RTABMapLib_setAppendMode(
UERROR("native_application is null!");
}
}
JNIEXPORT void JNICALL
Java_com_introlab_rtabmap_RTABMapLib_setUpstreamRelocalizationAccThr(
JNIEnv*, jclass, jlong native_application, float value)
{
if(native_application)
{
return native(native_application)->setUpstreamRelocalizationAccThr(value);
}
else
{
UERROR("native_application is null!");
}
}
JNIEXPORT void JNICALL
Java_com_introlab_rtabmap_RTABMapLib_setDataRecorderMode(
JNIEnv*, jclass, jlong native_application, bool enabled)
@@ -866,22 +880,6 @@ Java_com_introlab_rtabmap_RTABMapLib_postProcessing(
}
}
JNIEXPORT void JNICALL
Java_com_introlab_rtabmap_RTABMapLib_postCameraPoseEvent(
JNIEnv* env, jclass, jlong native_application,
float x, float y, float z, float qx, float qy, float qz, float qw, double stamp)
{
if(native_application)
{
native(native_application)->postCameraPoseEvent(x,y,z,qx,qy,qz,qw, stamp);
}
else
{
UERROR("native_application is null!");
return;
}
}
JNIEXPORT void JNICALL
Java_com_introlab_rtabmap_RTABMapLib_postOdometryEvent(
JNIEnv* env, jclass, jlong native_application,

View File

@@ -1 +1,4 @@
*.jar
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@@ -103,12 +103,12 @@
android:summary="@string/pref_summary_depth_from_motion"
android:defaultValue="@string/pref_default_depth_from_motion"/>
<ListPreference
android:key="@string/pref_key_arcore_localization_filtering_speed"
android:title="@string/pref_title_arcore_localization_filtering_speed"
android:summary="@string/pref_summary_arcore_localization_filtering_speed"
android:entries="@array/pref_arcore_localization_filtering_speed_keys"
android:entryValues="@array/pref_arcore_localization_filtering_speed_values"
android:defaultValue="@string/pref_default_arcore_localization_filtering_speed"/>
android:key="@string/pref_key_arcore_relocalization_acc_thr"
android:title="@string/pref_title_arcore_relocalization_acc_thr"
android:summary="@string/pref_summary_arcore_relocalization_acc_thr"
android:entries="@array/pref_arcore_relocalization_acc_thr_keys"
android:entryValues="@array/pref_arcore_relocalization_acc_thr_values"
android:defaultValue="@string/pref_default_arcore_relocalization_acc_thr"/>
<com.introlab.rtabmap.CustomSwitchPreference
android:key="@string/pref_key_smoothing"
android:title="@string/pref_title_smoothing"

View File

@@ -83,8 +83,8 @@
<string name="pref_default_camera_driver">-1</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_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_key_arcore_relocalization_acc_thr">pref_key_arcore_relocalization_acc_thr</string>
<string name="pref_default_arcore_relocalization_acc_thr">58.8399</string>
<string name="pref_key_update_rate">pref_key_update_rate</string>
<string name="pref_default_update_rate">1</string>
<string name="pref_key_max_speed">pref_key_max_speed</string>
@@ -100,7 +100,7 @@
<string name="pref_key_min_inliers">pref_key_min_inliers</string>
<string name="pref_default_min_inliers">25</string>
<string name="pref_key_opt_error">pref_key_opt_error</string>
<string name="pref_default_opt_error">1</string>
<string name="pref_default_opt_error">2</string>
<string name="pref_key_features_voc">pref_key_features_voc</string>
<string name="pref_default_features_voc">200</string>
<string name="pref_key_features">pref_key_features</string>
@@ -329,8 +329,8 @@
<string name="pref_summary_camera_driver">AR sdk used for capturing 6DoF poses and images. A TOF camera is required to record a 3D model.</string>
<string name="pref_title_depth_from_motion">Depth From Motion</string>
<string name="pref_summary_depth_from_motion">Use ARCore\'s depth API to compute depth image from motion. If the phone has a TOF camera and is supported by ARCore, results should be better. Currently supported only with ARCore NDK driver.</string>
<string name="pref_title_arcore_localization_filtering_speed">ARCore Localization Filtering Speed</string>
<string name="pref_summary_arcore_localization_filtering_speed">Filter ARCore\'s localizations to avoid jumps in odometry when creating a map with RTAB-Map, which would cause large drift errors that are difficult to correct. Set a speed threshold to detect those events.</string>
<string name="pref_title_arcore_relocalization_acc_thr">ARCore Re-Localization Acceleration Threshold</string>
<string name="pref_summary_arcore_relocalization_acc_thr">Filter ARCore\'s re-localizations to avoid jumps in odometry when creating a map with RTAB-Map, which would cause large drift errors that are difficult to correct. Set an acceleration threshold to detect those events.</string>
<string name="pref_title_append">Append Mode</string>
<string name="pref_summary_append">When resuming mapping, wait for a relocalization on the current map before starting a new map.</string>
<string name="pref_title_resolution">HD Mode</string>
@@ -412,23 +412,29 @@
<item>"1"</item>
<item>"0.5"</item>
</string-array>
<string-array name="pref_arcore_localization_filtering_speed_keys">
<string-array name="pref_arcore_relocalization_acc_thr_keys">
<item>"Disabled"</item>
<item>"5 m/s"</item>
<item>"4 m/s"</item>
<item>"3 m/s"</item>
<item>"2 m/s"</item>
<item>"1 m/s"</item>
<item>"0.5 m/s"</item>
<item>"10 g"</item>
<item>"9 g"</item>
<item>"8 g"</item>
<item>"7 g"</item>
<item>"6 g"</item>
<item>"5 g"</item>
<item>"4 g"</item>
<item>"3 g"</item>
<item>"2 g"</item>
</string-array>
<string-array name="pref_arcore_localization_filtering_speed_values">
<string-array name="pref_arcore_relocalization_acc_thr_values">
<item>"0"</item>
<item>"5"</item>
<item>"4"</item>
<item>"3"</item>
<item>"2"</item>
<item>"1"</item>
<item>"0.5"</item>
<item>"98.0665"</item>
<item>"88.25985"</item>
<item>"78.4532"</item>
<item>"68.64655"</item>
<item>"58.8399"</item>
<item>"49.03325"</item>
<item>"39.2266"</item>
<item>"29.41995"</item>
<item>"19.6133"</item>
</string-array>
<string-array name="pref_max_speed_keys">
<item>"No Limit"</item>

View File

@@ -56,9 +56,8 @@ public class ARCoreSharedCamera {
};
private static RTABMapActivity mActivity;
public ARCoreSharedCamera(RTABMapActivity c, float arCoreLocalizationFilteringSpeed) {
public ARCoreSharedCamera(RTABMapActivity c) {
mActivity = c;
mARCoreLocalizationFilteringSpeed = arCoreLocalizationFilteringSpeed;
}
// Depth TOF Image.
@@ -72,11 +71,7 @@ public class ARCoreSharedCamera {
// ARCore session that supports camera sharing.
private Session sharedSession;
private Pose previousAnchorPose = null;
private long previousAnchorTimeStamp;
private Pose arCoreCorrection = Pose.IDENTITY;
private Pose odomPose = Pose.IDENTITY;
private float mARCoreLocalizationFilteringSpeed = 1.0f;
// Camera capture session. Used by both non-AR and AR modes.
private CameraCaptureSession captureSession;
@@ -111,11 +106,17 @@ public class ARCoreSharedCamera {
private CaptureRequest.Builder previewCaptureRequestBuilder;
private int cameraTextureId = -1;
private boolean firstFrameReceived = false;
// Image reader that continuously processes CPU images.
public TOF_ImageReader mTOFImageReader = new TOF_ImageReader();
private boolean mTOFAvailable = false;
ByteBuffer mPreviousDepth = null;
double mPreviousDepthStamp = 0.0;
ByteBuffer mPreviousDepth2 = null;
double mPreviousDepthStamp2 = 0.0;
public boolean isDepthSupported() {return mTOFAvailable;}
public void setToast(Toast toast)
@@ -630,6 +631,7 @@ public class ARCoreSharedCamera {
}
mTOFImageReader.close();
firstFrameReceived = false;
if(cameraTextureId>=0)
{
@@ -678,14 +680,15 @@ public class ARCoreSharedCamera {
Log.e(TAG, String.format("camera is null!"));
return;
}
boolean lost = false;
if (camera.getTrackingState() != TrackingState.TRACKING) {
final String trackingState = camera.getTrackingState().toString();
Log.e(TAG, String.format("Tracking lost! state=%s", trackingState));
// This will force a new session on the next frame received
RTABMapLib.postCameraPoseEvent(RTABMapActivity.nativeApplication, 0,0,0,0,0,0,0,0);
lost = true;
mActivity.runOnUiThread(new Runnable() {
public void run() {
if(mToast!=null && previousAnchorPose != null)
if(mToast!=null && firstFrameReceived)
{
String msg = "Tracking lost! If you are mapping, you will need to relocalize before continuing.";
if(mToast.getView() == null || !mToast.getView().isShown())
@@ -697,67 +700,14 @@ public class ARCoreSharedCamera {
{
mToast.setText(msg);
}
previousAnchorPose = null;
}
}
});
return;
}
if (frame.getTimestamp() != 0) {
Pose pose = camera.getPose();
// Remove ARCore SLAM corrections by integrating pose from previous frame anchor
if(previousAnchorPose == null || mARCoreLocalizationFilteringSpeed==0)
{
odomPose = pose;
}
else
{
float[] t = previousAnchorPose.inverse().compose(pose).getTranslation();
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)
{
arCoreCorrection = arCoreCorrection.compose(previousAnchorPose).compose(pose.inverse());
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]));
t = odomPose.getTranslation();
float[] t2 = (arCoreCorrection.compose(pose)).getTranslation();
float[] t3 = previousAnchorPose.getTranslation();
float[] t4 = pose.getTranslation();
Log.e(TAG, String.format("Odom = %f %f %f -> %f %f %f ArCore= %f %f %f -> %f %f %f", t[0], t[1], t[2], t2[0], t2[1], t2[2], t3[0], t3[1], t3[2], t4[0], t4[1], t4[2]));
mActivity.runOnUiThread(new Runnable() {
public void run() {
if(mToast!=null)
{
String msg = String.format("ARCore localization has been suppressed "
+ "because of high speed detected (%f m/s) causing a jump! You can change "
+ "ARCore localization filtering speed in Settings->Mapping if you are "
+ "indeed moving as fast.", speed);
if(mToast.getView() == null || !mToast.getView().isShown())
{
mToast.makeText(mActivity.getApplicationContext(), msg, Toast.LENGTH_LONG).show();
}
else
{
mToast.setText(msg);
}
previousAnchorPose = null;
}
}
});
}
odomPose = arCoreCorrection.compose(pose);
}
previousAnchorPose = pose;
previousAnchorTimeStamp = frame.getTimestamp();
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));
RTABMapLib.postCameraPoseEvent(RTABMapActivity.nativeApplication, odomPose.tx(), odomPose.ty(), odomPose.tz(), odomPose.qx(), odomPose.qy(), odomPose.qz(), odomPose.qw(), stamp);
CameraIntrinsics intrinsics = camera.getImageIntrinsics();
try{
Image image = frame.acquireCameraImage();
@@ -800,7 +750,7 @@ public class ARCoreSharedCamera {
camera.getProjectionMatrix(p, 0, 0.1f, 100.0f);
float[] viewMatrix = new float[16];
arCoreCorrection.compose(camera.getDisplayOrientedPose()).inverse().toMatrix(viewMatrix, 0);
camera.getDisplayOrientedPose().inverse().toMatrix(viewMatrix, 0);
float[] quat = new float[4];
rotationMatrixToQuaternion(viewMatrix, quat);
@@ -814,30 +764,52 @@ public class ARCoreSharedCamera {
depthStamp = (double)mTOFImageReader.timestamp/10e8;
}
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));
if(mPreviousDepth == null)
{
mPreviousDepth = depth;
mPreviousDepthStamp = depthStamp;
}
if(mPreviousDepth2 == null)
{
mPreviousDepth2 = depth;
mPreviousDepthStamp2 = depthStamp;
}
if(!RTABMapActivity.DISABLE_LOG) Log.d(TAG, String.format("Depth %dx%d len=%dbytes format=%d stamp=%f previous=%f rgb=%f",
mTOFImageReader.WIDTH, mTOFImageReader.HEIGHT, depth.limit(), ImageFormat.DEPTH16, depthStamp, mPreviousDepthStamp, stamp));
RTABMapLib.postOdometryEventDepth(
RTABMapActivity.nativeApplication,
odomPose.tx(), odomPose.ty(), odomPose.tz(), odomPose.qx(), odomPose.qy(), odomPose.qz(), odomPose.qw(),
lost?0:pose.tx(), lost?0:pose.ty(), lost?0:pose.tz(), lost?0:pose.qx(), lost?0:pose.qy(), lost?0:pose.qz(), lost?0:pose.qw(),
fl[0], fl[1], pp[0], pp[1],
depthIntrinsics[0], depthIntrinsics[1], depthIntrinsics[2], depthIntrinsics[3],
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(),
stamp,
depthStamp,
depthStamp<=stamp?depthStamp:mPreviousDepthStamp<=stamp?mPreviousDepthStamp:mPreviousDepthStamp2,
y, u, v, y.limit(), image.getWidth(), image.getHeight(), image.getFormat(),
depth, depth.limit(), mTOFImageReader.WIDTH, mTOFImageReader.HEIGHT, ImageFormat.DEPTH16,
depthStamp<=stamp?depth:mPreviousDepthStamp<=stamp?mPreviousDepth:mPreviousDepth2,
depthStamp<=stamp?depth.limit():mPreviousDepthStamp<=stamp?mPreviousDepth.limit():mPreviousDepth2.limit(),
mTOFImageReader.WIDTH, mTOFImageReader.HEIGHT, ImageFormat.DEPTH16,
points, points.limit()/4,
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],
texCoord[0],texCoord[1],texCoord[2],texCoord[3],texCoord[4],texCoord[5],texCoord[6],texCoord[7]);
// triple buffer in case delay of rgb frame is > 60 ms
if(depthStamp != mPreviousDepthStamp)
{
mPreviousDepthStamp2 = mPreviousDepthStamp;
mPreviousDepth2 = mPreviousDepth;
mPreviousDepthStamp = depthStamp;
mPreviousDepth = depth;
}
}
else
{
RTABMapLib.postOdometryEvent(
RTABMapActivity.nativeApplication,
odomPose.tx(), odomPose.ty(), odomPose.tz(), odomPose.qx(), odomPose.qy(), odomPose.qz(), odomPose.qw(),
lost?0:pose.tx(), lost?0:pose.ty(), lost?0:pose.tz(), lost?0:pose.qx(), lost?0:pose.qy(), lost?0:pose.qz(), lost?0:pose.qw(),
fl[0], fl[1], pp[0], pp[1],
rgbExtrinsics.tx(), rgbExtrinsics.ty(), rgbExtrinsics.tz(), rgbExtrinsics.qx(), rgbExtrinsics.qy(), rgbExtrinsics.qz(), rgbExtrinsics.qw(),
stamp,
@@ -848,6 +820,7 @@ public class ARCoreSharedCamera {
texCoord[0],texCoord[1],texCoord[2],texCoord[3],texCoord[4],texCoord[5],texCoord[6],texCoord[7]);
}
firstFrameReceived = !lost;
image.close();
cloud.close();

View File

@@ -323,6 +323,7 @@ public class RTABMapActivity extends FragmentActivity implements OnClickListener
// touch point.
Display display = getWindowManager().getDefaultDisplay();
display.getSize(mScreenSize);
Log.i(TAG, String.format("Screen resolution: %dx%d", mScreenSize.x, mScreenSize.y));
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
@@ -1142,6 +1143,7 @@ public class RTABMapActivity extends FragmentActivity implements OnClickListener
RTABMapLib.setDepthFromMotion(nativeApplication, sharedPref.getBoolean(getString(R.string.pref_key_depth_from_motion), Boolean.parseBoolean(getString(R.string.pref_default_depth_from_motion))));
RTABMapLib.setCameraColor(nativeApplication, !sharedPref.getBoolean(getString(R.string.pref_key_fisheye), Boolean.parseBoolean(getString(R.string.pref_default_fisheye))));
RTABMapLib.setAppendMode(nativeApplication, sharedPref.getBoolean(getString(R.string.pref_key_append), Boolean.parseBoolean(getString(R.string.pref_default_append))));
RTABMapLib.setUpstreamRelocalizationAccThr(nativeApplication, Float.parseFloat(sharedPref.getString(getString(R.string.pref_key_arcore_relocalization_acc_thr), getString(R.string.pref_default_arcore_relocalization_acc_thr))));
RTABMapLib.setMappingParameter(nativeApplication, "Rtabmap/DetectionRate", mUpdateRate);
RTABMapLib.setMappingParameter(nativeApplication, "Rtabmap/TimeThr", mTimeThr);
RTABMapLib.setMappingParameter(nativeApplication, "Rtabmap/MemoryThr", memThr);
@@ -1383,9 +1385,7 @@ public class RTABMapActivity extends FragmentActivity implements OnClickListener
if(cameraStartSucess && mCameraDriver == 3)
{
synchronized (this) {
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getActivity());
String arCoreLocalizationFiltering = sharedPref.getString(getString(R.string.pref_key_arcore_localization_filtering_speed), getString(R.string.pref_default_arcore_localization_filtering_speed));
mArCoreCamera = new ARCoreSharedCamera(getActivity(), Float.parseFloat(arCoreLocalizationFiltering));
mArCoreCamera = new ARCoreSharedCamera(getActivity());
mArCoreCamera.setToast(mToast);
mProgressDialog.setTitle("");
mProgressDialog.setMessage(message);
@@ -1775,16 +1775,19 @@ public class RTABMapActivity extends FragmentActivity implements OnClickListener
long currentTime = System.currentTimeMillis()/1000;
if(loopClosureId > 0)
{
if (mToast != null) mToast.cancel();
mToast.setText(String.format("Loop closure detected! (%d/%d inliers)", inliers, matches));
mToast.show();
}
else if(landmarkDetected != 0)
{
if (mToast != null) mToast.cancel();
mToast.setText(String.format("Marker %d detected!", landmarkDetected));
mToast.show();
}
else if(rejected > 0)
{
if (mToast != null) mToast.cancel();
if(inliers >= Integer.parseInt(mMinInliers))
{
if(optimizationMaxError > 0.0f)
@@ -1806,6 +1809,7 @@ public class RTABMapActivity extends FragmentActivity implements OnClickListener
{
if(currentTime - mLastFastMovementNotificationStamp > 3)
{
if (mToast != null) mToast.cancel();
mToast.setText("Move slower... blurry images are not added to map (\"Settings->Mapping...->Maximum Motion Speed\" is enabled).");
mToast.show();
}
@@ -2057,7 +2061,14 @@ public class RTABMapActivity extends FragmentActivity implements OnClickListener
* "Unknown"
*/
String str = null;
if(key.equals("TangoServiceException"))
if(key.equals("UpstreamRelocationFiltered"))
{
if(mItemDebugVisibility != null && mItemDebugVisibility.isChecked()) {
str = String.format("%s re-localization filtered because an acceleration of %s has been detected, which is over current threshold set in the settings.",
mCameraDriver == 2?"AREngine":"ARCore", value);
}
}
else if(key.equals("TangoServiceException"))
str = String.format("Tango service exception: %s", value);
else if(key.equals("FisheyeOverExposed"))
;//str = String.format("The fisheye image is over exposed with average pixel value %s px.", value);
@@ -3024,7 +3035,6 @@ public class RTABMapActivity extends FragmentActivity implements OnClickListener
}
else
{
RTABMapLib.openDatabase(nativeApplication, tmpDatabase, databaseInMemory, false, true);
if(!(mState == State.STATE_CAMERA || mState ==State.STATE_MAPPING))

View File

@@ -76,6 +76,7 @@ public class RTABMapLib
public static native void setDepthFromMotion(long nativeApplication, boolean enabled);
public static native void setCameraColor(long nativeApplication, boolean enabled);
public static native void setAppendMode(long nativeApplication, boolean enabled);
public static native void setUpstreamRelocalizationAccThr(long nativeApplication, float value);
public static native void setDataRecorderMode(long nativeApplication, boolean enabled);
public static native void setMaxCloudDepth(long nativeApplication, float value);
public static native void setMinCloudDepth(long nativeApplication, float value);
@@ -135,7 +136,6 @@ public class RTABMapLib
public static native float getUpdateTime(long nativeApplication);
public static native int getLoopClosureId(long nativeApplication);
public static native void postCameraPoseEvent(long nativeApplication, float x, float y, float z, float qx, float qy, float qz, float qw, double stamp);
public static native void postOdometryEvent(long nativeApplication,
float x, float y, float z, float qx, float qy, float qz, float qw,
float rgb_fx, float rgb_fy, float rgb_cx, float rgb_cy,

View File

@@ -222,7 +222,7 @@ public class SettingsActivity extends PreferenceActivity implements OnSharedPref
((Preference)findPreference(getString(R.string.pref_key_background_color))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_background_color))).getEntry() + ") "+getString(R.string.pref_summary_background_color));
((Preference)findPreference(getString(R.string.pref_key_rendering_texture_decimation))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_rendering_texture_decimation))).getEntry() + ") "+getString(R.string.pref_summary_rendering_texture_decimation));
((Preference)findPreference(getString(R.string.pref_key_arcore_localization_filtering_speed))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_arcore_localization_filtering_speed))).getEntry() + ") "+getString(R.string.pref_summary_arcore_localization_filtering_speed));
((Preference)findPreference(getString(R.string.pref_key_arcore_relocalization_acc_thr))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_arcore_relocalization_acc_thr))).getEntry() + ") "+getString(R.string.pref_summary_arcore_relocalization_acc_thr));
((Preference)findPreference(getString(R.string.pref_key_update_rate))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_update_rate))).getEntry() + ") "+getString(R.string.pref_summary_update_rate));
((Preference)findPreference(getString(R.string.pref_key_max_speed))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_max_speed))).getEntry() + ") "+getString(R.string.pref_summary_max_speed));
((Preference)findPreference(getString(R.string.pref_key_time_thr))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_time_thr))).getEntry() + ") "+getString(R.string.pref_summary_time_thr));
@@ -285,7 +285,7 @@ public class SettingsActivity extends PreferenceActivity implements OnSharedPref
if(key.compareTo(getString(R.string.pref_key_background_color))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_background_color));
if(key.compareTo(getString(R.string.pref_key_rendering_texture_decimation))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_rendering_texture_decimation));
if(key.compareTo(getString(R.string.pref_key_arcore_localization_filtering_speed))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_arcore_localization_filtering_speed));
if(key.compareTo(getString(R.string.pref_key_arcore_relocalization_acc_thr))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_arcore_relocalization_acc_thr));
if(key.compareTo(getString(R.string.pref_key_update_rate))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_update_rate));
if(key.compareTo(getString(R.string.pref_key_max_speed))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_max_speed));
if(key.compareTo(getString(R.string.pref_key_time_thr))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_time_thr));

View File

@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
@@ -20,6 +20,7 @@
4EE016C3259BE464008CCE65 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4EE016BF259BE464008CCE65 /* Main.storyboard */; };
4EE016C4259BE464008CCE65 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4EE016C1259BE464008CCE65 /* LaunchScreen.storyboard */; };
4EE016C7259BE46F008CCE65 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4EE016C6259BE46F008CCE65 /* Assets.xcassets */; };
4EFAA9432CAE4E960055DA51 /* liblas.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EFAA9422CAE4E960055DA51 /* liblas.a */; };
4EFD0B36259D4DE900575D88 /* libboost_filesystem.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EFD0B2B259D4DE900575D88 /* libboost_filesystem.a */; };
4EFD0B37259D4DE900575D88 /* libboost_program_options.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EFD0B2C259D4DE900575D88 /* libboost_program_options.a */; };
4EFD0B38259D4DE900575D88 /* libboost_regex.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EFD0B2D259D4DE900575D88 /* libboost_regex.a */; };
@@ -170,6 +171,7 @@
4EE016C2259BE464008CCE65 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = RTABMapApp/Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4EE016C6259BE46F008CCE65 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = RTABMapApp/Assets.xcassets; sourceTree = "<group>"; };
4EE016E1259BE96A008CCE65 /* RTABMapApp-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "RTABMapApp-Bridging-Header.h"; path = "RTABMapApp/RTABMapApp-Bridging-Header.h"; sourceTree = "<group>"; };
4EFAA9422CAE4E960055DA51 /* liblas.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblas.a; path = RTABMapApp/Libraries/lib/liblas.a; sourceTree = "<group>"; };
4EFD0B2B259D4DE900575D88 /* libboost_filesystem.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libboost_filesystem.a; path = RTABMapApp/Libraries/lib/libboost_filesystem.a; sourceTree = "<group>"; };
4EFD0B2C259D4DE900575D88 /* libboost_program_options.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libboost_program_options.a; path = RTABMapApp/Libraries/lib/libboost_program_options.a; sourceTree = "<group>"; };
4EFD0B2D259D4DE900575D88 /* libboost_regex.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libboost_regex.a; path = RTABMapApp/Libraries/lib/libboost_regex.a; sourceTree = "<group>"; };
@@ -343,6 +345,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4EFAA9432CAE4E960055DA51 /* liblas.a in Frameworks */,
4EFD0F50259D67D900575D88 /* liblibwebp.a in Frameworks */,
4EFD0F51259D67D900575D88 /* liblibpng.a in Frameworks */,
4EFD0F52259D67D900575D88 /* liblibjpeg-turbo.a in Frameworks */,
@@ -493,6 +496,7 @@
4EFD0B2A259D4DE900575D88 /* Frameworks */ = {
isa = PBXGroup;
children = (
4EFAA9422CAE4E960055DA51 /* liblas.a */,
4EFD0F4D259D67D900575D88 /* liblibjpeg-turbo.a */,
4EFD0F4C259D67D900575D88 /* liblibpng.a */,
4EFD0F4F259D67D900575D88 /* liblibprotobuf.a */,
@@ -787,7 +791,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nversion=\"$MARKETING_VERSION\"\n/usr/libexec/PlistBuddy -c \"Set PreferenceSpecifiers:22:DefaultValue $version\" \"${SRCROOT}/Settings.bundle/Root.plist\"\n";
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nversion=\"$MARKETING_VERSION\"\n/usr/libexec/PlistBuddy -c \"Set PreferenceSpecifiers:21:DefaultValue $version\" \"${SRCROOT}/Settings.bundle/Root.plist\"\n";
};
/* End PBXShellScriptBuildPhase section */
@@ -957,6 +961,7 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = "";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
@@ -967,6 +972,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
@@ -1007,7 +1013,7 @@
"$(PROJECT_DIR)/RTABMapApp/Libraries/lib",
"$(PROJECT_DIR)/RTABMapApp/Libraries/share/OpenCV/3rdparty/lib",
);
MARKETING_VERSION = 0.21.0;
MARKETING_VERSION = 0.21.8;
OTHER_CFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.introlab.rtabmap;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1064,7 +1070,7 @@
"$(PROJECT_DIR)/RTABMapApp/Libraries/lib",
"$(PROJECT_DIR)/RTABMapApp/Libraries/share/OpenCV/3rdparty/lib",
);
MARKETING_VERSION = 0.21.0;
MARKETING_VERSION = 0.21.8;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.introlab.rtabmap;

View File

@@ -23,7 +23,7 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
@@ -51,6 +51,13 @@
ReferencedContainer = "container:RTABMapApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "IDEPreferLogStreaming"
value = "YES"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -70,7 +77,7 @@
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
buildConfiguration = "Release">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19455" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="zah-iI-EPt">
<device id="retina3_5" orientation="portrait" appearance="light"/>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="zah-iI-EPt">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19454"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
@@ -15,14 +15,14 @@
<objects>
<glkViewController preferredFramesPerSecond="30" id="zah-iI-EPt" customClass="ViewController" customModule="RTABMapApp" customModuleProvider="target" sceneMemberID="viewController">
<glkView key="view" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" drawableDepthFormat="24" enableSetNeedsDisplay="NO" id="sqF-4e-2HU">
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="kPv-DO-hpd">
<rect key="frame" x="250" y="180" width="60" height="120"/>
<rect key="frame" x="323" y="366" width="60" height="120"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mJN-Ru-yPg" userLabel="StopButton">
<rect key="frame" x="0.0" y="0.5" width="60" height="59"/>
<rect key="frame" x="0.0" y="1" width="60" height="58.666666666666671"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="g9J-0P-CmQ"/>
<constraint firstAttribute="width" constant="60" id="m06-eJ-dIn"/>
@@ -34,7 +34,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7Lv-u6-mGh" userLabel="RecordButton">
<rect key="frame" x="0.0" y="60.5" width="60" height="59"/>
<rect key="frame" x="0.0" y="61.000000000000007" width="60" height="58.666666666666664"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="DQI-eQ-v3X"/>
<constraint firstAttribute="width" constant="60" id="Oeu-YT-wMz"/>
@@ -50,10 +50,10 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="ozY-dg-YOd">
<rect key="frame" x="160" y="20" width="140" height="60"/>
<rect key="frame" x="233" y="79" width="140" height="60"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9kh-4C-KyP" userLabel="LibraryButton">
<rect key="frame" x="0.0" y="1" width="60" height="57.5"/>
<rect key="frame" x="0.0" y="1.6666666666666643" width="60" height="57"/>
<constraints>
<constraint firstAttribute="width" constant="60" id="Ekq-3J-kUL"/>
<constraint firstAttribute="height" constant="60" id="fqe-e7-0uk"/>
@@ -67,7 +67,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="y53-OI-O76" userLabel="MenuButton">
<rect key="frame" x="80" y="0.5" width="60" height="59"/>
<rect key="frame" x="80" y="1" width="60" height="58.666666666666671"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="L5T-8h-ale"/>
<constraint firstAttribute="width" constant="60" id="pLI-ns-KHQ"/>
@@ -78,14 +78,14 @@
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KlF-4H-k6I">
<rect key="frame" x="16" y="20" width="31" height="14.5"/>
<rect key="frame" x="16" y="79" width="31" height="14.333333333333329"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.29820365646258501" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="773-n4-lob" userLabel="ViewButton">
<rect key="frame" x="248" y="417.5" width="52" height="40.5"/>
<rect key="frame" x="321" y="756.33333333333337" width="52" height="40"/>
<constraints>
<constraint firstAttribute="width" constant="52" id="epT-x2-WRc"/>
<constraint firstAttribute="height" constant="44" id="wAe-I1-qhs"/>
@@ -96,7 +96,7 @@
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="012-W3-dOS" userLabel="CloseVisualization">
<rect key="frame" x="75" y="434" width="170.5" height="22"/>
<rect key="frame" x="111.33333333333333" y="772" width="170.33333333333337" height="22"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Close Visualization" image="xmark.square" catalog="system">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -106,7 +106,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9oq-op-NGV" userLabel="StopCamera">
<rect key="frame" x="98" y="433" width="124.5" height="22"/>
<rect key="frame" x="134.33333333333334" y="771" width="124.33333333333334" height="22"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Stop Camera" image="xmark.square" catalog="system">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -116,9 +116,9 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Jj4-ow-MwD" userLabel="NewScanButtonLarge">
<rect key="frame" x="73.5" y="224" width="173" height="32"/>
<rect key="frame" x="86.333333333333329" y="407" width="220.66666666666669" height="38.333333333333314"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Start the Camera">
<state key="normal" title="New Mapping Session">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<imageReference key="image" image="plus.app" catalog="system" symbolScale="large"/>
<preferredSymbolConfiguration key="preferredSymbolConfiguration" configurationType="font">
@@ -130,7 +130,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3Sc-lx-YKH">
<rect key="frame" x="161" y="96" width="149" height="22"/>
<rect key="frame" x="234" y="155" width="149" height="23.666666666666657"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Export OBJ-PLY" image="square.and.arrow.up" catalog="system"/>
<connections>
@@ -138,7 +138,7 @@
</connections>
</button>
<slider opaque="NO" contentMode="scaleToFill" placeholderIntrinsicWidth="114" placeholderIntrinsicHeight="30" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="80" minValue="0.0" maxValue="120" translatesAutoresizingMaskIntoConstraints="NO" id="30J-Tx-NRW" userLabel="OrthoClipDistanceSlider">
<rect key="frame" x="-2" y="344" width="122" height="31"/>
<rect key="frame" x="-2" y="682" width="122" height="31"/>
<constraints>
<constraint firstAttribute="width" constant="118" id="dsv-im-K52"/>
</constraints>
@@ -147,7 +147,7 @@
</connections>
</slider>
<slider opaque="NO" contentMode="scaleToFill" placeholderIntrinsicWidth="114" placeholderIntrinsicHeight="30" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="90" minValue="0.0" maxValue="180" translatesAutoresizingMaskIntoConstraints="NO" id="Z1x-Af-hdf" userLabel="GridRotationSlider">
<rect key="frame" x="99" y="389" width="122" height="31"/>
<rect key="frame" x="135.66666666666666" y="727" width="121.99999999999997" height="31"/>
<constraints>
<constraint firstAttribute="width" constant="118" id="KDl-lP-Jj7"/>
</constraints>
@@ -155,8 +155,8 @@
<action selector="rotateGridAction:" destination="zah-iI-EPt" eventType="valueChanged" id="eiC-QR-TYH"/>
</connections>
</slider>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Toast Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JMv-UE-cvK" userLabel="ToastLabel">
<rect key="frame" x="116.5" y="330" width="87.5" height="20.5"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Toast Label" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="4" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JMv-UE-cvK" userLabel="ToastLabel">
<rect key="frame" x="51" y="668.33333333333337" width="291" height="20.333333333333371"/>
<color key="backgroundColor" white="0.0" alpha="0.3002232142857143" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" staticText="YES" notEnabled="YES"/>
@@ -170,6 +170,7 @@
<constraints>
<constraint firstItem="KlF-4H-k6I" firstAttribute="leading" secondItem="qAR-pI-uT2" secondAttribute="leading" constant="16" id="14l-HO-Yqo"/>
<constraint firstItem="kPv-DO-hpd" firstAttribute="centerY" secondItem="sqF-4e-2HU" secondAttribute="centerY" id="4S8-5c-tBm"/>
<constraint firstItem="JMv-UE-cvK" firstAttribute="leading" secondItem="sqF-4e-2HU" secondAttribute="leadingMargin" constant="35" id="Awg-pU-JkT"/>
<constraint firstItem="KlF-4H-k6I" firstAttribute="top" secondItem="qAR-pI-uT2" secondAttribute="top" constant="20" id="CS3-Rk-Wxs"/>
<constraint firstItem="012-W3-dOS" firstAttribute="centerX" secondItem="sqF-4e-2HU" secondAttribute="centerX" id="IsC-yB-kNs"/>
<constraint firstItem="qAR-pI-uT2" firstAttribute="trailing" secondItem="773-n4-lob" secondAttribute="trailing" constant="20" id="N8s-Yg-VsL"/>
@@ -178,6 +179,7 @@
<constraint firstItem="Jj4-ow-MwD" firstAttribute="centerX" secondItem="sqF-4e-2HU" secondAttribute="centerX" id="OLx-LR-8xj"/>
<constraint firstItem="012-W3-dOS" firstAttribute="top" secondItem="Z1x-Af-hdf" secondAttribute="bottom" constant="15" id="RpS-k0-btM"/>
<constraint firstItem="ozY-dg-YOd" firstAttribute="top" secondItem="qAR-pI-uT2" secondAttribute="top" constant="20" id="TFT-we-noh"/>
<constraint firstAttribute="trailingMargin" secondItem="JMv-UE-cvK" secondAttribute="trailing" constant="35" id="Ya5-GD-1rM"/>
<constraint firstItem="30J-Tx-NRW" firstAttribute="leading" secondItem="sqF-4e-2HU" secondAttribute="leading" id="ZBG-GX-P1X"/>
<constraint firstItem="3Sc-lx-YKH" firstAttribute="top" secondItem="ozY-dg-YOd" secondAttribute="bottom" constant="16" id="abR-Tj-Nua"/>
<constraint firstItem="qAR-pI-uT2" firstAttribute="bottom" secondItem="012-W3-dOS" secondAttribute="bottom" constant="24" id="dcl-mV-bH1"/>
@@ -220,17 +222,17 @@
<objects>
<viewController storyboardIdentifier="unsupportedDeviceMessage" id="v3G-nW-gVc" userLabel="Unsupported View Controller" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="hzM-1k-POo">
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Unsupported Device" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" enabled="NO" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kZt-ct-4KD">
<rect key="frame" x="21.5" y="165" width="277.5" height="30"/>
<rect key="frame" x="28" y="341.33333333333331" width="337.33333333333331" height="33.666666666666686"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle1"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" enabled="NO" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4Js-Hw-3QU">
<rect key="frame" x="21.5" y="203" width="277.5" height="74"/>
<rect key="frame" x="28" y="383" width="337.33333333333331" height="86.333333333333314"/>
<string key="text">This sample app requires a LiDAR-capable device, such as the second-generation iPad Pro 11-inch and fourth-generation iPad Pro 12.9-inch.</string>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<nil key="textColor"/>
@@ -256,16 +258,16 @@
</scene>
</scenes>
<resources>
<image name="ellipsis.circle" catalog="system" width="128" height="121"/>
<image name="eye" catalog="system" width="128" height="81"/>
<image name="folder" catalog="system" width="128" height="97"/>
<image name="ellipsis.circle" catalog="system" width="128" height="123"/>
<image name="eye" catalog="system" width="128" height="79"/>
<image name="folder" catalog="system" width="128" height="96"/>
<image name="plus.app" catalog="system" width="128" height="114"/>
<image name="record.circle" catalog="system" width="128" height="121"/>
<image name="square.and.arrow.up" catalog="system" width="115" height="128"/>
<image name="stop.circle" catalog="system" width="128" height="121"/>
<image name="record.circle" catalog="system" width="128" height="123"/>
<image name="square.and.arrow.up" catalog="system" width="108" height="128"/>
<image name="stop.circle" catalog="system" width="128" height="123"/>
<image name="xmark.square" catalog="system" width="128" height="114"/>
<systemColor name="systemRedColor">
<color red="1" green="0.23137254901960785" blue="0.18823529411764706" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="1" green="0.23137254900000001" blue="0.18823529410000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>

View File

@@ -33,11 +33,12 @@ void setupCallbacksNative(const void *object, void * classPtr,
int,
float, float, float, float,
int, int,
float, float, float, float, float, float))
float, float, float, float, float, float),
void(*cameraInfoEventCallback)(void *, int, const char*, const char*))
{
if(object)
{
native(object)->setupSwiftCallbacks(classPtr, progressCallback, initCallback, statsUpdatedCallback);
native(object)->setupSwiftCallbacks(classPtr, progressCallback, initCallback, statsUpdatedCallback, cameraInfoEventCallback);
}
else
{
@@ -283,20 +284,6 @@ void setCameraNative(const void *object, int type) {
}
}
void postCameraPoseEventNative(const void *object,
float x, float y, float z, float qx, float qy, float qz, float qw)
{
if(object)
{
native(object)->postCameraPoseEvent(x,y,z,qx,qy,qz,qw,0.0);
}
else
{
UERROR("object is null!");
return;
}
}
void postOdometryEventNative(const void *object,
float x, float y, float z, float qx, float qy, float qz, float qw,
float fx, float fy, float cx, float cy,
@@ -312,7 +299,7 @@ void postOdometryEventNative(const void *object,
if(object)
{
native(object)->postOdometryEvent(
rtabmap::Transform(x,y,z,qx,qy,qz,qw),
(qx==0.0f && qy==0.0f && qz==0.0f && qw==0.0f)?rtabmap::Transform():rtabmap::Transform(x,y,z,qx,qy,qz,qw),
fx,fy,cx,cy, 0,0,0,0,
rtabmap::Transform(), rtabmap::Transform(),
stamp, 0,
@@ -454,6 +441,13 @@ void setLocalizationModeNative(const void *object, bool enabled)
else
UERROR("object is null!");
}
void setDataRecorderModeNative(const void *object, bool enabled)
{
if(object)
native(object)->setDataRecorderMode(enabled);
else
UERROR("object is null!");
}
void setTrajectoryModeNative(const void *object, bool enabled)
{
if(object)
@@ -510,6 +504,13 @@ void setAppendModeNative(const void *object, bool enabled)
else
UERROR("object is null!");
}
void setUpstreamRelocalizationAccThrNative(const void * object, float value)
{
if(object)
native(object)->setUpstreamRelocalizationAccThr(value);
else
UERROR("object is null!");
}
void setMaxCloudDepthNative(const void *object, float value)
{
if(object)
@@ -587,6 +588,15 @@ void setDepthConfidenceNative(const void *object, int value)
else
UERROR("object is null!");
}
void setExportPointCloudFormatNative(const void *object, const char * format)
{
if(object)
native(object)->setExportPointCloudFormat(format);
else
UERROR("object is null!");
}
int setMappingParameterNative(const void *object, const char * key, const char * value)
{
if(object)

View File

@@ -29,7 +29,8 @@ void setupCallbacksNative(const void *object, void * classPtr,
int,
float, float, float, float,
int, int,
float, float, float, float, float, float));
float, float, float, float, float, float),
void(*cameraInfoEventCallback)(void *, int, const char*, const char*));
void destroyNativeApplication(const void *object);
void setScreenRotationNative(const void *object, int displayRotation);
int openDatabaseNative(const void *object, const char * databasePath, bool databaseInMemory, bool optimize, bool clearDatabase);
@@ -66,8 +67,6 @@ int renderNative(const void *object);
bool startCameraNative(const void *object);
void stopCameraNative(const void *object);
void setCameraNative(const void *object, int type);
void postCameraPoseEventNative(const void *object,
float x, float y, float z, float qx, float qy, float qz, float qw);
void postOdometryEventNative(const void *object,
float x, float y, float z, float qx, float qy, float qz, float qw,
float fx, float fy, float cx, float cy,
@@ -92,6 +91,7 @@ void setLightingNative(const void *object, bool enabled);
void setBackfaceCullingNative(const void *object, bool enabled);
void setWireframeNative(const void *object, bool enabled);
void setLocalizationModeNative(const void *object, bool enabled);
void setDataRecorderModeNative(const void *object, bool enabled);
void setTrajectoryModeNative(const void *object, bool enabled);
void setGraphOptimizationNative(const void *object, bool enabled);
void setNodesFilteringNative(const void *object, bool enabled);
@@ -100,6 +100,7 @@ void setGridVisibleNative(const void *object, bool visible);
void setFullResolutionNative(const void *object, bool enabled);
void setSmoothingNative(const void *object, bool enabled);
void setAppendModeNative(const void *object, bool enabled);
void setUpstreamRelocalizationAccThrNative(const void *object, float value);
void setMaxCloudDepthNative(const void *object, float value);
void setMinCloudDepthNative(const void *object, float value);
void setCloudDensityLevelNative(const void *object, int value);
@@ -111,6 +112,7 @@ void setMaxGainRadiusNative(const void *object, float value);
void setRenderingTextureDecimationNative(const void *object, int value);
void setBackgroundColorNative(const void *object, float gray);
void setDepthConfidenceNative(const void *object, int value);
void setExportPointCloudFormatNative(const void *object, const char * format);
int setMappingParameterNative(const void *object, const char * key, const char * value);
typedef struct ImageNative

View File

@@ -85,6 +85,25 @@ class RTABMap {
observer.statsUpdated(mySelf, nodes: Int(nodes), words: Int(words), points: Int(points), polygons: Int(polygons), updateTime: updateTime, loopClosureId: Int(loopClosureId), highestHypId: Int(highestHypId), databaseMemoryUsed: Int(databaseMemoryUsed), inliers: Int(inliers), matches: Int(matches), featuresExtracted: Int(featuresExtracted), hypothesis: hypothesis, nodesDrawn: Int(nodesDrawn), fps: fps, rejected: Int(rejected), rehearsalValue: rehearsalValue, optimizationMaxError: optimizationMaxError, optimizationMaxErrorRatio: optimizationMaxErrorRatio, distanceTravelled: distanceTravelled, fastMovement: Int(fastMovement), landmarkDetected: Int(landmarkDetected), x: x, y: y, z: z, roll: roll, pitch: pitch, yaw: yaw)
}
},
//cameraInfoEventCallback
{(observer, type, key, value) -> Void in
// Extract pointer to `self` from void pointer:
let mySelf = Unmanaged<RTABMap>.fromOpaque(observer!).takeUnretainedValue()
// Call instance method:
//mySelf.TestMethod();
for (id, observation) in mySelf.observations {
// If the observer is no longer in memory, we
// can clean up the observation for its ID
guard let observer = observation.observer else {
mySelf.observations.removeValue(forKey: id)
continue
}
let strKey = String(cString: key!)
let strValue = String(cString: value!)
observer.cameraInfoEventReceived(mySelf, type: Int(type), key: strKey, value: strValue)
}
})
}
@@ -216,20 +235,6 @@ class RTABMap {
setCameraNative(native_rtabmap, Int32(type))
}
func postCameraPoseEvent(pose: simd_float4x4) {
let rotation = GLKMatrix3(
m: (pose[0,0], pose[0,1], pose[0,2],
pose[1,0], pose[1,1], pose[1,2],
pose[2,0], pose[2,1], pose[2,2]))
let quat = GLKQuaternionMakeWithMatrix3(rotation)
postCameraPoseEventNative(native_rtabmap, pose[3,0], pose[3,1], pose[3,2], quat.x, quat.y, quat.z, quat.w)
}
func notifyLost() {
// a null transform will make rtabmap creating a new session
postCameraPoseEventNative(native_rtabmap, 0,0,0,0,0,0,0)
}
func postOdometryEvent(frame: ARFrame, orientation: UIInterfaceOrientation, viewport: CGSize) {
let pose = frame.camera.transform // ViewMatrix
let rotation = GLKMatrix3(
@@ -239,8 +244,6 @@ class RTABMap {
let quat = GLKQuaternionMakeWithMatrix3(rotation)
postCameraPoseEventNative(native_rtabmap, pose[3,0], pose[3,1], pose[3,2], quat.x, quat.y, quat.z, quat.w)
let confMap = frame.sceneDepth?.confidenceMap
let depthMap = frame.sceneDepth?.depthMap
let points = frame.rawFeaturePoints?.points
@@ -314,8 +317,21 @@ class RTABMap {
addEnvSensor(type: 4, value: Float(frame.lightEstimate!.ambientIntensity))
}
var lost = false
switch frame.camera.trackingState {
case .normal:
lost = false
case .limited(.excessiveMotion):
lost = false
case .limited(.insufficientFeatures):
lost = false
default:
lost = true
}
// Notify lost with pose=null
postOdometryEventNative(native_rtabmap,
pose[3,0], pose[3,1], pose[3,2], quat.x, quat.y, quat.z, quat.w,
!lost ? pose[3,0]:0, !lost ? pose[3,1]:0, !lost ? pose[3,2]:0, !lost ? quat.x:0, !lost ? quat.y:0, !lost ? quat.z:0, !lost ? quat.w:0,
frame.camera.intrinsics[0,0], // fx
frame.camera.intrinsics[1,1], // fy
frame.camera.intrinsics[2,0], // cx
@@ -390,8 +406,8 @@ class RTABMap {
func setLocalizationMode(enabled: Bool) {
setLocalizationModeNative(native_rtabmap, enabled)
}
func setTrajectoryMode(enabled: Bool) {
setTrajectoryModeNative(native_rtabmap, enabled)
func setDataRecorderMode(enabled: Bool) {
setDataRecorderModeNative(native_rtabmap, enabled)
}
func setGraphOptimization(enabled: Bool) {
setGraphOptimizationNative(native_rtabmap, enabled)
@@ -414,6 +430,9 @@ class RTABMap {
func setAppendMode(enabled: Bool) {
setAppendModeNative(native_rtabmap, enabled)
}
func setUpstreamRelocalizationAccThr(value: Float) {
setUpstreamRelocalizationAccThrNative(native_rtabmap, value)
}
func setMaxCloudDepth(value: Float) {
setMaxCloudDepthNative(native_rtabmap, value)
}
@@ -447,6 +466,11 @@ class RTABMap {
func setDepthConfidence(value: Int) {
setDepthConfidenceNative(native_rtabmap, Int32(value))
}
func setExportPointCloudFormat(format: String) {
format.utf8CString.withUnsafeBufferPointer { bufferFormat in
return setExportPointCloudFormatNative(native_rtabmap, bufferFormat.baseAddress)
}
}
func setMappingParameter(key: String, value: String) {
key.utf8CString.withUnsafeBufferPointer { bufferKey in
value.utf8CString.withUnsafeBufferPointer { bufferValue in
@@ -523,6 +547,7 @@ protocol RTABMapObserver: class {
roll: Float,
pitch: Float,
yaw: Float)
func cameraInfoEventReceived(_ rtabmap: RTABMap, type: Int, key: String, value: String)
}
extension String {

View File

@@ -41,6 +41,7 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
private var mTimeThr: Int = 0
private var mMaxFeatures: Int = 0
private var mLoopThr = 0.11
private var mDataRecording = false
private var mReviewRequested = false
@@ -63,7 +64,7 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
case .STATE_CAMERA:
return "Camera Preview"
case .STATE_MAPPING:
return "Mapping"
return mDataRecording ? "Data Recording" : "Mapping"
case .STATE_PROCESSING:
return "Processing"
case .STATE_VISUALIZING:
@@ -428,6 +429,16 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
}
}
func cameraInfoEventReceived(_ rtabmap: RTABMap, type: Int, key: String, value: String) {
if(self.debugShown && key == "UpstreamRelocationFiltered")
{
DispatchQueue.main.async {
self.dismiss(animated: true)
self.showToast(message: "ARKit re-localization filtered because an acceleration of \(value) has been detected, which is over current threshold set in the settings.", seconds: 3)
}
}
}
func getMemoryUsage() -> UInt64 {
var taskInfo = mach_task_basic_info()
var count = mach_msg_type_number_t(MemoryLayout<mach_task_basic_info>.size)/4
@@ -460,7 +471,7 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
if(mMapNodes > 0 && self.openedDatabasePath == nil)
{
let msg = "RTAB-Map has been pushed to background while mapping. Do you want to save the map now?"
let alert = UIAlertController(title: "Mapping Stopped!", message: msg, preferredStyle: .alert)
let alert = UIAlertController(title: mDataRecording ? "Data Recording Stopped" : "Mapping Stopped!", message: msg, preferredStyle: .alert)
let alertActionNo = UIAlertAction(title: "Ignore", style: .cancel) {
(UIAlertAction) -> Void in
}
@@ -582,6 +593,7 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
mState = state;
var actionNewScanEnabled: Bool
var actionNewDataRecording: Bool
var actionSaveEnabled: Bool
var actionResumeEnabled: Bool
var actionExportEnabled: Bool
@@ -602,7 +614,8 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
exportOBJPLYButton.isHidden = true
orthoDistanceSlider.isHidden = cameraMode != 3
orthoGridSlider.isHidden = cameraMode != 3
actionNewScanEnabled = true
actionNewScanEnabled = !mDataRecording
actionNewDataRecording = mDataRecording
actionSaveEnabled = false
actionResumeEnabled = false
actionExportEnabled = false
@@ -621,7 +634,8 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
exportOBJPLYButton.isHidden = true
orthoDistanceSlider.isHidden = cameraMode != 3 || !mHudVisible
orthoGridSlider.isHidden = cameraMode != 3 || !mHudVisible
actionNewScanEnabled = true
actionNewScanEnabled = !mDataRecording
actionNewDataRecording = mDataRecording
actionSaveEnabled = false
actionResumeEnabled = false
actionExportEnabled = false
@@ -643,6 +657,7 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
orthoDistanceSlider.isHidden = cameraMode != 3 || mState != .STATE_VISUALIZING_WHILE_LOADING
orthoGridSlider.isHidden = cameraMode != 3 || mState != .STATE_VISUALIZING_WHILE_LOADING
actionNewScanEnabled = false
actionNewDataRecording = false
actionSaveEnabled = false
actionResumeEnabled = false
actionExportEnabled = false
@@ -662,6 +677,7 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
orthoDistanceSlider.isHidden = cameraMode != 3 || !mHudVisible
orthoGridSlider.isHidden = cameraMode != 3 || !mHudVisible
actionNewScanEnabled = true
actionNewDataRecording = true
actionSaveEnabled = mMapNodes>0
actionResumeEnabled = mMapNodes>0
actionExportEnabled = mMapNodes>0
@@ -681,6 +697,7 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
orthoDistanceSlider.isHidden = cameraMode != 3 || !mHudVisible
orthoGridSlider.isHidden = cameraMode != 3 || !mHudVisible
actionNewScanEnabled = true
actionNewDataRecording = true
actionSaveEnabled = mState != .STATE_WELCOME && mMapNodes>0
actionResumeEnabled = mState != .STATE_WELCOME && mMapNodes>0
actionExportEnabled = mState != .STATE_WELCOME && mMapNodes>0
@@ -763,8 +780,15 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
}),
optimizeAdvancedMenu])
// Advanced menu
let advancedMenu = UIMenu(title: "Advanced...", children: [
UIAction(title: "New Data Recording", image: UIImage(systemName: "plus.app"), attributes: actionNewDataRecording ? [] : .disabled, state: .off, handler: { _ in
self.newScan(dataRecordingMode: true)
})
])
var fileMenuChildren: [UIMenuElement] = []
fileMenuChildren.append(UIAction(title: "New Scan", image: UIImage(systemName: "plus.app"), attributes: actionNewScanEnabled ? [] : .disabled, state: .off, handler: { _ in
fileMenuChildren.append(UIAction(title: "New Mapping Session", image: UIImage(systemName: "plus.app"), attributes: actionNewScanEnabled ? [] : .disabled, state: .off, handler: { _ in
self.newScan()
}))
if(actionOptimizeEnabled) {
@@ -787,6 +811,7 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
fileMenuChildren.append(UIAction(title: "Append Scan", image: UIImage(systemName: "play.fill"), attributes: actionResumeEnabled ? [] : .disabled, state: .off, handler: { _ in
self.resumeScan()
}))
fileMenuChildren.append(advancedMenu)
// File menu
let fileMenu = UIMenu(title: "File", options: .displayInline, children: fileMenuChildren)
@@ -1001,16 +1026,9 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
status = "Camera Is Occluded Or Lighting Is Too Dark"
}
if accept
if let rotation = UIApplication.shared.windows.first?.windowScene?.interfaceOrientation
{
if let rotation = UIApplication.shared.windows.first?.windowScene?.interfaceOrientation
{
rtabmap?.postOdometryEvent(frame: frame, orientation: rotation, viewport: self.view.frame.size)
}
}
else
{
rtabmap?.notifyLost();
rtabmap?.postOdometryEvent(frame: frame, orientation: rotation, viewport: self.view.frame.size)
}
if !status.isEmpty {
@@ -1292,7 +1310,7 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
}
@IBAction func singleTapped(_ gestureRecognizer: UITapGestureRecognizer) {
if gestureRecognizer.state == UIGestureRecognizer.State.recognized
if gestureRecognizer.state == .recognized
{
resetNoTouchTimer(!mHudVisible)
@@ -1322,6 +1340,8 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
rtabmap!.setFullResolution(enabled: defaults.bool(forKey: "HDMode"));
rtabmap!.setSmoothing(enabled: defaults.bool(forKey: "Smoothing"));
rtabmap!.setAppendMode(enabled: defaults.bool(forKey: "AppendMode"));
rtabmap!.setUpstreamRelocalizationAccThr(value: defaults.float(forKey: "UpstreamRelocalizationFilteringAccThr"));
rtabmap!.setExportPointCloudFormat(format: defaults.string(forKey: "ExportPointCloudFormat")!);
mTimeThr = (defaults.string(forKey: "TimeLimit")! as NSString).integerValue
mMaxFeatures = (defaults.string(forKey: "MaxFeaturesExtractedLoopClosure")! as NSString).integerValue
@@ -1379,8 +1399,10 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
let bgColor = defaults.float(forKey: "BackgroundColor");
rtabmap!.setBackgroundColor(gray: bgColor);
let format = defaults.string(forKey: "ExportPointCloudFormat")!;
DispatchQueue.main.async {
self.statusLabel.textColor = bgColor>=0.6 ? UIColor(white: 0.0, alpha: 1) : UIColor(white: 1.0, alpha: 1)
self.exportOBJPLYButton.setTitle("Export OBJ-\(format == "las" ? "LAS" : "PLY")", for: .normal)
}
rtabmap!.setClusterRatio(value: defaults.float(forKey: "NoiseFilteringRatio"));
@@ -1409,22 +1431,24 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
rtabmap!.postExportation(visualize: false)
}
let alertController = UIAlertController(title: "Append Mode", message: "The camera preview will not be aligned to map on start, move to a previously scanned area, then push Record. When a loop closure is detected, new scans will be appended to map.", preferredStyle: .alert)
if(!mDataRecording) {
let alertController = UIAlertController(title: "Append Mode", message: "The camera preview will not be aligned to map on start, move to a previously scanned area, then push Record. When a loop closure is detected, new scans will be appended to map.", preferredStyle: .alert)
let okAction = UIAlertAction(title: "OK", style: .default) { (action) in
let okAction = UIAlertAction(title: "OK", style: .default) { (action) in
}
alertController.addAction(okAction)
present(alertController, animated: true)
}
alertController.addAction(okAction)
present(alertController, animated: true)
setGLCamera(type: 0);
startCamera();
}
func newScan()
func newScan(dataRecordingMode: Bool = false)
{
print("databases.size() = \(databases.size())")
if(databases.count >= 5 && !mReviewRequested && self.depthSupported)
if(databases.count >= 10 && !mReviewRequested && self.depthSupported)
{
SKStoreReviewController.requestReviewInCurrentScene()
mReviewRequested = true
@@ -1438,7 +1462,6 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
mMapNodes = 0;
self.openedDatabasePath = nil
let tmpDatabase = self.getDocumentDirectory().appendingPathComponent(self.RTABMAP_TMP_DB)
let inMemory = UserDefaults.standard.bool(forKey: "DatabaseInMemory")
if(!(self.mState == State.STATE_CAMERA || self.mState == State.STATE_MAPPING) &&
FileManager.default.fileExists(atPath: tmpDatabase.path) &&
tmpDatabase.fileSize > 1024*1024) // > 1MB
@@ -1454,7 +1477,7 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
catch {
print("Could not clear tmp database: \(error)")
}
self.newScan()
self.newScan(dataRecordingMode: dataRecordingMode)
}
alert.addAction(alertActionNo)
let alertActionCancel = UIAlertAction(title: "Cancel", style: .cancel) {
@@ -1545,10 +1568,25 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
}
else
{
let inMemory = UserDefaults.standard.bool(forKey: "DatabaseInMemory") && !dataRecordingMode
mDataRecording = dataRecordingMode
self.rtabmap!.setDataRecorderMode(enabled: dataRecordingMode)
self.optimizedGraphShown = true // Always reset to true when opening a database
self.rtabmap!.openDatabase(databasePath: tmpDatabase.path, databaseInMemory: inMemory, optimize: false, clearDatabase: true)
if(!(self.mState == State.STATE_CAMERA || self.mState == State.STATE_MAPPING))
{
if(mDataRecording) {
let alertController = UIAlertController(title: "Data Recording Mode", message: "This mode should be only used if you want to record raw ARKit data as long as possible without any feedback: loop closure detection and map rendering are disabled. The database size in Debug display shows how much data has been recorded so far.", preferredStyle: .alert)
let okAction = UIAlertAction(title: "OK", style: .default) { (action) in
}
alertController.addAction(okAction)
present(alertController, animated: true)
self.debugShown = true
}
self.setGLCamera(type: 0);
self.startCamera();
}
@@ -1575,6 +1613,9 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
alert.addAction(yes)
let no = UIAlertAction(title: "No", style: .cancel) {
(UIAlertAction) -> Void in
if(self.mDataRecording) {
self.save() // We cannot skip saving after data recording
}
}
alert.addAction(no)
@@ -1583,10 +1624,17 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
self.saveDatabase(fileName: fileName);
}
}
else
{
self.save()
}
}
//Step : 3
var placeholder = Date().getFormattedDate(format: "yyMMdd-HHmmss")
if(mDataRecording) {
placeholder += "-recording"
}
if self.openedDatabasePath != nil && !self.openedDatabasePath!.path.isEmpty
{
var components = self.openedDatabasePath!.lastPathComponent.components(separatedBy: ".")
@@ -1604,7 +1652,9 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
//Step : 4
alert.addAction(save)
//Cancel action
alert.addAction(UIAlertAction(title: "Cancel", style: .default) { (alertAction) in })
if(!mDataRecording) {
alert.addAction(UIAlertAction(title: "Cancel", style: .default) { (alertAction) in })
}
self.present(alert, animated: true) {
alert.textFields?.first?.selectAll(nil)
@@ -1649,7 +1699,7 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
print("Could not clear tmp database: \(error)")
}
self.updateDatabases()
self.updateState(state: previousState)
self.updateState(state: self.mDataRecording ? .STATE_WELCOME : previousState)
})
}
@@ -1854,6 +1904,10 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
locationManager?.stopUpdatingLocation()
rtabmap?.setPausedMapping(paused: true)
rtabmap?.stopCamera()
if(mDataRecording) {
// this will show the trajectory before saving
self.rtabmap!.setGraphOptimization(enabled: false)
}
setGLCamera(type: 2)
if(mState == .STATE_VISUALIZING_CAMERA)
{
@@ -1863,34 +1917,42 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
if !ignoreSaving
{
dismiss(animated: true, completion: {
var msg = "Do you want to do standard graph optimization and make a nice assembled mesh now? This can be also done later using \"Optimize\" and \"Assemble\" menus."
let depthUsed = self.depthSupported && UserDefaults.standard.bool(forKey: "LidarMode")
if !depthUsed
{
msg = "Do you want to do standard graph optimization now? This can be also done later using \"Optimize\" menu."
}
let alert = UIAlertController(title: "Mapping Stopped! Optimize Now?", message: msg, preferredStyle: .alert)
if depthUsed {
let alertActionOnlyGraph = UIAlertAction(title: "Only Optimize", style: .default)
if(mDataRecording)
{
// Go directly to save
self.save()
}
else
{
dismiss(animated: true, completion: {
var msg = "Do you want to do standard graph optimization and make a nice assembled mesh now? This can be also done later using \"Optimize\" and \"Assemble\" menus."
let depthUsed = self.depthSupported && UserDefaults.standard.bool(forKey: "LidarMode")
if !depthUsed
{
(UIAlertAction) -> Void in
self.optimization(withStandardMeshExport: false, approach: -1)
msg = "Do you want to do standard graph optimization now? This can be also done later using \"Optimize\" menu."
}
alert.addAction(alertActionOnlyGraph)
}
let alertActionNo = UIAlertAction(title: "Save First", style: .cancel) {
(UIAlertAction) -> Void in
self.save()
}
alert.addAction(alertActionNo)
let alertActionYes = UIAlertAction(title: "Yes", style: .default) {
(UIAlertAction) -> Void in
self.optimization(withStandardMeshExport: depthUsed, approach: -1)
}
alert.addAction(alertActionYes)
self.present(alert, animated: true, completion: nil)
})
let alert = UIAlertController(title: "Mapping Stopped! Optimize Now?", message: msg, preferredStyle: .alert)
if depthUsed {
let alertActionOnlyGraph = UIAlertAction(title: "Only Optimize", style: .default)
{
(UIAlertAction) -> Void in
self.optimization(withStandardMeshExport: false, approach: -1)
}
alert.addAction(alertActionOnlyGraph)
}
let alertActionNo = UIAlertAction(title: "Save First", style: .cancel) {
(UIAlertAction) -> Void in
self.save()
}
alert.addAction(alertActionNo)
let alertActionYes = UIAlertAction(title: "Yes", style: .default) {
(UIAlertAction) -> Void in
self.optimization(withStandardMeshExport: depthUsed, approach: -1)
}
alert.addAction(alertActionYes)
self.present(alert, animated: true, completion: nil)
})
}
}
else if(mMapNodes == 0)
{
@@ -1937,6 +1999,7 @@ class ViewController: GLKViewController, ARSessionDelegate, RTABMapObserver, UIP
updateState(state: .STATE_PROCESSING);
var status = 0
DispatchQueue.background(background: {
self.optimizedGraphShown = true // Always reset to true when opening a database
status = self.rtabmap!.openDatabase(databasePath: self.openedDatabasePath!.path, databaseInMemory: true, optimize: false, clearDatabase: false)
}, completion:{
// main thread

View File

@@ -4,17 +4,13 @@ set -euxo pipefail
# Tested on Apple Silicon Mac, with cmake 3.19.2.
mkdir Libraries
mkdir -p Libraries
cd Libraries
pwd=$(pwd)
prefix=$pwd
sysroot=iphoneos
#sysroot=iphonesimulator
# Install directory for all dependencies
mkdir -p $prefix
# openmp
# based on https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libomp.rb
#curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/openmp-11.1.0.src.tar.xz -o openmp-11.1.0.src.tar.xz
@@ -24,139 +20,231 @@ mkdir -p $prefix
#patch -p1 < arm.patch
#mkdir build
#cd build
#cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_C_FLAGS=-fembed-bitcode -DCMAKE_CXX_FLAGS=-fembed-bitcode -DCMAKE_INSTALL_PREFIX=$prefix -DLIBOMP_INSTALL_ALIASES=OFF -DLIBOMP_ENABLE_SHARED=OFF ..
#cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_INSTALL_PREFIX=$prefix -DLIBOMP_INSTALL_ALIASES=OFF -DLIBOMP_ENABLE_SHARED=OFF ..
#cmake --build . --config Release -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
#cp runtime/src/Release-iphoneos/libomp.a runtime/src/.
#cmake --build . --config Release --target install -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
# Boost
echo "wget boost..."
curl -L https://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz -o boost_1_59_0.tar.gz
tar -xzf boost_1_59_0.tar.gz
if [ ! -e $prefix/include/boost ]
then
if [ ! -e boost_1_59_0 ]
then
echo "wget boost..."
curl -L https://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz -o boost_1_59_0.tar.gz
tar -xzf boost_1_59_0.tar.gz
fi
cd boost_1_59_0
curl -L https://gist.github.com/matlabbe/0bce8feeb73a499a76afbbcc5c687221/raw/489ff2869eccd6f8d03ffb9090ef839108762741/BoostConfig.cmake.in -o BoostConfig.cmake.in
curl -L https://gist.github.com/matlabbe/0bce8feeb73a499a76afbbcc5c687221/raw/b07fe7d4e5dfe5f1d110c733e5cf660d79a26378/CMakeLists.txt -o CMakeLists.txt
mkdir build
mkdir -p build
cd build
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_C_FLAGS=-fembed-bitcode -DCMAKE_CXX_FLAGS=-fembed-bitcode -DCMAKE_INSTALL_PREFIX=$prefix ..
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_INSTALL_PREFIX=$prefix ..
cmake --build . --config Release
cmake --build . --config Release --target install
cd $pwd
#rm -r boost_1_59_0.tar.gz boost_1_59_0
fi
# eigen
echo "wget eigen..."
curl -L https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz -o 3.3.9.tar.gz
tar -xzf 3.3.9.tar.gz
if [ ! -e $prefix/include/eigen3 ]
then
if [ ! -e eigen-3.3.9 ]
then
echo "wget eigen..."
curl -L https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz -o 3.3.9.tar.gz
tar -xzf 3.3.9.tar.gz
fi
cd eigen-3.3.9
mkdir build
mkdir -p build
cd build
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_C_FLAGS=-fembed-bitcode -DCMAKE_CXX_FLAGS=-fembed-bitcode -DCMAKE_INSTALL_PREFIX=$prefix ..
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_INSTALL_PREFIX=$prefix ..
cmake --build . --config Release
cmake --build . --config Release --target install
cd $pwd
#rm -r 3.3.9.tar.gz eigen-3.3.9
fi
# FLANN
echo "wget flann..."
git clone https://github.com/flann-lib/flann.git
if [ ! -e $prefix/include/flann ]
then
if [ ! -e flann ]
then
echo "wget flann..."
git clone https://github.com/flann-lib/flann.git -b 1.8.4
fi
cd flann
git checkout 1.8.4
curl -L https://gist.githubusercontent.com/matlabbe/c858ba36fb85d5e44d8667dfb3543e12/raw/8fc40aa9bc3267604869444020476a49f14ab424/flann_ios.patch -o flann_ios.patch
git apply flann_ios.patch
mkdir build
if [ ! -e flann_ios.patch ]
then
curl -L https://gist.githubusercontent.com/matlabbe/c858ba36fb85d5e44d8667dfb3543e12/raw/8fc40aa9bc3267604869444020476a49f14ab424/flann_ios.patch -o flann_ios.patch
git apply flann_ios.patch
fi
mkdir -p build
cd build
# comment "add_subdirectory( test )" in top CMakeLists.txt
# comment "add_subdirectory( doc )" in top CMakeLists.txt
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_C_FLAGS=-fembed-bitcode -DCMAKE_CXX_FLAGS=-fembed-bitcode -DCMAKE_INSTALL_PREFIX=$prefix -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_MATLAB_BINDINGS=OFF -DBUILD_C_BINDINGS=OFF ..
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_INSTALL_PREFIX=$prefix -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_MATLAB_BINDINGS=OFF -DBUILD_C_BINDINGS=OFF ..
cmake --build . --config Release -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
cmake --build . --config Release --target install -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
cd $pwd
#rm -r flann
fi
# GTSAM
git clone https://bitbucket.org/gtborg/gtsam.git
cd gtsam
git checkout fbb9d3bdda8b88df51896bc401bfd170573e66f5
if [ ! -e $prefix/include/gtsam ]
then
if [ ! -e gtsam ]
then
git clone https://bitbucket.org/gtborg/gtsam.git
cd gtsam
git checkout fbb9d3bdda8b88df51896bc401bfd170573e66f5
else
cd gtsam
fi
# patch
curl -L https://gist.github.com/matlabbe/76d658dddb841b3355ae3a6e32850cd8/raw/7033cba1c89097b0c830651d7277c04dc92cbdd9/gtsam_GKlib_ios_fix.patch -o gtsam_GKlib_ios_fix.patch
git apply gtsam_GKlib_ios_fix.patch
mkdir build
if [ ! -e gtsam_GKlib_ios_fix.patch ]
then
curl -L https://gist.github.com/matlabbe/76d658dddb841b3355ae3a6e32850cd8/raw/7033cba1c89097b0c830651d7277c04dc92cbdd9/gtsam_GKlib_ios_fix.patch -o gtsam_GKlib_ios_fix.patch
git apply gtsam_GKlib_ios_fix.patch
fi
mkdir -p build
cd build
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_C_FLAGS=-fembed-bitcode -DCMAKE_CXX_FLAGS=-fembed-bitcode -DCMAKE_INSTALL_PREFIX=$prefix -DMETIS_SHARED=OFF -DGTSAM_BUILD_STATIC_LIBRARY=ON -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON -DGTSAM_WRAP_SERIALIZATION=OFF -DGTSAM_BUILD_WRAP=OFF -DGTSAM_INSTALL_CPPUNITLITE=OFF -DCMAKE_FIND_ROOT_PATH=$prefix ..
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_INSTALL_PREFIX=$prefix -DMETIS_SHARED=OFF -DGTSAM_BUILD_STATIC_LIBRARY=ON -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON -DGTSAM_WRAP_SERIALIZATION=OFF -DGTSAM_BUILD_WRAP=OFF -DGTSAM_INSTALL_CPPUNITLITE=OFF -DCMAKE_FIND_ROOT_PATH=$prefix ..
cmake --build . --config Release -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
cmake --build . --config Release --target install -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
cd $pwd
#rm -rf gtsam
fi
# g2o
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
git checkout a3f7706bdbb849b2808dc3e1b7aee189f63b498e
if [ ! -e $prefix/include/g2o ]
then
if [ ! -e g2o ]
then
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
git checkout a3f7706bdbb849b2808dc3e1b7aee189f63b498e
else
cd g2o
fi
# patch
curl -L https://gist.github.com/matlabbe/b9ccfeae8f0744b275cab23510872680/raw/a58e06accba3976420d4b61341685c123193810e/g2o_ios_fix.patch -o g2o_ios_fix.patch
git apply g2o_ios_fix.patch
mkdir build
if [ ! -e g2o_ios_fix.patch ]
then
curl -L https://gist.github.com/matlabbe/b9ccfeae8f0744b275cab23510872680/raw/a58e06accba3976420d4b61341685c123193810e/g2o_ios_fix.patch -o g2o_ios_fix.patch
git apply g2o_ios_fix.patch
fi
mkdir -p build
cd build
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_C_FLAGS=-fembed-bitcode -DCMAKE_CXX_FLAGS=-fembed-bitcode -DCMAKE_INSTALL_PREFIX=$prefix -DBUILD_LGPL_SHARED_LIBS=OFF -DG2O_BUILD_APPS=OFF -DG2O_BUILD_EXAMPLES=OFF -DCMAKE_FIND_ROOT_PATH=$prefix ..
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_INSTALL_PREFIX=$prefix -DBUILD_LGPL_SHARED_LIBS=OFF -DG2O_BUILD_APPS=OFF -DG2O_BUILD_EXAMPLES=OFF -DCMAKE_FIND_ROOT_PATH=$prefix ..
cmake --build . --config Release -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
cmake --build . --config Release --target install -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
cd $pwd
#rm -rf g2o
fi
# VTK
git clone https://github.com/Kitware/VTK.git
cd VTK
git checkout tags/v8.2.0
if [ ! -e $prefix/lib/vtk.framework ]
then
if [ ! -e VTK ]
then
git clone https://github.com/Kitware/VTK.git
cd VTK
git checkout tags/v8.2.0
else
cd VTK
fi
git cherry-pick bf3ae8072df2393c7270509bae41be0776826346
mkdir build
mkdir -p build
cd build
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=""
cmake --build . --config Release
cd $pwd
#rm -rf VTK
fi
# PCL
git clone https://github.com/PointCloudLibrary/pcl.git
cd pcl
git checkout tags/pcl-1.11.1
if [ ! -e $prefix/include/pcl-1.11 ]
then
if [ ! -e pcl ]
then
git clone https://github.com/PointCloudLibrary/pcl.git
cd pcl
git checkout tags/pcl-1.11.1
else
cd pcl
fi
# 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
git apply pcl_1_11_1_vtk_ios_support.patch
mkdir build
if [ ! -e pcl_1_11_1_vtk_ios_support.patch ]
then
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
fi
mkdir -p build
cd build
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_C_FLAGS=-fembed-bitcode -DCMAKE_CXX_FLAGS=-fembed-bitcode -DCMAKE_INSTALL_PREFIX=$prefix -DBUILD_apps=OFF -DBUILD_examples=OFF -DBUILD_tools=OFF -DBUILD_visualization=OFF -DBUILD_tracking=OFF -DBUILD_people=OFF -DBUILD_global_tests=OFF -DWITH_QT=OFF -DWITH_OPENGL=OFF -DWITH_VTK=ON -DPCL_SHARED_LIBS=OFF -DCMAKE_FIND_ROOT_PATH=$prefix ..
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_INSTALL_PREFIX=$prefix -DBUILD_apps=OFF -DBUILD_examples=OFF -DBUILD_tools=OFF -DBUILD_visualization=OFF -DBUILD_tracking=OFF -DBUILD_people=OFF -DBUILD_global_tests=OFF -DWITH_QT=OFF -DWITH_OPENGL=OFF -DWITH_VTK=ON -DPCL_SHARED_LIBS=OFF -DPCL_ENABLE_SSE=OFF -DCMAKE_FIND_ROOT_PATH=$prefix ..
cmake --build . --config Release
cmake --build . --config Release --target install
cd $pwd
#rm -rf pcl
fi
# OpenCV
git clone https://github.com/opencv/opencv_contrib.git
cd opencv_contrib
git checkout tags/3.4.2
if [ ! -e $prefix/include/opencv2 ]
then
if [ ! -e opencv_contrib ]
then
git clone https://github.com/opencv/opencv_contrib.git
cd opencv_contrib
git checkout tags/3.4.2
fi
cd $pwd
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout tags/3.4.2
curl -L https://gist.githubusercontent.com/matlabbe/fdc3ab4854f3a68fbde7277f543b4e5b/raw/f340839c09165056d3845645df24b76507542fd2/opencv_ios.patch -o opencv_ios.patch
git apply opencv_ios.patch
mkdir build
if [ ! -e opencv ]
then
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout tags/3.4.2
else
cd opencv
fi
if [ ! -e opencv_ios.patch ]
then
curl -L https://gist.githubusercontent.com/matlabbe/fdc3ab4854f3a68fbde7277f543b4e5b/raw/f340839c09165056d3845645df24b76507542fd2/opencv_ios.patch -o opencv_ios.patch
git apply opencv_ios.patch
fi
mkdir -p build
cd build
# add "add_definitions(-DPNG_ARM_NEON_OPT=0)" in 3rdparty/libpng/CMakeLists.txt
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_C_FLAGS=-fembed-bitcode -DCMAKE_CXX_FLAGS=-fembed-bitcode -DCMAKE_INSTALL_PREFIX=$prefix -DOPENCV_EXTRA_MODULES_PATH=$prefix/opencv_contrib/modules -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DWITH_CUDA=OFF -DBUILD_opencv_apps=OFF -DBUILD_opencv_xobjdetect=OFF -DBUILD_opencv_stereo=OFF ..
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_INSTALL_PREFIX=$prefix -DOPENCV_EXTRA_MODULES_PATH=$prefix/opencv_contrib/modules -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DWITH_CUDA=OFF -DBUILD_opencv_apps=OFF -DBUILD_opencv_xobjdetect=OFF -DBUILD_opencv_stereo=OFF ..
cmake --build . --config Release
cmake --build . --config Release --target install
cd $pwd
#rm -rf opencv opencv_contrib
fi
mkdir rtabmap
# LAS
if [ ! -e $prefix/include/liblas ]
then
if [ ! -e libLAS ]
then
git clone https://github.com/libLAS/libLAS.git
fi
cd libLAS
sed -i '' 's/SHARED/STATIC/g' src/CMakeLists.txt
mkdir -p build
cd build
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_FIND_ROOT_PATH=$prefix -DWITH_UTILITIES=OFF -DWITH_TESTS=OFF -DWITH_GEOTIFF=OFF ..
cmake --build . --config Release -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
cmake --build . --config Release --target install -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
cd $pwd
fi
mkdir -p rtabmap
cd rtabmap
cmake -DANDROID_PREBUILD=ON ../../../../..
cmake --build . --config Release
mkdir ios
mkdir -p ios
cd ios
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_C_FLAGS=-fembed-bitcode -DCMAKE_CXX_FLAGS=-fembed-bitcode -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_FIND_ROOT_PATH=$prefix -DWITH_QT=OFF -DBUILD_APP=OFF -DBUILD_TOOLS=OFF -DWITH_TORO=OFF -DWITH_VERTIGO=OFF -DWITH_MADGWICK=OFF -DWITH_ORB_OCTREE=OFF -DBUILD_EXAMPLES=OFF ../../../../../..
cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_SYSROOT=$sysroot -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_FIND_ROOT_PATH=$prefix -DWITH_QT=OFF -DBUILD_APP=OFF -DBUILD_TOOLS=OFF -DWITH_TORO=OFF -DWITH_VERTIGO=OFF -DWITH_MADGWICK=OFF -DWITH_ORB_OCTREE=OFF -DBUILD_EXAMPLES=OFF -DWITH_LIBLAS=ON ../../../../../..
cmake --build . --config Release
cmake --build . --config Release --target install

View File

@@ -346,6 +346,32 @@
<integer>0</integer>
</array>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>FooterText</key>
<string>The format of exported point cloud data.</string>
</dict>
<dict>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Title</key>
<string>Export Point Cloud Format</string>
<key>Key</key>
<string>ExportPointCloudFormat</string>
<key>DefaultValue</key>
<string>ply</string>
<key>Titles</key>
<array>
<string>PLY</string>
<string>LAS</string>
</array>
<key>Values</key>
<array>
<string>ply</string>
<string>las</string>
</array>
</dict>
</array>
</dict>
</plist>

View File

@@ -13,7 +13,7 @@
<string>
======= RTAB-Map =======
RTAB-Map - https://github.com/introlab/rtabmap
Copyright (c) 2010-2023, Mathieu Labbe - IntRoLab - Universite de Sherbrooke, all rights reserved.
Copyright (c) 2010-2024, Mathieu Labbe - IntRoLab - Universite de Sherbrooke, all rights reserved.
Copyright (c) XXX, contributors, all rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -165,6 +165,53 @@ 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.
======= libLAS =======
Copyright (c) 2007, Martin Isenburg, isenburg at cs.unc.edu
Copyright (c) 2008, Howard Butler, hobu.inc at gmail.com
Copyright (c) 2008, Mateusz Loskot, mateusz at loskot.net
Copyright (c) 2008, Phil Vachon, philippe at cowpig.ca
Copyright (c) 2008, Frank Warmerdam, warmerdam at pobox.com
Copyright (c) 2008, Martin Rodriguez, mrodriguez at stereocarto.com
Copyright (c) 2016, Oscar Martinez Rubi o.rubi at esciencecenter.nl
Copyright (c) 2016, Romulo Goncalves r.goncalves at esciencecenter.nl
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 Martin Isenburg or Iowa Department
of Natural Resources 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 OWNER 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.
</string>
</dict>

View File

@@ -54,6 +54,34 @@
<key>DefaultValue</key>
<true/>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>FooterText</key>
<string>Choosing between high and low depth confidence depends on the application. If precise geometry is critical, prioritize high depth confidence even if it means fewer points. If you need a dense point cloud for analysis, even in areas with weak LiDAR signal, a lower depth confidence might be suitable at the cost of highly interpolated points (that could give a wavy look of some surfaces). Important: the points with too low confidence are not saved in the db file, so we cannot recover or filter these points in post-processing.</string>
</dict>
<dict>
<key>DefaultValue</key>
<integer>2</integer>
<key>Key</key>
<string>DepthConfidence</string>
<key>Title</key>
<string>Depth Confidence</string>
<key>Titles</key>
<array>
<string>High</string>
<string>Medium</string>
<string>Low</string>
</array>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Values</key>
<array>
<integer>2</integer>
<integer>1</integer>
<integer>0</integer>
</array>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
@@ -70,6 +98,48 @@
<key>DefaultValue</key>
<false/>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>FooterText</key>
<string>Filter ARKit&apos;s re-localization events to avoid jumps in odometry when creating a map with RTAB-Map, which would cause large drift errors that are difficult to correct. Set an acceleration threshold to detect those events.</string>
</dict>
<dict>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Title</key>
<string>ARKit Re-Localization Acceleration Threshold</string>
<key>Key</key>
<string>UpstreamRelocalizationFilteringAccThr</string>
<key>DefaultValue</key>
<string>58.8399</string>
<key>Titles</key>
<array>
<string>Disabled</string>
<string>10 g</string>
<string>9 g</string>
<string>8 g</string>
<string>7 g</string>
<string>6 g</string>
<string>5 g</string>
<string>4 g</string>
<string>3 g</string>
<string>2 g</string>
</array>
<key>Values</key>
<array>
<string>0</string>
<string>98.0665</string>
<string>88.25985</string>
<string>78.4532</string>
<string>68.64655</string>
<string>58.8399</string>
<string>49.03325</string>
<string>39.2266</string>
<string>29.41995</string>
<string>19.6133</string>
</array>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
@@ -368,7 +438,7 @@
<key>Key</key>
<string>MaxOptimizationError</string>
<key>DefaultValue</key>
<integer>1</integer>
<integer>2</integer>
<key>Titles</key>
<array>
<string>4x</string>
@@ -600,13 +670,13 @@
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>FooterText</key>
<string>ArUco markers can be detected for localization and graph optimization.</string>
<string>ArUco or AprilTag markers can be detected for localization and graph optimization. Marker number should be &gt;0.</string>
</dict>
<dict>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Title</key>
<string>ArUco Marker Detection</string>
<string>ArUco/AprilTag Marker Detection</string>
<key>Key</key>
<string>ArUcoMarkerDetection</string>
<key>DefaultValue</key>
@@ -772,7 +842,7 @@
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>FooterText</key>
<string>The database is kept in RAM for fast access. Set to false to reduce RAM used at the cost of slower access. This parameter is applied on reset or when a database is opened.</string>
<string>The database is kept in RAM for fast access. Set to false to reduce RAM used at the cost of slower access. This parameter is applied on reset or when a database is opened. Important: if enabled, the database cannot be recovered in case of the App crashes for some reason (e.g., low battery).</string>
</dict>
<dict>
<key>Type</key>

View File

@@ -6,7 +6,7 @@
<array>
<dict>
<key>FooterText</key>
<string>Decrease density to reduce rendering time and memory. Tip: To apply a different density to current map: save the map, change density and re-open the same map to regenerate the point clouds at this density. Points over the maximum depth, under minimum depth or under the depth confidence are not rendered.</string>
<string>Decrease density to reduce rendering time and memory. Points over the maximum depth or under minimum depth are not rendered. In all cases, the raw data is still saved in the db file, meaning that the the point cloud can be regenerated differently by changing these settings and by re-opening the scan in the Library.</string>
<key>Title</key>
<string>Rendering</string>
<key>Type</key>
@@ -106,28 +106,6 @@
<real>3</real>
</array>
</dict>
<dict>
<key>DefaultValue</key>
<integer>2</integer>
<key>Key</key>
<string>DepthConfidence</string>
<key>Title</key>
<string>Depth Confidence</string>
<key>Titles</key>
<array>
<string>High</string>
<string>Medium</string>
<string>Low</string>
</array>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Values</key>
<array>
<integer>2</integer>
<integer>1</integer>
<integer>0</integer>
</array>
</dict>
<dict>
<key>FooterText</key>
<string>Increase minimum polygon angle to force scanning perpendicular to surfaces. Set a decimation factor to reduce the number of polygons. The higher the factor, the less polygons will remain. Note that the decimation factor is done after decreasing point cloud density. Decimation factor and texture resolution don't affect post-processing.</string>
@@ -454,7 +432,7 @@
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2010-2023, Mathieu Labbe - IntRoLab - Université de Sherbrooke. All rights reserved.</string>
<string>Copyright (c) 2010-2024, Mathieu Labbe - IntRoLab - Université de Sherbrooke. All rights reserved.</string>
<key>Title</key>
<string>About</string>
<key>Type</key>
@@ -462,7 +440,7 @@
</dict>
<dict>
<key>DefaultValue</key>
<string>0.21.0</string>
<string>0.21.8</string>
<key>Key</key>
<string>Version</string>
<key>Title</key>

View File

@@ -65,14 +65,17 @@ ENDIF(APPLE AND BUILD_AS_BUNDLE)
IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
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(openni2_dest_dir bin)
SET(thirdparty_dest_dir bin)
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(openni2_dest_dir MacOS)
SET(thirdparty_dest_dir MacOS)
SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
ENDIF(APPLE)
@@ -89,11 +92,11 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
ENDIF()
INSTALL(DIRECTORY "${OpenNI2_BIN_DIR}/OpenNI2"
DESTINATION ${openni2_dest_dir}
DESTINATION ${thirdparty_dest_dir}
COMPONENT runtime
REGEX ".*pdb" EXCLUDE)
INSTALL(FILES "${OpenNI2_BIN_DIR}/OpenNI.ini"
DESTINATION ${openni2_dest_dir}
DESTINATION ${thirdparty_dest_dir}
COMPONENT runtime)
ENDIF(OpenNI2_FOUND)
@@ -102,7 +105,7 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
IF(WIN32)
file(TO_CMAKE_PATH "$ENV{K4A_ROOT_DIR}" ENV_K4A_ROOT_DIR)
INSTALL(FILES "${ENV_K4A_ROOT_DIR}/tools/depthengine_2_0.dll"
DESTINATION ${plugin_dest_dir}
DESTINATION ${thirdparty_dest_dir}
COMPONENT runtime)
ENDIF(WIN32)
ENDIF(k4a_FOUND)
@@ -117,7 +120,7 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
MESSAGE(STATUS "Found ${CUDNN_OPS_DLL}")
MESSAGE(STATUS "Found ${CUDNN_CNN_DLL}")
INSTALL(FILES ${CUDNN_OPS_DLL} ${CUDNN_CNN_DLL}
DESTINATION ${plugin_dest_dir}
DESTINATION ${thirdparty_dest_dir}
COMPONENT runtime)
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.")
@@ -135,75 +138,87 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
include(\"${QT_DEPLOY_SUPPORT}\")
qt_deploy_runtime_dependencies(
EXECUTABLE \"${APPS}\"
PLUGINS_DIR ${plugin_dest_dir}
GENERATE_QT_CONF
NO_TRANSLATIONS
VERBOSE
PLUGINS_DIR ${plugin_dest_dir}/plugins
)")
IF("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/deploy_appDebug.cmake"
CONFIGURATIONS Debug
COMPONENT runtime)
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/deploy_appRelease.cmake"
CONFIGURATIONS Release
COMPONENT runtime)
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/deploy_appRelWithDebInfo.cmake"
CONFIGURATIONS RelWithDebInfo
COMPONENT runtime)
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/deploy_appMinSizeRel.cmake"
CONFIGURATIONS MinSizeRel
COMPONENT runtime)
CONFIGURATIONS Debug
COMPONENT runtime)
ENDIF()
IF("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
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}/plugins${plugin_type}\"")
INSTALL(FILES ${plugin_loc}
DESTINATION ${plugin_dest_dir}/plugins${plugin_type}
COMPONENT runtime)
endforeach()
IF(NOT Qt5Widgets_VERSION VERSION_LESS 5.10.0)
IF(WIN32)
SET(plugin_loc "${plugin_root}/styles/qwindowsvistastyle.dll")
ELSEIF(APPLE)
SET(plugin_loc "${plugin_root}/styles/libqmacstyle.dylib")
ENDIF()
IF(EXISTS ${plugin_loc})
get_filename_component(plugin_dir ${plugin_loc} DIRECTORY)
string(REPLACE "plugins" ";" loc_list ${plugin_dir})
list(GET loc_list 1 plugin_type)
INSTALL(FILES ${plugin_loc}
DESTINATION ${plugin_dest_dir}/plugins${plugin_type}
COMPONENT runtime)
#MESSAGE(STATUS "Qt5 plugin \"${plugin_loc}\" installed in \"${plugin_dest_dir}/plugins${plugin_type}\"")
ENDIF(EXISTS ${plugin_loc})
ENDIF(NOT Qt5Widgets_VERSION VERSION_LESS 5.10.0)
#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)
endforeach()
IF(NOT Qt5Widgets_VERSION VERSION_LESS 5.10.0)
IF(WIN32)
SET(plugin_loc "${plugin_root}/styles/qwindowsvistastyle.dll")
ELSEIF(APPLE)
SET(plugin_loc "${plugin_root}/styles/libqmacstyle.dylib")
ENDIF()
IF(EXISTS ${plugin_loc})
get_filename_component(plugin_dir ${plugin_loc} DIRECTORY)
string(REPLACE "plugins" ";" loc_list ${plugin_dir})
list(GET loc_list 1 plugin_type)
INSTALL(FILES ${plugin_loc}
DESTINATION ${plugin_dest_dir}/plugins${plugin_type}
COMPONENT runtime)
#MESSAGE(STATUS "Qt5 plugin \"${plugin_loc}\" installed in \"${plugin_dest_dir}${plugin_type}\"")
ENDIF(EXISTS ${plugin_loc})
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}/plugins
COMPONENT runtime
REGEX ".*d4.dll" EXCLUDE
REGEX ".*d4.a" EXCLUDE)
# 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()
# install a qt.conf file
# this inserts some cmake code into the install script to write the file
SET(QT_CONF_FILE [Paths]\nPlugins=plugins)
IF(APPLE)
SET(QT_CONF_FILE [Paths]\nPlugins=MacOS/plugins)
ENDIF(APPLE)
INSTALL(CODE "
file(WRITE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"${QT_CONF_FILE}\")
" COMPONENT runtime)
IF(Qt5_FOUND OR QT4_FOUND)
# install a qt.conf file
# this inserts some cmake code into the install script to write the file
SET(QT_CONF_FILE [Paths]\nPlugins=plugins)
IF(APPLE)
SET(QT_CONF_FILE [Paths]\nPlugins=MacOS/plugins)
ENDIF(APPLE)
INSTALL(CODE "
file(WRITE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"${QT_CONF_FILE}\")
" COMPONENT runtime)
ENDIF()
# directories to look for dependencies
SET(DIRS ${QT_LIBRARY_DIRS} ${PROJECT_BINARY_DIR}/bin)
SET(DIRS "${QT_LIBRARY_DIRS}" "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib")
IF(APPLE)
SET(DIRS ${DIRS} /usr/local /usr/local/lib /opt/homebrew /opt/homebrew/lib /opt/homebrew/lib/gcc/current)
ENDIF(APPLE)
@@ -215,10 +230,11 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
# over.
# To find dependencies, cmake use "otool" on Apple and "dumpbin" on Windows (make sure you have one of them).
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)
include(\"BundleUtilities\")
fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
" COMPONENT runtime)
ENDIF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))

View File

@@ -55,9 +55,6 @@ int main(int argc, char* argv[])
CoInitialize(nullptr);
#endif
#if VTK_MAJOR_VERSION >= 8 && defined(BUILD_AS_BUNDLE)
vtkObject::GlobalWarningDisplayOff();
#endif
#if VTK_MAJOR_VERSION > 9 || (VTK_MAJOR_VERSION==9 && VTK_MINOR_VERSION >= 1)
// needed to ensure appropriate OpenGL context is created for VTK rendering.
QSurfaceFormat::setDefaultFormat(QVTKRenderWidget::defaultFormat());

View File

@@ -1,86 +0,0 @@
SignatureID WordsID...
-1 4 5 21 22 24 31 32 33 35 46 48 49 58 60 63 72 73 78 83 84 103 105 114 120 124 133 136 141 162 179 182 188 189 202 204 211 217 218 227 232 241 247 249 260 268 271 287 289 301 304 318 320 324 338 340 345 346 349 358 366 368 370 371 381 395 407 408 414 415 416 424 439 442 447 502 504 508 509 527 539 540 550 553 558 568 572 583 588 598 606 617 624 625 638 652 653 667 674 693 694 699 702 738 755 770 782 784 793 816 818 819 832 836 842 846 847 858 867 868 923 939 954 955 965 987 1027 1030 1034 1083 1087 1097 1098 1177 1187 1199 1200 1214 1241 1258 1259 1270 1303 1339 1351 1388 1451 1501 1515 1526 1630 1679 1680 1771 1841 1868 2014 2243 2400 2494 2591 2957 3075 3079 3194
1 1 2 2 3 4 4 4 5 6 7 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 24 24 25 26 27 28 29 30 31 31 32 33 34 34 35 35 36 37 38 39 40 41 42 43 44 44 45 46 47 48 49 49 50 51 52 53 53 54 55 56 57 58 59 59 60 60 60 61 62 63 64 65 66 67 68 69 70 70 71 72 73 74 75 76 77 78 79 80 81 82 83 83 83 84 85 86 86 87 88 89 90 91 92 93 94 95 96 97 98 99 99 100 101 102 103 104
2 4 4 4 4 4 4 5 7 7 7 12 14 18 19 21 22 26 28 29 29 31 32 33 35 37 48 49 49 51 51 53 54 55 56 56 57 58 58 59 60 60 60 63 65 66 67 70 73 75 77 77 77 78 78 82 84 84 84 84 92 94 94 96 96 99 103 105 105 106 107 108 109 110 111 112 113 114 115 116 116 117 118 118 119 120 120 121 122 123 124 125 126 127 128 129 130 131 132 133 133 133 134 135 136 137 138 139 140 141 141 142 143 144 145 146 147 148 149 150 151 151 152 152 153 154 155 156 156 157 158 159 160 161 161 162 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 189 189 190 191 192 193 194 195 196 197 198 199 200 201 202 202 203 204 204 205
3 4 4 5 12 12 19 21 22 23 28 28 29 32 32 33 33 44 46 48 48 49 52 53 55 56 58 59 60 60 65 65 67 71 72 72 73 78 84 96 96 97 103 105 105 123 124 124 133 136 136 136 139 139 141 141 141 142 143 144 148 162 167 167 182 188 189 189 202 206 207 208 209 210 210 211 212 213 214 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 247 248 249 249 250 251 252 253 254 255 255 256 257 258 259 260 261 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 287 288 289 290 291 292 293 294 295 296 296 297 298 298 299 300 301 302 303 303 304 305 306 306 307 307 308 309 310 311
4 4 5 18 21 21 22 24 24 32 33 35 42 44 46 46 46 46 49 65 67 68 68 70 70 72 72 72 83 84 95 96 96 103 120 130 135 136 136 136 136 139 142 143 143 153 156 162 177 179 179 182 189 189 189 189 189 189 202 202 204 217 217 218 218 227 227 228 228 230 230 232 246 247 249 249 255 268 271 271 275 276 276 284 287 290 312 313 314 315 316 317 318 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 338 339 340 341 342 343 344 345 346 347 348 349 349 350 351 352 352 353 354 354 355 356 357 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 408 409 410 411 412 413
5 4 5 24 25 31 32 33 42 45 45 48 48 67 70 84 105 114 120 120 120 130 133 179 189 202 202 217 217 217 217 217 217 217 217 232 268 270 271 318 324 338 345 346 349 349 354 355 356 362 366 366 407 414 414 415 416 417 418 418 419 420 421 422 423 423 424 424 425 425 426 427 428 429 429 430 431 432 433 433 434 435 436 436 437 438 439 439 440 441 442 443 444 445 446 447 448 449 450 451 451 452 453 454 455 456 457 458 459 460
6 4 4 4 4 21 22 24 24 25 31 31 31 31 31 31 32 33 45 48 64 64 72 72 72 84 95 105 114 114 114 120 122 130 136 156 189 189 189 189 189 189 202 202 208 213 217 217 217 227 232 243 271 280 287 312 320 320 320 324 324 340 345 345 358 366 366 366 366 407 414 416 416 416 416 421 423 424 426 436 439 439 439 439 439 439 442 447 457 457 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 497 498 498 499 499 500 501 501 502 502 503 504 504 505 505 506 507 508 509 510 511 512 513 514 515 516 517 518 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 536 537 537 538 539 540 541 542 543 544 545 546 547 548 549 550 550 551 552 553 554 555 556 557 558 559
7 30 31 31 31 31 32 32 32 33 33 39 46 48 53 58 58 58 78 78 182 188 218 228 236 249 304 318 318 318 318 346 358 366 368 368 408 410 414 429 431 447 447 453 453 473 499 508 527 539 550 550 553 560 561 562 563 564 565 565 566 567 568 569 570 571 572 572 573 574 575 576 577 578 578 579 580 581 582 582 583 584 585 586 587 588 588 589 590 590 591 592 593 594 595 596 597 598 599 600 601 602 603 603 604 605 606 607 607 608 609 610 611 612 613 614 614 615 616 617 617 618 619 620 621 621 622 623 624 625 625 626 627 628 629 630 631 632 632 633 634 635 636 637 638 638 639 640 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 654 655 656 657 658 658 659 660 661 661 662 663 664 665 666 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
8 24 31 31 32 33 33 33 58 78 84 217 217 237 312 312 338 338 338 340 366 366 366 442 453 453 508 519 519 527 539 565 565 566 567 568 568 568 573 575 578 581 583 588 588 590 592 597 597 598 599 603 606 611 612 613 624 626 634 638 638 647 649 652 652 652 660 663 664 684 685 686 687 688 689 690 691 692 693 694 695 696 697 697 698 699 699 700 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 729 730 731 732 733 734 735 736 737
9 4 4 4 30 31 31 33 64 72 78 84 84 84 207 217 217 217 217 217 217 217 217 217 217 217 217 237 253 257 260 271 271 271 304 318 346 366 417 442 480 503 508 519 539 550 553 553 566 578 581 583 588 590 590 594 606 607 610 612 617 621 625 634 634 638 638 638 652 653 654 657 660 664 664 688 690 691 696 697 702 702 706 706 706 708 708 711 715 723 730 732 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 793 794 795 796 797 798 799 800 801 802 803 804 804 805 806 806 807 808 809 810 811
10 4 4 4 4 4 5 21 31 31 31 32 32 32 32 53 58 58 72 72 72 72 84 178 178 189 189 202 202 207 207 217 217 217 217 218 249 249 289 320 320 368 370 384 395 407 499 502 502 504 508 522 522 523 527 536 539 548 550 550 553 553 558 558 558 563 574 583 583 588 590 602 602 608 608 624 626 638 644 646 654 664 684 693 704 706 710 711 715 750 754 755 770 770 770 774 780 780 782 782 801 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 887 888 889 890 891 891 892 893 893 894 895 896 897 898 898 899 900 901 902 903 904
11 4 4 4 32 58 58 58 63 78 114 114 120 120 189 189 189 207 217 223 223 236 243 249 249 318 338 345 345 345 346 349 431 442 502 502 504 504 509 522 527 558 568 568 573 585 588 588 590 590 591 592 594 598 598 598 602 619 619 625 644 652 664 669 678 691 697 697 702 770 770 786 794 812 812 817 817 818 818 819 824 826 832 834 839 843 846 851 853 856 856 859 860 862 865 866 872 880 905 906 907 908 909 910 911 912 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952
12 4 5 24 24 24 31 32 32 32 32 32 33 33 33 46 63 72 78 120 120 120 124 136 136 162 182 189 189 217 217 217 237 237 249 249 249 249 253 271 370 370 370 395 415 416 502 502 502 502 502 514 531 536 540 540 540 540 553 553 558 568 580 585 588 606 625 638 653 664 684 693 693 699 702 714 726 731 755 755 755 755 755 770 786 793 793 794 794 810 810 818 824 832 834 836 842 846 846 851 883 883 883 883 893 898 898 901 916 916 922 923 929 931 932 935 939 941 943 953 954 955 956 957 958 958 958 959 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1013 1014 1015
13 4 4 4 4 4 4 4 4 24 32 32 35 63 78 83 83 84 84 105 105 114 120 165 188 188 189 204 210 211 223 227 237 247 247 249 249 249 249 249 260 260 289 289 317 325 338 384 405 414 432 439 439 447 463 502 502 502 502 502 502 502 504 509 540 544 544 550 558 568 568 588 593 604 606 606 606 607 617 625 634 653 653 693 712 750 754 755 782 786 794 804 805 810 812 818 836 836 845 846 846 846 847 849 852 868 893 896 915 918 939 943 955 958 965 965 965 974 974 979 986 989 989 997 1000 1002 1016 1017 1018 1019 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086
14 4 4 11 31 31 32 32 32 32 32 33 33 46 46 48 72 72 72 72 72 78 83 95 105 120 120 120 120 120 133 193 210 210 211 211 213 217 217 217 217 218 221 237 249 270 304 320 320 324 325 326 346 349 349 356 405 405 407 424 431 431 439 442 502 502 502 502 527 537 543 544 553 553 558 572 574 579 585 588 588 598 617 625 644 662 674 693 699 742 749 751 755 755 782 836 836 842 842 842 846 851 856 858 867 916 925 943 958 961 1001 1001 1001 1032 1035 1035 1052 1060 1082 1085 1087 1088 1089 1090 1091 1092 1093 1093 1094 1095 1096 1097 1098 1098 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1107 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1140 1141 1142 1143 1144 1145 1146
15 4 4 7 32 32 32 72 72 72 83 83 84 114 114 120 120 120 120 124 147 162 202 202 218 218 218 228 249 289 298 304 320 320 320 320 324 345 366 366 370 407 412 415 424 439 500 500 502 514 522 546 546 583 585 588 644 644 653 662 668 674 684 702 706 706 782 782 793 793 794 824 836 836 847 867 883 883 901 916 955 959 965 989 1003 1022 1027 1028 1030 1034 1034 1039 1060 1087 1087 1097 1099 1099 1103 1109 1114 1114 1120 1133 1140 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1164 1165 1166 1167 1168 1169 1170 1171 1171 1172 1173 1174 1175 1175 1176 1177 1177 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213
16 4 4 32 33 114 120 370 370 381 439 506 522 527 527 568 588 598 606 606 606 622 653 693 702 706 836 867 901 916 959 964 1019 1025 1097 1097 1177 1177 1177 1192 1193 1193 1202 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234
17 2 2 4 4 4 4 4 4 4 4 4 24 24 31 31 31 31 31 45 45 68 72 72 72 73 84 182 189 189 189 202 211 211 217 217 217 217 217 217 218 218 218 218 218 271 271 271 276 346 370 370 370 370 370 370 403 415 416 527 539 539 539 550 550 550 553 553 553 553 553 553 553 558 558 558 558 558 558 558 568 568 568 606 606 607 674 674 702 738 755 769 782 782 782 787 847 858 858 858 858 867 954 955 965 1087 1087 1087 1087 1087 1087 1087 1087 1087 1087 1087 1098 1149 1219 1223 1226 1233 1235 1236 1236 1236 1237 1238 1239 1240 1241 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275
18 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 22 22 24 24 31 31 33 45 46 46 68 72 72 84 133 133 133 136 179 189 189 189 189 189 189 189 189 202 202 202 207 207 211 211 217 218 218 218 227 268 271 271 289 370 370 370 370 370 370 370 370 370 415 416 416 429 463 504 504 504 510 539 539 550 550 550 553 553 553 553 553 553 553 553 558 558 558 558 558 558 558 558 559 568 568 568 568 588 588 607 607 755 755 755 755 755 782 782 782 908 919 919 954 954 954 954 954 954 954 954 954 954 954 954 955 1087 1087 1087 1087 1087 1087 1087 1087 1087 1149 1149 1155 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1250 1258 1258 1259 1267 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303
19
20 35 46 58 58 72 73 98 105 117 120 120 133 133 133 136 141 141 156 162 182 202 204 204 209 213 260 270 289 318 337 340 358 372 373 405 496 508 540 553 553 568 583 592 653 684 699 713 738 784 786 845 858 858 867 874 885 893 1029 1034 1061 1098 1098 1098 1111 1133 1155 1187 1187 1214 1219 1228 1283 1304 1305 1306 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1319 1320 1321 1322 1323 1323 1324 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1366 1367 1368 1369 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1388 1389 1390 1391 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422
21 33 45 48 48 56 133 162 165 204 270 325 338 340 340 366 370 370 371 433 434 553 558 572 572 572 583 583 784 806 842 845 847 852 925 979 1083 1177 1181 1187 1219 1256 1256 1290 1307 1331 1333 1339 1342 1342 1345 1352 1358 1367 1369 1378 1379 1381 1392 1392 1410 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1440 1441 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1475 1476
22 4 4 4 4 4 4 4 4 21 22 32 53 67 73 95 133 133 133 133 179 182 211 217 217 218 218 219 287 310 366 414 496 502 502 502 504 527 527 539 544 550 553 572 572 622 699 706 784 793 836 842 845 845 852 867 867 867 958 965 974 980 1030 1049 1087 1087 1088 1098 1153 1181 1187 1214 1214 1219 1219 1222 1256 1271 1283 1305 1310 1315 1339 1340 1342 1342 1350 1351 1369 1370 1370 1385 1388 1395 1450 1451 1451 1451 1463 1467 1477 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567
23 4 4 4 24 72 72 84 120 120 120 133 136 189 189 210 217 217 217 217 218 236 289 304 320 320 320 320 340 346 347 349 349 508 527 539 550 553 558 563 568 592 618 693 739 782 782 782 816 835 847 867 867 867 867 867 901 923 924 1018 1024 1047 1102 1153 1177 1181 1181 1199 1235 1241 1241 1246 1256 1257 1258 1270 1303 1304 1310 1326 1340 1340 1343 1350 1351 1351 1351 1371 1395 1432 1463 1487 1488 1490 1503 1511 1512 1515 1515 1526 1544 1568 1569 1570 1571 1572 1573 1574 1575 1576 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631
24 4 21 31 32 33 72 72 73 133 189 217 218 227 243 285 320 327 338 340 346 346 366 368 368 370 370 370 370 376 416 417 424 424 430 438 504 504 537 550 550 553 558 568 572 606 606 655 684 786 842 867 867 903 903 954 965 1030 1087 1087 1098 1170 1200 1200 1214 1218 1223 1223 1228 1246 1246 1258 1258 1270 1310 1322 1336 1343 1351 1370 1370 1463 1463 1488 1492 1513 1515 1518 1533 1545 1586 1589 1594 1597 1615 1621 1623 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1643 1644 1645 1646 1646 1646 1647 1648 1649 1650 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690
25 4 4 31 32 72 72 73 73 133 217 217 217 218 271 320 403 539 550 558 702 755 858 858 867 867 903 965 1073 1237 1241 1241 1241 1256 1336 1340 1351 1351 1370 1391 1426 1462 1463 1487 1533 1558 1560 1594 1671 1680 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1707 1708 1709 1710 1711 1712
26 22 31 32 39 56 58 78 84 105 133 136 141 142 162 182 182 210 219 241 247 249 256 260 318 324 345 358 366 403 416 506 506 509 568 572 572 598 626 642 653 674 674 691 751 793 819 847 868 918 923 923 978 980 987 1039 1082 1119 1155 1182 1199 1203 1206 1303 1345 1368 1368 1388 1388 1392 1398 1406 1415 1441 1477 1521 1521 1557 1575 1630 1646 1651 1704 1713 1714 1715 1716 1717 1718 1719 1719 1720 1721 1722 1723 1724 1725 1726 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1748 1749 1750 1751 1752 1753 1754 1755 1756 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1765 1766 1767 1767 1768 1769 1770 1771 1771 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821
27 32 32 33 35 35 38 58 58 78 78 81 84 89 114 124 124 162 168 182 182 182 202 204 211 211 223 241 249 249 249 259 296 320 320 325 345 346 366 366 366 366 370 395 417 428 433 500 510 527 553 572 598 598 619 626 653 654 675 699 702 702 704 755 805 818 832 842 864 923 955 987 987 987 990 1001 1088 1200 1200 1352 1368 1388 1388 1415 1415 1515 1515 1529 1672 1680 1692 1713 1720 1722 1733 1738 1743 1747 1748 1750 1755 1759 1763 1763 1764 1765 1766 1766 1766 1768 1771 1771 1771 1771 1771 1771 1775 1776 1777 1778 1779 1779 1785 1789 1790 1793 1794 1809 1815 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1893 1894 1895 1896 1897 1898 1899 1900 1901
28 22 35 58 78 78 133 168 182 204 241 243 249 249 260 324 346 354 366 366 371 372 414 429 447 504 536 538 553 553 558 572 572 594 622 625 637 653 653 654 679 694 699 702 702 704 704 706 706 713 738 818 819 819 832 848 922 923 923 923 925 954 954 965 987 987 1034 1059 1059 1087 1087 1127 1129 1155 1165 1183 1187 1226 1241 1301 1303 1342 1374 1406 1415 1444 1509 1518 1518 1538 1630 1696 1713 1718 1722 1728 1729 1738 1753 1763 1765 1771 1771 1771 1771 1771 1774 1789 1832 1833 1836 1841 1844 1862 1873 1883 1902 1903 1904 1905 1905 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1934 1935 1936 1937 1938 1939 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980
29 4 31 31 31 33 33 58 58 78 133 133 162 179 241 249 260 346 349 370 408 429 527 568 592 621 622 624 625 652 662 699 699 704 753 816 819 819 832 832 868 923 1083 1087 1155 1174 1303 1543 1543 1680 1714 1718 1718 1738 1743 1771 1771 1800 1800 1829 1830 1833 1835 1836 1841 1844 1868 1873 1877 1884 1889 1904 1916 1936 1957 1961 1971 1976 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043
30 31 32 33 33 58 76 83 144 162 204 210 219 221 230 320 340 345 345 347 366 395 403 429 527 540 540 543 548 553 553 583 594 622 652 652 653 662 694 699 709 709 744 753 782 832 858 923 923 923 923 934 954 1003 1026 1083 1083 1088 1111 1174 1290 1303 1303 1360 1521 1630 1651 1725 1738 1763 1771 1779 1787 1788 1799 1838 1852 1856 1871 1873 1874 1883 1902 1902 1903 1915 1916 1930 1931 1941 1961 1975 1997 1998 2014 2014 2015 2015 2015 2029 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150
31 4 7 7 31 31 32 33 33 48 78 78 89 114 133 147 162 182 208 211 241 260 296 315 345 381 395 403 439 494 498 543 553 563 619 623 624 699 704 707 895 923 923 978 978 990 1052 1174 1195 1199 1303 1518 1519 1566 1630 1630 1680 1721 1723 1731 1738 1743 1750 1848 1856 1868 1900 1902 1953 1957 1962 1963 1973 1987 1987 1993 2010 2033 2051 2052 2058 2061 2067 2069 2106 2147 2151 2152 2153 2154 2155 2156 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2209 2210 2211 2212 2213 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260
32 32 32 33 33 48 58 63 78 95 133 253 275 301 354 371 395 405 495 597 662 699 699 707 707 738 778 784 793 805 818 867 899 923 1027 1027 1034 1103 1103 1144 1200 1237 1529 1692 1714 1743 1743 1749 1750 1753 1768 1817 1841 1843 1878 1993 2047 2054 2054 2061 2067 2067 2067 2067 2101 2113 2116 2139 2152 2156 2159 2165 2167 2168 2171 2190 2190 2201 2208 2221 2233 2248 2261 2262 2263 2264 2264 2265 2265 2266 2267 2268 2269 2269 2270 2271 2272 2273 2274 2275 2276 2277 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2299 2300 2301 2302 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2316 2317 2318 2319 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369
33 33 48 58 78 78 114 118 162 167 182 182 193 202 202 204 221 226 249 249 257 261 274 287 287 345 346 368 408 412 457 504 506 576 592 624 653 697 699 699 771 818 832 847 923 923 1003 1103 1175 1199 1200 1202 1223 1370 1519 1696 1723 1723 1750 1771 1777 1848 1903 1929 1935 2014 2030 2053 2061 2072 2151 2152 2152 2153 2168 2168 2221 2243 2247 2262 2263 2264 2288 2291 2293 2293 2303 2323 2333 2335 2340 2352 2370 2371 2372 2373 2374 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2451 2452 2453 2454 2455 2456 2457 2458 2459 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474
34 31 32 32 33 35 35 44 58 58 67 67 70 78 78 83 96 115 136 136 162 182 182 202 202 202 202 217 230 237 249 320 324 340 345 346 366 397 405 414 504 519 540 572 576 593 597 622 625 669 694 694 699 790 815 815 832 835 920 923 923 954 1042 1098 1102 1110 1129 1199 1200 1218 1477 1501 1509 1515 1529 1557 1625 1692 1722 1723 1742 1844 1868 1877 1904 1904 1972 2152 2165 2168 2171 2173 2198 2243 2267 2293 2293 2294 2308 2317 2323 2323 2387 2389 2390 2400 2400 2422 2423 2423 2440 2442 2447 2459 2461 2475 2475 2476 2477 2478 2479 2480 2481 2481 2482 2483 2484 2485 2486 2487 2488 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2527 2528 2529 2530 2531 2532 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569
35 30 32 33 35 58 60 64 76 78 78 84 89 120 133 202 204 204 241 249 249 301 304 340 366 384 416 428 496 508 624 699 700 700 778 815 832 906 923 923 943 987 997 1001 1200 1203 1226 1303 1360 1424 1432 1441 1749 1802 1868 1914 1933 1936 1962 2171 2188 2243 2327 2342 2352 2360 2427 2490 2494 2494 2502 2504 2530 2532 2533 2546 2546 2547 2548 2558 2560 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612
36 32 32 32 58 58 63 89 98 133 133 133 162 162 188 204 213 217 304 345 358 366 366 366 366 381 395 395 395 539 553 623 624 624 640 667 667 667 694 694 699 722 782 815 816 858 922 923 979 1012 1026 1040 1063 1079 1079 1088 1091 1149 1222 1453 1461 1526 1565 1662 1692 1692 1731 1750 1796 1829 1889 1931 1997 2000 2014 2014 2038 2111 2164 2188 2427 2445 2501 2505 2546 2578 2580 2591 2594 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656
37 9 32 32 33 46 58 63 79 84 133 133 162 188 237 247 259 260 273 301 301 304 304 326 340 358 366 424 447 480 504 508 546 580 591 606 617 617 637 640 653 667 667 699 782 793 793 794 895 923 955 1001 1026 1034 1034 1061 1087 1088 1088 1127 1147 1148 1155 1166 1177 1177 1228 1249 1303 1323 1339 1343 1368 1388 1441 1441 1444 1515 1630 1645 1800 1809 1972 2000 2054 2117 2151 2157 2164 2292 2360 2580 2591 2591 2617 2624 2625 2626 2631 2632 2632 2633 2634 2635 2638 2642 2643 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705
38 4 32 32 33 46 58 63 78 88 179 182 204 204 211 241 249 249 259 301 345 346 346 366 412 415 416 416 438 439 447 447 447 504 527 527 539 540 553 553 558 661 667 667 667 674 699 722 725 725 782 794 797 812 842 842 842 923 954 954 1129 1137 1144 1181 1202 1259 1339 1339 1444 1543 1617 1680 1705 1713 1874 1874 1878 2030 2054 2153 2224 2256 2307 2360 2413 2461 2481 2546 2580 2617 2619 2633 2635 2660 2661 2662 2663 2664 2665 2666 2669 2679 2680 2681 2689 2694 2695 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752
39 4 4 32 32 55 58 58 70 95 124 133 141 177 186 211 211 217 247 249 249 259 260 301 304 312 312 326 329 338 340 345 366 366 408 447 447 502 509 509 510 522 527 553 558 566 598 612 619 621 622 625 625 625 640 653 653 653 667 667 667 674 699 715 741 753 868 954 955 958 1027 1034 1063 1102 1120 1147 1193 1241 1241 1303 1483 1672 1719 1803 1868 1868 1973 2003 2014 2138 2138 2211 2248 2450 2494 2580 2615 2617 2617 2624 2625 2625 2625 2633 2635 2661 2662 2666 2669 2679 2682 2689 2711 2713 2725 2725 2728 2729 2732 2734 2737 2740 2746 2748 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2780 2781 2782 2783 2784 2785
40 35 44 120 131 202 207 304 304 336 381 434 537 553 566 572 867 1039 1170 1222 1235 1259 1270 1357 1501 1575 1575 1617 1749 1795 1868 1889 2434 2627 2716 2756 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2799 2800 2801 2802 2803 2804 2804 2805 2806 2807 2808 2809 2810 2811 2812 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833
41 8 21 26 28 28 31 32 33 33 33 38 42 46 46 48 49 49 53 55 57 58 58 59 60 61 61 63 65 66 67 68 72 73 73 78 82 84 84 84 85 85 88 92 94 96 96 103 103 111 113 115 122 124 133 138 142 143 148 151 153 154 160 162 165 166 167 167 172 174 178 178 179 180 182 183 186 188 189 189 189 189 196 199 201 202 202 202 202 202 204 205 213 218 218 239 255 256 268 268 271 277 277 278 289 289 290 290 291 299 340 366 368 371 371 376 407 414 415 553 598 623 625 816 816 835 965 965 965 1082 1086 1129 1129 1172 1222 1241 1574 1575 1630 1673 1707 1825 1884 1928 2158 2293 2494 2619 2722 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2853 2854 2855 2856 2857 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883
42 4 5 24 28 32 32 33 44 44 48 49 51 52 55 56 56 56 59 65 70 72 72 73 78 96 97 103 111 111 113 117 123 124 135 136 136 136 141 143 148 152 153 167 178 179 182 185 186 188 190 217 218 226 230 232 235 236 241 244 246 247 249 255 259 260 260 260 261 268 268 268 273 274 276 277 278 279 282 287 289 290 291 291 293 294 295 304 305 308 310 326 340 340 349 368 376 381 384 403 406 407 407 414 417 450 454 510 535 540 553 554 702 710 738 789 889 964 1087 1087 1155 1200 1241 1241 1388 1432 1681 1696 1822 1962 1974 2014 2371 2372 2400 2409 2450 2619 2624 2781 2877 2878 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926
43 5 24 31 32 32 32 35 46 47 49 56 67 68 68 72 73 73 120 123 124 130 135 141 143 165 167 177 179 189 189 190 213 213 217 220 223 228 232 241 246 255 256 268 271 276 282 284 287 287 290 305 306 306 324 325 326 326 340 347 358 362 368 371 372 376 376 377 381 388 389 390 394 395 397 398 399 403 404 405 407 411 415 415 415 442 447 450 539 550 553 593 691 699 741 816 856 868 954 1097 1097 1102 1191 1195 1214 1214 1259 1351 1368 1390 1417 1477 1545 1545 1680 1841 1868 1868 1962 2223 2248 2293 2360 2475 2475 2506 2508 2510 2514 2625 2673 2678 2779 2877 2888 2915 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973
44 4 21 24 31 41 46 48 49 72 73 83 103 105 120 120 120 124 124 130 136 136 136 165 179 189 189 193 202 217 218 218 219 222 227 227 227 228 232 243 249 268 271 275 289 320 324 325 327 329 334 349 354 356 363 376 388 395 404 405 407 421 431 431 439 439 442 447 450 454 457 473 489 504 504 504 504 504 510 550 550 553 553 568 593 709 753 883 959 964 964 965 987 1047 1052 1086 1087 1097 1097 1241 1259 1432 1501 1696 1829 1865 2240 2469 2484 2726 2727 2847 2914 2933 2946 2947 2947 2948 2974 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2989 2990 2991 2992 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007
45 4 21 22 105 114 114 120 120 124 124 130 156 162 188 189 202 217 217 217 232 241 249 289 289 325 340 408 414 415 419 423 428 429 429 432 437 439 462 474 474 478 480 485 496 497 497 498 500 502 504 508 509 509 509 527 527 528 530 532 532 533 533 535 539 543 543 547 554 554 559 864 868 912 930 930 954 965 971 1002 1019 1087 1129 1149 1163 1183 1200 1214 1214 1237 1241 1259 1259 1318 1350 1390 1424 1501 1526 1538 1678 1714 1829 1829 1886 1973 2014 2086 2198 2198 2243 2371 2421 2678 2753 2758 2766 2851 2877 2995 2995 3003 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3020 3021 3022 3023 3024 3024 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3034 3035 3036 3037 3038 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081
46
47 21 31 32 33 33 58 58 64 78 204 207 217 217 260 260 318 366 366 408 504 508 508 539 550 553 567 568 568 568 568 568 570 573 574 576 577 580 588 590 590 591 594 597 597 598 599 601 603 604 606 608 608 609 610 612 613 614 623 624 625 626 634 635 638 641 642 643 646 646 649 652 652 653 659 662 663 664 672 678 690 693 699 703 708 712 713 715 717 725 726 727 733 751 763 782 790 792 819 823 841 849 867 868 887 919 934 939 939 939 954 1052 1087 1130 1270 1276 1303 1451 1673 1679 2400 2591 2591 2627 2706 2856 2926 3042 3075 3075 3082 3083 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120
48 21 31 31 58 67 181 181 217 217 217 217 340 346 346 356 366 366 499 527 527 527 539 553 568 588 588 588 590 590 606 606 612 623 626 630 637 638 638 638 641 650 652 652 653 664 687 691 700 706 711 711 714 715 716 721 723 725 729 738 741 745 753 762 763 764 765 765 767 769 774 780 782 783 785 786 787 787 791 796 802 803 810 810 811 838 849 858 894 895 942 951 954 954 979 1019 1027 1039 1044 1057 1170 1174 1203 1222 1222 1572 1691 1829 1953 1953 1987 1987 2014 2014 2135 2241 2736 2793 2912 2962 3100 3121 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164
49 4 4 4 4 32 32 33 33 58 58 72 72 83 84 105 157 162 162 162 162 179 179 179 213 217 217 217 217 217 243 318 320 321 336 346 366 368 384 388 416 424 504 539 550 550 550 553 553 553 553 558 570 573 583 588 590 635 638 644 654 664 691 691 697 702 704 711 750 753 753 754 755 755 756 757 759 760 762 763 765 770 774 775 799 807 817 818 819 823 837 838 842 842 844 845 846 846 849 851 854 858 858 858 858 860 865 866 868 874 875 878 880 880 885 885 887 889 889 891 891 892 895 897 922 925 942 951 954 970 1019 1030 1034 1047 1049 1060 1097 1170 1187 1195 1199 1214 1241 1241 1241 1241 1241 1259 1405 1465 1501 1529 1575 1622 1679 1768 1889 2276 2494 2576 2627 2678 2678 2847 2973 3006 3043 3063 3073 3147 3155 3165 3166 3167 3168 3169 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212
50 31 32 32 58 63 114 219 247 320 345 345 358 366 366 366 395 416 424 502 504 504 509 539 544 550 550 554 558 558 558 569 580 580 583 583 588 590 598 604 612 617 617 624 636 638 664 693 693 710 715 750 770 770 770 780 786 790 813 817 818 818 819 824 825 826 832 834 836 836 839 839 843 846 846 851 853 853 854 856 858 858 859 860 867 868 869 872 874 875 875 878 880 885 885 887 887 889 902 909 915 920 923 924 925 928 931 932 933 939 939 940 941 943 951 951 954 954 1002 1007 1083 1107 1111 1235 1235 1241 1303 1679 1742 1841 1841 1862 1872 2135 2165 2276 2276 2390 2627 2729 2745 2748 3105 3117 3182 3184 3194 3197 3197 3204 3208 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241
51 22 32 32 32 32 32 33 33 46 58 58 63 72 114 182 217 217 217 218 247 247 260 260 345 358 366 424 439 539 539 553 553 558 558 591 604 608 623 623 693 698 702 731 738 750 770 770 782 786 794 815 817 818 819 824 825 832 834 843 846 856 862 862 862 868 880 895 896 902 909 913 916 919 922 924 926 927 928 929 931 932 933 939 939 941 943 943 944 946 948 948 954 954 954 954 955 957 959 968 970 971 973 974 975 978 983 986 987 1000 1004 1007 1010 1014 1034 1061 1077 1079 1083 1087 1121 1149 1149 1153 1153 1187 1259 1707 1742 1742 1750 1829 1841 1841 1946 2047 2168 2188 2276 2306 2683 3004 3047 3075 3077 3104 3171 3194 3225 3235 3237 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274
52 4 22 31 32 33 58 72 72 105 124 204 218 218 218 218 218 227 227 247 249 287 326 439 480 489 502 502 502 502 502 502 504 504 539 540 553 553 558 568 572 574 583 585 588 606 606 606 606 684 693 699 709 751 755 765 793 804 829 836 846 846 849 851 868 881 898 911 915 916 916 939 943 949 954 954 955 956 957 958 961 962 965 969 972 974 974 978 978 987 989 996 1000 1001 1002 1003 1005 1016 1017 1021 1023 1029 1030 1030 1034 1034 1034 1035 1043 1050 1052 1055 1055 1058 1060 1060 1063 1064 1068 1071 1083 1106 1109 1111 1114 1127 1127 1152 1170 1174 1183 1204 1235 1259 1471 1506 1545 1660 1679 1696 1841 1841 1869 1874 1874 1974 2014 2014 2151 2152 2168 2188 2243 2307 2532 2532 2678 2736 2758 2764 3065 3152 3171 3192 3255 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309
53 32 33 48 69 105 120 120 188 188 189 189 204 204 204 217 217 218 247 247 249 249 260 271 320 320 320 349 370 405 408 408 416 438 500 500 502 502 502 502 502 509 543 544 546 552 553 553 566 588 588 607 617 652 654 654 662 693 699 812 819 842 842 847 851 858 868 868 868 916 955 959 964 965 983 1001 1003 1009 1019 1021 1022 1023 1024 1030 1033 1034 1041 1047 1057 1060 1061 1063 1064 1064 1076 1083 1085 1097 1097 1099 1107 1109 1109 1111 1114 1120 1120 1120 1121 1129 1129 1129 1129 1129 1129 1129 1132 1138 1145 1153 1155 1174 1182 1187 1199 1200 1214 1228 1258 1259 1270 1276 1386 1451 1506 1528 1553 1622 1696 1718 1809 2048 2138 2138 2248 2326 2532 2619 2758 2758 3034 3047 3071 3079 3085 3096 3096 3264 3275 3277 3278 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348
54 32 48 78 105 114 120 120 120 120 182 204 204 211 241 249 303 303 304 324 324 346 349 366 366 366 366 405 502 502 502 502 502 522 544 544 546 585 588 588 588 597 617 644 653 699 725 782 836 836 868 875 959 961 980 1001 1001 1027 1034 1052 1059 1083 1087 1087 1093 1099 1102 1102 1103 1109 1109 1110 1111 1114 1119 1120 1120 1127 1129 1130 1131 1133 1138 1140 1141 1141 1144 1153 1165 1169 1189 1192 1214 1241 1258 1258 1270 1392 1505 1509 1526 1526 1575 1678 1684 1684 1915 2014 2138 2269 2678 2761 2761 2874 2997 3003 3049 3054 3075 3138 3138 3316 3319 3325 3330 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371
55 4 4 4 30 31 31 32 32 32 32 33 202 228 247 249 276 320 320 338 345 346 366 366 366 366 366 366 366 366 366 381 439 442 462 509 546 568 588 588 653 653 653 653 653 674 674 751 782 842 842 842 847 847 847 989 1025 1027 1030 1030 1034 1041 1060 1097 1097 1097 1098 1114 1140 1148 1150 1151 1155 1168 1169 1169 1170 1170 1177 1183 1183 1187 1189 1192 1193 1196 1200 1205 1206 1210 1213 1226 1227 1229 1233 1234 1234 1241 1256 1258 1258 1258 1270 1270 1303 1392 1415 1451 1501 1550 1662 1673 1679 1680 1742 1794 1822 2014 2014 2461 2493 2713 2764 3079 3098 3121 3147 3152 3194 3254 3316 3360 3361 3365 3372 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402
56 4 4 4 32 114 120 217 218 218 358 366 366 370 370 381 426 506 506 540 543 553 558 558 568 588 588 638 810 810 867 939 964 1019 1060 1087 1087 1098 1153 1177 1214 1218 1219 1234 1241 1241 1242 1258 1258 1270 1276 1286 1371 1424 1451 1501 1678 1679 1679 1679 1745 2242 2706 2791 2941 3194 3284 3360 3392 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414
57 4 4 4 24 24 24 25 31 31 45 46 68 72 72 72 72 72 72 73 73 133 182 189 189 189 189 202 217 217 217 217 218 218 218 218 218 218 218 218 218 271 345 345 345 345 346 346 346 366 366 370 370 370 370 370 407 434 489 527 539 539 539 539 550 550 550 550 550 550 553 553 553 553 558 558 568 568 588 607 618 653 716 782 816 867 867 867 954 954 954 954 1041 1087 1087 1087 1087 1177 1187 1218 1223 1223 1235 1236 1236 1236 1238 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1246 1253 1254 1258 1258 1259 1265 1265 1266 1266 1270 1273 1278 1286 1290 1303 1451 1526 1550 1588 1679 1679 1679 1680 1692 1822 2014 2047 2242 2369 2501 2823 2941 3075 3075 3075 3079 3079 3079 3372 3372 3372 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449
58 4 4 4 4 4 4 4 4 4 4 4 21 24 24 24 24 24 24 31 31 31 32 32 33 46 46 72 72 72 84 133 133 189 189 189 189 189 202 202 202 213 217 217 217 217 217 218 218 234 271 312 370 370 370 370 370 370 434 527 527 527 539 539 550 553 553 568 568 607 755 755 782 858 908 919 954 954 954 954 954 1087 1087 1087 1087 1087 1087 1087 1087 1087 1087 1149 1223 1238 1238 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1242 1258 1258 1258 1258 1259 1259 1281 1283 1286 1287 1290 1424 1673 1679 1679 1679 1692 1704 2014 2591 2753 2941 2957 2957 2957 2957 3079 3194 3194 3194 3194 3194 3194 3416 3429 3438 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464
59 4 4 24 31 32 33 46 46 72 120 120 133 179 189 189 189 189 189 189 202 217 218 218 218 268 370 370 539 550 550 553 553 558 558 558 558 558 568 568 568 755 755 782 782 843 858 954 954 955 965 965 965 1039 1087 1087 1087 1214 1235 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1241 1283 1286 1538 1538 1675 1679 1679 1679 1679 2014 2238 2761 2941 2957 3075 3079 3194 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3485 3486
60 4 4 4 24 24 31 31 32 33 56 72 105 136 189 189 207 209 209 209 217 217 217 217 217 218 247 260 271 301 306 312 317 320 354 408 548 550 553 553 558 568 568 568 568 568 568 568 613 619 619 623 635 637 652 653 684 706 738 784 847 853 858 894 939 954 965 985 1087 1151 1187 1193 1223 1226 1237 1334 1338 1339 1342 1343 1355 1375 1375 1378 1411 1422 1428 1441 1460 1468 1471 1515 1617 1673 1809 1829 1841 1905 2326 2494 2510 2532 2706 2707 2729 2745 3075 3194 3264 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576
61 4 4 33 33 45 48 58 73 83 105 120 120 120 133 133 202 204 204 217 218 285 289 312 320 320 320 324 327 340 370 432 438 485 502 504 508 509 509 527 540 544 550 558 563 699 739 770 845 867 867 867 922 965 1022 1030 1047 1082 1083 1086 1097 1098 1109 1177 1206 1214 1241 1270 1271 1303 1305 1307 1310 1312 1315 1337 1339 1339 1340 1342 1345 1353 1365 1367 1367 1369 1370 1378 1379 1379 1379 1381 1381 1382 1383 1388 1388 1392 1392 1415 1424 1443 1450 1451 1451 1457 1458 1459 1460 1467 1475 1515 1515 1523 1526 1544 1560 1621 1623 1679 1681 1696 1705 1779 1796 1805 1972 2014 2018 2138 2240 2341 2400 2706 2736 2753 2753 2765 2877 2903 2957 2957 2957 3079 3171 3252 3293 3311 3325 3455 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626
62 4 21 21 24 45 53 72 72 73 120 133 133 146 156 179 204 204 217 312 320 320 338 340 349 366 407 429 502 502 502 502 502 553 553 558 637 699 699 725 739 784 784 816 845 852 867 867 884 949 965 979 1087 1097 1097 1097 1098 1098 1109 1182 1187 1218 1246 1256 1310 1315 1339 1340 1342 1342 1342 1345 1350 1351 1351 1351 1365 1371 1379 1381 1388 1395 1407 1450 1450 1451 1451 1451 1463 1467 1482 1483 1486 1487 1489 1490 1493 1494 1497 1498 1500 1501 1502 1504 1504 1505 1507 1508 1508 1511 1513 1514 1515 1518 1519 1520 1522 1523 1523 1525 1526 1526 1527 1529 1530 1531 1532 1538 1538 1540 1541 1543 1552 1553 1553 1557 1560 1561 1562 1563 1629 1630 1678 1679 1680 1690 1796 1839 1962 1965 2134 2161 2400 2483 2867 2925 3047 3194 3248 3360 3583 3627 3628 3629 3630 3631 3632 3633 3634 3635 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665
63 4 4 21 22 72 73 120 120 133 133 133 136 165 232 320 320 327 340 439 508 527 537 539 539 550 696 702 702 782 784 784 835 841 847 867 1072 1098 1098 1098 1098 1102 1170 1177 1181 1214 1214 1219 1241 1241 1246 1256 1256 1271 1310 1339 1342 1342 1395 1451 1451 1467 1501 1512 1515 1515 1515 1517 1526 1544 1550 1560 1568 1572 1575 1576 1580 1581 1589 1591 1593 1598 1605 1609 1616 1617 1618 1619 1621 1623 1630 1704 1711 1712 1723 1780 1868 2014 2135 2619 2812 2847 2979 3047 3047 3075 3075 3139 3251 3426 3537 3587 3591 3612 3612 3651 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695
64 4 4 4 4 19 32 33 35 48 118 120 133 133 217 217 227 289 340 368 441 443 550 558 782 813 842 842 842 852 867 867 867 901 954 1241 1310 1336 1340 1350 1351 1351 1370 1370 1371 1501 1513 1538 1587 1589 1594 1597 1615 1615 1621 1632 1636 1637 1637 1638 1640 1642 1646 1646 1647 1650 1651 1652 1656 1661 1662 1663 1663 1671 1672 1681 1684 1689 1694 1702 1707 2014 2753 2812 3121 3499 3687 3694 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714
65 4 4 4 4 4 4 4 22 31 31 32 32 72 73 84 162 217 318 321 346 370 370 508 550 558 755 784 842 954 965 1087 1226 1241 1276 1336 1351 1557 1594 1623 1671 1680 1689 1697 1702 1703 2014 2014 2014 2117 2135 2792 2941 2941 3056 3152 3177 3326 3703 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727
66 32 39 58 204 275 318 318 320 371 407 408 408 414 417 432 473 626 649 653 653 653 653 655 667 668 668 674 674 793 797 939 1030 1113 1115 1203 1210 1319 1352 1388 1529 1557 1566 1714 1716 1720 1722 1725 1726 1729 1738 1742 1742 1745 1745 1747 1748 1748 1750 1751 1755 1756 1758 1759 1763 1764 1766 1766 1766 1768 1771 1771 1777 1779 1779 1781 1784 1785 1785 1791 1794 1796 1798 1799 1800 1802 1803 1807 1808 1809 1810 1811 1812 1813 1815 1820 1821 1836 1841 1842 1864 1868 1870 1871 1875 1889 1895 1901 1902 1929 1936 1961 1980 2014 2017 2018 2060 2106 2186 2202 2237 2301 2360 2360 2389 2450 2491 2494 2494 2521 2546 2591 2617 2745 2745 2748 2748 2781 3038 3075 3293 3311 3378 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3770 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783
67 14 32 32 32 48 58 84 133 133 168 183 211 259 260 366 395 395 408 433 439 547 558 563 566 572 572 580 583 591 598 622 625 642 653 654 662 662 684 694 699 704 731 755 797 816 818 818 819 832 832 858 910 922 923 925 954 987 1034 1200 1352 1415 1477 1501 1521 1543 1543 1630 1692 1726 1738 1747 1748 1750 1763 1763 1765 1766 1771 1771 1771 1771 1776 1777 1785 1809 1819 1822 1824 1826 1832 1837 1840 1841 1841 1843 1844 1845 1852 1862 1863 1868 1871 1879 1882 1882 1885 1886 1888 1889 1891 1892 1896 1897 1899 1901 1903 1908 1909 1936 1953 1961 1963 1968 1972 1973 2000 2000 2030 2053 2099 2107 2138 2151 2242 2243 2361 2372 2400 2442 2470 2494 2501 2506 2563 2729 2741 2939 3047 3075 3079 3181 3219 3311 3369 3707 3707 3758 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824
68 33 58 72 78 98 133 133 168 193 204 217 217 217 241 241 249 354 366 366 366 366 414 439 447 463 494 537 592 607 619 625 632 635 637 653 654 668 675 675 679 699 794 819 842 923 925 958 1048 1079 1174 1374 1386 1388 1521 1543 1575 1753 1761 1771 1771 1829 1832 1856 1856 1862 1868 1868 1874 1874 1877 1899 1914 1916 1928 1928 1928 1929 1930 1931 1933 1933 1933 1937 1941 1943 1945 1946 1953 1953 1958 1959 1962 1963 1965 1965 1965 1968 1969 1971 1973 1980 2005 2014 2014 2016 2018 2028 2039 2042 2106 2111 2136 2147 2151 2151 2185 2237 2292 2360 2400 2440 2459 2470 2494 2578 2587 2653 2741 2881 2918 3075 3079 3079 3096 3464 3748 3789 3795 3800 3800 3801 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3867 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880
69 32 33 33 33 58 63 188 228 239 247 249 260 296 325 340 345 366 371 395 432 540 550 568 624 652 662 684 694 699 736 782 816 863 868 922 923 923 923 1027 1034 1061 1165 1170 1199 1241 1301 1303 1395 1680 1717 1721 1768 1810 1824 1833 1836 1856 1874 1884 1903 1916 1930 1957 2014 2030 2040 2048 2051 2052 2053 2058 2060 2061 2065 2084 2091 2094 2102 2103 2117 2117 2122 2128 2137 2141 2147 2152 2218 2243 2288 2361 2440 2481 2494 2546 2546 2572 2600 2614 2625 2655 2748 2751 2764 2874 2957 2957 3075 3075 3075 3312 3764 3784 3833 3835 3844 3854 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928
70 32 32 38 48 58 58 78 112 204 210 211 226 226 231 236 287 366 366 371 550 644 653 694 699 744 782 784 845 923 955 1009 1024 1027 1034 1036 1042 1052 1083 1220 1226 1303 1380 1441 1518 1538 1543 1630 1630 1738 1753 1777 1788 1836 1841 1856 1871 1916 1936 1936 1957 2000 2014 2015 2027 2033 2033 2046 2047 2052 2058 2061 2063 2067 2074 2083 2083 2099 2106 2113 2116 2122 2125 2132 2138 2145 2147 2152 2153 2156 2157 2161 2162 2165 2168 2170 2183 2186 2187 2188 2191 2193 2204 2205 2206 2207 2209 2224 2228 2230 2253 2258 2301 2302 2440 2440 2442 2459 2482 2494 2613 2624 2625 2668 2736 2851 2979 3004 3006 3059 3150 3281 3464 3464 3667 3801 3854 3862 3863 3880 3890 3891 3922 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005
71 33 63 105 143 162 217 260 321 371 372 390 408 429 432 540 572 613 621 642 694 699 707 784 789 793 842 842 895 918 923 923 923 1027 1034 1072 1157 1160 1199 1303 1357 1432 1543 1731 1743 1746 1750 1836 1836 1852 1870 1872 1875 1987 1995 2010 2061 2067 2125 2141 2147 2147 2151 2152 2156 2158 2186 2203 2207 2208 2224 2233 2258 2261 2263 2266 2268 2269 2272 2276 2280 2293 2301 2306 2323 2329 2336 2344 2352 2361 2440 2442 2459 2459 2494 2542 2576 2591 2726 2728 2979 2979 3047 3205 3205 3292 3321 3507 3587 3743 3790 3863 3870 3979 4006 4007 4008 4009 4010 4011 4012 4013 4014 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089
72 4 5 24 31 33 48 58 88 98 162 217 231 268 366 372 429 486 527 566 592 694 738 923 985 1019 1019 1200 1352 1432 1630 1675 1690 1692 1726 1753 1870 1871 1878 1946 1954 2082 2158 2202 2221 2234 2263 2276 2288 2293 2301 2303 2333 2371 2372 2373 2386 2390 2400 2413 2417 2423 2426 2433 2437 2440 2442 2443 2447 2450 2455 2458 2460 2462 2465 2470 2471 2494 2494 2494 2527 2558 2560 2568 2625 2741 2799 2851 2898 2914 2984 3063 3100 3150 3201 3309 3311 3318 3348 3348 3356 3356 3612 3784 3801 3844 3906 3913 3918 3979 4011 4052 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186
73 32 33 33 33 35 35 44 58 58 78 104 217 237 257 320 351 397 405 408 416 502 508 528 583 625 686 738 753 918 920 987 987 1009 1019 1052 1144 1175 1175 1199 1223 1377 1483 1515 1615 1622 1722 1726 1742 1877 1896 1915 1915 1946 1974 2061 2171 2221 2301 2323 2325 2327 2340 2385 2386 2387 2420 2423 2442 2445 2459 2494 2521 2528 2528 2537 2544 2558 2560 2561 2561 2563 2591 2594 2666 2805 2928 2972 3004 3042 3147 3177 3251 3311 3588 3641 3741 3742 3784 3785 3851 3898 3908 4109 4172 4179 4187 4188 4189 4190 4190 4191 4192 4193 4194 4195 4196 4196 4197 4198 4199 4200 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275
74 32 32 32 58 58 124 193 202 204 204 213 217 260 340 366 366 395 415 485 527 553 589 591 625 625 642 668 684 694 699 812 818 923 1003 1034 1034 1042 1199 1200 1200 1203 1471 1526 1675 1868 1884 1904 1914 1931 1950 2062 2111 2165 2165 2168 2243 2292 2292 2356 2360 2387 2389 2400 2423 2427 2440 2445 2491 2491 2494 2527 2532 2533 2542 2542 2546 2547 2555 2558 2558 2560 2563 2567 2583 2585 2591 2592 2593 2598 2600 2603 2609 2610 2617 2636 2638 2639 2666 2691 2736 2741 2755 2851 2874 3228 3264 3348 3356 3503 3725 3725 3835 3912 4036 4048 4115 4149 4210 4232 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4319 4320 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334
75 7 32 32 33 72 76 98 210 217 228 301 301 304 320 346 366 366 395 432 508 566 572 572 617 624 640 699 770 815 860 906 916 923 923 1061 1063 1219 1222 1229 1253 1263 1270 1303 1421 1692 1742 1822 1841 1868 1868 1870 1874 1941 2015 2117 2138 2138 2165 2214 2237 2241 2243 2292 2459 2475 2494 2494 2505 2546 2547 2560 2589 2598 2604 2617 2622 2625 2626 2627 2631 2638 2645 2652 2655 2680 2686 2696 2730 2801 3075 3417 3425 3503 3707 3750 3826 4291 4320 4321 4335 4335 4336 4337 4338 4339 4340 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364
76 32 33 33 33 60 63 68 89 133 156 188 237 260 301 304 368 395 432 617 617 619 624 640 652 667 694 699 713 772 815 860 923 1026 1069 1079 1222 1398 1444 1505 1681 1787 1800 1822 1953 2000 2014 2151 2164 2188 2243 2243 2292 2400 2494 2494 2580 2591 2592 2617 2623 2626 2628 2632 2638 2645 2654 2664 2669 2696 2701 2735 2746 2801 2851 2997 3075 3079 3588 3676 3682 4036 4048 4189 4343 4344 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382
77 8 32 32 32 33 33 33 58 58 105 120 124 133 133 156 162 228 287 301 304 349 366 366 395 414 442 447 447 527 553 568 625 640 640 653 653 667 667 699 702 738 797 835 847 954 963 1034 1069 1083 1121 1214 1271 1339 1543 1679 1720 1742 1829 1844 2111 2153 2188 2241 2248 2248 2413 2413 2427 2494 2497 2560 2576 2580 2613 2633 2635 2661 2662 2663 2669 2676 2680 2684 2687 2689 2695 2713 2721 2723 2726 2730 2732 2736 2740 2741 2743 2744 2745 2746 2747 2748 2748 2749 2751 2753 2775 2855 2874 2947 2957 3082 3205 3284 3294 3952 4115 4115 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409
78 32 46 58 60 60 78 124 133 144 162 182 182 186 210 211 211 211 287 304 312 324 345 358 366 381 414 415 416 447 447 487 504 527 565 621 622 623 625 652 653 667 699 725 739 782 858 898 965 974 1027 1034 1052 1058 1061 1087 1169 1196 1241 1451 1477 1633 1719 1787 2138 2224 2243 2269 2360 2413 2580 2616 2624 2625 2635 2635 2665 2679 2682 2713 2725 2729 2729 2732 2734 2736 2740 2741 2743 2748 2753 2757 2760 2766 2767 2768 2770 2775 2776 2777 2780 2780 2780 2781 2782 2783 2784 2785 2925 2957 3007 3053 3075 3075 3082 3127 3152 3299 3464 3510 3510 3536 3536 3746 4115 4182 4387 4402 4410 4411 4412 4413 4414 4415 4416 4417 4417 4418 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437
79 4 4 31 32 33 46 48 55 58 58 59 114 120 133 144 162 182 182 217 228 235 247 249 249 287 304 345 366 366 370 381 395 408 424 426 439 442 502 504 558 568 625 637 653 653 667 668 755 755 784 810 858 858 901 954 954 954 964 974 989 1027 1049 1063 1087 1087 1120 1214 1241 1241 1303 1406 1451 1462 1501 1501 1501 1678 1678 1718 1809 1880 1888 1889 1901 1972 2014 2070 2293 2360 2372 2494 2501 2578 2591 2615 2615 2617 2617 2617 2633 2661 2665 2678 2679 2691 2711 2713 2734 2757 2758 2759 2759 2760 2762 2767 2768 2770 2771 2775 2780 2784 2941 3018 3063 3071 3075 3075 3079 3313 3426 3464 3676 3731 3835 4287 4383 4396 4402 4420 4423 4428 4434 4434 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475
80 32 33 58 72 79 179 202 207 217 304 304 338 366 381 395 498 553 553 553 576 591 623 674 694 782 810 845 857 918 1087 1120 1120 1157 1229 1241 1241 1339 1511 1660 1704 1829 2117 2269 2533 2617 2661 2665 2665 2711 2759 2767 2768 2780 2784 2816 2847 2941 3005 3251 3464 4290 4387 4390 4390 4395 4418 4422 4427 4427 4457 4462 4462 4463 4464 4466 4470 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521
81 3 4 4 5 7 9 11 12 19 23 29 32 33 35 35 36 39 43 45 48 48 49 51 52 55 56 57 58 58 59 60 61 63 64 65 67 68 70 72 72 72 72 72 73 73 76 77 80 82 83 84 84 84 84 85 85 88 92 94 96 97 98 98 99 101 103 133 141 141 153 156 157 157 157 165 167 169 178 179 183 186 188 189 189 198 199 204 205 217 217 217 218 218 227 239 249 256 277 278 289 290 301 354 358 366 368 370 370 371 371 376 395 407 415 424 430 536 553 614 623 625 636 784 965 1030 1195 1241 1465 1526 1575 1617 1673 1673 1679 1953 2030 2223 2480 2812 2836 2841 2853 2853 2856 2879 2918 2957 3006 3146 3205 3326 3676 3676 3676 3707 4391 4489 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4561 4562
82 5 7 12 21 24 29 32 44 49 49 52 52 55 56 58 58 58 60 65 68 73 73 97 99 103 113 115 126 126 131 136 136 136 136 141 142 143 147 147 148 150 151 154 158 165 165 167 179 179 182 182 186 188 189 192 197 199 231 232 235 240 249 255 260 268 268 268 270 271 274 275 276 278 280 287 289 289 290 291 295 301 304 305 307 320 320 320 320 370 372 403 404 407 415 454 502 784 786 842 959 964 964 964 965 965 1030 1088 1200 1219 1223 1352 1390 1501 1868 2113 2159 2409 2447 2480 2483 2552 2624 2624 2690 2845 2846 2848 2869 2878 2903 2907 2914 2917 2918 2924 2948 2957 2957 2957 2968 2973 2990 3030 3045 3047 3194 3197 3667 3835 3890 3921 4115 4429 4489 4524 4529 4529 4535 4538 4541 4544 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601
83 5 19 23 28 31 32 32 42 48 49 52 73 73 96 97 103 105 135 141 142 143 162 167 179 207 218 227 232 235 244 246 250 255 257 261 262 268 273 274 275 276 277 280 282 283 284 289 290 292 295 297 304 331 340 354 358 371 371 376 388 390 395 395 398 403 404 407 407 414 417 450 553 699 702 816 816 829 868 955 1102 1102 1241 1323 1388 1528 1874 1874 2243 2430 2619 2756 2758 2848 2848 2856 2893 2898 2901 2903 2911 2914 2915 2917 2918 2941 2946 2962 2965 2997 3002 3030 3045 3282 3284 3356 3968 4280 4345 4529 4546 4582 4582 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626
84 4 4 4 21 22 22 24 71 73 103 103 124 124 130 136 143 162 165 178 202 217 218 232 243 246 247 249 255 271 271 276 276 286 289 290 296 311 315 320 328 328 335 337 338 340 340 342 354 358 381 381 389 390 395 399 399 403 404 407 409 414 417 434 439 442 451 453 454 457 504 553 568 607 653 842 959 1097 1155 1219 1223 1241 1342 1351 1395 1406 1675 1681 1742 1792 2215 2341 2469 2806 2848 2903 2903 2914 2931 2934 2965 2991 2991 3045 3047 3186 3194 3290 3890 3928 4411 4569 4601 4605 4615 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648

View File

@@ -0,0 +1,25 @@
To reproduce results (based on parameters of this [paper](https://www.arxiv.org/abs/2407.15304)):
```
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`.

View File

@@ -1,4 +0,0 @@
This directory contains some basic concepts on Bayes filtering.
Main scripts :
RecursivesBayes.m
RecursivesBayesAvpd.m

View File

@@ -33,7 +33,6 @@ if ~isempty(GroundTruth)
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
%[highestHypot, CorrespondingID, GT, Accepted, Good, Index, UnderLoopRatio] descending order
if(sum(LogI(:,8) == 10) > 0)
%OLD
@@ -111,14 +110,14 @@ if ~isempty(GroundTruth)
index = find(PR(:,1) == 1);
if ~isempty(index)
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
display('Recall max (Precision=100%) = 0')
end
indexAccepted = find(PR(:,3) == 1);
if ~isempty(indexAccepted)
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
display('Recall max accepted (Precision=100%) = 0')
end

View File

@@ -0,0 +1,56 @@
#set(0,'defaultAxesFontName', 'Times')
#set(0,'defaultTextFontName', 'Times')
Prefix = 'loop_closure_detection_datasets';
Dataset= 'CityCentre'
Detectors = {'Surf'; 'Sift'; 'CudaSift'; 'GfttBrief'};
% The Ground Truth is a squared bmp file (size must match the log files
% length) where white dots mean loop closures.
% Grey dots mean 'loop closures to ignore', this happens when the rehearsal
% doesn't match consecutive images together.
GroundTruthFile = [Prefix '/' Dataset '.png'];
colors = 'kbgrcm';
figure
xlabel('Recall (%)')
ylabel('Precision (%)')
hold on;
Results = {};
TimeResults = {};
for i=1:length(Detectors)
LogI = importfile([Prefix '/' Dataset '/' Detectors{i} 'LogI.txt']);
LogF = importfile([Prefix '/' Dataset '/' Detectors{i} 'LogF.txt']);
PR = getPrecisionRecall(LogI, LogF, GroundTruthFile, 0.07);
plot(100*PR(:,2), 100*PR(:,1), colors(mod(i,6)+1));
% hold on;
Results{i} = PR;
time = sum(LogF(:,2:7),2)+LogF(:,17);%LogF(:,1)
TimeResults{i} = time;
meanTime = mean(time)
meanWm = mean(LogI(:,7))
meanDict = mean(LogI(:,6))
maxTime = max(time)
maxWm = max(LogI(:,7))
maxDict = max(LogI(:,6))
%figure(2)
%plot(PR(:,4), PR(:,3), colors(mod(i,6)+1));
%hold on;
end
legend(Detectors)
title(Dataset)
figure
rows=floor(length(Detectors)/2 )+ mod(length(Detectors), 2)
for i=1:length(TimeResults)
subplot(rows, 2, i)
plot(TimeResults{i})
ylabel('Time (s)')
title([Detectors{i} ' (' num2str(mean(TimeResults{i})) 's)'])
end
xlabel('Location indexes')

View File

@@ -1,4 +1,4 @@
function [LogF LogI] = showlogs(PathPrefix, GT_file)
function [LogF LogI] = showlogs(PathPrefix, GT_file, LogPrefix)
% [LogF LogI] = showlogs(PathPrefix, GT_file)
% SHOWLOGS Plot a RTAB-Map results (LogI.txt, LogF.txt). Just put this
% file in the same directory as LogF.txt and LogI.txt files
@@ -22,6 +22,9 @@ function [LogF LogI] = showlogs(PathPrefix, GT_file)
set(0,'defaultAxesFontName', 'Times')
set(0,'defaultTextFontName', 'Times')
close all
if nargin < 3, LogPrefix = ''; end
if nargin < 2, GT_file = ''; end
if nargin < 1, PathPrefix = '.'; end
@@ -29,7 +32,7 @@ if nargin < 1, PathPrefix = '.'; end
display(' ');
display('Loading log files...');
LogF = importfile([PathPrefix '/' 'LogF.txt']);
LogF = importfile([PathPrefix '/' LogPrefix 'LogF.txt']);
% COLUMN HEADERS :
% 1 totalTime
% 2 timeMemoryUpdate,
@@ -52,7 +55,7 @@ LogF = importfile([PathPrefix '/' 'LogF.txt']);
% 19 timeEmptyingTrash
% 20 timeRetrievalDbAccess
LogI = importfile([PathPrefix '/' 'LogI.txt']);
LogI = importfile([PathPrefix '/' LogPrefix 'LogI.txt']);
% COLUMN HEADERS :
% 1 lcHypothesisId,
% 2 highestHypothesisId,
@@ -325,7 +328,7 @@ y(LogI(:, 1) == 0) = [];
x(LogI(:, 1) == 0) = [];
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
% y = LogI(:,2);
% x = 1:length(y);

View File

@@ -0,0 +1,29 @@
#!/bin/bash
DATASETS_FOLDER=""
if [ $# -eq 1 ]
then
DATASETS_FOLDER=$1
else
echo "Usage: run_all_datasets.sh \"datasets folder\" "
exit
fi
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
$SCRIPT_DIR/run_bow.sh $DATASETS_FOLDER/NewCollege $DATASETS_FOLDER/NewCollege.png
if [ -s LogF.txt ]; then
mv LogF.txt $DATASETS_FOLDER/NewCollege/LogF.txt
mv LogI.txt $DATASETS_FOLDER/NewCollege/LogI.txt
fi
$SCRIPT_DIR/run_bow.sh $DATASETS_FOLDER/CityCentre $DATASETS_FOLDER/CityCentre.png
if [ -s LogF.txt ]; then
mv LogF.txt $DATASETS_FOLDER/CityCentre/LogF.txt
mv LogI.txt $DATASETS_FOLDER/CityCentre/LogI.txt
fi
$SCRIPT_DIR/run_bow.sh $DATASETS_FOLDER/UdeS_1Hz $DATASETS_FOLDER/UdeS_1Hz.png
if [ -s LogF.txt ]; then
mv LogF.txt $DATASETS_FOLDER/UdeS_1Hz/LogF.txt
mv LogI.txt $DATASETS_FOLDER/UdeS_1Hz/LogI.txt
fi

View File

@@ -0,0 +1,37 @@
#!/bin/bash
DATASET_FOLDER=""
GT_FILE=""
MEMORY_THR=0
if [ $# -ge 2 ]
then
DATASET_FOLDER=$1
GT_FILE=$2
else
echo "Usage: run_all_detectors.sh \"dataset folder\" \"ground truth file\" [\"Rtabmap/MemoryThr=0\"]"
exit
fi
if [ $# -ge 3 ]
then
MEMORY_THR=$3
fi
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
$SCRIPT_DIR/run_bow.sh $DATASET_FOLDER $GT_FILE $MEMORY_THR 0 false
mv LogF.txt $DATASET_FOLDER/SurfLogF.txt
mv LogI.txt $DATASET_FOLDER/SurfLogI.txt
$SCRIPT_DIR/run_bow.sh $DATASET_FOLDER $GT_FILE $MEMORY_THR 1 false
mv LogF.txt $DATASET_FOLDER/SiftLogF.txt
mv LogI.txt $DATASET_FOLDER/SiftLogI.txt
$SCRIPT_DIR/run_bow.sh $DATASET_FOLDER $GT_FILE $MEMORY_THR 1 true
mv LogF.txt $DATASET_FOLDER/CudaSiftLogF.txt
mv LogI.txt $DATASET_FOLDER/CudaSiftLogI.txt
$SCRIPT_DIR/run_bow.sh $DATASET_FOLDER $GT_FILE $MEMORY_THR 6 false
mv LogF.txt $DATASET_FOLDER/GfttBriefLogF.txt
mv LogI.txt $DATASET_FOLDER/GfttBriefLogI.txt
#$SCRIPT_DIR/run_bow.sh $DATASET_FOLDER $GT_FILE $MEMORY_THR 11 false
#mv LogF.txt $DATASET_FOLDER/SuperPointLogF.txt
#mv LogI.txt $DATASET_FOLDER/SuperPointLogI.txt

View File

@@ -0,0 +1,53 @@
#!/bin/bash
DATASET_FOLDER=""
GT_FILE=""
MEMORY_THR=300
DETECTOR=0
GPU=false
if [ $# -ge 2 ]
then
DATASET_FOLDER=$1
GT_FILE=$2
else
echo "Usage: run_bow.sh \"dataset folder\" \"ground truth file\" [\"Rtabmap/MemoryThr=300\"] [\"Kp/DetectorStrategy=0\"] [\"GPU=false\"]"
exit
fi
if [ $# -ge 3 ]
then
MEMORY_THR=$3
fi
if [ $# -ge 4 ]
then
DETECTOR=$4
fi
if [ $# -ge 5 ]
then
GPU=$5
fi
rtabmap-console \
-quiet \
--Rtabmap/StatisticLogged true\
--Rtabmap/StatisticLoggedHeaders false\
--Kp/DetectorStrategy $DETECTOR\
--SURF/HessianThreshold 150\
--Rtabmap/MemoryThr $MEMORY_THR\
--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\
--FAST/Gpu $GPU\
--GFTT/Gpu $GPU\
--ORB/Gpu $GPU\
--SIFT/Gpu $GPU\
--SURF/GpuVersion $GPU\
-gt "$GT_FILE"\
"$DATASET_FOLDER"

View File

@@ -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.
* [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
* `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`.
* `device_poses.txt`: VIO poses of each image in `device` 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
@@ -62,7 +62,7 @@ We provide two formats: the first one is more general and the second one is used
6. Use the MatLab/Octave scripts in this folder to show results you want. Set `dataDir` to directory containing the exported statistics.
```
sudo apt install install octave liboctave-dev
sudo apt install octave liboctave-dev
# In octave:
pkg install -forge control signal

View File

@@ -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_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(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(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)
SET(ORB_SLAM_VERSION 3)
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()
IF (ORB_SLAM_INCLUDE_DIR AND ORB_SLAM_LIBRARY AND DBoW2_LIBRARY AND g2o_INCLUDE_DIR AND g2o_LIBRARY)

View File

@@ -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)

View File

@@ -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.
Redistribution and use in source and binary forms, with or without
@@ -28,47 +28,32 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma once
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
#include <opencv2/highgui/highgui.hpp>
#include "rtabmap/core/SensorData.h"
#include "rtabmap/core/CameraInfo.h"
#include <set>
#include <stack>
#include <list>
#include <vector>
class UDirectory;
class UTimer;
#include <rtabmap/core/SensorCapture.h>
#include <rtabmap/core/IMU.h>
namespace rtabmap
{
class IMUFilter;
/**
* Class Camera
*
*/
class RTABMAP_CORE_EXPORT Camera
class RTABMAP_CORE_EXPORT Camera : public SensorCapture
{
public:
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);
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "") = 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:
/**
* Constructor
@@ -78,19 +63,16 @@ protected:
*/
Camera(float imageRate = 0, const Transform & localTransform = Transform::getIdentity());
/**
* returned rgb and depth images should be already rectified if calibration was loaded
*/
virtual SensorData captureImage(CameraInfo * info = 0) = 0;
virtual SensorData captureImage(SensorCaptureInfo * info = 0) = 0;
int getNextSeqID() {return ++_seq;}
void postInterIMU(const IMU & imu, double stamp);
private:
float _imageRate;
Transform _localTransform;
cv::Size _targetImageSize;
UTimer * _frameRateTimer;
int _seq;
virtual SensorData captureData(SensorCaptureInfo * info = 0) {return captureImage(info);}
private:
IMUFilter * imuFilter_;
bool publishInterIMU_;
};

View File

@@ -27,65 +27,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma once
#include <rtabmap/utilite/UEvent.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
#include "rtabmap/core/SensorEvent.h"

View File

@@ -27,48 +27,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma once
#include <string>
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
#include "rtabmap/core/SensorCaptureInfo.h"

View File

@@ -37,4 +37,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <rtabmap/core/camera/CameraRealSense2.h>
#include <rtabmap/core/camera/CameraRGBDImages.h>
#include <rtabmap/core/camera/CameraK4A.h>
#include <rtabmap/core/camera/CameraSeerSense.h>

View File

@@ -27,129 +27,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma once
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
#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_CORE_EXPORT 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();
// Use new version of this function with groundNormalsUp=0.8 for forceGroundNormalsUp=True and groundNormalsUp=0.0 for forceGroundNormalsUp=False.
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);
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
#include "rtabmap/core/SensorCaptureThread.h"

View File

@@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
#include <rtabmap/core/rvl_codec.h>
#include <rtabmap/utilite/UThread.h>
#include <opencv2/opencv.hpp>
@@ -86,5 +87,9 @@ cv::Mat RTABMAP_CORE_EXPORT uncompressData(const unsigned char * bytes, unsigned
cv::Mat RTABMAP_CORE_EXPORT compressString(const std::string & str);
std::string RTABMAP_CORE_EXPORT uncompressString(const cv::Mat & bytes);
std::string RTABMAP_CORE_EXPORT compressedDepthFormat(const cv::Mat & bytes);
std::string RTABMAP_CORE_EXPORT compressedDepthFormat(const std::vector<unsigned char> & bytes);
std::string RTABMAP_CORE_EXPORT compressedDepthFormat(const unsigned char * bytes, size_t size);
} /* namespace rtabmap */
#endif /* COMPRESSION_H_ */

View File

@@ -96,7 +96,11 @@ public:
const cv::Mat & empty,
float cellSize,
const cv::Point3f & viewpoint);
void updateDepthImage(int nodeId, const cv::Mat & image);
void updateCalibration(
int nodeId,
const std::vector<CameraModel> & models,
const std::vector<StereoCameraModel> & stereoModels);
void updateDepthImage(int nodeId, const cv::Mat & image, const std::string & format);
void updateLaserScan(int nodeId, const LaserScan & scan);
public:
@@ -174,6 +178,7 @@ public:
void getWeight(int signatureId, int & weight) const;
void getLastNodeIds(std::set<int> & ids) const;
void getAllNodeIds(std::set<int> & ids, bool ignoreChildren = false, bool ignoreBadSignatures = false, bool ignoreIntermediateNodes = false) const;
void getAllOdomPoses(std::map<int, Transform> & poses, bool ignoreChildren = false, bool ignoreIntermediateNodes = false) const;
void getAllLinks(std::multimap<int, Link> & links, bool ignoreNullLinks = true, bool withLandmarks = false) const;
void getLastNodeId(int & id) const;
void getLastMapId(int & mapId) const;
@@ -231,9 +236,15 @@ protected:
float cellSize,
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(
int nodeId,
const cv::Mat & image) const = 0;
const cv::Mat & image,
const std::string & format) const = 0;
virtual void updateLaserScanQuery(
int nodeId,
@@ -277,6 +288,7 @@ protected:
virtual bool getNodeInfoQuery(int signatureId, Transform & pose, int & mapId, int & weight, std::string & label, double & stamp, Transform & groundTruthPose, std::vector<float> & velocity, GPS & gps, EnvSensors & sensors) const = 0;
virtual void getLastNodeIdsQuery(std::set<int> & ids) const = 0;
virtual void getAllNodeIdsQuery(std::set<int> & ids, bool ignoreChildren, bool ignoreBadSignatures, bool ignoreIntermediateNodes) const = 0;
virtual void getAllOdomPosesQuery(std::map<int, Transform> & poses, bool ignoreChildren, bool ignoreIntermediateNodes) const = 0;
virtual void getAllLinksQuery(std::multimap<int, Link> & links, bool ignoreNullLinks, bool withLandmarks) const = 0;
virtual void getLastIdQuery(const std::string & tableName, int & id, const std::string & fieldName="id") const = 0;
virtual void getInvertedIndexNiQuery(int signatureId, int & ni) const = 0;

View File

@@ -96,9 +96,15 @@ protected:
float cellSize,
const cv::Point3f & viewpoint) const;
virtual void updateCalibrationQuery(
int nodeId,
const std::vector<CameraModel> & models,
const std::vector<StereoCameraModel> & stereoModels) const;
virtual void updateDepthImageQuery(
int nodeId,
const cv::Mat & image) const;
const cv::Mat & image,
const std::string & format) const;
void updateLaserScanQuery(
int nodeId,
@@ -142,6 +148,7 @@ protected:
virtual bool getNodeInfoQuery(int signatureId, Transform & pose, int & mapId, int & weight, std::string & label, double & stamp, Transform & groundTruthPose, std::vector<float> & velocity, GPS & gps, EnvSensors & sensors) const;
virtual void getLastNodeIdsQuery(std::set<int> & ids) const;
virtual void getAllNodeIdsQuery(std::set<int> & ids, bool ignoreChildren, bool ignoreBadSignatures, bool ignoreIntermediateNodes) const;
virtual void getAllOdomPosesQuery(std::map<int, Transform> & poses, bool ignoreChildren, bool ignoreIntermediateNodes) const;
virtual void getAllLinksQuery(std::multimap<int, Link> & links, bool ignoreNullLinks, bool withLandmarks) const;
virtual void getLastIdQuery(const std::string & tableName, int & id, const std::string & fieldName="id") const;
virtual void getInvertedIndexNiQuery(int signatureId, int & ni) const;
@@ -153,6 +160,7 @@ private:
std::string queryStepNode() const;
std::string queryStepImage() const;
std::string queryStepDepth() const;
std::string queryStepCalibrationUpdate() const;
std::string queryStepDepthUpdate() const;
std::string queryStepScanUpdate() const;
std::string queryStepSensorData() const;
@@ -165,7 +173,8 @@ private:
void stepNode(sqlite3_stmt * ppStmt, const Signature * s) const;
void stepImage(sqlite3_stmt * ppStmt, int id, const cv::Mat & imageBytes) const;
void stepDepth(sqlite3_stmt * ppStmt, const SensorData & sensorData) const;
void stepDepthUpdate(sqlite3_stmt * ppStmt, int nodeId, const cv::Mat & imageCompressed) 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 & image, const std::string & format) const;
void stepScanUpdate(sqlite3_stmt * ppStmt, int nodeId, const LaserScan & image) const;
void stepSensorData(sqlite3_stmt * ppStmt, const SensorData & sensorData) const;
void stepLink(sqlite3_stmt * ppStmt, const Link & link) const;

View File

@@ -82,14 +82,15 @@ public:
virtual bool isCalibrated() const;
virtual std::string getSerial() const;
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:
virtual SensorData captureImage(CameraInfo * info = 0);
virtual SensorData captureImage(SensorCaptureInfo * info = 0);
private:
SensorData getNextData(CameraInfo * info = 0);
SensorData getNextData(SensorCaptureInfo * info = 0);
private:
std::list<std::string> _paths;

View File

@@ -34,6 +34,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <list>
#include <numeric>
#include "rtabmap/core/Parameters.h"
#include "rtabmap/core/SensorData.h"
@@ -45,6 +46,7 @@ namespace gpu {
class SURF_GPU;
class ORB_GPU;
class FAST_GPU;
class GoodFeaturesToTrackDetector_GPU;
}
}
typedef cv::SIFT CV_SIFT;
@@ -57,13 +59,14 @@ typedef cv::BRISK CV_BRISK;
typedef cv::gpu::SURF_GPU CV_SURF_GPU;
typedef cv::gpu::ORB_GPU CV_ORB_GPU;
typedef cv::gpu::FAST_GPU CV_FAST_GPU;
typedef cv::gpu::GoodFeaturesToTrackDetector_GPU CV_GFTT_GPU;
#else
namespace cv{
namespace xfeatures2d {
class FREAK;
class DAISY;
class BriefDescriptorExtractor;
#if CV_MAJOR_VERSION < 3 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION <= 3) || (CV_MAJOR_VERSION == 3 && (CV_MINOR_VERSION < 4 || (CV_MINOR_VERSION==4 && CV_SUBMINOR_VERSION<11)))
#if (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION <= 3) || (CV_MAJOR_VERSION == 3 && (CV_MINOR_VERSION < 4 || (CV_MINOR_VERSION==4 && CV_SUBMINOR_VERSION<11)))
class SIFT;
#endif
class SURF;
@@ -72,9 +75,10 @@ namespace cuda {
class FastFeatureDetector;
class ORB;
class SURF_CUDA;
class CornersDetector;
}
}
#if CV_MAJOR_VERSION < 3 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION <= 3) || (CV_MAJOR_VERSION == 3 && (CV_MINOR_VERSION < 4 || (CV_MINOR_VERSION==4 && CV_SUBMINOR_VERSION<11)))
#if (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION <= 3) || (CV_MAJOR_VERSION == 3 && (CV_MINOR_VERSION < 4 || (CV_MINOR_VERSION==4 && CV_SUBMINOR_VERSION<11)))
typedef cv::xfeatures2d::SIFT CV_SIFT;
#else
typedef cv::SIFT CV_SIFT; // SIFT is back in features2d since 4.4.0 / 3.4.11
@@ -90,8 +94,12 @@ typedef cv::ORB CV_ORB;
typedef cv::cuda::SURF_CUDA CV_SURF_GPU;
typedef cv::cuda::ORB CV_ORB_GPU;
typedef cv::cuda::FastFeatureDetector CV_FAST_GPU;
typedef cv::cuda::CornersDetector CV_GFTT_GPU;
#endif
// CudaSift fork: https://github.com/matlabbe/CudaSift
class SiftData;
namespace rtabmap {
class ORBextractor;
@@ -192,16 +200,17 @@ public:
const cv::Mat & disparity,
float minDisparity);
static void limitKeypoints(std::vector<cv::KeyPoint> & keypoints, int maxKeypoints);
static void limitKeypoints(std::vector<cv::KeyPoint> & keypoints, cv::Mat & descriptors, int maxKeypoints);
static void limitKeypoints(std::vector<cv::KeyPoint> & keypoints, std::vector<cv::Point3f> & keypoints3D, cv::Mat & descriptors, int maxKeypoints);
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, int gridRows, int gridCols);
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, 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, 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 = 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, 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::vector<float> & roiRatios);
int getMaxFeatures() const {return maxFeatures_;}
bool getSSC() const {return SSC_;}
float getMinDepth() const {return _minDepth;}
float getMaxDepth() const {return _maxDepth;}
int getGridRows() const {return gridRows_;}
@@ -234,6 +243,7 @@ private:
private:
ParametersMap parameters_;
int maxFeatures_;
bool SSC_;
float _maxDepth; // 0=inf
float _minDepth;
std::vector<float> _roiRatios; // size 4
@@ -292,9 +302,18 @@ private:
double contrastThreshold_;
double edgeThreshold_;
double sigma_;
bool preciseUpscale_;
bool rootSIFT_;
bool gpu_;
float guaussianThreshold_;
bool upscale_;
cv::Ptr<CV_SIFT> _sift;
cv::Ptr<CV_SIFT> sift_;
SiftData * cudaSiftData_;
float * cudaSiftMemory_;
cv::Size cudaSiftMemorySize_;
cv::Mat cudaSiftDescriptors_;
bool cudaSiftUpscaling_;
};
//ORB
@@ -423,8 +442,10 @@ private:
int _blockSize;
bool _useHarrisDetector;
double _k;
bool _gpu;
cv::Ptr<CV_GFTT> _gftt;
cv::Ptr<CV_GFTT_GPU> _gpuGftt;
};
//GFTT_BRIEF

View File

@@ -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.
Redistribution and use in source and binary forms, with or without

View 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_ */

View 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_ */

View File

@@ -115,7 +115,8 @@ Transform RTABMAP_CORE_EXPORT calcRMSE(
float & rotational_median,
float & rotational_std,
float & rotational_min,
float & rotational_max);
float & rotational_max,
bool align2D = false);
void RTABMAP_CORE_EXPORT computeMaxGraphErrors(
const std::map<int, Transform> & poses,
@@ -136,6 +137,12 @@ std::multimap<int, Link>::iterator RTABMAP_CORE_EXPORT findLink(
int to,
bool checkBothWays = true,
Link::Type type = Link::kUndef);
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,
int from,
@@ -147,6 +154,12 @@ std::multimap<int, Link>::const_iterator RTABMAP_CORE_EXPORT findLink(
int to,
bool checkBothWays = true,
Link::Type type = Link::kUndef);
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,
int from,

View File

@@ -28,12 +28,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef 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 <Eigen/Geometry>
namespace rtabmap {
class IMUFilter
class RTABMAP_CORE_EXPORT IMUFilter
{
public:
enum Type {

View File

@@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
#include <rtabmap/core/Transform.h>
#include <rtabmap/core/Parameters.h>
#include <rtabmap/utilite/UThread.h>
#include <rtabmap/utilite/UEventsSender.h>
#include <rtabmap/utilite/UTimer.h>
@@ -39,6 +40,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace rtabmap
{
class IMUFilter;
/**
* Class IMUThread
*
@@ -53,6 +56,8 @@ public:
bool init(const std::string & path);
void setRate(int rate);
void enableIMUFiltering(int filteringStrategy=1, const ParametersMap & parameters = ParametersMap(), bool baseFrameConversion = false);
void disableIMUFiltering();
private:
virtual void mainLoopBegin();
@@ -65,6 +70,8 @@ private:
UTimer frameRateTimer_;
double captureDelay_;
double previousStamp_;
IMUFilter * _imuFilter;
bool _imuBaseFrameConversion;
};
} // namespace rtabmap

View File

@@ -0,0 +1,43 @@
/*
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 CORELIB_INCLUDE_RTABMAP_CORE_LASWRITER_H_
#define CORELIB_INCLUDE_RTABMAP_CORE_LASWRITER_H_
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
namespace rtabmap {
int saveLASFile(const std::string & filePath, const pcl::PointCloud<pcl::PointXYZ> & cloud, const std::vector<int> & cameraIds = std::vector<int>());
int saveLASFile(const std::string & filePath, const pcl::PointCloud<pcl::PointXYZRGB> & cloud, const std::vector<int> & cameraIds = std::vector<int>(), const std::vector<float> & intensities = std::vector<float>());
int saveLASFile(const std::string & filePath, const pcl::PointCloud<pcl::PointXYZI> & cloud, const std::vector<int> & cameraIds = std::vector<int>());
}
#endif /* CORELIB_INCLUDE_RTABMAP_CORE_LASWRITER_H_ */

View File

@@ -47,7 +47,8 @@ public:
kXYZRGB=7,
kXYZNormal=8,
kXYZINormal=9,
kXYZRGBNormal=10};
kXYZRGBNormal=10,
kXYZIT=11};
static std::string formatName(const Format & format);
static int channels(const Format & format);
@@ -55,6 +56,7 @@ public:
static bool isScanHasNormals(const Format & format);
static bool isScanHasRGB(const Format & format);
static bool isScanHasIntensity(const Format & format);
static bool isScanHasTime(const Format & format);
static LaserScan backwardCompatibility(
const cv::Mat & oldScanFormat,
int maxPoints = 0,
@@ -121,22 +123,27 @@ public:
float angleMin() const {return angleMin_;}
float angleMax() const {return angleMax_;}
float angleIncrement() const {return angleIncrement_;}
void setLocalTransform(const Transform & t) {localTransform_ = t;}
Transform localTransform() const {return localTransform_;}
bool empty() 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();}
bool is2d() const {return isScan2d(format_);}
bool hasNormals() const {return isScanHasNormals(format_);}
bool hasRGB() const {return isScanHasRGB(format_);}
bool hasIntensity() const {return isScanHasIntensity(format_);}
bool hasTime() const {return isScanHasTime(format_);}
bool isCompressed() const {return !data_.empty() && data_.type()==CV_8UC1;}
bool isOrganized() const {return data_.rows > 1;}
LaserScan clone() const;
LaserScan densify() const;
int getIntensityOffset() const {return hasIntensity()?(is2d()?2:3):-1;}
int getRGBOffset() const {return hasRGB()?(is2d()?2:3):-1;}
int getNormalsOffset() const {return hasNormals()?(2 + (is2d()?0:1) + ((hasRGB() || hasIntensity())?1:0)):-1;}
int getTimeOffset() const {return hasTime()?4:-1;}
float & field(unsigned int pointIndex, unsigned int channelOffset);

View File

@@ -0,0 +1,57 @@
/*
Copyright (c) 2010-2022, 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.
*/
#pragma once
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
#include <rtabmap/core/SensorCapture.h>
namespace rtabmap
{
/**
* 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

View 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_ */

View 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_ */

View File

@@ -57,8 +57,9 @@ class RegistrationInfo;
class RegistrationIcp;
class RegistrationVis;
class Stereo;
class OccupancyGrid;
class LocalGridMaker;
class MarkerDetector;
class GlobalDescriptorExtractor;
class RTABMAP_CORE_EXPORT Memory
{
@@ -302,6 +303,7 @@ private:
bool _notLinkedNodesKeptInDb;
bool _saveIntermediateNodeData;
std::string _rgbCompressionFormat;
std::string _depthCompressionFormat;
bool _incrementalMemory;
bool _localizationDataSaved;
bool _reduceGraph;
@@ -313,6 +315,7 @@ private:
bool _badSignaturesIgnored;
bool _mapLabelsAdded;
bool _depthAsMask;
float _maskFloorThreshold;
bool _stereoFromMotion;
unsigned int _imagePreDecimation;
unsigned int _imagePostDecimation;
@@ -330,8 +333,10 @@ private:
bool _rehearsalWeightIgnoredWhileMoving;
bool _useOdometryFeatures;
bool _useOdometryGravity;
bool _rotateImagesUpsideUp;
bool _createOccupancyGrid;
int _visMaxFeatures;
bool _visSSC;
bool _imagesAlreadyRectified;
bool _rectifyOnlyFeatures;
bool _covOffDiagonalIgnored;
@@ -371,9 +376,11 @@ private:
RegistrationIcp * _registrationIcpMulti;
RegistrationVis * _registrationVis;
OccupancyGrid * _occupancy;
LocalGridMaker * _localMapMaker;
MarkerDetector * _markerDetector;
GlobalDescriptorExtractor * _globalDescriptorExtractor;
};
} // namespace rtabmap

View File

@@ -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.
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.
*/
#ifndef CORELIB_SRC_OCCUPANCYGRID_H_
#define CORELIB_SRC_OCCUPANCYGRID_H_
#ifndef CORELIB_INCLUDE_RTABMAP_CORE_OCCUPANCYGRID_H_
#define CORELIB_INCLUDE_RTABMAP_CORE_OCCUPANCYGRID_H_
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
/*
* Deprecated header, use the one below directly!
*/
#include <pcl/point_cloud.h>
#include <pcl/pcl_base.h>
#include <rtabmap/core/Parameters.h>
#include <rtabmap/core/Signature.h>
#include <rtabmap/core/global_map/OccupancyGrid.h>
namespace rtabmap {
class RTABMAP_CORE_EXPORT OccupancyGrid
{
public:
inline static float logodds(double probability)
{
return (float) log(probability/(1-probability));
}
inline static double probability(double logodds)
{
return 1. - ( 1. / (1. + exp(logodds)));
}
public:
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_ */
#endif /* CORELIB_INCLUDE_RTABMAP_CORE_OCCUPANCYGRID_H_ */

View File

@@ -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.
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.
*/
#ifndef SRC_OCTOMAP_H_
#define SRC_OCTOMAP_H_
#ifndef CORELIB_INCLUDE_RTABMAP_CORE_OCTOMAP_H_
#define CORELIB_INCLUDE_RTABMAP_CORE_OCTOMAP_H_
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
/*
* Deprecated header, use the one below directly!
*/
#include <octomap/ColorOcTree.h>
#include <octomap/OcTreeKey.h>
#include <rtabmap/core/global_map/OctoMap.h>
#include <pcl/pcl_base.h>
#include <pcl/point_types.h>
#include <rtabmap/core/Transform.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_CORE_EXPORT 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_ */
#endif /* CORELIB_INCLUDE_RTABMAP_CORE_OCTOMAP_H_ */

View File

@@ -111,6 +111,7 @@ private:
bool _alignWithGround;
bool _publishRAMUsage;
bool _imagesAlreadyRectified;
bool _deskewing;
Transform _pose;
int _resetCurrentCount;
double previousStamp_;

View File

@@ -50,6 +50,7 @@ public:
localBundleConstraints(0),
localBundleTime(0),
keyFrameAdded(false),
timeDeskewing(0.0f),
timeEstimation(0.0f),
timeParticleFiltering(0.0f),
stamp(0),
@@ -76,6 +77,7 @@ public:
output.localBundlePoses = localBundlePoses;
output.localBundleModels = localBundleModels;
output.keyFrameAdded = keyFrameAdded;
output.timeDeskewing = timeDeskewing;
output.timeEstimation = timeEstimation;
output.timeParticleFiltering = timeParticleFiltering;
output.stamp = stamp;
@@ -105,6 +107,7 @@ public:
std::map<int, Transform> localBundlePoses;
std::map<int, std::vector<CameraModel> > localBundleModels;
bool keyFrameAdded;
float timeDeskewing;
float timeEstimation;
float timeParticleFiltering;
double stamp;

View File

@@ -79,8 +79,7 @@ public:
const std::map<int, Transform> & posesIn,
const std::multimap<int, Link> & linksIn,
std::map<int, Transform> & posesOut,
std::multimap<int, Link> & linksOut,
bool adjustPosesWithConstraints = true) const;
std::multimap<int, Link> & linksOut) const;
public:
virtual ~Optimizer() {}

View File

@@ -197,6 +197,7 @@ class RTABMAP_CORE_EXPORT Parameters
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, 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
RTABMAP_PARAM(Mem, RehearsalSimilarity, float, 0.6, "Rehearsal similarity.");
@@ -208,6 +209,7 @@ class RTABMAP_CORE_EXPORT Parameters
RTABMAP_PARAM(Mem, NotLinkedNodesKept, bool, true, "Keep not linked nodes in db (rehearsed nodes and deleted nodes).");
RTABMAP_PARAM(Mem, IntermediateNodeDataKept, bool, false, "Keep intermediate node data in db.");
RTABMAP_PARAM_STR(Mem, ImageCompressionFormat, ".jpg", "RGB image compression format. It should be \".jpg\" or \".png\".");
RTABMAP_PARAM_STR(Mem, DepthCompressionFormat, ".rvl", "Depth image compression format for 16UC1 depth type. It should be \".png\" or \".rvl\". If depth type is 32FC1, \".png\" is used.");
RTABMAP_PARAM(Mem, STMSize, unsigned int, 10, "Short-term memory size.");
RTABMAP_PARAM(Mem, IncrementalMemory, bool, true, "SLAM mode, otherwise it is Localization mode.");
RTABMAP_PARAM(Mem, LocalizationDataSaved, bool, false, uFormat("Save localization data during localization session (when %s=false). When enabled, the database will then also grow in localization mode. This mode would be used only for debugging purpose.", kMemIncrementalMemory().c_str()).c_str());
@@ -220,6 +222,7 @@ class RTABMAP_CORE_EXPORT Parameters
RTABMAP_PARAM(Mem, BadSignaturesIgnored, bool, false, "Bad signatures are ignored.");
RTABMAP_PARAM(Mem, InitWMWithAllNodes, bool, false, "Initialize the Working Memory with all nodes in Long-Term Memory. When false, it is initialized with nodes of the previous session.");
RTABMAP_PARAM(Mem, DepthAsMask, bool, true, "Use depth image as mask when extracting features for vocabulary.");
RTABMAP_PARAM(Mem, DepthMaskFloorThr, float, 0.0, uFormat("Filter floor from depth mask below specified threshold (m) before extracting features. 0 means disabled, negative means remove all objects above the floor threshold instead. Ignored if %s is false.", kMemDepthAsMask().c_str()));
RTABMAP_PARAM(Mem, StereoFromMotion, bool, false, uFormat("Triangulate features without depth using stereo from motion (odometry). It would be ignored if %s is true and the feature detector used supports masking.", kMemDepthAsMask().c_str()));
RTABMAP_PARAM(Mem, ImagePreDecimation, unsigned int, 1, uFormat("Decimation of the RGB image before visual feature detection. 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.",kMemDepthAsMask().c_str()));
RTABMAP_PARAM(Mem, ImagePostDecimation, unsigned int, 1, uFormat("Decimation of the RGB image before saving it to database. If depth size is larger than decimated RGB size, depth is decimated to be always at most equal to RGB size. Decimation is done from the original image. If set to same value than %s, data already decimated is saved (no need to re-decimate the image).", kMemImagePreDecimation().c_str()));
@@ -231,6 +234,8 @@ class RTABMAP_CORE_EXPORT Parameters
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, 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)
RTABMAP_PARAM(Kp, NNStrategy, int, 1, "kNNFlannNaive=0, kNNFlannKdTree=1, kNNFlannLSH=2, kNNBruteForce=3, kNNBruteForceGPU=4");
@@ -241,6 +246,7 @@ class RTABMAP_CORE_EXPORT Parameters
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, 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, 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)
@@ -277,12 +283,15 @@ class RTABMAP_CORE_EXPORT Parameters
RTABMAP_PARAM(SURF, GpuVersion, bool, false, "GPU-SURF: Use GPU version of SURF. This option is enabled only if OpenCV is built with CUDA and GPUs are detected.");
RTABMAP_PARAM(SURF, GpuKeypointsRatio, float, 0.01, "Used with SURF GPU.");
RTABMAP_PARAM(SIFT, NFeatures, int, 0, "The number of best features to retain. The features are ranked by their scores (measured in SIFT algorithm as the local contrast).");
RTABMAP_PARAM(SIFT, NOctaveLayers, int, 3, "The number of layers in each octave. 3 is the value used in D. Lowe paper. The number of octaves is computed automatically from the image resolution.");
RTABMAP_PARAM(SIFT, ContrastThreshold, double, 0.04, "The contrast threshold used to filter out weak features in semi-uniform (low-contrast) regions. The larger the threshold, the less features are produced by the detector.");
RTABMAP_PARAM(SIFT, NOctaveLayers, int, 3, "The number of layers in each octave. 3 is the value used in D. Lowe paper. The number of octaves is computed automatically from the image resolution. Not used by CudaSift, the number of octaves is still computed automatically.");
RTABMAP_PARAM(SIFT, ContrastThreshold, double, 0.04, uFormat("The contrast threshold used to filter out weak features in semi-uniform (low-contrast) regions. The larger the threshold, the less features are produced by the detector. Not used by CudaSift (see %s instead).", kSIFTGaussianThreshold().c_str()));
RTABMAP_PARAM(SIFT, EdgeThreshold, double, 10, "The threshold used to filter out edge-like features. Note that the its meaning is different from the contrastThreshold, i.e. the larger the edgeThreshold, the less features are filtered out (more features are retained).");
RTABMAP_PARAM(SIFT, Sigma, double, 1.6, "The sigma of the Gaussian applied to the input image at the octave #0. If your image is captured with a weak camera with soft lenses, you might want to reduce the number.");
RTABMAP_PARAM(SIFT, RootSIFT, bool, false, "Apply RootSIFT normalization of the descriptors.");
RTABMAP_PARAM(SIFT, PreciseUpscale, bool, false, "Whether to enable precise upscaling in the scale pyramid (OpenCV >= 4.8).");
RTABMAP_PARAM(SIFT, RootSIFT, bool, false, "Apply RootSIFT normalization of the descriptors.");
RTABMAP_PARAM(SIFT, Gpu, bool, false, "CudaSift: Use GPU version of SIFT. This option is enabled only if RTAB-Map is built with CudaSift dependency and GPUs are detected.");
RTABMAP_PARAM(SIFT, GaussianThreshold, float, 2.0, "CudaSift: Threshold on difference of Gaussians for feature pruning. The higher the threshold, the less features are produced by the detector.");
RTABMAP_PARAM(SIFT, Upscale, bool, false, "CudaSift: Whether to enable upscaling.");
RTABMAP_PARAM(BRIEF, Bytes, int, 32, "Bytes is a length of descriptor in bytes. It can be equal 16, 32 or 64 bytes.");
@@ -301,6 +310,7 @@ class RTABMAP_CORE_EXPORT Parameters
RTABMAP_PARAM(GFTT, BlockSize, int, 3, "");
RTABMAP_PARAM(GFTT, UseHarrisDetector, bool, false, "");
RTABMAP_PARAM(GFTT, K, double, 0.04, "");
RTABMAP_PARAM(GFTT, Gpu, bool, false, "GPU-GFTT: Use GPU version of GFTT. This option is enabled only if OpenCV>=3 is built with CUDA and GPUs are detected.");
RTABMAP_PARAM(ORB, ScaleFactor, float, 2, "Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor will mean that to cover certain scale range you will need more pyramid levels and so the speed will suffer.");
RTABMAP_PARAM(ORB, NLevels, int, 3, "The number of pyramid levels. The smallest level will have linear size equal to input_image_linear_size/pow(scaleFactor, nlevels).");
@@ -353,10 +363,12 @@ class RTABMAP_CORE_EXPORT 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, 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, 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, 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, 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, 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.");
@@ -376,6 +388,8 @@ class RTABMAP_CORE_EXPORT 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, 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
RTABMAP_PARAM(RGBD, ProximityByTime, bool, false, "Detection over all locations in STM.");
@@ -433,6 +447,9 @@ class RTABMAP_CORE_EXPORT 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(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
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");
@@ -455,6 +472,7 @@ class RTABMAP_CORE_EXPORT 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, 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, 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
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.");
@@ -525,12 +543,19 @@ class RTABMAP_CORE_EXPORT Parameters
RTABMAP_PARAM(OdomViso2, BucketHeight, double, 50, "Height of bucket.");
// Odometry ORB_SLAM2
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, ThDepth, double, 40.0, "Close/Far threshold. Baseline times.");
RTABMAP_PARAM(OdomORBSLAM, Fps, float, 0.0, "Camera FPS.");
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_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, ThDepth, double, 40.0, "Close/Far threshold. Baseline times.");
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, 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
RTABMAP_PARAM_STR(OdomOKVIS, ConfigPath, "", "Path of OKVIS config file.");
@@ -575,6 +600,68 @@ class RTABMAP_CORE_EXPORT Parameters
// Odometry VINS
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
RTABMAP_PARAM(OdomOpen3D, MaxDepth, float, 3.0, "Maximum depth.");
RTABMAP_PARAM(OdomOpen3D, Method, int, 0, "Registration method: 0=PointToPlane, 1=Intensity, 2=Hybrid.");
@@ -585,54 +672,60 @@ class RTABMAP_CORE_EXPORT 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.");
// 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, 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, 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, PnPFlags, int, 0, uFormat("[%s = 1] PnP flags: 0=Iterative, 1=EPNP, 2=P3P", kVisEstimationType().c_str()));
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, 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, 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()));
#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
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
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, 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, 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, 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, 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, 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)
// 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");
#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");
#endif
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, MinDepth, float, 0, "Min depth of the features (0 means no limit).");
RTABMAP_PARAM(Vis, DepthAsMask, bool, true, "Use depth image as mask when extracting features.");
RTABMAP_PARAM_STR(Vis, RoiRatios, "0.0 0.0 0.0 0.0", "Region of interest ratios [left, right, top, bottom].");
RTABMAP_PARAM(Vis, SubPixWinSize, int, 3, "See cv::cornerSubPix().");
RTABMAP_PARAM(Vis, SubPixIterations, int, 0, "See cv::cornerSubPix(). 0 disables sub pixel refining.");
RTABMAP_PARAM(Vis, SubPixEps, float, 0.02, "See cv::cornerSubPix().");
RTABMAP_PARAM(Vis, GridRows, int, 1, uFormat("Number of rows of the grid used to extract uniformly \"%s / grid cells\" features from each cell.", kVisMaxFeatures().c_str()));
RTABMAP_PARAM(Vis, GridCols, int, 1, uFormat("Number of columns of the grid used to extract uniformly \"%s / grid cells\" features from each cell.", kVisMaxFeatures().c_str()));
RTABMAP_PARAM(Vis, CorType, int, 0, "Correspondences computation approach: 0=Features Matching, 1=Optical Flow");
RTABMAP_PARAM(Vis, 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, CorNNDR, float, 0.8, uFormat("[%s=0] NNDR: nearest neighbor distance ratio. Used for knn 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, CorGuessMatchToProjection, bool, false, uFormat("[%s=0] Match frame's corners to source's projected points (when guess transform is provided) instead of projected points to frame's corners.", kVisCorType().c_str()));
RTABMAP_PARAM(Vis, CorFlowWinSize, int, 16, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
RTABMAP_PARAM(Vis, CorFlowIterations, int, 30, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
RTABMAP_PARAM(Vis, CorFlowEps, float, 0.01, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
RTABMAP_PARAM(Vis, CorFlowMaxLevel, int, 3, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
RTABMAP_PARAM(Vis, MaxFeatures, int, 1000, "0 no limits.");
RTABMAP_PARAM(Vis, SSC, bool, false, "If true, SSC (Suppression via Square Covering) is applied to limit keypoints.");
RTABMAP_PARAM(Vis, MaxDepth, float, 0, "Max depth of the features (0 means no limit).");
RTABMAP_PARAM(Vis, MinDepth, float, 0, "Min depth of the features (0 means no limit).");
RTABMAP_PARAM(Vis, DepthAsMask, bool, true, "Use depth image as mask when extracting features.");
RTABMAP_PARAM(Vis, DepthMaskFloorThr, float, 0.0, uFormat("Filter floor from depth mask below specified threshold (m) before extracting features. 0 means disabled, negative means remove all objects above the floor threshold instead. Ignored if %s is false.", kVisDepthAsMask().c_str()));
RTABMAP_PARAM_STR(Vis, RoiRatios, "0.0 0.0 0.0 0.0", "Region of interest ratios [left, right, top, bottom].");
RTABMAP_PARAM(Vis, SubPixWinSize, int, 3, "See cv::cornerSubPix().");
RTABMAP_PARAM(Vis, SubPixIterations, int, 0, "See cv::cornerSubPix(). 0 disables sub pixel refining.");
RTABMAP_PARAM(Vis, SubPixEps, float, 0.02, "See cv::cornerSubPix().");
RTABMAP_PARAM(Vis, GridRows, int, 1, uFormat("Number of rows of the grid used to extract uniformly \"%s / grid cells\" features from each cell.", kVisMaxFeatures().c_str()));
RTABMAP_PARAM(Vis, GridCols, int, 1, uFormat("Number of columns of the grid used to extract uniformly \"%s / grid cells\" features from each cell.", kVisMaxFeatures().c_str()));
RTABMAP_PARAM(Vis, CorType, int, 0, "Correspondences computation approach: 0=Features Matching, 1=Optical Flow");
RTABMAP_PARAM(Vis, 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, CorNNDR, float, 0.8, uFormat("[%s=0] NNDR: nearest neighbor distance ratio. Used for knn 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, CorGuessMatchToProjection, bool, false, uFormat("[%s=0] Match frame's corners to source's projected points (when guess transform is provided) instead of projected points to frame's corners.", kVisCorType().c_str()));
RTABMAP_PARAM(Vis, CorFlowWinSize, int, 16, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
RTABMAP_PARAM(Vis, CorFlowIterations, int, 30, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
RTABMAP_PARAM(Vis, CorFlowEps, float, 0.01, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
RTABMAP_PARAM(Vis, CorFlowMaxLevel, int, 3, uFormat("[%s=1] See cv::calcOpticalFlowPyrLK(). Used for optical flow approach.", kVisCorType().c_str()));
RTABMAP_PARAM(Vis, CorFlowGpu, bool, false, uFormat("[%s=1] Enable GPU version of the optical flow approach (only available if OpenCV is built with CUDA).", kVisCorType().c_str()));
#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
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
// Features matching approaches
@@ -646,6 +739,10 @@ class RTABMAP_CORE_EXPORT Parameters
RTABMAP_PARAM(GMS, WithScale, bool, false, "Take scale transformation into account.");
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
#ifdef RTABMAP_POINTMATCHER
RTABMAP_PARAM(Icp, Strategy, int, 1, "ICP implementation: 0=Point Cloud Library, 1=libpointmatcher, 2=CCCoreLib (CloudCompare).");
@@ -668,6 +765,7 @@ class RTABMAP_CORE_EXPORT Parameters
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, 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
RTABMAP_PARAM(Icp, PointToPlane, bool, true, "Use point to plane ICP.");
#else
@@ -701,6 +799,7 @@ class RTABMAP_CORE_EXPORT Parameters
RTABMAP_PARAM(Stereo, OpticalFlow, bool, true, "Use optical flow to find stereo correspondences, otherwise a simple block matching approach is used.");
RTABMAP_PARAM(Stereo, SSD, bool, true, uFormat("[%s=false] Use Sum of Squared Differences (SSD) window, otherwise Sum of Absolute Differences (SAD) window is used.", kStereoOpticalFlow().c_str()));
RTABMAP_PARAM(Stereo, Eps, double, 0.01, uFormat("[%s=true] Epsilon stop criterion.", kStereoOpticalFlow().c_str()));
RTABMAP_PARAM(Stereo, Gpu, bool, false, uFormat("[%s=true] Enable GPU version of the optical flow approach (only available if OpenCV is built with CUDA).", kStereoOpticalFlow().c_str()));
RTABMAP_PARAM(Stereo, DenseStrategy, int, 0, "0=cv::StereoBM, 1=cv::StereoSGBM");
@@ -763,8 +862,6 @@ class RTABMAP_CORE_EXPORT Parameters
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, 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, 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).");
@@ -849,6 +946,7 @@ public:
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 readINIStr(const std::string & configContent, ParametersMap & parameters, bool modifiedOnly = false);
static void writeINI(const std::string & configFile, const ParametersMap & parameters);
/**

View File

@@ -11,31 +11,31 @@
#include <string>
#include <rtabmap/utilite/UMutex.h>
#include <Python.h>
namespace pybind11 {
class scoped_interpreter;
class gil_scoped_release;
}
namespace rtabmap {
/**
* Create a single PythonInterface on main thread at
* global scope before any Python classes.
*/
class PythonInterface
{
public:
PythonInterface();
virtual ~PythonInterface();
protected:
std::string getTraceback(); // should be called between lock() and unlock()
void lock();
void unlock();
private:
static UMutex mutex_;
static int refCount_;
protected:
static PyThreadState * mainThreadState_;
static unsigned long mainThreadID_;
PyThreadState * threadState_;
pybind11::scoped_interpreter* guard_;
pybind11::gil_scoped_release* release_;
};
std::string getPythonTraceback();
}
#endif /* CORELIB_SRC_PYTHON_PYTHONINTERFACE_H_ */

View File

@@ -69,6 +69,7 @@ private:
float _epsilon;
float _correspondenceRatio;
bool _force4DoF;
int _filtersEnabled;
bool _pointToPlane;
int _pointToPlaneK;
float _pointToPlaneRadius;

View File

@@ -82,12 +82,16 @@ private:
float _PnPReprojError;
int _PnPFlags;
int _PnPRefineIterations;
int _PnPVarMedianRatio;
float _PnPMaxVar;
bool _PnPSplitLinearCovarianceComponents;
unsigned int _multiSamplingPolicy;
int _correspondencesApproach;
int _flowWinSize;
int _flowIterations;
float _flowEps;
int _flowMaxLevel;
bool _flowGpu;
float _nndr;
int _nnType;
bool _gmsWithRotation;
@@ -97,6 +101,7 @@ private:
bool _guessMatchToProjection;
int _bundleAdjustment;
bool _depthAsMask;
float _maskFloorThreshold;
float _minInliersDistributionThr;
float _maxInliersMeanDistance;

View File

@@ -151,6 +151,8 @@ public:
float getTimeThreshold() const {return _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);
int triggerNewMap();
@@ -282,6 +284,8 @@ private:
unsigned int _maxMemoryAllowed; // signatures count in WM
float _loopThr;
float _loopRatio;
float _aggressiveLoopThr;
int _virtualPlaceLikelihoodRatio;
float _maxLoopClosureDistance;
bool _verifyLoopClosureHypothesis;
unsigned int _maxRetrieved;
@@ -322,10 +326,13 @@ private:
int _pathStuckIterations;
float _pathLinearVelocity;
float _pathAngularVelocity;
bool _forceOdom3doF;
bool _restartAtOrigin;
bool _loopCovLimited;
bool _loopGPS;
int _maxOdomCacheSize;
bool _localizationSmoothing;
double _localizationPriorInf;
bool _createGlobalScanMap;
float _markerPriorsLinearVariance;
float _markerPriorsAngularVariance;

View File

@@ -0,0 +1,93 @@
/*
Copyright (c) 2010-2022, Mathieu Labbe
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 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.
*/
#pragma once
#include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
#include <opencv2/highgui/highgui.hpp>
#include <rtabmap/core/SensorCaptureInfo.h>
#include "rtabmap/core/SensorData.h"
#include <set>
#include <stack>
#include <list>
#include <vector>
class UDirectory;
class UTimer;
namespace rtabmap
{
/**
* Class Camera
*
*/
class RTABMAP_CORE_EXPORT SensorCapture
{
public:
virtual ~SensorCapture();
SensorData takeData(SensorCaptureInfo * info = 0);
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "") = 0;
virtual std::string getSerial() const = 0;
virtual bool odomProvided() const { return false; }
virtual bool getPose(double stamp, Transform & pose, cv::Mat & covariance, double maxWaitTime = 0.06) { return false; }
//getters
float getFrameRate() const {return _frameRate;}
const Transform & getLocalTransform() const {return _localTransform;}
//setters
void setFrameRate(float frameRate) {_frameRate = frameRate;}
void setLocalTransform(const Transform & localTransform) {_localTransform= localTransform;}
void resetTimer();
protected:
/**
* Constructor
*
* @param frameRate the frame rate (Hz), 0 for fast as the sensor can
* @param localTransform the transform from base frame to sensor frame
*/
SensorCapture(float frameRate = 0, const Transform & localTransform = Transform::getIdentity());
/**
* returned rgb and depth images should be already rectified if calibration was loaded
*/
virtual SensorData captureData(SensorCaptureInfo * info = 0) = 0;
int getNextSeqID() {return ++_seq;}
private:
float _frameRate;
Transform _localTransform;
UTimer * _frameRateTimer;
int _seq;
};
} // namespace rtabmap

Some files were not shown because too many files have changed in this diff Show More