Ask Your Question
0

remapper /scan to /scan2

asked 2015-07-07 04:28:53 -0500

osmancns gravatar image

I have one lidar. I need a /scan topic for laser_scan_matcher package and need a /scan2 topic for gmapping package.

gmapping launch :

    <node pkg="gmapping" type="slam_gmapping" name="slam_gmapping"
output="screen">
<param name="scan_topic" type="string" value="scan2" />

laser_scan_matcher launch:

<node pkg="laser_scan_matcher" type="laser_scan_matcher_node"
<param name="laser_topic" type="string" value="scan" />

ı need a node like this :

<node pkg="laser_remapper" type="remapper2" name="hokuyo_remapper"/>

I know remap argument but how can I do that

thank you for advices...

edit retag flag offensive close merge delete

Comments

so you want the same laser scan for the scan_matcher and gmapping? so why do you need the remapper node? you could just remap e.g. in the gmapping or set the topic to scan, right?

Otherwise, you could always use a relay

mgruhler gravatar image mgruhler  ( 2015-07-07 05:56:39 -0500 )edit

yes ı want different topics with same laser. you say like that :

  <node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">
    <param name="scan_topic" type="string" value="scan2" />
    <remap from="scan" to="scan2" />
osmancns gravatar image osmancns  ( 2015-07-07 06:54:22 -0500 )edit

I need separately scan topics as /scan and /scan2. because this method better then my different nodes subscribe same topic but ı cant see result with this : rostopic echo /scan2 no publish as /scan2 and ı use this tf tree: http://i.imgur.com/AlhuTY6.png

osmancns gravatar image osmancns  ( 2015-07-07 06:54:58 -0500 )edit

1 Answer

Sort by » oldest newest most voted
3

answered 2015-07-10 01:11:46 -0500

mgruhler gravatar image

According to the documentation there is no parameter scan_topic in gmapping. So the parameter will not do anything. The remapping seems to be correct.

I'm not sure why you need the scan information of the same lidar on a different topic. What you could easily do is to create a relay: rosrun topic_tools relay scan scan2

However, in the end, this would still be, more or less, subscribing to the same topic. This has nothing to do with your tf tree. Which looks strange, by the way. You have tree which is only connectet through the map topic. But I guess this comes from gmapping and the scan_matcher providing a /map->something transform, right?

edit flag offensive delete link more

Comments

Sorry to be slightly of topic, but how generally should a TF tree general look, should it be map-> odom-> base_link-> sensors or is this dependent on the application?

miguel gravatar image miguel  ( 2015-07-10 01:36:40 -0500 )edit

okay you are right. But if gmapping and laser_scan_matcher subscribe to same topic ( /scan) , mapping performance is good but I see drifting and jumping a little. I think, if gmapping and laser_scan_matcher subscribe to topic diffrent topics (/scan, /scan2) , mapping has no problem.

osmancns gravatar image osmancns  ( 2015-07-10 01:49:27 -0500 )edit

there is a argumnet like that and working :

<!-- gmapping launcher -->
 <node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" args="scan:=scan2" output="screen">
osmancns gravatar image osmancns  ( 2015-07-10 01:50:10 -0500 )edit

Well, with the args="scan:=scan2" you are basically doing a remapping over the command line as you would do with rosrun gmapping slam_gmapping scan:=scan2. The remap in the launch file has the slame effect, but is better readable.

mgruhler gravatar image mgruhler  ( 2015-07-10 01:53:40 -0500 )edit

@miguel, in most applications the tf tree is /map->/odom->/base_link->rest_of_robot yes. maybe you have additional frames (e.g. /base_footprint) in between. However, in the end, it depends on your robot and the application

mgruhler gravatar image mgruhler  ( 2015-07-10 01:55:25 -0500 )edit

I see, Thank you for the reply!

miguel gravatar image miguel  ( 2015-07-10 02:16:17 -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: 2015-07-07 04:28:53 -0500

Seen: 321 times

Last updated: Jul 10 '15