Posted by
viniciusbs on
URL: http://official-rtab-map-forum.206.s1.nabble.com/RTAB-Map-and-Unity-integration-tp4925p4973.html
Hi again,
Sorry for the delay in replying, but this has been harder than I initially expected. I've decided to start with a pre-built map loaded in Unity and just update the position according to the robot localization, because this is easier to implement and also to explore a best case scenario of what could be achieved in terms of visualization.
So, I'm trying to get the 3d map using rtabmap. However, I'm facing this problem where the clouds don't get correctly aligned, leading to double walls and distorted objects, as seen in the figures below.

This happens even after loop closure is detected. I've tried many different things and no success, so I was hoping that maybe you could have some insight to help me. Follows a description of my setup and observations:
I'm using Ubuntu 16.04 and ROS Kinetic. The robot I'm using has laser scanners with 360 degrees laser coverage, but no wheel encoders, so I'm using a slightly modified version of
this to do the mapping. I'm trying to map a corridor with an Asus Xtion camera, by going one way, back and then another half rotation for loop closure detection. I noticed that the points relative to the right wall are always a bit shifted from the laser readings, which messes up the map. When loop closure is detected, the grid map from hector_mapping gets corrected, but not the point cloud map. When I run hector_mapping alone, I don't see any distortion between the laser readings and the map. I think that setting "RGBD/NeighborLinkRefining" parameter to true helped a little, but not much. Also, during runtime, rtabmap keeps throwing this error below but continues to run normally. From what I read on another post here on the forum I understood that it is safe to ignore this, right?
[ERROR] (2018-08-31 17:19:51.847) Memory.cpp:815::addSignatureToStm() Failed to invert the covariance matrix! Covariance matrix should be invertible!
Covariance: [12.03116893768311, -2.387195825576782, 0, 0, 0, 139.1024169921875;
-2.387195825576782, 32.27930450439453, 0, 0, 0, 249.5898590087891;
0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0;
139.1024169921875, 249.5898590087891, 0, 0, 0, 32290.607421875]
To reproduce the problem, I've uploaded
here a compressed bag file of a sample run, my roslaunch file, the unmodified rtabmap database that was saved when the run finished, and two .ply mesh files generated, with the above parameter set or unset.
Like I said, I've run out of ideas on how to fix this, so really appreciate any help. And sorry for the long post!
Cheers,
Vinicius