Gazebo | Ignition | Community
Ask Your Question

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


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

<model name="my_laser">
        <pose>-0.22 0 0.10500000000000001 0 0 3.141592653589793</pose>
        <plugin name="laser_plugin" filename="" />

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?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

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

mikec gravatar image

Hi Kaldo, I'm also using the "" 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>
    <plugin name="gpu_laser" filename="">

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

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.


edit flag offensive delete link more

Question Tools

1 follower


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

Seen: 1,849 times

Last updated: Feb 07 '17