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

No transform from [base_link] to [odom]

asked 2017-06-03 21:47:27 -0500

Cerin gravatar image

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 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-06-04 20:21:00 -0500

ufr3c_tjc gravatar image

Although you are publishing a message describing the robot's position in the odom frame, there probably isn't a TF transform being published. How are you publishing the odom message? Most packages that publish odometry messages will also give the option to publish the TF transform as well, which will fix your error.

I see you have the robot_state_publisher node running, which will publish transforms for you, but only using joints on the joint_states topic. This will work for everything above base_link, but won't work for base_link->odom.

edit flag offensive delete link more

Comments

You're right, I wasn't publishing any TF data. I actually have a node to do this, but it only publishes TF data when the robot's actively moving. As soon as I activated the motors and the motor encoders started publishing odometry info, then the Rviz errors went away.

Cerin gravatar image Cerin  ( 2017-06-05 10:48:39 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2017-06-03 21:47:27 -0500

Seen: 8,116 times

Last updated: Jun 04 '17