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

How to put Hokuyo laser sensor on p2os?

asked 2012-09-27 10:14:38 -0500

Mendelson gravatar image

updated 2022-02-13 16:58:40 -0500

lucasw gravatar image

I'm new at gazebo, and I would like to know how to put a hokuyo sensor on my p2os model. I am not using a real robot, I just want to know how to add a sensor on my simulation. Thanks!

edit retag flag offensive close merge delete


Are you using P2OS or are you using ROSARIA?

allenh1 gravatar image allenh1  ( 2015-07-07 19:46:00 -0500 )edit

4 Answers

Sort by ยป oldest newest most voted

answered 2012-09-29 04:50:28 -0500

Peter Listov gravatar image

Or just create a laser link and add something similar to this:

  <link name="laser_scan_link" type="laser"> 
      <mass value="0.5" /> 
      <origin xyz="0 0 0" /> 
      <inertia ixx="0.3"  ixy="0.3"  ixz="0.3" iyy="0.3"  iyz="0.3"  izz="0.3" /> 
       <origin xyz="0 0 0" rpy="0 0 0"/> 
         <cylinder length="0.1" radius="0.05" /> 
      <origin xyz="0 0 0" rpy="0 0 0"/> 
         <cylinder length="0.1" radius="0.05" /> 

<joint name="laser_to_base_link" type="fixed"> 
  <origin xyz="0.25 0 0.32" rpy="0 0 0" /> 
  <parent link="base_link" /> 
  <child link="laser_scan_link"/> 

   <gazebo reference="laser_scan_link"> 
  <sensor:ray name="laser_scan_link"> 

         <origin>0.0 0.0 0.0</origin> 



         <controller:gazebo_ros_laser name="gazebo_ros_base_scan_link_controller" plugin=""> 
                <interface:laser name="gazebo_ros_base_scan_link_iface"/> 

   <controller:gazebo_ros_controller_manager name="gazebo_ros_controller_manager" plugin="">
      <interface:audio name="gazebo_ros_controller_manager_dummy_iface" />
edit flag offensive delete link more


@Peter Listov I got interested with this answer, can you give a suggestion into how to add a hokuyo laser to the turtlebot. I am new to ros. Can you tell me where do I have to put the code.

Vegeta gravatar image Vegeta  ( 2012-10-18 18:33:56 -0500 )edit

answered 2012-09-27 13:17:01 -0500

dejanpan gravatar image

For this you will first need to understand how urdf works and John has written great tutorials for that (section 1 and 2). Then you will need to understand the Gazebo extensions for URDF ( and finally here is also an example of how to add the actual sensor:

For the insertion of the hokuyo specifically you can check how it is being done for turtlebot: Sensor description: (turtlebot_sim_laser) Sensor insertion into robot's urdf: (laser_joint)

Please also note that this shall probably be asked on


edit flag offensive delete link more

answered 2015-06-27 08:19:40 -0500

130s gravatar image

updated 2015-06-27 19:51:50 -0500

@Peter Listov's answer worked for me except for gazebo tag that's based on older syntax. With later version of Gazebo (2.2.5 for me), you might want to refer to .

Update: Gazebo's tutorial linked above did not work for me (asked another question for that). I got it working with (see the change I made with my package) instead of This blog was helpful.

edit flag offensive delete link more

answered 2012-10-02 07:54:48 -0500

Mendelson gravatar image

updated 2012-10-02 08:04:52 -0500

Thanks Peter Listov, it was really useful! But I still don't know how to use the Hokuyo, the visual model

edit flag offensive delete link more


Do you mean, visaulization? Then you need to launch your model in RViz. What exactly do you want?

Peter Listov gravatar image Peter Listov  ( 2012-10-02 23:53:57 -0500 )edit

Yes, I just need a visual model. I want a sensor wich looks like the Hokuyo (just to make my model more beautiful). The sensor is already working, I just want the visual.

Mendelson gravatar image Mendelson  ( 2012-10-29 08:56:19 -0500 )edit

Question Tools

1 follower


Asked: 2012-09-27 10:14:38 -0500

Seen: 2,587 times

Last updated: Jun 27 '15