No transform to anything in rviz (pure simulation)

asked 2020-12-09 03:46:13 -0500

lslabon gravatar image

updated 2020-12-09 09:32:45 -0500

Hello,

I am facing a problem when I try to bringup my robot model in rviz. I am launching joint state publisher gui and robot_state publisher in my launch file with the right robot_description urdf file.

Rviz keeps saying "No transform from xxx to base_footprint" for every link in my urdf.

I read here that somebody is needed who publishes the joint positions? Is this something I am missing?

I hope somebody can help me with this!

EDIT:

Robot RVIZ

(how it actually looks like)

image description

Robot Gazebo

(how it should look like)

image description

Robot RVIZ with gazebo

(This is how it looks like in RVIZ when the robot is launched parallel in gazebo) -> only some links are transformed (back wheels are missing)

image description


Launch File

<launch>
 <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
 <arg name="multi_robot_name" default=""/>

 <include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
    <arg name="model" value="$(arg model)" />
    <arg name="multi_robot_name" value="$(arg multi_robot_name)"/>
 </include>

 <node pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" name="joint_state_publisher_gui">
    <param name="use_gui" value="true"/>
    <param name="rate" value="50"/>
 </node>

 <node pkg="robot_state_publisher" type="robot_state_publisher" name="rob_st_pub">
 </node>

 <node name="rviz" pkg="rviz" type="rviz" args="-d $(find turtlebot3_description)/rviz/model.rviz"/>
</launch>

URDF

<?xml version="1.0" ?>
<robot name="turtlebot3_waffle_pi" xmlns:xacro="http://ros.org/wiki/xacro">
  <xacro:include filename="$(find turtlebot3_description)/urdf/common_properties.xacro"/>
  <xacro:include filename="$(find turtlebot3_description)/urdf/turtlebot3_waffle_pi.gazebo.xacro"/>

  <link name="base_footprint"/>

  <joint name="base_joint" type="fixed">
    <parent link="base_footprint"/>
    <child link="base_link" />
    <origin xyz="0 0 0" rpy="0 0 0"/>
  </joint>

  <link name="base_link">
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <box size="0.53 0.50 1.20"/>
      </geometry>
      <material name="light_black"/>
    </visual>

    <collision>
      <origin xyz="0 0 0.033" rpy="0 0 0"/>
      <geometry>
        <box size="0.52 0.50 1.20"/>
      </geometry>
    </collision>

    <inertial>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <mass value="20.00e+00"/>
      <inertia ixx="3" ixy="0" ixz="0"
               iyy="2.82" iyz="0"
               izz="0.83" />
    </inertial>
  </link>

  <joint name="wheel_left_joint" type="continuous">
    <parent link="base_link"/>
    <child link="wheel_left_link"/>
    <origin xyz="0.265 0.2215 -0.633" rpy="-1.57 0 0"/>
    <axis xyz="0 0 1"/>
  </joint>

  <link name="wheel_left_link">
    <visual>
      <origin xyz="0 0 0" rpy="1.57 0 0"/>
      <geometry>
        <mesh filename="package://turtlebot3_description/meshes/wheels/left_tire.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="dark"/>
    </visual>

    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <cylinder length="0.018" radius="0.033"/>
      </geometry>
    </collision>

    <inertial>
      <origin xyz="0 0 0" />
      <mass value="2.8498940e-02" />
      <inertia ixx="1.1175580e-05" ixy="-4.2369783e-11" ixz ...
(more)
edit retag flag offensive close merge delete

Comments

Rviz keeps saying "No transform from xxx to base_footprint"

Whats xxx? I guess map? you need to have every transform published for rviz to be able to display anything. Doesn't seem you have anything that starts localization, which usually produces the map->base_footprint transform.

You don't need, that, you can also just change the fixed_frame in rviz to base_footprint or base_link (or any other existing frame).

mgruhler gravatar image mgruhler  ( 2020-12-09 04:46:50 -0500 )edit

My urdf consists of many links. With xxx I meant just every possible link mentioned in urdf

I was trying to simulate my robot without actual driving. So there can not be a localization, or am I wrong ?

lslabon gravatar image lslabon  ( 2020-12-09 07:48:36 -0500 )edit

Yes, you don't need to have localization. As said before, you can change the fixed_frame in rviz to any existing frame.

For more help, you need to share your full urdf.

mgruhler gravatar image mgruhler  ( 2020-12-09 09:11:17 -0500 )edit

Added my urdf.

Alright, fixed frame is base_link (so there should be a transformation) Interesting is the fact that I can change the frame to anything existing and it won't give an error on this specific link but on all others. So the transform clearly is missing

lslabon gravatar image lslabon  ( 2020-12-09 09:21:20 -0500 )edit

Thanks. Sorry, I've been on the wrong track so far.

Yes, you are correct, someone needs to publish the joint states. The joint_state_publisher_gui should actually do that.

I was actually able to get the expected behavior (minus some textures) by simply running (in separate terminals):

  1. roscore
  2. uploading your urdf to the parameter server with rosparam load <YOUR_URDF> robot_description
  3. rosrun robot_state_publisher robot_state_publisher
  4. rosrun joint_state_publisher_gui joint_state_publisher_gui
  5. running rviz

All transforms were available. Can you reproduce that?

mgruhler gravatar image mgruhler  ( 2020-12-09 09:54:19 -0500 )edit

Well.. It is working now when I start gazebo and rviz both

lslabon gravatar image lslabon  ( 2020-12-12 07:52:20 -0500 )edit

Strange. You shouldn't need Gazebo though. This might also publish some joint states. As described above, I was able to get the expected behavior with only those few nodes and your URDF...

mgruhler gravatar image mgruhler  ( 2020-12-14 00:49:40 -0500 )edit