0
$\begingroup$

Rosanswers logo

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?


Originally posted by Kate Zabelova on ROS Answers with karma: 13 on 2016-11-07

Post score: 1


Original comments

Comment by gvdhoorn on 2016-11-07:
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?

Comment by Kate Zabelova on 2016-11-07:
@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?

Comment by gvdhoorn on 2016-11-08:
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.

Comment by gvdhoorn on 2016-11-08:
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?

Comment by Kate Zabelova on 2016-11-09:
@gvdhoorn here is arm model that I have tried to add into the scene.

Comment by Kate Zabelova on 2016-11-09:
@gvdhoorn Yes, glxgears run properly

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by gvdhoorn with karma: 86574 on 2016-11-09

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by Kate Zabelova on 2016-11-09:
Thank you!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.