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:
Two things are obvious:
- the origin of this mesh does not lie in the mesh itself
- 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:
- scale your mesh (using Meshlab fi): scale it with
0.01
(lock all dimensions), then save it again - 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.
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, 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?
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.
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 here is arm model that I have tried to add into the scene.
@gvdhoorn Yes, glxgears run properly