Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed gripper not releasing object #128

Merged
merged 3 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions rlbench/backend/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions rlbench/task_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down