From ce2e87b4b363da2678ba1ab7980248585a1eb67b Mon Sep 17 00:00:00 2001 From: stephen Date: Mon, 12 Apr 2021 21:52:25 +0100 Subject: [PATCH 1/2] [skip ci] Update matrix reshape following PyRep update. Resolves #124. --- rlbench/backend/scene.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/rlbench/backend/scene.py b/rlbench/backend/scene.py index de072b5da..4ea944b4d 100644 --- a/rlbench/backend/scene.py +++ b/rlbench/backend/scene.py @@ -254,18 +254,16 @@ def get_mask(sensor: VisionSensor, mask_fn): gripper_pose=( np.array(tip.get_pose()) if self._obs_config.gripper_pose else None), - gripper_matrix=( - np.reshape(tip.get_matrix(), (3, 4)) - if self._obs_config.gripper_matrix else None), + gripper_matrix=(tip.get_matrix() + if self._obs_config.gripper_matrix else None), gripper_touch_forces=( ee_forces_flat if self._obs_config.gripper_touch_forces else None), gripper_joint_positions=( np.array(self._robot.gripper.get_joint_positions()) if self._obs_config.gripper_joint_positions else None), - wrist_camera_matrix=( - np.reshape(self._cam_wrist.get_matrix(), (3, 4)) - if self._cam_wrist.still_exists() else None), + wrist_camera_matrix=(self._cam_wrist.get_matrix() + if self._cam_wrist.still_exists() else None), task_low_dim_state=( self._active_task.get_low_dim_state() if self._obs_config.task_low_dim_state else None)) From f5972ae9e929b4a4fec56c9e9c8d1ad166f580da Mon Sep 17 00:00:00 2001 From: Eugenio Chisari Date: Sat, 8 May 2021 15:38:42 +0200 Subject: [PATCH 2/2] fixed gripper not releasing object --- rlbench/task_environment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rlbench/task_environment.py b/rlbench/task_environment.py index 46c8069f0..8ace8fb9e 100644 --- a/rlbench/task_environment.py +++ b/rlbench/task_environment.py @@ -184,8 +184,8 @@ def step(self, action) -> (Observation, int, bool): raise ValueError('Gripper action expected to be within 0 and 1.') # Discretize the gripper action - current_ee = (1.0 if self._robot.gripper.get_open_amount()[0] > 0.9 - else 0.0) + open_condition = all(x > 0.9 for x in self._robot.gripper.get_open_amount()) + current_ee = 1.0 if open_condition else 0.0 if ee_action > 0.5: ee_action = 1.0