Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Understanding relationship between new xacro macros and --inorder

I just learned of the new Jade xacro macros as part of a PR I submitted. In switching to using ${radians(foo)}, the build failed. In comparing to other robots in the kuka_experimental repository, I found a few differences, one of which being the --inorder flag. I was informed that these new Jade macros require --inorder, but I didn't see that on the wiki.

I've updated the wiki on math expressions to suggest using --inorder, but I'm still a bit confused by the behavior and thought I'd bring it here in case there were further doc changes that might be helpful.

For one, I updated two robot macros.xacro files to use ${radians()} for their joint limits. One failed (linked above), and one succeeded. Changing the first to use --inorder fixed the build error. The second still doesn't have it, yet this somehow passes the build?

<launch>
  <param name="robot_description" command="$(find xacro)/xacro.py '$(find kuka_lbr_iiwa_support)/urdf/lbr_iiwa_14_r820.xacro'" />
</launch>

Secondly, the wiki suggests that one can test whether or not this flag affects their xacro files with:

rosrun xacro xacro file.xacro > /tmp/old.xml
rosrun xacro xacro --inorder file.xacro > /tmp/new.xml
diff /tmp/old.xml /tmp/new.xml

I assumed that if --inorder was the source of issues, I'd detect it with this test? In trying that on lbr_iiwa_14_r820_macro.xacro and lbr_iiwa_14_r820.xacro in this branch of kuka_experimental, I get no results for either using diff (identical output).

Could someone with more macros experience help illuminate what's going on here and suggest any changes I could make to the wiki to help others? I found this to be pretty nuanced/subtle, and it caused maybe an hour of trying random things, waiting for a Travis build, and repeating. It'd be nice to help other users avoid this.