# Sensors in Gazebo

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 close merge delete ## 2 Answers Sort by » oldest newest most voted I solved the problem changing the lines added this way:  <include filename="$(find p2os_urdf_mod)/defs/erratic_hokuyo_laser.xacro"/>

<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.

more

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.

more

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.

( 2012-12-20 02:02:09 -0500 )edit