ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Map not being built using gmapping with depthimage_to_laserscan [closed]

asked 2017-04-22 20:14:55 -0500

hdbot gravatar image

updated 2017-04-23 13:43:29 -0500


I am using Zed Camera, to build map of the surrounding. I am trying to build the map using depthimage_to_laserscan with slam_gmapping, however the laser scan data is not being published. Attached is my tf_frames, rqt_graph image, and the launch file I am using. It shows /scan for the laser scan in RVIZ. However, no points are being published, and there is no map being published.

I am not sure where the error is, any suggestion would be appreciated.

Ros: Kinetic, Ubuntu: 16.04

Since I am not allowed to upload images, I am attaching in the link below:


edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by hdbot
close date 2017-05-05 09:13:41.860119


Looks like there's no input to the depthimage_to_laserscan node.

ahendrix gravatar image ahendrix  ( 2017-04-22 23:39:39 -0500 )edit

How would I fix that? Any suggestions? Also it says that there is no map received.

hdbot gravatar image hdbot  ( 2017-04-23 08:20:20 -0500 )edit

You are not publishing what depthimage_to_laserscan needs to subscribe. check the package documentation. you need a image (sensor_msgs/Image) and camera_info (sensor_msgs/CameraInfo). It seems that the Image is of a special type, so it needs a depth image as sensor_msgs/Image...

mohsen1989m gravatar image mohsen1989m  ( 2017-04-23 13:35:39 -0500 )edit

Yes you are right @mohsen1989m, the issue was of special topic, I managed to fix the issue of the laser scan output, but I still have error of no map received. I have updated the dropbox with new launch file, and the rviz output screenshot.

hdbot gravatar image hdbot  ( 2017-04-23 13:44:34 -0500 )edit

For starters you can remove the remap from scan to /zed/scan. Next you have a static transform for odom. This does not sound right.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-04-24 12:21:22 -0500 )edit

Yea I took the static transform off, but that causes issue such that tf has two trees. For some reason it seems that laser scan match is not being triggered. Not sure why though...

hdbot gravatar image hdbot  ( 2017-04-26 11:35:19 -0500 )edit

Two tf trees: Looks like your odometry is not working. The odom->base_frame transform needs to be published by you.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-04-27 00:35:20 -0500 )edit

The laser scan matcher node is supposed to do that, even if I publish that transform the map doesn't get built. I have added the laser scan matcher node in the file for reference.

hdbot gravatar image hdbot  ( 2017-04-27 07:50:49 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-01 13:50:51 -0500

Humpelstilzchen gravatar image

updated 2017-05-01 14:15:11 -0500

Ok, installed laser_scan_matcher and tested your launch file in my setup with a xtion, so I removed both tfs and the zed_wrapper_node/zed_tf.launch from the launch file. In my comment above I did not see the zed-group (indentation!), so the remaps in depthimage_to_laserscan have to stay, for you they probably have to look like this:

    <remap from="image" to="/zed/depth/image_rect_color"/>
<remap from="scan" to="/scan"/>

Additionally I had to remove the output_frame_id of depthimage_to_laserscan param as base_frame does not exist in my setup. After these changes gmapping went nuts and painted some kind of modern art while jumping around. It either is not supposed to work with my 3d camera or needs heavy tuning, however the launch file basically works.

Update: I should have disabled all my other nodes while testing this (my 'normal' odometry node was the cause of the jumping): Both laser_scan_matcher and gmapping defaults to "base_link" as their frame of reference. As far as I can tell you have no "base_link" in your setup. So you need to set the "base_frame" parameter to "base_frame" for both nodes.

edit flag offensive delete link more


I tried your path, when I follow it I get this error: [ WARN] [1493735681.711479943]: Failed to compute laser pose, aborting initialization ("base_link" passed to lookupTransform argument target_frame does not exist. ) Any idea why? I have updated the dropbox with the files containing changes.

hdbot gravatar image hdbot  ( 2017-05-02 09:59:53 -0500 )edit

Obviously one of the nodes is still using base_link instead of base_frame. Please post updated launch file

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-05-02 10:06:17 -0500 )edit

I have updated the dropbox, as I mentioned in the previous comment. The updated launch file for gmapping, and the file for laser scan matcher is there.

hdbot gravatar image hdbot  ( 2017-05-02 10:08:30 -0500 )edit

The launch file in the drop box does not contain the param "base_frame" for either gmapping or laser_scan_matcher

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-05-03 02:12:51 -0500 )edit

Sorry the file I uploaded was not the correct file. I have refreshed the dropbox with all recent errors that I receive. Still same issue no map is being built. I just had question, are you also using kinetic?

hdbot gravatar image hdbot  ( 2017-05-03 10:55:01 -0500 )edit

I don't think this is specific to kinetic or any other recent version. You are still missing the param "base_frame" on gmapping.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-05-03 11:36:59 -0500 )edit

What do you mean? should I add this : param name ="base_frame" value =:base_frame" in gmapping section of the launch file as well?

hdbot gravatar image hdbot  ( 2017-05-03 11:43:47 -0500 )edit

Yes, of course. Else the base_frame param of gmapping defaults to base_link, which you do not have in your setup.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-05-03 11:50:04 -0500 )edit

Question Tools

1 follower


Asked: 2017-04-22 20:14:55 -0500

Seen: 1,037 times

Last updated: May 01 '17