From 9ce616023a3d53ccf3ecb98615158b478e4db823 Mon Sep 17 00:00:00 2001 From: misoshiruseijin Date: Wed, 11 May 2022 15:38:03 -0700 Subject: [PATCH 1/2] fix site error --- .../manipulation/single_arm_env.py | 9 +++++---- .../environments/manipulation/two_arm_env.py | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/robosuite/environments/manipulation/single_arm_env.py b/robosuite/environments/manipulation/single_arm_env.py index e2577150c8..d922da8b98 100644 --- a/robosuite/environments/manipulation/single_arm_env.py +++ b/robosuite/environments/manipulation/single_arm_env.py @@ -52,11 +52,12 @@ def _eef_xmat(self): Returns: np.array: (3,3) End Effector orientation matrix """ - pf = self.robots[0].robot_model.naming_prefix + pf = self.robots[0].gripper.naming_prefix + if self.env_configuration == "bimanual": - return np.array(self.sim.data.site_xmat[self.sim.model.site_name2id(pf + "right_ee")]).reshape(3, 3) + return np.array(self.sim.data.site_xmat[self.sim.model.site_name2id(pf + "right_grip_site")]).reshape(3, 3) else: - return np.array(self.sim.data.site_xmat[self.sim.model.site_name2id(pf + "ee")]).reshape(3, 3) + return np.array(self.sim.data.site_xmat[self.sim.model.site_name2id(pf + "grip_site")]).reshape(3, 3) @property def _eef_xquat(self): @@ -68,4 +69,4 @@ def _eef_xquat(self): Returns: np.array: (x,y,z,w) End Effector quaternion """ - return mat2quat(self._eef_xmat) + return mat2quat(self._eef_xmat) \ No newline at end of file diff --git a/robosuite/environments/manipulation/two_arm_env.py b/robosuite/environments/manipulation/two_arm_env.py index 28f71ce27c..f7bf83204a 100644 --- a/robosuite/environments/manipulation/two_arm_env.py +++ b/robosuite/environments/manipulation/two_arm_env.py @@ -86,11 +86,13 @@ def _eef0_xmat(self): Returns: np.array: (3,3) orientation matrix for EEF0 """ - pf = self.robots[0].robot_model.naming_prefix + pf = self.robots[0].gripper.naming_prefix + if self.env_configuration == "bimanual": - return np.array(self.sim.data.site_xmat[self.sim.model.site_name2id(pf + "right_ee")]).reshape(3, 3) + return np.array(self.sim.data.site_xmat[self.sim.model.site_name2id(pf + "right_grip_site")]).reshape(3, 3) + else: - return np.array(self.sim.data.site_xmat[self.sim.model.site_name2id(pf + "ee")]).reshape(3, 3) + return np.array(self.sim.data.site_xmat[self.sim.model.site_name2id(pf + "grip_site")]).reshape(3, 3) @property def _eef1_xmat(self): @@ -103,11 +105,11 @@ def _eef1_xmat(self): np.array: (3,3) orientation matrix for EEF1 """ if self.env_configuration == "bimanual": - pf = self.robots[0].robot_model.naming_prefix - return np.array(self.sim.data.site_xmat[self.sim.model.site_name2id(pf + "left_ee")]).reshape(3, 3) + pf = self.robots[0].gripper.naming_prefix + return np.array(self.sim.data.site_xmat[self.sim.model.site_name2id(pf + "left_grip_site")]).reshape(3, 3) else: - pf = self.robots[1].robot_model.naming_prefix - return np.array(self.sim.data.site_xmat[self.sim.model.site_name2id(pf + "ee")]).reshape(3, 3) + pf = self.robots[1].gripper.naming_prefix + return np.array(self.sim.data.site_xmat[self.sim.model.site_name2id(pf + "grip_site")]).reshape(3, 3) @property def _eef0_xquat(self): @@ -131,4 +133,4 @@ def _eef1_xquat(self): Returns: np.array: (x,y,z,w) quaternion for EEF1 """ - return mat2quat(self._eef1_xmat) + return mat2quat(self._eef1_xmat) \ No newline at end of file From 940591fabaf40f8d7dbfa67ae7251d476f50f42c Mon Sep 17 00:00:00 2001 From: Yuke Zhu Date: Sun, 14 Aug 2022 21:01:09 -0500 Subject: [PATCH 2/2] update pre-commit hooks (#352) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5465ea99d3..673c05b8c9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 21.12b0 # Replace by any tag/version: https://github.com/psf/black/tags + rev: 22.6.0 # Replace by any tag/version: https://github.com/psf/black/tags hooks: - id: black language_version: python3 # Should be a command that runs python3.6+