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

URDF model not opening correctly on RViz or Gazebo.

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

John999990 gravatar image

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

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 image Delb  ( 2018-12-17 04:38:43 -0500 )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 image Delb  ( 2018-12-17 04:40:44 -0500 )edit

your link from the tf origin.

Delb gravatar image Delb  ( 2018-12-17 04:41:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

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

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

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 image John999990  ( 2018-12-13 23:25:59 -0500 )edit

I've updated my answer now

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-12-14 11:29:03 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 276 times

Last updated: Dec 14 '18