RTAB-Map occupancy grid map error in Turtlebot3 Gazebo

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

RTAB-Map occupancy grid map error in Turtlebot3 Gazebo

yclo3
This post was updated on .
Hi,

I am new and testing RTAB-Map with Turtlebot3 in Gazebo, i.e., the package turtlebot3_gazebo. It's highly likely that at the beginning OccupancyGrid.cpp reports extreme poses and the grid map is not generated but recovered after a small move. If the grid map is not recovered after moves the process will die. The error messages and my launch file are at the bottom.

The RGB-D part just works fine and produces 3D point clouds without problems even if the grid map is getting stuck. The launch file at the bottom only subscribes to scan topic. The error occurs no matter whether it subscribes to RGB-D topics.

The version of rtabmap and rtabmap_ros are up-to-date.

Here are some observations:
1. This error is not observed on real Turtlebot3.
2. This error is not shown if neither rviz nor rtabmapviz is launched. For rtabmapviz, this error occurs on the request to graphview and Rtabmap will be paused.
3. It occurs randomly. At the beginning the grid map may be shown without problems or the process may die instantly.
4. It acts like being affected by non-initialized variables. Once it died, simply reopen the same Gazebo launch file and rtabmap process would repeat the dead status. But opening another Gazebo launch file can refresh it. e.g, died in turtlebot3_house.launch and be refreshed with turtlebot3_world.launch.
5. The status may go from good to bad during the mapping process and die in worst case.
6. When the grid map is recovered after moves, the scans from locations while in bad status is available on the recovered grid map.
7. The lidar spec seems doesn't matter. The error remains with better lidar range, rate, resolution.

Error message:
[ INFO] [1559125683.728586934, 12.243000000]: rtabmap 0.19.2 started...
[ INFO] [1559125683.812297465, 12.327000000]: Loading from pre-hydro parameter style
[ INFO] [1559125683.827900775, 12.342000000]: Using plugin "static_layer"
[ INFO] [1559125683.834373944, 12.349000000]: Requesting the map...
[ INFO] [1559125683.886420927, 12.401000000]: rtabmap (1): Rate=1.00s, Limit=0.000s, RTAB-Map=0.0020s, Maps update=0.0059s pub=0.0002s (local map=1, WM=1)
[ERROR] (2019-05-29 18:28:05.084) OccupancyGrid.cpp:1093::update() Large map size!! map min=(-10.525000, -10.525000) max=(15393669209995186527723847680.000000,16772793129819273747759104.000000). There's maybe an error with the poses provided! The map will not be created!
[ WARN] [1559125685.084768042, 13.597000000]: Grid map is empty! (local maps=2)
[ INFO] [1559125685.084814301, 13.597000000]: rtabmap (2): Rate=1.00s, Limit=0.000s, RTAB-Map=0.0021s, Maps update=0.0029s pub=0.0001s (local map=1, WM=1)
[ERROR] (2019-05-29 18:28:06.286) OccupancyGrid.cpp:1093::update() Large map size!! map min=(-10.525000, -10.525000) max=(15393669209995186527723847680.000000,16772793129819273747759104.000000). There's maybe an error with the poses provided! The map will not be created!
[ WARN] [1559125686.287078498, 14.796000000]: Grid map is empty! (local maps=2)
[ INFO] [1559125686.287131429, 14.796000000]: rtabmap (3): Rate=1.00s, Limit=0.000s, RTAB-Map=0.0023s, Maps update=0.0013s pub=0.0001s (local map=1, WM=1)
[ERROR] (2019-05-29 18:28:07.289) OccupancyGrid.cpp:1093::update() Large map size!! map min=(-10.525000, -10.525000) max=(15393669209995186527723847680.000000,16772793129819273747759104.000000). There's maybe an error with the poses provided! The map will not be created!

Recovered and grid map shown:


Process died: (This case is not easy to be reproduced, this screenshot is taken in localization mode. It is also crashed by extreme poses)


rqt_graph:


