From 12cc6ab22caa8f1c50e968e552efcdbeb6da8b3f Mon Sep 17 00:00:00 2001 From: Chenyu Yang Date: Thu, 24 Jun 2021 16:00:59 +0800 Subject: [PATCH 1/2] Remove float conversion urdf.Joint.get_child_pose To support passing in sympy symbols from cfg --- urdfpy/urdf.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/urdfpy/urdf.py b/urdfpy/urdf.py index 8536e39..1be767d 100644 --- a/urdfpy/urdf.py +++ b/urdfpy/urdf.py @@ -2306,15 +2306,11 @@ def get_child_pose(self, cfg=None): elif self.joint_type in ['revolute', 'continuous']: if cfg is None: cfg = 0.0 - else: - cfg = float(cfg) R = trimesh.transformations.rotation_matrix(cfg, self.axis) return self.origin.dot(R) elif self.joint_type == 'prismatic': if cfg is None: cfg = 0.0 - else: - cfg = float(cfg) translation = np.eye(4, dtype=np.float64) translation[:3,3] = self.axis * cfg return self.origin.dot(translation) From 2680b7a7c062de76bbb9ac40d2638a38ced70fe8 Mon Sep 17 00:00:00 2001 From: Chenyu Yang Date: Fri, 2 Jul 2021 16:22:54 +0800 Subject: [PATCH 2/2] Changed Inertial default to zero instead of 1 --- urdfpy/urdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/urdfpy/urdf.py b/urdfpy/urdf.py index 1be767d..7aaf915 100644 --- a/urdfpy/urdf.py +++ b/urdfpy/urdf.py @@ -2534,7 +2534,7 @@ def inertial(self, value): raise TypeError('Expected Inertial object') # Set default inertial if value is None: - value = Inertial(mass=1.0, inertia=np.eye(3)) + value = Inertial(mass=0.0, inertia=0.*np.eye(3)) self._inertial = value @property