Skip to content

Commit 4f78aef

Browse files
committed
fix(wrappers): binary prev action obs wrong location
1 parent c88b62d commit 4f78aef

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎python/rcs/envs/base.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ def reset(self, **kwargs) -> tuple[dict[str, Any], dict[str, Any]]:
10771077

10781078
def observation(self, observation: dict[str, Any], info: dict[str, Any]) -> tuple[dict[str, Any], dict[str, Any]]:
10791079
observation = copy.deepcopy(observation)
1080-
if self.binary:
1080+
if self.prev_action_obs:
10811081
observation[self.gripper_key] = (
10821082
self._last_gripper_cmd if self._last_gripper_cmd is not None else self.BINARY_GRIPPER_OPEN
10831083
)
@@ -1100,7 +1100,7 @@ def action(self, action: dict[str, Any]) -> dict[str, Any]:
11001100
gripper_action = np.clip(np.asarray(gripper_action, dtype=np.float32), 0.0, 1.0)
11011101

11021102
if self._command_changed(gripper_action):
1103-
if self.prev_action_obs:
1103+
if self.binary:
11041104
self.gripper.grasp() if gripper_action[0] < self.GRIPPER_THRESHOLD else self.gripper.open()
11051105
else:
11061106
self.gripper.set_normalized_width(float(gripper_action[0]))

0 commit comments

Comments
 (0)