ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

topic /scan of hokuyo node can't link to the /base_scan of gmapping node

asked 2011-08-23 19:19:41 -0500

JosephChen gravatar image

When I launch gmapping node and hokuyo node, the topic /scan of hokuyo node can't link to the /base_scan of gmapping node.

Do I miss something ?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
8

answered 2011-08-24 00:44:40 -0500

Nick Armstrong-Crews gravatar image

updated 2011-08-24 00:45:45 -0500

You just need to remap (rename) the topic. It is explained on wiki in Remapping Arguments .

For you specific case, either:

  • Running from command-line, rosrun hokuyo_node hokuyo_node scan:=base_scan
  • In launch script, <node pkg="hokuyo_node" type="hokuyo_node" name="hokuyo" > <remap from="scan" to="base_scan" /> </node>
edit flag offensive delete link more

Comments

Thank you ! Now it can link to the gmapping node. but I have one thing I don't understand, the /scan of hokuyo node is "base_laser" coordinate frame. Do I need to use tf to transform coordinate to robot's "base_link" coordinate frames, than input to the gmapping ?
JosephChen gravatar image JosephChen  ( 2011-08-24 14:01:02 -0500 )edit
You don't need to do it yourself. You do need to provide the transform between base_link and base_laser by publishing the appropriate transform. You can easily do this with a static_transform_publisher if your laser is fixed with respect to the base. Gmapping can transform the scan itself with tf.
Eric Perko gravatar image Eric Perko  ( 2011-08-24 14:35:10 -0500 )edit

thank you for solving my problem!

zxh362989 gravatar image zxh362989  ( 2014-05-25 21:55:50 -0500 )edit
0

answered 2011-08-25 00:52:41 -0500

Nick Armstrong-Crews gravatar image

If you don't care about anything but the laser's position in the map, you can skip the extra transform and just specify the frame_id param when launching the hokuyo_node:

  • rosrun hokuyo_node hokuyo_node scan:=base_scan _frame_id=base_link

or

  • <node pkg="hokuyo_node" type="hokuyo_node" name="hokuyo" >

    <param name="frame_id" value="base_link" />

    <remap from="scan" to="base_scan" />

    </node>

I believe you can also specify the frame that gmapping uses, in the same fashion.

edit flag offensive delete link more
0

answered 2014-05-25 21:59:01 -0500

zxh362989 gravatar image

I think you you can also use urg_node to replace hokuyo_node

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-08-23 19:19:41 -0500

Seen: 4,234 times

Last updated: May 25 '14