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

URDF parsing error: 'Error reading Attributes. at line 72 in /../urdf_parser/src/model.cpp ERROR: Model Parsing the xml failed'

asked 2018-08-15 03:14:57 -0500

adityabvs gravatar image

updated 2018-08-15 03:22:39 -0500

gvdhoorn gravatar image

URDF:

<?xml version = "1.0"?> 
<robot name = "two_wheeled_robot"> 
    <link name = "chassis">         
                <visual>        
                 <origin rpy = "0 0 0" xyz = "0 0 0.05"/>       
                <geometry>          
                <box size = "0.05 0.1 0.03"/>       
                </geometry>         
                </visual>   
        </link>       

         <link name = "right_wheel">        
               <visual>         
             <origin rpy = "0 0 0" xyz = "0.025 0 0.05"/>       
              <geometry> 
            <cylinder radius = "0.05" length = "0.01"/> 
        </geometry>         
               </visual>
    </link>
          <link name = "left_wheel">
                 <visual>
                 <origin rpy = "0 0 0" xyz = "-0.025 0 0.05"/>
                 <geometry>
                         <cylinder radius = "0.05" length = "0.01"/>
                 </geometry>
                 </visual>
         </link>    
         <joint name = "c_to_rw" type = "revolute">
        <parent link = "chassis"/>
        <child link = "right_wheel"/>
        <origin rpy = "0 0 0" xyz = "0.025 0 0.05"/>
        <limit upper = "2" lower = "-2" effort = "0.1" velocity = "0.5"/>
        <axis = "1 0 0"/>
           </joint>     
           <joint name = "c_to_lw" type = "revolute">
                 <parent link = "chassis"/>
                 <child link = "left_wheel"/>
                 <origin rpy = "0 0 0" xyz = "-0.025 0 0.05"/>
                 <limit upper = "2" lower = "-2" effort = "0.1" velocity = "0.5"/>
                 <axis = "-1 0 0"/>
         </joint>
 </robot>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-08-15 03:26:41 -0500

gvdhoorn gravatar image

Running your urdf through an XML formatter returned the following error:

Unable to parse any XML input. Error on line 33: Element type "axis" must be followed by either attribute specifications, ">" or "/>".

And indeed, if we look at your axis elements we see:

<axis = "1 0 0"/>

This is not valid XML, and thus not valid URDF. It's missing the xyz attribute and should be:

<axis xyz="1 0 0"/>

See also the Elements section of the urdf/XML/joint page on the ROS wiki. xyz is a required attribute for axis elements.

edit flag offensive delete link more

Comments

PS: just a note: there is no need for all the spaces between attribute names and their values. So this:

<joint name = "c_to_lw" type = "revolute">

can just be this:

 <joint name="c_to_lw" type="revolute">

That will make things a little more compact and easier to read.

gvdhoorn gravatar image gvdhoorn  ( 2018-08-15 03:27:52 -0500 )edit

thank you gvdhoorn. I take note of the advice about the spaces.

adityabvs gravatar image adityabvs  ( 2018-08-15 10:26:31 -0500 )edit

rxp is a good xml format testing command line tool, maybe there are better ones

lucasw gravatar image lucasw  ( 2022-03-10 18:28:37 -0500 )edit

Question Tools

Stats

Asked: 2018-08-15 03:14:57 -0500

Seen: 1,334 times

Last updated: Aug 15 '18