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

rosrun xacro nao_robot_v4_structure.urdf.xacro fails

asked 2012-05-10 02:59:30 -0600

JunpeiTsuji gravatar image

updated 2016-07-18 01:45:58 -0600

130s gravatar image


The other day, I send following question to University of Freiburg who made this package, and got an answer. I hope you can benefit from this as well if you have the same problem.

I'm also using NAO robot too ( ), and try to use nao_description package, but I have following error. If you know how to fix this, please let me know.

rosrun xacro nao_robot_v4_structure.urdf.xacro  >

Traceback (most recent call last):
 File "/opt/ros/electric/stacks/xacro/", line 35, in <module>
 File "/opt/ros/electric/stacks/xacro/src/", line 558, in main
 File "/opt/ros/electric/stacks/xacro/src/", line 499, in
   eval_all(doc.documentElement, macros, symbols)
 File "/opt/ros/electric/stacks/xacro/src/", line 483, in eval_all
   result = eval_text(at[1], symbols)
 File "/opt/ros/electric/stacks/xacro/src/", line 402, in eval_text
 File "/opt/ros/electric/stacks/xacro/src/", line 390, in handle_expr
   return eval_expr(lex, symbols)
 File "/opt/ros/electric/stacks/xacro/src/", line 364, in eval_expr
   result = eval_term(lex, symbols)
 File "/opt/ros/electric/stacks/xacro/src/", line 339, in eval_term
   result = eval_factor(lex, symbols)
 File "/opt/ros/electric/stacks/xacro/src/", line 320, in eval_factor
   return neg * eval_lit(lex, symbols)
 File "/opt/ros/electric/stacks/xacro/src/", line 298, in eval_lit
   raise XacroException("Property wasn't defined: %s" % str(ex))
xacro.XacroException: Property wasn't defined: u'pi_2'

And I got following answer.

The file is not meant to be used stand-alone because it includes only the structure without visualization. You need to run "rosrun xacro nao_robot_v4.urdf.xacro"

Or directly start the state_publisher as well with the launch file with launch/nao_v4_publisher.launch.
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-02-27 07:02:17 -0600

domingoesteban gravatar image

Probably this is a late answer, but it can be useful for someone else.

I had a similar problem with other package, apparently the reason is that property tags cannot be declared inside of a xacro:macro. And unfortunately, for nao_description package some macros in "visuals.xacro" use "pi" and "pi_2" properties, so when it copies theirs contents in "nao_robot_v4_structure.urdf.xacro" file, this two properties don't appear. One solution is move this two properties:

< xacro:property name="pi" value="3.1415926535897931"/>

< xacro:property name="pi_2" value="1.5707963267948966"/>

to "nao_robot_v4_structure.urdf.xacro" file.

edit flag offensive delete link more



The best way to request fixes or improvements would be to submit an issue to the corresponding GitHub repo. You can even contribute fixes via fork / pull request.

AHornung gravatar image AHornung  ( 2014-02-28 00:58:19 -0600 )edit

Question Tools


Asked: 2012-05-10 02:59:30 -0600

Seen: 1,608 times

Last updated: Jul 18 '16