From 7752de8710591b32f95a9d72a62ff91cce5feed1 Mon Sep 17 00:00:00 2001 From: Iori Yanokura Date: Mon, 4 Dec 2023 00:25:29 +0900 Subject: [PATCH] Remove rescalling for 3dxml. (#321) --- skrobot/utils/urdf.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/skrobot/utils/urdf.py b/skrobot/utils/urdf.py index 07aeccb5..b8cb37bd 100644 --- a/skrobot/utils/urdf.py +++ b/skrobot/utils/urdf.py @@ -252,11 +252,9 @@ def _load_meshes(filename): _, ext = os.path.splitext(filename) # It seems that .3DXML files assume [mm] unit. # Convert the mesh unit from [mm] to [m]. - if ext.lower() in ['.3dxml']: - meshes = trimesh.load(filename) - meshes = meshes.scaled(0.001) - else: - meshes = trimesh.load(filename) + # To convert the mesh unit from millimeters to meters, + # use the function meshes.convert_units('meter'). + meshes = trimesh.load(filename) if meshes.units is not None and meshes.units != 'meter': meshes = meshes.convert_units('meter') except Exception as e: