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

invisible links in rviz [closed]

asked 2012-09-06 11:48:07 -0600

viovio gravatar image

updated 2012-09-07 01:35:32 -0600

Hello to all,

when I start Rviz with following .udfr - file:

<?xml version="1.0"?>
<robot name="test_robot">
  <link name="base_link"> 
    <visual>
      <geometry>
      <mesh filename="package://learning_urdf/meshes/tx60l_arm.stl"/>
      </geometry>
      <material name="white">
        <color rgba="1 1 1 1"/>
      </material>
    </visual>
  </link>
  <link name="link2" >
    <visual>
      <geometry>
      <mesh filename="package://learning_urdf/meshes/tx60l_shoulder.stl"/>
      </geometry>
      <material name="whatever">
        <color rgba="1 0 1 0"/>
      </material>
    </visual>
  </link>

  <joint name="joint1" type="continuous">
    <parent link="base_link"/>
    <child link="link2"/>
    <origin xyz="0 0 0" rpy="0 0 0" />
    <axis xyz="1 0 0" />
  </joint>
</robot>

Nothing is shown in the camera-view but the grid. The STL-Files were exported in Binary. There are none failure-messages while starting rviz or inside of it.

First i suggested the .stl - files are invisible, so I added the material-tag.

Any Suggestions why my camera-view is blank?

Many Thanks in advance Dominik


edit:

@Lorenz I tried to open my urdf file seperately in rviz und gazebo. For rviz I followed the rviz-tutorial. It was possible to load the urdf-file which you are suposed to build in this tutorial. I only exchanged the simple geometry with the meshes. At the end of the tutorial also a mesh is used (though a dae-file).

update to gazebo: I was able to load the urdf file in gazebo, but it is invisible like in rviz. Also the links of the urdf file are not shown in the tree.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by viovio
close date 2013-03-30 09:23:33

4 Answers

Sort by ยป oldest newest most voted
0

answered 2012-09-07 00:14:58 -0600

Lorenz gravatar image

updated 2012-09-07 01:27:04 -0600

To visualize a URDF file in rviz, it's not enough to just load it in gazebo. You have to load it on the parameter server and you need to publish tf frames for each link in the urdf.

The following launch file loads the urdf and starts the robot_state_publisher to publish the TF frames of the urdf based on the data coming in over the joint_states topic.

<launch>
  <param name="robot_description" textfile="$(find learning_urdf)/tx60l.urdf" />
  <node name="robot_state_published" pkg="robot_state_publisher" type="state_publisher" />
</launch>

Now you need a node to publish joint states. If you want to use gazebo, you will have to use a plugin that reads the state of the joints in the physics simulation. On the real robot the node that communicates with your hardware needs to publish joint states.

For just testing your model in rviz, you can use the joint_state_publisher which provides a nice GUI to move the joints of your model. Don't forget that you have to add 'Robot Model' in rviz and your reference frame needs to be the root of your robot, i.e. base_link.

Edit: Just another guess what could go wrong: How is the scale of your stl files? 1 corresponds to 1mm, the meshes will be really big and you might not see anything. Make sure 1 corresponds to exactly 1 meter.

edit flag offensive delete link more
1

answered 2012-09-07 14:44:56 -0600

I agree with everyone above, but will offer another possibility. When I had tried STL files, I had terrible results. Maybe there were some small visible portions, but most of the mesh didn't show up.

What I ended up doing was installing Blender, which I highly recommend. In Blender, all I did was import STL, export Collada, and then use the .dae mesh in my URDF. This solved all of my problems.

I did have to re-center the origin of my mesh in Blender so the joint would show up in the right place (thanks AutoCAD for changing the origin :P ) but luckily did not have to do any scaling.

edit flag offensive delete link more

Comments

Oh and you should also check your material. Your link #2 has an alpha of 0, meaning it would be 100% transparent.

dougbot01 gravatar image dougbot01  ( 2012-09-07 14:46:14 -0600 )edit
0

answered 2012-09-06 16:24:06 -0600

isao gravatar image

I'm having a similar problem. I think the problem is the parser of the joint. Only the first link is visible on gazebo. In rviz i have no joints.

edit flag offensive delete link more
0

answered 2012-10-18 06:18:07 -0600

viovio gravatar image

Meanwhile I solved it. I forgot to scale the .stl Files with the factor 0.001.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-09-06 11:48:07 -0600

Seen: 2,293 times

Last updated: Oct 18 '12