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

File conversion from *.urdf to *.xacro.

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

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?

GDSP

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
9

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

mjcarroll gravatar image

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

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.

Edit:

See this tutorial for further details and syntax.

edit flag offensive delete link more
3

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

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

Comments

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

Question Tools

Stats

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

Seen: 7,304 times

Last updated: Jun 13 '11