URDF model not opening correctly on RViz or Gazebo.
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.
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 TFworld
and by recording every transformations........ (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 ....
your link from the tf origin.