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

Revision history [back]

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.

click to hide/show revision 2
added turorial link

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.