-
Notifications
You must be signed in to change notification settings - Fork 788
Kinect mapping
matlabbe edited this page Jan 23, 2015
·
14 revisions
Tutorial about mapping an environment using a hand-held Kinect.
- Mapping
- Your first map!
- Lost Odometry (RED screens!)
- Restart/New mapping session
- Open a previous mapping session
- Export cloud
- Export TORO graph
## Mapping ### Your first map! * Open RTAB-Map. At the first start, RTAB-Map tells you that it will put some data (database, screenshots...) in your documents folder.
$ rtabmap
- (RTAB-Map>=0.7.1) When the GUI is opened, the actions are disabled like in the first screenshot below. You need to create a new database or open a previous session to continue to map in it. Here we will create a new database, so click on "File -> New database..." like in the second screenshot. The third screenshot shows the progress dialog telling that the database is initialized.
- By default, the OpenNI driver is used for the Kinect sensor. If you have an ASUS Xtion, you may want to select OpenNI2 driver, as in the screenshot below. If RTAB-Map is built with Freenect, Freenect driver could be also used with the Kinect.
- Start mapping using the "Start" button.
- When a loop closure is found, the matching image is shown with a green background.
- To see more clearly the loop closures found, you can open the "3D loop closure" panel: Window->Show view->3D Loop closure. By using numbers 1->5 on the keypad, you can change how point clouds are shown (random colors, axis oriented colors or RGB).
- To recover from lost odometry, you could also reset the odometry using "Detection -> Reset odometry" (on ROS:
$rosservice call /reset_odom
). Don't forget to replace the camera to a scene with a lot of texture before resetting, otherwise the odometry won't still be able to start at all (RED background will stay here). Resetting the odometry will make RTAB-Map to create a new map, so the map should disappear and a new one is shown:
- When a loop closure is detected with the old map, it should re-appear:
- Here a video example showing what happens on odometry reset and map merging.
- If you want to clear the current mapping session, press "Edit -> Delete memory".
- The database is initialized but nothing shown yet in the GUI. You should download the clouds from the database to the GUI to see them, press "Download all clouds (update cache)":
- A small dialog should open with "Global map optimized" already selected, press OK and a progress dialog will open:
- Now you should see the clouds of the previous session.
- If you just opened a database, you should do "Edit -> Download all clouds (update cache) to enable the Export action.
- The "Export 3D clouds..." dialog will open with some options to export the clouds. By default, the clouds are regenerated with more points and are assembled together:
- When saved to PLY format, the cloud can be imported to any 3D applications, here imported in MeshLab:
- When saved to PCD format, you can open the point clouds with pcl_viewer:
$ pcl_viewer cloud*
VERTEX3 1 -0.487161 0.497615 -0.457941 -0.140045 -0.190645 -0.440158
VERTEX3 2 -0.488029 0.496808 -0.456870 -0.139456 -0.190018 -0.439254
VERTEX3 3 -0.486170 0.499928 -0.457844 -0.140213 -0.190512 -0.441440
VERTEX3 4 -0.487552 0.496047 -0.457573 -0.137795 -0.190239 -0.439541
VERTEX3 5 -0.487681 0.495221 -0.457093 -0.138144 -0.189963 -0.438671
VERTEX3 6 -0.487354 0.495988 -0.458522 -0.138571 -0.190634 -0.439124
[...]
EDGE3 1 2 -0.001122 0.000234 0.002675 -0.001059 0.001952 -0.000275 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 2 3 -0.000257 -0.001027 0.000539 -0.000240 -0.000039 0.000980 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 3 4 -0.002841 -0.002771 0.001017 0.006640 -0.000192 0.000507 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 3 1 -0.000000 -0.000000 0.000000 0.000000 0.000000 0.000000 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 4 5 -0.000165 0.001504 -0.001403 0.000698 -0.000963 -0.000977 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 4 1 0.000000 0.000000 0.000000 -0.000000 0.000000 0.000000 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 4 2 0.000610 0.001493 0.001027 -0.001396 0.000515 -0.000822 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 5 6 0.000079 0.000609 -0.000993 0.000083 -0.000677 -0.000252 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 5 1 -0.002703 -0.000298 -0.001471 -0.002082 -0.001686 -0.000104 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 5 2 -0.000000 0.000000 0.000000 -0.000000 0.000000 -0.000000 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 5 3 -0.001887 0.000871 -0.008452 0.001067 -0.006083 -0.000940 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 6 7 -0.000337 -0.000881 -0.000683 0.000078 -0.000878 0.000886 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 6 1 -0.001197 0.005586 0.001946 -0.003419 0.001207 -0.004001 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 6 2 -0.001600 -0.002833 0.000011 -0.001111 0.000138 0.002364 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 6 3 -0.001129 0.009211 0.004070 -0.006041 0.002271 -0.004176 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
EDGE3 6 4 -0.000277 -0.001431 -0.001244 0.003501 -0.001753 -0.000819 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1
[...]