a
    ij                     @   sf   d Z ddlmZ ddlmZ ddlZddlmZ ddlZdZ	dZ
G dd	 d	ejZed
krbe  dS )zTests for msh2obj.py.    )absltest)epathN)msh2obj)Zmesh_vertadrZmesh_vertnumZmesh_faceadrZmesh_facenumZmesh_bvhadrZmesh_bvhnumZmesh_normaladrZmesh_normalnumZmesh_texcoordadrZmesh_texcoordnumZmesh_graphadrZ	mesh_vertZmesh_normalZ	mesh_faceZmesh_facenormalZmesh_facetexcoordZ
mesh_graphZmesh_texcoordze
<mujoco>
  <asset>
    <mesh name="abdomen_1_body" file="abdomen_1_body.obj"/>
  </asset>
</mujoco>
c                   @   s   e Zd ZddddZdS )MshTestN)returnc                 C   s   t dd }|d }tj| }|d }t|}tjt	d|
 i}tD ],}tjjt||t||dd| dd	 qRd S )
NmujocoZtestdatazmsh.xmlzabdomen_1_body.mshzabdomen_1_body.objgư>zField z+ does not match between msh and obj models.)Zatolerr_msg)r   resource_pathr   ZMjModelZfrom_xml_pathas_posixr   Z
msh_to_objZfrom_xml_string_XMLencode_MESH_FIELDSnpZtestingZassert_allclosegetattr)selfZ	test_pathZmsh_xmlZ	msh_modelZmsh_pathobjZ	obj_modelfield r   S/home/ghrups/robot-bench/.venv/lib64/python3.9/site-packages/mujoco/msh2obj_test.py test_obj_model_matches_msh_model8   s    

z(MshTest.test_obj_model_matches_msh_model)__name__
__module____qualname__r   r   r   r   r   r   6   s   r   __main__)__doc__Zabsl.testingr   Zetilsr   r   r   numpyr   r   r   ZTestCaser   r   mainr   r   r   r   <module>   s   	