Ask Your Question
1

urdf to xacro

asked 2015-02-21 11:03:40 -0600

End-Effector gravatar image

I'm building my first robot and I'm not understanding XACRO.

I did the robot in urdf and now I'm changing the file to xacro. But I get a lot or errors.

Expat parsing error.  Check that:
 - Your XML is correctly formed
 - You have the xacro xmlns declaration: xmlns:xacro="http://www.ros.org/wiki/xacro"

Traceback (most recent call last):
  File "/opt/ros/indigo/share/xacro/xacro.py", line 60, in <module>
    xacro.main()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/xacro/__init__.py", line 672, in main
    doc = parse(f)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
    return expatbuilder.parse(file)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 928, in parse
    result = builder.parseFile(file)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 211, in parseFile
    parser.Parse("", True)
xml.parsers.expat.ExpatError: unclosed token: line 1, column 0

I only changed the first lines of the original urdf file that was successfully parsed. I just added this code.

<?xml version="1.0">
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="r2d2" >

<xacro:property name="raioRoda" value="0.05"/>
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2015-02-21 11:47:12 -0600

marguedas gravatar image

updated 2015-02-21 11:49:22 -0600

It seems that your xml tag is not closed according to the error. can you try this instead ?

<?xml version="1.0" ?>

can you also make sure that your <robot> tag is closed at the end of the file ?

Hope this helps,

edit flag offensive delete link more
1

answered 2015-02-21 11:46:46 -0600

paulbovbel gravatar image

updated 2015-02-21 11:46:58 -0600

Your prolog needs to be closed:

<?xml version="1.0"?>
edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

Asked: 2015-02-21 11:03:40 -0600

Seen: 1,239 times

Last updated: Feb 21 '15