Home | Tutorials | Wiki | Issues
Ask Your Question
0

Attach plugin to included laser model

asked 2017-01-24 23:43:02 -0500

kaldo gravatar image

updated 2017-01-25 03:08:50 -0500

Hello,

My sdf model contains an included Hokuyo laser, and I tried to attach the rather standard libgazebo_ros_gpu_laser.so plugin, as follows:

<model name="my_laser">
    <include>
        <uri>model://hokuyo</uri>
        <pose>-0.22 0 0.10500000000000001 0 0 3.141592653589793</pose>
        <plugin name="laser_plugin" filename="libgazebo_ros_gpu_laser.so" />
    </include>
</model>

I get this error:

Model[my_laser] is attempting to load a plugin, but detected an incorrect plugin type.

Indeed, from what I see in the example, the plugin is meant for <sensor> elements.

So can I access the sensor itself, and attach the plugin to it directly?

If not, how do you suggest I use the plugin?

Thanks,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-02-07 13:32:34 -0500

mikec gravatar image

Hi Kaldo, I'm also using the "libgazebo_ros_gpu_laser.so" plugin on my model, but my model is in URDF format (I would not think that it matters). I initially had problems getting my laser to work but somewhere I found an answer from someone (I don't remember who answered or where I found it).

Here is what I have in my URDF file:

<gazebo reference="base_link">
  <sensor type ="gpu_ray" name="hoyuko">
    <pose>0.19391 0.00126 0.28877 0 0 0</pose>
    <visualize>true</visualize>
    <update_rate>20</update_rate>
    <ray>
      <scan>
        <horizontal>
          <samples>720</samples>
          <resolution>1</resolution>
          <min_angle>-1.570796</min_angle>
          <max_angle>1.570796</max_angle>
        </horizontal>
      </scan>
      <range>
        <min>0.10</min>
        <max>2.5</max>
        <resolution>0.01</resolution>
      </range>
    </ray>
    <plugin name="gpu_laser" filename="libgazebo_ros_gpu_laser.so">
      <topicName>/scan</topicName>
      <frameName>base_link</frameName>
    </plugin>
  </sensor>            
</gazebo>

In your file try changing <plugin name="laser_plugin" filename="libgazebo_ros_gpu_laser.so" /> to <plugin name="gpu_laser" filename="libgazebo_ros_gpu_laser.so">.

I tried several different combinations before mine worked, but I think it was this change that actually did the trick. Give it a try and see what happens. Hopefully it will work for you.

Mike

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-01-24 23:43:02 -0500

Seen: 1,275 times

Last updated: Feb 07 '17