Cartographer_ros: Cartographer 3D with IMU, 1 Velodyne-16 LiDAR. No map output

Created on 9 Oct 2018  路  19Comments  路  Source: cartographer-project/cartographer_ros

Hi all !
I'm trying to use my own 3D bagfile (collected by Husky Robot, using only one Velodyne-16 LiDAR and one 3DM-GX3-25 IMU) to run on Cartographer but no map generated.
Before this, I've successfully run Cartographer on my own 2D bagfile.

My bag file has 2 topics and here is what rosbag info gives me:
rosbag_info

And the result of running the rosbag_validate gives me:
rosbag_validate

I had tuned the parameters and tried to run this bag by roslaunch cartographer_ros offline_backpack_3d.launch bag_filename:=/home/williamwoo/husky-tf-scan-_2018-10-08-08-14-41.bag but there's no map showing on the Rviz.
The running results (some repetitive part ignored) and Rviz screenshots are shown as below:
running result 1

running result 2

running result 3

running result 4

running result 5

rviz

The related files are uploaded for your reference:
3D Bagfile with my sensor data: https://entuedu-my.sharepoint.com/:u:/g/personal/zhenyu002_e_ntu_edu_sg/EbOR1SYYAeFBk5bVflIcrvsBYmshHWGSTDlUIxx8LrG4Cw?e=78UbLr
Launch file: https://github.com/NTUwilliam/Google_cartographer/blob/master/offline_backpack_3d.launch
lua file: https://github.com/NTUwilliam/Google_cartographer/blob/master/backpack_3d.lua
URDF file: https://github.com/NTUwilliam/Google_cartographer/blob/master/backpack_3d.urdf

Is there any solution to this problem? Any comment is appreciated. Thanks a lot. @gaschler @cschuet
@SirVer @ojura

Most helpful comment

@NTUwilliam, your bag has a single PointCloud2 per revolution, with a sample rate of 10 Hz.

Cartographer's demo bags consist of small point clouds which correspond to individual Velodyne UDP packets. There is around 100-200 of these per revolution. Therefore, the following parameter in the .lua file is set to accumulate 160 point clouds into one scan:

TRAJECTORY_BUILDER_3D.num_accumulated_range_data = 160

This is wrong for your setup, since in your data, 1 cloud = 1 revolution. Therefore, this parameter should be set to 1 or 2 for your case, since Cartographer only wants a revolution or two of points in a single scan.

@cschuet I've seen this issue occur many times. Most people are using the open source ROS velodyne driver, which accumulates a whole revolution into one point cloud. They use the default provided tuning and forget to change this. Perhaps we should document this in the .lua.

All 19 comments

Your lidar seems to be posting its ROS messages with a frame_id set to "velodyne" however your urdf (and also it seems no other transform provider) seems to be publishing a transform to it.

@cschuet Thanks for your speedy reply.

I've made some changes to my urdf file and the updated URDF file is:
https://github.com/NTUwilliam/Google_cartographer/blob/master/backpack_3d.urdf

Then I run again and there's no more warning about the "velodyne". But there's still repetitive warning as shown below:
running result

And there's still little map generated in the Rviz and the ROS time runs pretty fast (running finished in around 10 seconds, although the actual duration time is 136s), as shown below:
rviz2

Looking forward to your comments. Thanks!

@NTUwilliam, your bag has a single PointCloud2 per revolution, with a sample rate of 10 Hz.

Cartographer's demo bags consist of small point clouds which correspond to individual Velodyne UDP packets. There is around 100-200 of these per revolution. Therefore, the following parameter in the .lua file is set to accumulate 160 point clouds into one scan:

TRAJECTORY_BUILDER_3D.num_accumulated_range_data = 160

This is wrong for your setup, since in your data, 1 cloud = 1 revolution. Therefore, this parameter should be set to 1 or 2 for your case, since Cartographer only wants a revolution or two of points in a single scan.

@cschuet I've seen this issue occur many times. Most people are using the open source ROS velodyne driver, which accumulates a whole revolution into one point cloud. They use the default provided tuning and forget to change this. Perhaps we should document this in the .lua.

@ojura Yes, you are right!

I got it worked and the generated map in the Rviz is:
For TRAJECTORY_BUILDER_3D.num_accumulated_range_data = 0.1
trajectory_builder 0 1

For TRAJECTORY_BUILDER_3D.num_accumulated_range_data = 1
trajectory_builder 1

For TRAJECTORY_BUILDER_3D.num_accumulated_range_data = 3
trajectory_builder 3

I've noticed that the generated map is still kind of unclear and the ROS time runs pretty fast (running finished in around 10 seconds, although the actual duration time is 136s). Any suggestions for tuning the parameters?
@ojura @cschuet Thanks!!

Just a quick note, TRAJECTORY_BUILDER_3D.num_accumulated_range_data = 0.1 does not make sense. This is the number (integer) of point clouds to accumulate. Float values do not make sense here.

Also, have you tried out visualizing the high-resolution submaps?

@ojura Thanks for your speedy reply.
I see. Then I think TRAJECTORY_BUILDER_3D.num_accumulated_range_data = 1 works great for my case.

I already chose to display high-resolution submaps but it's still not clear, as shown below:
high-resolution

@NTUwilliam
Hello, I am using a 16-lines LIDAR and IMU to build 3D map by cartographer.
I tun the parameters and run it with no error, the results are as follows:
2019-02-27 21-56-15
2019-02-27 21-56-43

