Gazebo Answers logo


I made a gazebo plugin which simulates a particular motor. To do this I created this plugin which inherits from a ModelPlugin, and I take the joint from a model class. If there is a single joint it's ok, but if there are two or more joints, I need to give a reference to the plugin. As this link suggests I used the reference name of the joint in the gazebo tag.

<joint name="joint1" type="revolute">
<parent link="link1"/>
<child link="link2"/>
<origin xyz="0 ${width} ${height1 - axel_offset}" rpy="0 ${PI} 0"/> 
<limit lower="${-1.5*PI}" upper="${1.5*PI}" velocity="${2*PI}" effort="220"/> 
<axis xyz="0 1 0"/>
<dynamics damping="0.7"/>

<gazebo reference="joint1">
<plugin name="motor_spring" filename="/home/gabriele/gazebo_plugin_tutorial/build/libmotor_spring_plugin.so">

The compilation is ok, but when I try to start gazebo I see this warning:

Warning [parser.cc:713] XML Element[plugin], child of element[joint] not defined in SDF. Ignoring[plugin]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element.

Do I wrong in positioning the gazebo tag in my xacro file? Do I wrong to use a ModelPlugin type? If there are more joint that uses the plugin, there is another way to do it?

Thank you!

Originally posted by gabri89 on Gazebo Answers with karma: 19 on 2016-04-26

Post score: 0


1 Answer 1


Gazebo Answers logo

A ModelPlugin can't be attached to a <joint>; it must be attached to the <model>. Perhaps you can add a parameter to your <plugin> that takes the name of the joint to use for the motor?

I realize that the tutorial you referenced is wrong. I've created an issue about fixing the tutorial.

Originally posted by scpeters with karma: 2861 on 2016-04-26

This answer was ACCEPTED on the original site

Post score: 2


Your Answer

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