Ask Your Question
0

URDF model not opening correctly on RViz or Gazebo.

asked 2018-12-13 16:06:54 -0600

John999990 gravatar image

updated 2018-12-13 16:15:49 -0600

Dear all, I have the following URDF file:

<?xml version="1.0"?>
<robot name="r2d3">
    <link name="base_link">
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <box size="0.5 0.5 1"/>
            </geometry>
            <material name="Cyan1">
                <color rgba="0 0.5 0.9 1.0"/>
            </material>
        </visual>
        <collision>
            <geometry>
                <box size="0.55 0.55 1.05"/>
            </geometry>
        </collision>
        <inertial>
            <mass value="1"/>
            <inertia ixx="0.5" ixy="0.0" ixz="0.0" iyy="0.5" iyz="0.0" izz="0.5"/>
        </inertial>
    </link>
    <link name="head_link">
        <visual>
            <origin xyz="0 0 0.5" rpy="0 0 0"/>
            <geometry>
                <sphere radius="0.25"/>
            </geometry>
            <material name="Cyan1">
                <color rgba="0 0.9 0.9 1.0"/>
            </material>
            <collision>
                <geometry>
                    <sphere radius="0.26"/>
                </geometry>
            </collision>
            <inertial>
                <mass value="0.5"/>
                <inertia ixx="0.5" ixy="0.0" ixz="0.0" iyy="0.5" iyz="0.0" izz="0.5"/>
            </inertial>
        </visual>
    </link>
    <link name="l_wheel_link">
        <visual>
            <origin xyz="0.25 0 -0.5" rpy="0 0 0"/>
            <geometry>
                <sphere radius="0.125"/>
            </geometry>
            <material name="red">
                <color rgba="0 0.2 0.5 1.0"/>
            </material>
            <collision>
                <geometry>
                    <sphere radius="0.130"/>
                </geometry>
            </collision>
            <inertial>
                <mass value="0.1"/>
                <inertia ixx="0.2" ixy="0.0" ixz="0.0" iyy="0.2" iyz="0.0" izz="0.2"/>
            </inertial>
        </visual>
    </link>
    <link name="r_wheel_link">
        <visual>
            <origin xyz="-0.25 0 -0.5" rpy="0 0 0"/>
            <geometry>
                <sphere radius="0.125"/>
            </geometry>
            <material name="red">
                <color rgba="0 0.2 0.5 1.0"/>
            </material>
            <collision>
                <geometry>
                    <sphere radius="0.130"/>
                </geometry>
            </collision>
            <inertial>
                <mass value="0.1"/>
                <inertia ixx="0.2" ixy="0.0" ixz="0.0" iyy="0.2" iyz="0.0" izz="0.2"/>
            </inertial>
        </visual>
    </link>
    <joint name="head_joint" type="continuous">
        <parent link="base_link"/>
        <child link="head_link"/>
        <origin xyz="0 0 0.5" rpy="0 0 0"/>
        <limit lower="-1.57" upper="1.57" effort="10" velocity="3"/>
    </joint>
    <joint name="l_wheel_joint" type="continuous">
        <parent link="base_link"/>
        <child link="l_wheel_link"/>
        <origin xyz="0 0.125 -0.5" rpy="0 0 0"/>
    </joint>
    <joint name="r_wheel_joint" type="continuous">
        <parent link="base_link"/>
        <child link="r_wheel_link"/>
        <origin xyz="0 -0.125 -0.5" rpy="0 0 0"/>
    </joint>
</robot>

The problem is that it doesn't open correctly on RViz. The error produced is: " No transform from [base_link] to [map] " This error is showing for every link in my file.

Some additional questions are: 1. What is the TF in URDF? 2. What is the Link Origin in contrast with the Joint Origin? (What does each of those represent?)

Thanks in advance.

edit retag flag offensive close merge delete

Comments

You should read the wiki to learn about TF. It records the transformations between your robot parts so that you know the position of each part compared to the others. To locate a robot you use a fixed TF world and by recording every transformations....

Delb gravatar imageDelb ( 2018-12-17 04:38:43 -0600 )edit

.... (linear and angular) you can know the position of the robot. To understand the difference between link origin and joint origin you can see #q285055, the joint origin is the tf origin and the link is the position of ....

Delb gravatar imageDelb ( 2018-12-17 04:40:44 -0600 )edit

your link from the tf origin.

Delb gravatar imageDelb ( 2018-12-17 04:41:06 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-12-13 16:16:00 -0600

updated 2018-12-14 11:28:53 -0600

You just need to select the 'base_link' frame as the fixed frame in RVIZ. The error your getting is because you're trying to view the world in the map frame, but nothing is defined in the map frame.

You can change this by clicking on the fixed frame drop down under global options, this is highlighted in the image below. You should be able to select from any of the link frames in your urdf.

image description

edit flag offensive delete link more

Comments

If you could share how would I do that It would be most appreciated. I am a very new user of RViz. Thank you.

John999990 gravatar imageJohn999990 ( 2018-12-13 23:25:59 -0600 )edit

I've updated my answer now

PeteBlackerThe3rd gravatar imagePeteBlackerThe3rd ( 2018-12-14 11:29:03 -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

1 follower

Stats

Asked: 2018-12-13 16:06:54 -0600

Seen: 84 times

Last updated: Dec 14 '18