Ask Your Question
1

rosrun xacro xacro.py nao_robot_v4_structure.urdf.xacro fails

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

JunpeiTsuji gravatar image

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

130s gravatar image

Hi,

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 ( http://www.youtube.com/watch?v=9KfqmX... ), and try to use nao_description package, but I have following error. If you know how to fix this, please let me know.

tsuji@leda:~/ros/electric/alufr-ros-pkg/nao_common/nao_description/urdf$
rosrun xacro xacro.py nao_robot_v4_structure.urdf.xacro  >
nao_structure.urdf

Traceback (most recent call last):
 File "/opt/ros/electric/stacks/xacro/xacro.py", line 35, in <module>
   xacro.main()
 File "/opt/ros/electric/stacks/xacro/src/xacro.py", line 558, in main
   eval_self_contained(doc)
 File "/opt/ros/electric/stacks/xacro/src/xacro.py", line 499, in
eval_self_contained
   eval_all(doc.documentElement, macros, symbols)
 File "/opt/ros/electric/stacks/xacro/src/xacro.py", line 483, in eval_all
   result = eval_text(at[1], symbols)
 File "/opt/ros/electric/stacks/xacro/src/xacro.py", line 402, in eval_text
   results.append(handle_expr(lex.next()[1][2:-1]))
 File "/opt/ros/electric/stacks/xacro/src/xacro.py", line 390, in handle_expr
   return eval_expr(lex, symbols)
 File "/opt/ros/electric/stacks/xacro/src/xacro.py", line 364, in eval_expr
   result = eval_term(lex, symbols)
 File "/opt/ros/electric/stacks/xacro/src/xacro.py", line 339, in eval_term
   result = eval_factor(lex, symbols)
 File "/opt/ros/electric/stacks/xacro/src/xacro.py", line 320, in eval_factor
   return neg * eval_lit(lex, symbols)
 File "/opt/ros/electric/stacks/xacro/src/xacro.py", 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 xacro.py 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
0

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

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

Comments

1

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 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 1,378 times

Last updated: Jul 18 '16