ROS Q&A | How to retrieve the robot name from the URDF file?

Written by Ruben Alves

17/10/2017

 

Q: How to retrieve the robot name from the URDF file?

A: This can be accomplished by loading a URDF file, parsing it and calling the getName() method of the C++ Urdf model.

To see how to load and parse a URDF file, you can follow the Parse a urdf file tutorial  (http://wiki.ros.org/urdf/Tutorials/Parse%20a%20urdf%20file).

After compile the code and generate the executable called “parser” following the “Parse a urdf file” tutorial, you can call it with the path of the URDF file as argument. Something like: rosrun your_package_name parser /path/to/your/file.urdf

Topics:
Masterclass 2023 batch2 blog banner

Check Out These Related Posts

1 Comment

  1. Maria Cornejo

    really helpfull to undertand the basics of loading an urdf file. can you do another video to list links or joints of the urdf file?

    Reply

Submit a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest

Share This