Ask Your Question
2

Sensors in Gazebo

asked 2012-12-17 01:32:24 -0500

camilla gravatar image

updated 2014-01-28 17:14:36 -0500

ngrennan gravatar image

Hi all! I'd like to add an hokuyo laser to the pioneer that I'm simulating with gazebo. But I don't know how to do it.
I've seen that with Gazebo you can simulate an erratic robot with a laser on it. So I added:

 <include filename="$(find erratic_description)/urdf/erratic_hokuyo_laser.xacro" />
 <!-- BASE LASER ATTACHMENT -->
<erratic_hokuyo_laser parent="base_link">
    <origin xyz="0.2 0 0.001" rpy="0 0 0" />
</erratic_hokuyo_laser>

to the pioneer3dx.xacro. But when I run the simulation I can't see the laser in the robot model and /scan in the topic list. Any advice?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2012-12-20 02:23:36 -0500

camilla gravatar image

I solved the problem changing the lines added this way:

 <include filename="$(find p2os_urdf_mod)/defs/erratic_hokuyo_laser.xacro"/>

<xacro:erratic_hokuyo_laser parent="base_link">
    <origin xyz="0.01 0 0.23" rpy="0 0 0" />
</xacro:erratic_hokuyo_laser>

and in the "erratic_hokuyo_laser.xarco" I added the keyword xacro: before the macro tag:

<xacro:macro name="erratic_hokuyo_laser" params="parent *origin">
...
</xacro:macro>

Now I can see the /scan topic and map its values with rviz.

edit flag offensive delete link more
0

answered 2012-12-18 04:11:44 -0500

davinci gravatar image

Does the include work? You can also try to copy paste the contents of the erratic_hokuyo_laser.xacro to your pioneer file and change all the erratic specific parts to pioneer.

edit flag offensive delete link more

Comments

I changed a bit the line added and now I can see the model of the laser on the top of the robot, but there isn't still the /scan topic.

camilla gravatar image camilla  ( 2012-12-20 02:02:09 -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: 2012-12-17 01:32:24 -0500

Seen: 444 times

Last updated: Dec 20 '12