ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

File conversion from *.urdf to *.xacro.

asked 2011-06-13 05:24:54 -0600

PGAM gravatar image

How we can convert a hand-written URDF file to a .xacro file (xml macro for generating URDF files) for robot and world models?


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-06-13 05:56:50 -0600

mjcarroll gravatar image

updated 2011-06-13 17:47:17 -0600

tfoote gravatar image

There is no official or programmatic way of doing this, as the process is strongly dependent on the platform that you are using.

When converting from a URDF to a xacro file, I did the following:

  • Create properties for commonly-used constants
    • Mathematics constants: M_PI, M_2PI
    • Conversion constants: Radians to Degrees, inches to centimeters
    • Physics constants: Speed of Light, gravity (if needed)
  • Create properties for variable components of your robot (Parts that will be constant over a run, but may change between runs)
    • Wheel Radius
    • Ground Clearance
    • Camera Height/Angle
  • Create macros for arrays of parts on your robot (a good example would be the super-structure of the turtlebot).
  • Create macros for any components that are "mirrored"
    • arms
    • wheels

This would be a good starting point for creating a xacro file, in general.


See this tutorial for further details and syntax.

edit flag offensive delete link more

answered 2011-06-13 06:45:31 -0600

David Lu gravatar image

Michael's answer covers the strategy well. See this tutorial for further details and syntax.

edit flag offensive delete link more


Good catch, I forgot that there was an entire tutorial on that.
mjcarroll gravatar image mjcarroll  ( 2011-06-13 07:16:20 -0600 )edit

Question Tools


Asked: 2011-06-13 05:24:54 -0600

Seen: 6,882 times

Last updated: Jun 13 '11