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 -0600

adityabvs gravatar image

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

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 -0600

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

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

adityabvs gravatar image adityabvs  ( 2018-08-15 10:26:31 -0600 )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: 2018-08-15 03:14:57 -0600

Seen: 859 times

Last updated: Aug 15 '18