Tuning Google Cartographer to work with a Velodyne HDL-32

asked 2017-07-31 23:23:31 -0500

M@t gravatar image

updated 2017-08-24 18:08:38 -0500

The Problem (TL;DR)

I can get Google Cartographer to run in 2D mode, but not 3D. I want to write a .launch and .lua file that will get Cartographer (in 3D mode) to smoothly run over my bagfile.

The Problem (full explanation)

I've got a Velodyne HDL-32 mounted on a Clearpath Jackal UGV, and I'm trying to get Google Cartographer (in 3D mode) working with it. I've collected a short bagfile with all the necessary sensor and TF data, and I can get Cartographer working in 2D mode (see image below).

Completed map from Cartographer (2D): image description

But I can't for the life of me get it working in 3D, mostly because I don't really understand how to tune the myriad of settings Cartographer offers. Unfortunately I haven't found any demo files that use a similar setup (which I could therefore copy). The closest thing is the 3d_demo_packpack.launch and backpack_3d.lua files. However, when I try a modified version of these files, this is what I get:

My best result from Cartographer (3D) image description

It looks like the raw data simply isn't being matched properly, and I suspect that fixing this may well be a case of tweaking the right parameters. However, none of the tinkering or tweaking I've done so far has produced anything better than what you see above. Everything under "options={}" in the .lua files is well documented here, and I think I've got those right, but the other parameters aren't documented at all and unfortunately I'm mostly guesstimating at what they do.

I'd like know how to write/configure a set of launch/lua files to get Cartographer working on my system. I suspect that my use case - one UGV and one 3D LiDAR - will be a relatively common as Cartographer grows in popularity. So hopefully any answers or advice here can help others with a similar setup. Thanks in advance for any help or advice anyone can provide. The details of my system are below.

System Information


Update 1

With some help from the developers, I've got a working configuration. The three key parameter changes for me were:

  1. TRAJECTORY_BUILDER_3D.scans_per_accumulation = 1 I don't really understand this parameter but it seems to ...
edit retag flag offensive close merge delete


Hey, I am very interested in your integration of Cartographer with the LiDAR data since I am trying to achieve something very similar. Would it be okay if we talked directly on e-mail since I have quite a few questions?

i_robot_flight gravatar image i_robot_flight  ( 2017-10-30 16:17:55 -0500 )edit

@i_robot_flight: you should ask your questions here (as a question!) so that the entire community can benefit.

jayess gravatar image jayess  ( 2017-10-30 16:33:08 -0500 )edit

All right, thanks!

i_robot_flight gravatar image i_robot_flight  ( 2017-10-31 09:06:20 -0500 )edit

I've had MUCH better results with the latest release of Cartographer (dunno why). So I suggest you start with that and modify the 3D backpack demo files. I'm trying to update all this but CloudCompare has stopped working on my computer so I can't work with point clouds ATM.

M@t gravatar image M@t  ( 2017-10-31 17:42:33 -0500 )edit

Hi, Matt, How did you implement zero velocity update for imu. I am having a similar problem where my laser readings keep changing the position without moving lidar. Thus, this is giving me multiple submaps in different orientations of the same location.

RoboRos gravatar image RoboRos  ( 2018-04-29 15:32:24 -0500 )edit

I can give you the code I used to implement a zero velocity update, but if you're having other problems you're better to post it as its own question.

M@t gravatar image M@t  ( 2018-04-30 20:21:51 -0500 )edit

@Mat that'd be great, if u can can share the code. Thanks.

RoboRos gravatar image RoboRos  ( 2018-05-01 03:17:13 -0500 )edit

@RoboRos here's a link: imu_processor. You'll need to install it in a catkin package, compile it and run it using rosrun <package_name> imu_processor.py Or just copy the code, it's not particularly well written but it works.

M@t gravatar image M@t  ( 2018-05-02 16:52:27 -0500 )edit