Re: Rtabmap mapping with two cameras

Posted by matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Rtabmap-mapping-with-two-cameras-tp2662p2752.html

Hi,

For your errors above, it seems related to multiple rtabmap installations with different versions.
1- Make sure the rtabmap/rtabmap_ros binaries are not installed
2- Update both rtabmap and rtabmap_ros projects (git pull)
3- Make sure there are no rtabmap installed from source anywhere:
# If installed in /usr/local
$ rm /usr/local/lib/librtabmap*
$ rm -r /usr/local/lib/rtabmap*
$ rm -r /usr/local/include/rtabmap*
$ rm /usr/local/bin/rtabmap*

# If installed in ~/catkin_ws/devel
$ rm ~/catkin_ws/devel/lib/librtabmap*
$ rm -r ~/catkin_ws/devel/lib/rtabmap*
$ rm -r ~/catkin_ws/devel/include/rtabmap*
$ rm ~/catkin_ws/devel/bin/rtabmap*

4- In rtabmap project, delete everything in build folder, and remake:
$ rm -r rtabmap/build/*
$ cd rtabmap/build
$ cmake -DCMAKE_INSTALL_PREFIX=~/catkin_ws/devel ..
$ make install
5- catkin_make

For your questions:
adr_arroyo wrote
How is the relation between the 2D map and the 3D map?
They both generated with sensor data contained in the map's graph. When the graph changes (e.g., loop closure correction), the maps are regenerated/updated according to each new poses.

adr_arroyo wrote
how does rtabmap use the laser for the mapping?
It uses it to
1) create the 2D occupancy grid map (Grid/FromDepth=false), and/or
2) refine graph's links with ICP (Reg/Strategy=1, RGBD/NeighborLinkRefining=true), and/or
3) add proximity links, similar to loop closure detection but only by matching nearby scans (RGBD/ProximityBySpace=true)

adr_arroyo wrote
Is it mandatory to use or is it possible to use only a camera?
A LiDAR is not required, while it can add precision in some environments. The minimum requirement is a RGB-D camera or a stereo camera.

adr_arroyo wrote
does rtabmap perform a localization of the 2D map and then translates it to the 3D map?
Localization is done by matching visual features and by scan matching (if subscribed to a scan topic and RGBD/ProximityBySpace=true) using directly the nodes in the map's graph. Thus 2D map and the 3D map are not used for localization, they are the results of the optimized graph/pose correction.

adr_arroyo wrote
does it get a 2D map from a camera and a 3D map from a different source and then combines them or does it combine them on the road from the same sources?
It may be complicated because of the choice of the sensors, but to make it simple you must choose a single sensor to create the map. Here some examples (note that some examples can produce both 2D and 3D maps):
1) 2d scan input (/scan + subscribe_scan=true) + Grid/FromDepth=false -----> 2D grid map
2) 3d point cloud input (/scan_cloud + subscribe_scan_cloud=true) + Grid/FromDepth=false + Grid/3D=true -----> 3D grid map and 2D grid map
3) 3d point cloud input (/scan_cloud + subscribe_scan_cloud=true) + Grid/FromDepth=false + Grid/3D=false -----> 2D grid map
4) Grid/FromDepth=true + Grid/3D=true -----> 3D grid map and 2D grid map from camera's depth
5) Grid/FromDepth=true + Grid/3D=false -----> 2D grid map from camera's depth
There is no way to combine multiple sensors to create the map (multi-camera is considered one sensor). If you want to combine multiple sensor data, you have to merge them together into a single point cloud per acquisition before rtabmap node, then use /scan_cloud input topic.

adr_arroyo wrote
What is the difference between using one camera or two; is one of them used for the mapping and the other as laser or are both used for mapping and combined their images?
They are both combined into a single image. The mapping doesn't know that there are two or more cameras. The advantage is the extended FOV (better visual odometry and localization).

adr_arroyo wrote
is the laser independent of the cameras?
If laser scans are from a different sensor, yes. In some examples (like this one), we create a fake laser scan from the kinect for convenience to get a fast 2D grid map created like with a real LiDAR (2D ray tracing), so in these cases they are dependent (same source).

cheers,
Mathieu