0
$\begingroup$

Rosanswers logo

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


Originally posted by PGAM on ROS Answers with karma: 61 on 2011-06-13

Post score: 6

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by mjcarroll with karma: 6414 on 2011-06-13

This answer was ACCEPTED on the original site

Post score: 9

$\endgroup$
0
$\begingroup$

Rosanswers logo

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


Originally posted by David Lu with karma: 10932 on 2011-06-13

This answer was NOT ACCEPTED on the original site

Post score: 3


Original comments

Comment by mjcarroll on 2011-06-13:
Good catch, I forgot that there was an entire tutorial on that.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.