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

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

Comments

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
2

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"> 
 <inertial> 
      <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" /> 
     </inertial> 
     <visual> 
       <origin xyz="0 0 0" rpy="0 0 0"/> 
       <geometry> 
         <cylinder length="0.1" radius="0.05" /> 
       </geometry> 
     </visual> 
     <collision> 
      <origin xyz="0 0 0" rpy="0 0 0"/> 
       <geometry> 
         <cylinder length="0.1" radius="0.05" /> 
       </geometry> 
     </collision> 
  </link> 

<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"/> 
</joint> 

   <gazebo reference="laser_scan_link"> 
  <sensor:ray name="laser_scan_link"> 
     <rayCount>683</rayCount> 
     <rangeCount>683</rangeCount> 
     <laserCount>1</laserCount> 

         <origin>0.0 0.0 0.0</origin> 
         <displayRays>true</displayRays> 

         <minAngle>-105</minAngle> 
         <maxAngle>105</maxAngle> 

         <minRange>0.06</minRange> 
         <maxRange>4.0</maxRange> 
         <resRange>0.01</resRange> 
         <updateRate>10.0</updateRate> 

         <controller:gazebo_ros_laser name="gazebo_ros_base_scan_link_controller" plugin="libgazebo_ros_laser.so"> 
                <gaussianNoise>0.005</gaussianNoise> 
                <alwaysOn>true</alwaysOn> 
                <updateRate>20.0</updateRate> 
                <topicName>base_scan/scan</topicName> 
                <frameName>laser_scan_link</frameName> 
                <interface:laser name="gazebo_ros_base_scan_link_iface"/> 
         </controller:gazebo_ros_laser> 
        </sensor:ray> 
    </gazebo> 


  <gazebo>
   <controller:gazebo_ros_controller_manager name="gazebo_ros_controller_manager" plugin="libgazebo_ros_controller_manager.so">
      <alwaysOn>true</alwaysOn>
      <updateRate>1000.0</updateRate>
      <interface:audio name="gazebo_ros_controller_manager_dummy_iface" />
    </controller:gazebo_ros_controller_manager>
  </gazebo>
edit flag offensive delete link more

Comments

@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
3

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 http://ros.org/wiki/urdf/Tutorials (section 1 and 2). Then you will need to understand the Gazebo extensions for URDF (http://ros.org/wiki/urdf/Tutorials/UnderstandingPR2URDFGazeboExtension) and finally here is also an example of how to add the actual sensor: http://ros.org/wiki/urdf/Tutorials/AddingSensorsToPR2.

For the insertion of the hokuyo specifically you can check how it is being done for turtlebot: Sensor description: https://kforge.ros.org/turtlebot/turtlebot/file/fb8354a98ac5/turtlebot_description/urdf/gazebo.urdf.xacro (turtlebot_sim_laser) Sensor insertion into robot's urdf: https://kforge.ros.org/turtlebot/turtlebot/file/fb8354a98ac5/turtlebot_description/urdf/turtlebot_body.urdf.xacro (laser_joint)

Please also note that this shall probably be asked on http://answers.gazebosim.org/questions/.

D.

edit flag offensive delete link more
0

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 libgazebo_ros_laser.so (see the change I made with my package) instead of libgazebo_ros_gpu_laser.so. This blog was helpful.

edit flag offensive delete link more
0

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

Comments

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

Stats

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

Seen: 2,587 times

Last updated: Jun 27 '15