No transform from [base_link] to [odom]
I'm trying to visualize my robot in Rviz and I'm getting several errors:
- Global Status: Fixed Frame: No tf data. Actual error: Fixed Frame [odom] does not exist
- Robot Model: base_link: No transform from [base_link] to [odom]
- Imu: Transform [sender=unknown_publisher] For frame [base_link]: Fixed Frame [odom] does not exist
Why am I getting these errors?
My robot is a simple cylinder with the URDF:
<?xml version="1.0" encoding="UTF-8"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="robot">
<xacro:property name="torso_radius" value="0.075" />
<xacro:property name="torso_height" value="0.16" />
<link name="base_link">
<visual>
<geometry>
<cylinder length="${torso_height}" radius="${torso_radius}" />
</geometry>
<origin xyz="0 0 ${torso_height/2}" rpy="0 0 0" />
</visual>
</link>
</robot>
It outputs odometry messages like:
header:
seq: 10
stamp:
secs: 1496543906
nsecs: 963784933
frame_id: /odom
child_frame_id: /base_link
pose:
pose:
position:
x: 0.082
y: 0.001
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.0234978370806
w: 0.999723887707
covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
twist:
twist:
linear:
x: 0.002
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: -0.009
covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
and IMU messages like:
header:
seq: 165
stamp:
secs: 1496543986
nsecs: 493674993
frame_id: base_link
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
angular_velocity:
x: 0.0
y: 0.0
z: 0.0
angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
linear_acceleration:
x: -0.5
y: -0.24
z: 9.77
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
I'm launching Rviz with the launch file:
<launch>
<arg name="model" default="$(find myrobot_description)/urdf/robot.urdf.xacro"/>
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
<arg name="gui" default="true" />
<arg name="rvizconfig" default="$(find myrobot_description)/rviz/urdf.rviz" />
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
<param name="use_gui" value ...