Ask Your Question

RVIZ failed to visualize STL scene objects

asked 2016-11-07 11:25:54 -0500

Kate Zabelova gravatar image

I have tried to add some STL objects into the scene in RVIZ (add object as a file option). It seems that more complex models failed to render in rviz. The simplest ones renders well. [I can't load a file to show you the "invisible" model] I am using ROS Indigo under Ubuntu in Virtual Box VW. Any suggestions?

edit retag flag offensive close merge delete


RViz is quite a graphically heavy application, especially if you have complex meshes (ie: high nrs of vertices and faces) in your scene. VMs haven't had the best performance in these cases. Not sure, but the two could be related. Do those meshes load properly in fi Meshlab or other tools?

gvdhoorn gravatar image gvdhoorn  ( 2016-11-07 12:02:43 -0500 )edit

@gvdhoorn, yes, the models load properly in other tools. The problem appears with .stl files, approximately larger than 1MB. Is it possible to improve the performance of the VM?

Kate Zabelova gravatar image Kate Zabelova  ( 2016-11-07 13:59:37 -0500 )edit

If at all possible, please provide us with a way to replicate your issue, either by making the meshes that show the problem available, or by creating something else (other meshes) that are also problematic.

gvdhoorn gravatar image gvdhoorn  ( 2016-11-08 12:32:59 -0500 )edit

re: improve performance of vm: have you installed the proper drivers for the vm hw? Most likely current Ubuntu distributions include all the necessary drivers for VirtualBox hw, but it's a good thing to check. Does glxgears run properly?

gvdhoorn gravatar image gvdhoorn  ( 2016-11-08 12:33:46 -0500 )edit

@gvdhoorn here is arm model that I have tried to add into the scene.

Kate Zabelova gravatar image Kate Zabelova  ( 2016-11-09 02:49:53 -0500 )edit

@gvdhoorn Yes, glxgears run properly

Kate Zabelova gravatar image Kate Zabelova  ( 2016-11-09 02:52:34 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-11-09 03:05:45 -0500

gvdhoorn gravatar image

updated 2016-11-09 03:09:40 -0500

Turns out this has (most likely) nothing to do with drivers or your VM: ROS uses SI units for everything (REP-103), so meshes are expected to be scaled to meters.

After loading arm.stl in Blender, I see the following:

image description

Two things are obvious:

  1. the origin of this mesh does not lie in the mesh itself
  2. the mesh is probably stored with units set to centimeters

Nr 1 isn't really a problem (having the mesh origin close to the geometry is not strictly necessary, but it's quite far away in this case, which can make creating a proper urdf difficult).

The scaling is a problem here however: STL (the mesh format) doesn't include any information on what units it is using for distances and vertex locations. This leads to situations where a mesh is saved with all lengths scaled to centimeters, while ROS expects them to be meters. Result: your hand is now a 100 times too big. With the default viewport settings of RViz, it will look like your mesh is not being visualised, while in reality it will just be very far away from the centre of projection.

Two possible solutions:

  1. scale your mesh (using Meshlab fi): scale it with 0.01 (lock all dimensions), then save it again
  2. add a scale="0.01 0.01 0.01" attribute to a mesh tag in a URDF (see wiki/urdf/XML/link)

Since you are not using URDF to add these meshes to your scene, scaling the mesh is probably the easiest option here. Alternatively you could use the Scale slider provided by the UI, but you'd need to repeat that every time you load your mesh, and additionally might not be as precise.

edit flag offensive delete link more


Thank you!

Kate Zabelova gravatar image Kate Zabelova  ( 2016-11-09 11:24:34 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2016-11-07 11:25:54 -0500

Seen: 1,139 times

Last updated: Nov 09 '16