0
$\begingroup$

Gazebo Answers logo

Hi, In gazebo, there are already available models (insert tab) which you can simply insert in your scene. I am having trouble with using it with my urdf model.

I want to add velodyne to my robot. But the problem is that i cannot do this. I have tried adding it using this link information http://gazebosim.org/tutorials/?tut=add_laser but NO LUCK as it's for .sdf format models.

Need help with adding available model (velodyne in .sdf) sensor to a urdf robot model...


Originally posted by RoboticRos on Gazebo Answers with karma: 3 on 2018-02-10

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

You need to set a gazebo tag in your urdf file.

For example, if I have a link safety_lidar to represent my sensor, I will add the following tag :

<gazebo reference="velodyne_${lidarName}">
  <sensor type="ray" name="velodyne_sensor_${lidarName}">
    <pose>0.0 0.0 0.0 0.0 0 0</pose>
    <visualize>false</visualize>
    <update_rate>10</update_rate>
    <ray>
      <scan>
        <horizontal>
          <samples>${sample_number}</samples>
          <min_angle>${min_angle}</min_angle>
          <max_angle>${max_angle}</max_angle>
        </horizontal>
        <vertical>
          <samples>16</samples>
          <min_angle>-0.26</min_angle>
          <max_angle>0.26</max_angle>
        </vertical>
      </scan>
      <range>
        <min>0.30</min>
        <max>100.0</max>
      </range>
    </ray>
    <plugin name="gazebo_ros_velodyne_controller_${lidarName}" filename="libblock_laser_plugin.so">
      <topicName>/velodyne_${lidarName}</topicName>
      <frameName>velodyne_${lidarName}</frameName>
      <alwaysOn>true</alwaysOn>
      <gaussianNoise>0.00</gaussianNoise>
      <updateRate>10.0</updateRate>
      <hokuyoMinIntensity>1</hokuyoMinIntensity>
    </plugin>
  </sensor>
</gazebo>

I am using xacro parameters (${}) to adapt my sensor.


Originally posted by Brosseau.F with karma: 284 on 2018-02-15

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by RoboticRos on 2018-02-16:
Thanks.....

Comment by RoboticRos on 2018-02-16:
@Brosseau ... It is not publishing any topics. ${lidarName} --> This can be anything (name) i want it to be be ... right??

Comment by Brosseau.F on 2018-02-16:
Yes it can be the name you want. You have to replace all the parameters with the value that you want.

This part of urdf is inside a xacro macro, that's why there is some ${parameters}.

Comment by Subodh Malgonde on 2018-08-11:
The plugin needs to be updated to libgazebo_ros_laser.so, then this works.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.