How to convert URDF from xacro

Simply put, after install the ROS noetic:

rosrun xacro xacro xxx.urdf.xacro > xxx.urdf

A little bit comments:
Though we are considering design a new universal format to replace URDF, for the historical reason, we still need to support it. What makes URDF frustrating to use is that most robot assets in the community is defined by XACRO!

So to use URDF, you have to convert the XACRO first.
But if you want to convert XACRO, you have to:

  1. install ROS
  2. learn how to put the xxx_description into a ros workspace: mkdir -p ~/catkin_ws/src FYI.
  3. pray for this package does not rely on too many strange external lib.
  4. hope the xacro is actually working! (you may surprisingly find, the working portion is really low…)

After a long time, I still do not get why robot community adopts such an ugly format like xacro. If URDF is too cumbersome to use, just abandoning XML! I blame this to gazebo.

2 Likes

That does not sound good… LOL :rofl:

Because xacro conversion usually requires ENV VAR setup by ros…

xacro is not self-contained… I try to extract the xacro.py but it does not work.