Performance Optimization - dfki-ric/phobos GitHub Wiki

Model Optimization

There are many reasons to optimize models for the simulation. For example it is an improvement if many robots of the same type share the same meshes, especially for large simulations.

Moreover you can reduce the vertices in a mesh. Less vertices mean less rendering/computation time in your simulation.

Regarding the collisions, mesh collisions are rather expensive in means of computation time, therefore - if appropriate - represent your collision geometry rather using primitives than using meshes.

Sharing meshes among multiple objects

Blender allows to use the same mesh for multiple objects. For Phobos' visual and collision objects, this allows to export a mesh that occurs multiple times in the model only once, reducing the size of both the Blender file and the exported URDF/SMURF model, speeding up the export process and improving simulation performance. Linking meshes also makes sure that if the mesh of a specific part of the robot is modified, the meshes of identical parts get updated as well.

To re-use meshes, you can link one or multiple object(s) to another object by selecting them (select the object with the mesh to be used last, making it the active object in Blender) and hit CTRL+L. To unlink object data (meshes), hit U.

Meshes can also be selected for any visual or collision object from a list of meshes provided by Blender on the mesh tab of the object property panel on the right.

Reducing vertices in meshes

By selecting an object and pressing tab, Blender will open the Edit Mode. In this mode you are able to edit the meshes. Under Mesh->Clean-Up Blender offers different tools to reduce your mesh.

Merge by distance is a tool we highly recommend to use it with a small distance (e.g. 1 mm). Depending on the way the mesh was created, there might be two vertices in the same place, where one would be sufficient. Therefore this utility can already eliminate some vertices without loosing mesh detail.

Using Limited Dissolve and Degenerate Dissolve enables you to reduce the degree of detail of the mesh. Play around with their parameters. For most applications the reducing the details of a mesh are an appropriate way of reducing the number of vertices. If you simulate a whole robot, having a representation of every screw on the inside is mostly not necessary.

Finally, you can edit the mesh by hand. E.g. removing the formerly mentioned internal details. Often meshes exported from CAD, have internal 'parts'. If you select a vertex/face/edge of such a part and press CTRL+L Blender selects everything that is connected to it. This is good way to easily select and then remove those internal parts.

Representing Collisions as Primitives

This is quite easy to do simply select the visual for that you want to have a primitive collsision, and click 'Create Collision'. Then you can select what kind of primitive matches your visual the best. See also the section on Collisions.