ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Poor results of loop closurse detection rtabmap_ros.

asked 2016-08-03 12:38:19 -0500

necro gravatar image

updated 2016-08-05 06:10:20 -0500

Hello,

I was trying to map hallway and passed it twice, during mapping i got almost zero loop closures and my second pass is seen under another angle. Result is that i got two connected hallways: http://i.imgur.com/yJkODMn.png .
I'm using Xtion Live Pro with configuration:

  <param name="Kp/DetectorStrategy" type="string" value="5"/> <!-- GFFT+FREAK -->
  <param name="Kp/MaxDepth" type="string" value="3.5"/> <!-- Max distance  -->
  <param name="Vis/MaxDepth" type="string" value="3.5"/>
  <param name="Vis/MinDepth" type="string" value="0.8"/> <!-- Min distance -->
  <param name="Kp/MinDepth" type="string" value="0.8"/>
  <param name="Kp/NNStrategy" type="string" value="3"/> <!-- BruteForce -->
  <param name="Vis/CorNNType" type="string" value="3"/> <!-- BruteForce -->

Do you have any ideas how i can get better results? Also I'm not sure about those Brute Forces. I decided to use GFFT+FREAK because i read they give good results, should I try another algorithm?

Thanks for answers.

[EDIT]
I realized that using GFFT+FREAK (which i read are slow) i got 440 frames in 30 minutes which gives only 14,(6) frames per minute which is 0,2(4)FPS, with this i scanned 2 floors + stairs few times. Next i decided to use ORB algorithm which gives me 330 frames in 6 minutes ~0,91FPS.

Can I record with high framerate and them make GFFT+FREAK algorithm work? To make sure, algorithms use most of my CPU not GPU or RAM? In comments there are few questions please answer as much as you can. I will make more algorithm tests but my battery is empty i need to wait for charge ;)

edit retag flag offensive close merge delete

Comments

Did you save the database somewhere and can you share it? (the one created in ~/.ros/rtabmap.db)

matlabbe gravatar image matlabbe  ( 2016-08-03 18:26:47 -0500 )edit

Clouds are saved in database only if I download them all from cache? I few scans today but my database files are very small... Now I'm in office i looked around, downloaded clouds and my database is much bigger.

necro gravatar image necro  ( 2016-08-04 06:54:02 -0500 )edit

Also i realized that after first pass i got about 100 new pictures (IDs counter), second pass ~80, thid ~60 and so on... After 8 passes through hall i got 367 entries which give me about 45 per walk. Today first floor was ok (4passes) when staris are curved and another floor (4passes) looks bad.

necro gravatar image necro  ( 2016-08-04 06:57:17 -0500 )edit

The database contains all data in the map automatically added to it. Make sure to kill rtabmap before copying the database (to make sure everything is saved in it). You can browse data in the database with rtabmap-databaseViewer.

matlabbe gravatar image matlabbe  ( 2016-08-04 08:18:50 -0500 )edit

My bad. In a while I'm going for another scan. Can i record database with data recorder and then process it? Already i recorded DB but it says there is no graph when i try to make pointcloud from databaseViewer, i generated it but viewer still don't see it. How can i export pcl from Data recorder?

necro gravatar image necro  ( 2016-08-04 08:43:04 -0500 )edit

I want to make it this way because my laptop is slow and I'm not in hurry so my idea is to record big amount of pictures and then process them (already all is made "live" which i don't need). In short i have a lot of time and i want to process record with high accuray.

necro gravatar image necro  ( 2016-08-04 08:45:09 -0500 )edit

I'm back. I realized that using GFFT+FREAK (which i read are slow) i got 440 frames in 30 minutes which gives only 14,(6) frames per minute which is 0,2(4)FPS, with this i scanned 2 floors + stairs few times.
Next i decided to use ORB algorithm which gives me 330 frames in 6 minutes ~0,91FPS.

necro gravatar image necro  ( 2016-08-04 09:55:12 -0500 )edit

Can I record with high framerate and them make GFFT+FREAK algorithm work? To make sure, algorithms use most of my CPU not GPU or RAM?
In comments there are few questions please answer as much as you can. I will make more algorithm tests but my battery is empty i need to wait for charge ;)

