Robotics StackExchange | Archived questions

Gmapping Launch File

At the moment we are trying to increasingly use launch files (for obvious resons).

With Gmapping in the Gazebo simulator I am somehow stuck. The mapping works fine, when I start it via rosrun as follows:

$ rosparam set use_sim_time true
$ rosrun gmapping slam_gmapping scan:=youbot/scan_front _base_frame:=youbot/base_link _odom_frame:=youbot/odom

We then tried to do the same thing in a launch file, which resulted in something like this:

<launch>
  <param name="use_sim_time" value="true" />
  <node pkg="gmapping" type="slam_gmapping" name="gmapping_thing" output="screen" >
    <remap from="scan" to="youbot/scan_front" />
    <remap from="base_link" to="youbot/base_link" />
    <remap from="odom" to="youbot/odom" />
  </node>
</launch>

which results in debug messages like:

Node: /gmapping_thing
Time: 01:01:51.823000000 (1970-01-01)
Severity: Debug
Published Topics: /gmapping_thing/entropy, /map, /map_metadata, /rosout, /tf

MessageFilter [target=odom ]: Added message in frame youbot/base_laser_front_link at time 111.818, count now 5

Location:
/opt/ros/indigo/include/tf/message_filter.h:MessageFilter<M>::add:280

and:

Node: /gmapping_thing
Time: 01:01:51.823000000 (1970-01-01)
Severity: Debug
Published Topics: /gmapping_thing/entropy, /map, /map_metadata, /rosout, /tf

MessageFilter [target=odom ]: Removed oldest message because buffer is full, count now 5 (frame_id=youbot/base_laser_front_link, stamp=111.806000)

Location:
/opt/ros/indigo/include/tf/message_filter.h:MessageFilter<M>::add:264

One thing I already find strange here is the date, which seems to be low unix time stamps? The actual date of the machine is:

$ date
Fri Sep 25 13:22:50 CEST 2015

After further searching we found that the remap-tag might not be the best approach here, as the parameters can be set directly, which lead to the following launch file (it yields the same result when using _odom_frame and _base_link respectively):

<launch>
  <param name="use_sim_time" value="true" />
  <node pkg="gmapping" type="slam_gmapping" name="gmapping_thing" output="screen" >
    <param name="scan" value="youbot/scan_front" />
    <param name="odom_frame" value="youbot/odom" />
    <param name="base_frame" value="youbot/base_link" />
  </node>
</launch>

This leads to dropping of /clock messages

Node: /gmapping_thing
Time: 01:16:09.648000000 (1970-01-01)
Severity: Debug
Published Topics: /gmapping_thing/entropy, /map, /map_metadata, /rosout, /tf

Incoming queue full for topic "/clock".  Discarding oldest message (current queue size [0])

Location:
/tmp/buildd/ros-indigo-roscpp-1.11.13-0trusty-20150522-1157/src/libros/subscription_queue.cpp:SubscriptionQueue::push:67

We are kinda stuck here, so if anyone could provide some input, we would be glad.

Asked by 85pando on 2015-09-25 07:16:09 UTC

Comments

The thing is, with the same launch file, it works on the actual robot (Kuka YouBot).

Asked by 85pando on 2015-10-14 03:23:48 UTC

Answers

For anyone with similar issue:
Use this file as a reference: jackal gmapping launch file.

In this case launching the gmapping node should look like this.

<node pkg="gmapping" type="slam_gmapping" name="gmapping_thing" output="screen" >
  <remap from="scan" to="youbot/scan_front" />
  <param name="odom_frame" value="youbot/odom" />
  <param name="base_frame" value="youbot/base_link" />
</node>

Asked by northfork on 2017-06-07 17:58:27 UTC

Comments

Hi ! It's been a while since you asked your question !

I've the same problem here... Did you manage to solve it ?

Thanks for your answer !

Asked by AstroUKN on 2020-02-24 19:11:11 UTC

Comments

Hi, sorry for the late answer. No the problem was never really solved in our setup. We switched to the actual robot shortly after so no further effort was put into this.

Asked by 85pando on 2020-04-03 12:48:32 UTC