Skip to content

Commit

Permalink
Simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhoeller19 committed Oct 28, 2024
1 parent 4a5c03e commit b50a2ba
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions source/extensions/omni.isaac.lab/test/sim/test_mesh_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_convert_obj(self):
mesh_converter = MeshConverter(mesh_config)

# check that mesh conversion is successful
self._check_mesh_conversion(mesh_converter, mesh_config)
self._check_mesh_conversion(mesh_converter)

def test_convert_stl(self):
"""Convert an STL file"""
Expand All @@ -139,7 +139,7 @@ def test_convert_stl(self):
mesh_converter = MeshConverter(mesh_config)

# check that mesh conversion is successful
self._check_mesh_conversion(mesh_converter, mesh_config)
self._check_mesh_conversion(mesh_converter)

def test_convert_fbx(self):
"""Convert an FBX file"""
Expand All @@ -152,14 +152,14 @@ def test_convert_fbx(self):
mesh_converter = MeshConverter(mesh_config)

# check that mesh conversion is successful
self._check_mesh_conversion(mesh_converter, mesh_config)
self._check_mesh_conversion(mesh_converter)

def test_convert_default_xform_transforms(self):
"""Convert an OBJ file and check that default xform transforms are applied correctly"""
mesh_config = MeshConverterCfg(asset_path=self.assets["obj"])
mesh_converter = MeshConverter(mesh_config)
# check that mesh conversion is successful
self._check_mesh_conversion(mesh_converter, mesh_config)
self._check_mesh_conversion(mesh_converter)

def test_collider_no_approximation(self):
"""Convert an OBJ file using no approximation"""
Expand Down Expand Up @@ -242,7 +242,7 @@ def test_collider_mesh_no_collision(self):
Helper functions.
"""

def _check_mesh_conversion(self, mesh_converter: MeshConverter, mesh_config: MeshConverterCfg):
def _check_mesh_conversion(self, mesh_converter: MeshConverter):
"""Check that mesh is loadable and stage is valid."""
# Load the mesh
prim_path = "/World/Object"
Expand All @@ -265,12 +265,12 @@ def _check_mesh_conversion(self, mesh_converter: MeshConverter, mesh_config: Mes

# Check mesh settings
pos = tuple(prim_utils.get_prim_at_path("/World/Object/geometry").GetAttribute("xformOp:translate").Get())
self.assertEqual(pos, mesh_config.translation)
self.assertEqual(pos, mesh_converter.cfg.translation)
quat = prim_utils.get_prim_at_path("/World/Object/geometry").GetAttribute("xformOp:orient").Get()
quat = (quat.GetReal(), quat.GetImaginary()[0], quat.GetImaginary()[1], quat.GetImaginary()[2])
self.assertEqual(quat, mesh_config.rotation)
self.assertEqual(quat, mesh_converter.cfg.rotation)
scale = tuple(prim_utils.get_prim_at_path("/World/Object/geometry").GetAttribute("xformOp:scale").Get())
self.assertEqual(scale, mesh_config.scale)
self.assertEqual(scale, mesh_converter.cfg.scale)

def _check_mesh_collider_settings(self, mesh_converter: MeshConverter):
# Check prim can be properly spawned
Expand Down

0 comments on commit b50a2ba

Please sign in to comment.