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.

edit retag close merge delete

Sort by » oldest newest most voted

I've commented on the issue you opened over at ros-industrial/kuka_experimental: ros-industrial/kuka_experimental/issues/120 - comment.

In short: --inorder is not needed on Jade and newer to enable the new xacro features. Those are enabled by default.

It was needed to enable "in order processing" of xacros on Jade. This was done to allow for a transition period in which users could test their xacros with the new xacro.

The --inorder flag is needed if you want to make use of the new xacro features on Indigo. This just makes Indigo xacro behave like Jade+ xacro.

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.

I hope it's now clear that --inorder is not needed to enable these new features, unless you are on Indigo. I would suggest to revert your changes, or clarify this is only needed for Indigo.

For some context, see ros/xacro#110, specifically Morgan's comment.

Additionally, see ros/xacro#117 where this got merged.

more

Thank you for clarifying and the PR was immensely helpful to understanding what was going on. I now see that this is just serving as a way to trigger access to Jade+ features from Indigo. Thanks!

( 2018-03-18 13:14:59 -0600 )edit