necro gravatar image necro  ( 2016-08-04 09:59:43 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-08-04 11:36:51 -0500

matlabbe gravatar image

Don't use BruteForce matching for the vocabulary (Kp group), use KDTree (default). I tested both databases (see in comments) and ORB seems to find most of the loop closures. The database with ORB seems to be already ok. Note that I have a better global optimized graph using TORO or GTSAM on this database (well g2o with GaussNewton optimizer seems better too g2o/Optimizer=1). For features, I personally prefer SURF for loop closure detection but it is just I've never did an exhaustive comparison of ORB and SURF, just did SURF benchmark for loop closure detection and it works well most of the time.

Here some parameters I changed:

<param name="Kp/DetectorStrategy" type="string" value="0"/> <!-- SURF -->
<param name="Kp/MaxDepth"  type="string" value="0"/> <!-- unlimited distance for the vocabulary  -->
<param name="Kp/NNStrategy"       type="string" value="1"/> <!-- KdTree -->
<param name="Vis/CorNNType"       type="string" value="1"/> <!-- KdTree -->
<param name="Optimizer/Strategy"  type="string" value="2"/> <!-- GTSAM global optimization -->
<param name="RGBD/LoopClosureReextractFeatures" type="string" value="true"/> <!-- optional but more loop closures would be accepted -->

<!-- optional for odometry and rtabmap node -->
<param name="Vis/EstimationType" type="string" value="1"/> <!-- use 2D to 3D estimation -->
<param name="Vis/MaxDepth"       type="string" value="5"/> <!-- max depth can be higher with 2D to 3D estimation -->

In the database where you traverse two floors, most loop closures are detected with SURF or ORB. You may want to close the loop between the two floors by taking the stairs at the other side, this may reduce the "bending" map effect between the two floors. Well, the visual odometry could be also better, to reduce the drift. Also, be careful when you pass a door so that visual odometry can keep a high number of features to track, otherwise large drifts would happen.

cheers

edit flag offensive delete link more

Comments

Thanks, I will check Your configuration now. I am able to record data with rtabmap-dataRecorder and then analyze it with one of algorithms? Already i got problem which says there is no graph, it's no odometry fault? How i can add graph and analyze database.

necro gravatar image necro  ( 2016-08-05 02:57:22 -0500 )edit

I'm trying to re-compute my odometry but it's lost almost every step, how should i confiugurate it?
During re-computing my clouds are still "bending" at the end of hallway (i make U turn). Can i save and load parameters from file somehow without reset rtabmap? Also i can't check FLANN KdTree.

necro gravatar image necro  ( 2016-08-05 03:44:32 -0500 )edit

I made it ;) Successfully opened database saved with rtabmap-Datarecorder. But i want to check odometry/depth for each frame, now it's scans at about 1hz when "movie" is played at 100% speed, can I slow down that record? In next comment i will put link to download my "movie" and my result.

necro gravatar image necro  ( 2016-08-05 06:30:50 -0500 )edit

Ok, here's my record: https://drive.google.com/file/d/0BwBc...
And here is my database after running it in Rtabmap stand-alone app: https://drive.google.com/file/d/0BwBc...

necro gravatar image necro  ( 2016-08-05 06:38:01 -0500 )edit

Propably got it. I changed detection rate and data buffer size to 0 (infinity). Should i change something in odometry? Other thing is that i can't check FLANN KdTree (non-commercial OpenCV without SIFT/SURF i want to use BSD licenses), and last thing is that there is no 2D to 3D but 3D to 2D (PnP).

necro gravatar image necro  ( 2016-08-05 07:03:22 -0500 )edit

To make sure here is my configuration http://pastebin.com/AR3zn1Cj . I changed FLANN to Linear (KdTree not available) How I am able to load it to standalone app?

necro gravatar image necro  ( 2016-08-05 07:12:29 -0500 )edit

With rtabmap-dataRecorder, there is no graph saved, only raw data. You may use this kind of database as input source. I fixed kdTree not available bug (as it should be always be available). It was a bug in rtabmapviz only, rtabmap node should be ok.

matlabbe gravatar image matlabbe  ( 2016-08-05 15:58:51 -0500 )edit

2D to 3D or 3D to 2D is the same, just a typo

matlabbe gravatar image matlabbe  ( 2016-08-05 16:00:15 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-08-03 12:38:19 -0500

Seen: 1,308 times

Last updated: Aug 05 '16