Rviz: Failed to parse URDF model

Hi,

I just begin the first unit of urdf. When I do the exercise to write a urdf-file to describe mira-robot, I cannot successfully visualize the model. My .launch file is ok. The problem is in the urdf-file. But I have no idea why does it nor work. I have already word by word compared with the solution, and didn’t find the reason of error. Maybe there are some details in constructure of urdf-file that I don’t know. Here is my urdf coding.

‘’’

<?xml version="1.0"?>
<material name="red">
    <color rgba="1 0 0 1"/>
</material>

<link name="base_link">
    <visual>
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <geometry>
            <cylinder radius="0.06" length="0.09"/>
        <geometry/>
    </visual>
</link>

<link name="roll_M1_link">
    <visual>
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <geometry>
            <cylinder length="0.005" radius="0.01"/>
        </geometry>
        <material name="red"/>
    </visual>
</link>

<joint name="roll_joint" type="revolute">
	<parent link="base_link"/>
	<child link="roll_M1_link"/>
    <origin xyz="0.0023 0 -0.0005" rpy="0 0 0"/>
    <limit lower="-0.2" upper="0.2" effort="0.1" velocity="0.005"/>
    <axis xyz="1 0 0"/>
</joint>
'''

please help…

Jialei Li

Hi @MeineLiebeAxt ,

Your urdf file must start with the tag <robot name="robot_name"> ... </robot>

Why is this piece of code outside? I think it should come under `base_link`
<material name="red">
    <color rgba="1 0 0 1"/>
</material>

Regards,
Girish

Hi @girishkumar.kannan ,

Thanks for your explaination. But actually this is ok, it doesn’t affect the compling of coding. I just want to define a commen material, which can be used by more than one link. So I don’t need to define colors for every link.

And after some time I found the error. I must say it is stupid error…

    <geometry>
        <cylinder radius="0.06" length="0.09"/>
    <geometry/>

I put the “/” at the end, it should be at the beginning…

Thank you anyway.

Jialei Li

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.