My launch file modified from demo_turtlebot_mapping.launch (simulation:=true model:='waffle' in my runs, model doesn't matter though):
demo_turtlebot3_mapping_L.launch

Sincerely,
YC
Reply | Threaded
Open this post in threaded view
|

Re: RTAB-Map occupancy grid map error in Turtlebot3 Gazebo

matlabbe
Administrator
Can you show values of odometry when it occurs?
$ rostopic echo /odom
Reply | Threaded
Open this post in threaded view
|

Re: RTAB-Map occupancy grid map error in Turtlebot3 Gazebo

yclo3
This post was updated on .
Hi, Mathieu,

Thank you for replying.
Here is the odom values and screenshot of rviz when the error occurs. The long arrow is base_footprint.
odom1.txt
odom1_rviz.png

Here is the odom values and screenshot of rviz after moves and the map is recovered.
odom2.txt
odom2_rviz.png

Sincerely,
YC
Reply | Threaded
Open this post in threaded view
|

Re: RTAB-Map occupancy grid map error in Turtlebot3 Gazebo

matlabbe
Administrator
Can you share the database after the error happens?
Reply | Threaded
Open this post in threaded view
|

Re: RTAB-Map occupancy grid map error in Turtlebot3 Gazebo

yclo3
This post was updated on .
Here it is. The .db that the error occurs at the beginning.
rtabmap.db

Excuse me for another question, is it feasible for RTAB-Map to generate 3D pointclouds with RGB camera without depth?(e.g. using ORB2 as VO) 3D Lidar must work but how would the result be like to assemble a 2D Lidar for depth?
Reply | Threaded
Open this post in threaded view
|

Re: RTAB-Map occupancy grid map error in Turtlebot3 Gazebo

matlabbe
Administrator
The error looks coming from the laser scans. Some rays have very large range. A quick fix on rtabmap side is to set Grid/RangeMax to 50 for example. This will filter those very far scans. Can you show an example of scan topic?
$ rostopic echo /scan

For your other question, no, rtabmap doesn't do dense structure from motion (based only on RGB images). We can see the 3d visual features when enabled in rtabmapviz->Preferences->3D Rendering->Miscellaneous section. To export the 3d visual features, we can do File->Export Bundler format... and check 3d points.

If you have a rotating 2D lidar, you could assemble the scans into a Pointcloud2 during a rotation, then feed the resulting assembled cloud to rtabmap (subscribe_scan_cloud:=true). The laserscan_to_pointcloud and rtabmap_ros/pointcloud_assembler nodelets can be used for that.

With the assembled cloud, you could also create a depth image for the RGB image with rtabmap_ros/pointcloud_to_depthimage nodelet.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: RTAB-Map occupancy grid map error in Turtlebot3 Gazebo

yclo3
Hi, Mathieu,

Thank you for your help!

Here is the scan topic from turtlebot3_gazebo.
scan1.txt

Setting Grid/RangeMax does suppress the error.
I will try to assemble the scans into PointCloud2.

Sincerely,
YC
Reply | Threaded
Open this post in threaded view
|

Re: RTAB-Map occupancy grid map error in Turtlebot3 Gazebo

matlabbe
Administrator
Hi, normally the inf values in the ranges should be discarded. I tried the turtlebot3 gazebo example and I didn't have problems:

$ export TURTLEBOT3_MODEL=waffle

$ roslaunch turtlebot3_gazebo turtlebot3_house.launch

$ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

$ roslaunch turtlebot3_bringup turtlebot3_remote.launch model:=waffle

$ roslaunch rtabmap_ros rtabmap.launch \
   args:="-d \
      --RGBD/NeighborLinkRefining true \
      --Reg/Force3DoF true \
      --Reg/Strategy 1 \
      --Mem/LaserScanVoxelSize 0.05 \
      --Icp/MaxCorrespondenceDistance 0.1 \
      --Mem/ImagePreDecimation 3 \
      --Mem/ImagePostDecimation 2" \
   visual_odometry:=false \
   odom_frame_id:=odom \
   subscribe_scan:=true \
   scan_topic:="/scan" \
   rgbd_sync:=true \
   approx_rgbd_sync:=false \
   rgb_topic:=/camera/rgb/image_raw \
   camera_info_topic:=/camera/rgb/camera_info \
   depth_topic:=/camera/depth/image_raw \
   frame_id:=base_footprint

Reply | Threaded
Open this post in threaded view
|

Re: RTAB-Map occupancy grid map error in Turtlebot3 Gazebo

yclo3
This post was updated on .
Hi,

Doesn't your turtlebot3_gazebo print inf range on "rostopic echo /scan" ?

I didn't get the meaning of "inf values should be discard".
Is it turtlebot3_gazebo should discard inf values so that "rostopic echo /scan" shouldn't print inf values,
Or RTAB-Map would discard the inf values?

I followed your instruction to launch rtabmap.launch without setting Grid/RangeMax and reproduced the error on requesting graphview in rtabmapviz. Then I set Grid/RangeMax, requesting graphview and got this fatal error:

...
[ INFO] [1559612821.527029555, 69.909000000]: rtabmap (7): Rate=1.00s, Limit=0.000s, RTAB-Map=0.0558s, Maps update=0.0013s pub=0.0000s (local map=1, WM=1)
[ INFO] [1559612822.581598235, 70.936000000]: rtabmap (8): Rate=1.00s, Limit=0.000s, RTAB-Map=0.0604s, Maps update=0.0021s pub=0.0001s (local map=1, WM=1)
[FATAL] (2019-06-04 09:47:03.346) OccupancyGrid.cpp:1302::update() Condition (pt.y>=0 && pt.y < map.rows && pt.x>=0 && pt.x < map.cols) not met! [1: pt=(-2147483648,-2147483648) map=99x123 rawPt=(-nan,-nan) xMin=-3.458823 yMin=-3.077035 channels=2vs3 (graph modified=0)]
[ INFO] [1559612823.802955428, 72.136000000]: rtabmap (9): Rate=1.00s, Limit=0.000s, RTAB-Map=0.0467s, Maps update=0.0028s pub=0.0000s (local map=1, WM=1)
[ INFO] [1559612824.755927756, 73.075000000]: rtabmap (10): Rate=1.00s, Limit=0.000s, RTAB-Map=0.0400s, Maps update=0.0013s pub=0.0001s (local map=1, WM=1)
...

This must also caused by the inf value ranges.
I may have to check my installation of turtlebot3_gazebo.

Sincerely,
YC
Reply | Threaded
Open this post in threaded view
|

Re: RTAB-Map occupancy grid map error in Turtlebot3 Gazebo

matlabbe
Administrator
Hi,

rtabmap filters inf values, I had some in my tests, so it is ok to have inf in scan topics. On your side, it seems the laser scan has also very large numbers (not inf), causing the errors. You may use a LaserScanRangeFilter to make sure the scans have valid numbers, or use the Grid/RangeMax workaround. The large numbers are maybe related to gazebo laser scan plugin on your system (if your system supports GPU rays or not for example).

cheers,
Mathieu