Ask Your Question
0

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

Comments

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

1 Answer

Sort by ยป oldest newest most voted
3

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

Comments

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

acp gravatar imageacp ( 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

Stats

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

Seen: 1,088 times

Last updated: Jan 13 '14