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

Revision history [back]

Unfortunately, this is not possible at the moment. It would be nice if one could do something like:

rosrun xacro xacro.py model.urdf.xacro | rosrun urdf check_urdf -

... and have check_urdf read stdin instead of a file, but tinyxml (which is used internally by check_urdf) expects a filename, and nothing can be done about that without changing the code of tinyxml (which would be quite easy). Of course you could just write your two lines into one, but that would be cheating, wouldn't it? :-)

rosrun xacro xacro.py model.urdf.xacro > tmp.urdf && rosrun urdf check_urdf tmp.urdf && rm tmp.urdf

Unfortunately, this is not possible at the moment. It would be nice if one could do something like:

rosrun xacro xacro.py --inorder model.urdf.xacro | rosrun urdf check_urdf -

... and have check_urdf read stdin instead of a file, but tinyxml (which is used internally by check_urdf) expects a filename, and nothing can be done about that without changing the code of tinyxml (which would be quite easy). Of course you could just write your two lines into one, but that would be cheating, wouldn't it? :-)

rosrun xacro xacro.py --inorder model.urdf.xacro > tmp.urdf && rosrun urdf check_urdf tmp.urdf && rm tmp.urdf

Unfortunately, this is not possible at the moment. It would be nice if one could do something like:

xacro --inorder model.urdf.xacro | check_urdf -

... and have check_urdf read stdin instead of a file, but tinyxml (which is used internally by check_urdf) expects a filename, and nothing can be done about that without changing the code of tinyxml (which would be quite easy). Of course you could just write your two lines into one, but that would be cheating, wouldn't it? :-)

xacro --inorder model.urdf.xacro > tmp.urdf && check_urdf tmp.urdf && rm tmp.urdf

Update 07/2018: Since people still seem to be reading this question 7 years later, here's a nicer way to do it in one line:

check_urdf <(xacro --inorder model.urdf.xacro)

Unfortunately, this is not possible at the moment. It would be nice if one could do something like:

xacro --inorder model.urdf.xacro | check_urdf -

... and have check_urdf read stdin instead of a file, but tinyxml (which is used internally by check_urdf) expects a filename, and nothing can be done about that without changing the code of tinyxml (which would be quite easy). Of course you could just write your two lines into one, but that would be cheating, wouldn't it? :-)

xacro --inorder model.urdf.xacro > tmp.urdf && check_urdf tmp.urdf && rm tmp.urdf

Update 07/2018: Since people still seem to be reading this question 7 years later, here's a nicer way to do it in one line:

check_urdf <(xacro --inorder model.urdf.xacro)

Unfortunately, this is not possible at the moment. It would be nice if one could do something like:

xacro model.urdf.xacro | check_urdf -

... and have check_urdf read stdin instead of a file, but tinyxml (which is used internally by check_urdf) expects a filename, and nothing can be done about that without changing the code of tinyxml (which would be quite easy). Of course you could just write your two lines into one, but that would be cheating, wouldn't it? :-)

xacro --inorder model.urdf.xacro > tmp.urdf && check_urdf tmp.urdf && rm tmp.urdf

Update 07/2018: Since people still seem to be reading this question 7 years later, here's a nicer way to do it in one line:

check_urdf <(xacro model.urdf.xacro)