There is a big gap with the real environment. I think the map is in a mess. What is the problem of this result? How can I solve it?
This is the validate result of my bag:

  • E0227 22:30:57.092067 19056 rosbag_validate_main.cc:365] Average IMU linear acceleration is 10.6084 m/s^2, expected is [9.5, 10.5] m/s^2. Linear acceleration data should include gravity and be given in m/s^2.
    I0227 22:30:57.093359 19056 rosbag_validate_main.cc:398] Time delta histogram for consecutive messages on topic "/IMU" (frame_id: "imu"):
    Count: 37968 Min: 0.004133 Max: 0.016211 Mean: 0.010000
    [0.004133, 0.005340) Count: 2 (0.005268%) Total: 2 (0.005268%)
    [0.005340, 0.006548) Count: 3 (0.007901%) Total: 5 (0.013169%)
    [0.006548, 0.007756) Count: 8 (0.021070%) Total: 13 (0.034239%)
    [0.007756, 0.008964) Count: 828 (2.180784%) Total: 841 (2.215023%)
    [0.008964, 0.010172) ################### Count: 35958 (94.706070%) Total: 36799 (96.921089%)
    [0.010172, 0.011380) Count: 345 (0.908660%) Total: 37144 (97.829750%)
    [0.011380, 0.012588) Count: 820 (2.159714%) Total: 37964 (99.989464%)
    [0.012588, 0.013796) Count: 1 (0.002634%) Total: 37965 (99.992096%)
    [0.013796, 0.015004) Count: 0 (0.000000%) Total: 37965 (99.992096%)
    [0.015004, 0.016211] Count: 3 (0.007901%) Total: 37968 (100.000000%)
    E0227 22:30:57.094650 19056 rosbag_validate_main.cc:382] Point data (frame_id: "rslidar") has a large gap, largest is 0.101409 s, recommended is [0.0005, 0.05] s with no jitter.
    I0227 22:30:57.094745 19056 rosbag_validate_main.cc:398] Time delta histogram for consecutive messages on topic "/rslidar_points" (frame_id: "rslidar"):
    Count: 3766 Min: 0.100213 Max: 0.101409 Mean: 0.100801
    [0.100213, 0.100333) Count: 1 (0.026553%) Total: 1 (0.026553%)
    [0.100333, 0.100452) Count: 1 (0.026553%) Total: 2 (0.053107%)
    [0.100452, 0.100572) Count: 9 (0.238980%) Total: 11 (0.292087%)
    [0.100572, 0.100691) Count: 33 (0.876261%) Total: 44 (1.168348%)
    [0.100691, 0.100811) ############## Count: 2717 (72.145515%) Total: 2761 (73.313858%)
    [0.100811, 0.100931) ##### Count: 972 (25.809877%) Total: 3733 (99.123741%)
    [0.100931, 0.101050) Count: 25 (0.663834%) Total: 3758 (99.787575%)
    [0.101050, 0.101170) Count: 6 (0.159320%) Total: 3764 (99.946892%)
    [0.101170, 0.101289) Count: 1 (0.026553%) Total: 3765 (99.973450%)
    [0.101289, 0.101409] Count: 1 (0.026553%) Total: 3766 (100.000000%)

2019-02-27 22-11-11
2019-02-27 22-16-52

Here are my files:
demo_rsldiar_3d.launch
rslidar_3d.launch
mydemo_3d.rviz
rslidar_2d.urdf
rslidar_scan_3d.lua
my data bag
Do you know the problem?

Hello, I have seen your result, but I got a question about it. You have built a 2D map, but do you know how to build a 3D map using one velodyne-16 LIDAR ?

@NTUwilliam

I see. Then I think TRAJECTORY_BUILDER_3D.num_accumulated_range_data = 1 works great for my case.

I already chose to display high-resolution submaps but it's still not clear, as shown below:

Hi William,
Try using demo_my_robot.launch instead of offline_my_robot.launch in your launch file.

(From cartographer documentation) "offline_my_robot.launch is very similar to demo_my_robot.launch but tries to execute SLAM as fast as possible. This can make map building significantly faster. This launch file can also use multiple bag files provided to the bag_filenames argument."

@2505381597
I tried to build a 3D map but failed. So that's why I got the 2D map.....
You may search for some other issues about how to build a 3D map using one velodyne-16 LIDAR (I think they got a lot of similar issues)

@simongtan
Thanks for replying! I'll give it a try in the future.

@Duke-Allen Hi
Sorry that I browsed through your issue but have no idea how to solve it.
Maybe you can post a new issue and @ the contributors who will be willing to solve your issue.

@NTUwilliam
Do you build 3D map successfully? I am trying build 3D map by LIDAR and IMU, but I always have some problems I don't know how to solve.

@Duke-Allen No I didn't :(
So it's better for you to post a new issue and ask for help.

@NTUwilliam
Thanks for your reply. I will try it. Wish me good luck.

@Duke-Allen Were you able to get the 3D mapping work?

@Akash-Pardasani Yeah, I just built a 3D map. But I did not check to see if the map was correct.

@Duke-Allen Thanks for the speedy reply. It would be really great if you could share the final configuration that worked for you in Google Cartographer?

@Akash-Pardasani This is my configuration. rslidar_scan_3d.lua
I hope it could help you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ozgudum picture ozgudum  路  6Comments

shreyasgokhale picture shreyasgokhale  路  5Comments

zhaoyu24 picture zhaoyu24  路  4Comments

mklingen picture mklingen  路  5Comments

cagataysari picture cagataysari  路  6Comments