SofaDefrost / SofaGym

Machine Learning framework for Sofa
69 stars 10 forks source link

Error during GripperScene initialisation #7

Closed hunoutl closed 1 year ago

hunoutl commented 1 year ago

The GripperEnv work but during the scene initialisation (on sofa), i got an error :

[ERROR]   [TetrahedronSetTopologyContainer(container)] Cannot find edge 0 [1, 336] in triangle 0 [0 1 336] in the provided edge list (@/Gripper/Finger1/container.edges). It shows an inconsistency between the edge list (@/Gripper/Finger1/container.edges) and the triangle list (@/Gripper/Finger1/container.triangles). Either fix the topology (probably in a mesh file), or provide only the triangle list to '/Gripper/Finger1/container' and not the edges. In the latter case, the edge list will be computed from triangles.

The error takes root from here. https://github.com/SofaDefrost/SofaGym/blob/66af7d8aa248767242b2823621ec941240fde829/sofagym/envs/Gripper/Finger.py#L30-L32 I don't know if it comes from the vtkloader or from the mesh itself

alxbilger commented 1 year ago

Hi @hunoutl,

could you try

model.addObject('TetrahedronSetTopologyContainer', position="@loader.position", tetrahedra="@loader.tetrahedra")

?

By doing that, I explicitly say that I don't want the triangle list and edge list from the loader. They will be computed by the topology.

Why there is a problem with the triangle and edge list in the mesh file is another story...

Alex

hunoutl commented 1 year ago

This solution works. Thanks :-) Lots of stuff I don't know about sofa yet. Thanks :-) I will be able to fix the envs that have this error.

Yes, good question indeed. I opened the vtk with paraview, I had no problem.. Léo