Rosanswers logo

Dear all.

I have a new topic name for a LaserScan.

When I run:

rosrun gmapping slam_gmapping scan:=new_topic_name

The gmapping takes the data under the new topic name.

However when I run a launch file

node name="slam_gmapping" pkg="gmapping" type="slam_gmapping" args="new_topic_name"

respawn="false" output="screen">

The gmapping doesnt take the data under the new topic name, it takes instead the data from the scan topic.

Can somebody explain why and how to solve that issue.

In advance thank you to all.

Originally posted by acp on ROS Answers with karma: 556 on 2014-01-13

Post score: 0

Original comments

Comment by rnunziata on 2014-01-13:
Did you look at: http://wiki.ros.org/roslaunch/XML/arg


1 Answer 1


Rosanswers logo

What you did in your example essentially is the same as typing the following on the terminal (you forgot the "scan:=" part):

rosrun gmapping slam_gmapping new_topic_name

what you wanted to do is:

<node name="slam_gmapping" pkg="gmapping" type="slam_gmapping" args="scan:=new_topic_name" respawn="false" output="screen"/>

Note you can also use the remapping syntax provided for roslaunch (this is preferred as it is more clear). See also the remap wiki page:

<node name="slam_gmapping" pkg="gmapping" type="slam_gmapping" respawn="false" output="screen">
  <remap from="scan" to="new_topic_name />

Originally posted by Stefan Kohlbrecher with karma: 24361 on 2014-01-13

This answer was ACCEPTED on the original site

Post score: 4

Original comments

Comment by acp on 2014-01-13:
Hi, yea I forgot the "scan:=" part, thank you very much :)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.