ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
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 image rnunziata  ( 2014-01-13 03:59:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
4

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 image acp  ( 2014-01-13 22:12:27 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 2,162 times

Last updated: Jan 13 '14