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

ros gmapping change scan topic

asked 2014-01-13 03:39:07 -0500

acp gravatar image

updated 2014-04-20 14:09:39 -0500

ngrennan gravatar image

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.

edit retag flag offensive close merge delete


rnunziata gravatar image rnunziata  ( 2014-01-13 03:59:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-01-13 03:54:45 -0500

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 />
edit flag offensive delete link more


Hi, yea I forgot the "scan:=" part, thank you very much :)

acp gravatar image acp  ( 2014-01-13 22:12:27 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-01-13 03:39:07 -0500

Seen: 2,034 times

Last updated: Jan 13 '14