Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to load plugin from URDF in ignition ? #109

Closed
doisyg opened this issue Sep 8, 2020 · 3 comments
Closed

How to load plugin from URDF in ignition ? #109

doisyg opened this issue Sep 8, 2020 · 3 comments

Comments

@doisyg
Copy link
Contributor

doisyg commented Sep 8, 2020

Transitioning from Gazebo to Ignition, I am trying to use the spawner #60
I can successfully load an URDF which spawn a model in Ignition, but in don't understand how to load a plugin from the URDF.
More precisely I am trying to start the DiffDrive plugin, I put the following :

  <plugin
    filename="libignition-gazebo-diff-drive-system.so"
    name="ignition::gazebo::systems::DiffDrive">
    <left_joint>left_wheel_joint</left_joint>
    <right_joint>right_wheel_joint</right_joint>
    <wheel_separation>1.25</wheel_separation>
    <wheel_radius>0.3</wheel_radius>
    <!-- no odom_publisher_frequency defaults to 50 Hz -->
  </plugin>

below under robot tag but nothing seems to be loaded. However when using a sdf file and putting it under the model tag, it works properly. Maybe there is an equivalent to the urdf gazebo tag for ignition but I cannot find any example.

@diegoferigo
Copy link

Have you tried the following?

<robot name="model_name">
  <gazebo>
    <plugin filename="" ...>
      <!-- ... -->
    </plugin>
  </gazebo>
</robot>

The urdf file is converted by gazebo to sdf before being parsed by sdformat. You can test the conversion with ign sdf -p file.urdf.

@doisyg
Copy link
Contributor Author

doisyg commented Sep 8, 2020

🤦‍♂️ 🤦‍♂️ 🤦‍♂️
Thanks, it works!
and ign sdf -p file.urdf is very useful for debugging

@doisyg doisyg closed this as completed Sep 8, 2020
@diegoferigo
Copy link

For future reference, the URDF tutorial for Gazebo Classic seems still valid also for Ignition Gazebo. In particular, from the section <gazebo> element for the tag:

If a <gazebo> element is used without a reference="" property, it is assumed the <gazebo> element is for the whole robot model.

that can be applied also to model plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants