Skip to content

Commit a45efc7

Browse files
committed
chore(gripper): backward compatibility non list action
1 parent 2a7eea6 commit a45efc7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

python/rcs/envs/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,9 @@ def action(self, action: dict[str, Any]) -> dict[str, Any]:
724724
action = copy.deepcopy(action)
725725
assert self.gripper_key in action, "Gripper action not found."
726726

727+
if isinstance(gripper_action, int) or isinstance(gripper_action, float):
728+
gripper_action = [gripper_action] # type: ignore
729+
727730
gripper_action = np.round(action[self.gripper_key]) if self.binary else action[self.gripper_key]
728731
gripper_action = np.clip(gripper_action, 0.0, 1.0)
729732

0 commit comments

Comments
 (0)