Problem with plugin referencing to a joint.
Hi,
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"/>
<spring_stiffness>2300</spring_stiffness>
</joint>
<gazebo reference="joint1">
<plugin name="motor_spring" filename="/home/gabriele/gazebo_plugin_tutorial/build/libmotor_spring_plugin.so">
<alwaysOn>true</alwaysOn>
</plugin>
</gazebo>
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!