How can I use arg to add a node to a urdf.xacro?
I use the $(arg foo) syntax to change some values in a urdf.xacro file to adapt the urdf to different robots. This works fine if I just want to replace a string like a position (e.g.
<origin xyz="-0.05 -0.20 -0.038" rpy="($arg rpy_joint_1)/>
but I also want to be able to a a full xml node. I'd like to have a urdf.xacro that looks like
<link name="link_foo" />
$(arg bla)
<link name="link_bar" />
If an additional link is present, 'bar' would contain the whole link definition (maybe also with a joint definition), otherwise it would just be empty. Unfortunately, xacro ignores args that are not already within an xml-node (other than
Has anyone managed to get this done?
Asked by NEngelhard on 2015-06-30 01:42:18 UTC
Answers
The $(arg bla) syntax is actually part of rospack. That's fine to use in a xacro file, but xacro has many more tools available than that. Look at the xacro:macro commands and the xacro conditionals at http://wiki.ros.org/xacro
Asked by thebyohazard on 2015-06-30 11:08:49 UTC
Comments
I had a look at the docu, but so far, I have seen no syntax with which I could create a new node.
Asked by NEngelhard on 2015-06-30 11:54:50 UTC
Comments