Gazebo | Ignition | Community
Ask Your Question
0

How to convert gazebo plugin for SDF model into plugin for URDF?

asked 2020-04-24 02:32:11 -0500

raghavthakar gravatar image

Hi! I have made a custom Gazebo plugin for an SDF model. I would now like to use this same plugin with a URDF file, along with the ability to specify parameters for plugin inside the URDF file. How do I do this? Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-04-30 09:30:51 -0500

Vianne gravatar image

updated 2020-04-30 09:31:56 -0500

Hi! This seems to work for me:

<gazebo>
    <plugin name="apply_input_force" filename="libapply_input_force_plugin.so">
        <link>base_footprint</link>
    </plugin>
</gazebo>

the 'link' element here is a custom parameter you are passing to the plugin. These can be used in the plugin using this code:

_sdf->GetElement("link")->Get<std::string>();

Don't forget to pass 'sdf::ElementPtr _sdf' to your function!

edit flag offensive delete link more

Comments

This was very helpful! I shall try this and revert ASAP!

raghavthakar gravatar imageraghavthakar ( 2020-05-01 08:13:44 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-04-24 02:32:11 -0500

Seen: 36 times

Last updated: Apr 30