Continuing the discussion from HowTo: Connect pypot to your simulated version of Poppy humanoid in V-REP:
Call for contributions
The current 3D model for simulation (for the moment V-REP only) is a bit too complex making the simulation quite slow. Therefore, it would be great to reduce the meshes complexity to improve the overall performance.
In this kind of model, there are actually 2 bodies per part. The physical body is used to compute collision between parts while the visual body is the one displayed. Both have to be simplify to improve the overall performances.
The simulated robot is generated from a URDF file available here. This URDF links to the visual meshes (STL) available here and currently links to the same meshes for the collision bodies (which is not optimized):
<link name="pelvis">
<inertial>
<origin xyz="-0.000134932459328483 -0.000399086261064929 0.00195556930608449" rpy="0 0 0"></origin>
<mass value="0.18520035953947"></mass>
<inertia ixx="0.000101804322229161" ixy="3.56589402562651E-08" ixz="-1.38613151054156E-05" iyy="0.000142404075398435" iyz="-3.50682832702007E-06" izz="9.38193247222871E-05"></inertia>
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0"></origin>
<geometry>
<mesh filename="package://meshes/pelvis.STL"></mesh>
</geometry>
<material name="">
<color rgba="0.9 0.9 0.9 1.0"></color>
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0"></origin>
<geometry>
<mesh filename="package://meshes/pelvis.STL"></mesh>
</geometry>
</collision>
</link>
It is needed to create alternative meshes for the collision and simplify the visual meshes. To do so the MeshLab software appears as a very good candidate.
Step 1: Simplify collision bodies
Currently, physical bodies are the same as the visual body so they are waaayyy too complex for efficient collisions computation.
The first step is to create an alternative very-simplified version and as convex as possible. The convex hull algorithm seems a good starting point but may not be adapted for all parts.
Then export the alternative mesh and link it properly in the URDF file, for example:
<collision>
<origin xyz="0 0 0" rpy="0 0 0"></origin>
<geometry>
<mesh filename="package://meshes/pelvis-collidable.STL"></mesh>
</geometry>
</collision>
Step 2: Simplify the visual bodies
For the visual bodies, we only have to reduce the number of triangle to improve the display framerate. Meshlab has a lot of tool to do it, here is an example:
Bonus step: create a script to automatically perform all these operations
On Poppy Humanoid, there are many moving parts (26) so generating all these meshes each time the robot is upgraded seems quite boring⌠Meshlab permits to create scripts, maybe there is something to do with this feature ?
Contributions guidelines
You can fork the Poppy Humanoid repository and work directly on meshes available in hardware/URDF/meshes
. Then create a pull request to integrate your awesome changes