From 21602edcb456a6e0fed6d9da84a7685f885b1885 Mon Sep 17 00:00:00 2001 From: Yifeng Zhu Date: Mon, 22 Apr 2024 19:52:21 -0500 Subject: [PATCH] Update scripts --- deoxys/deoxys/experimental/motion_utils.py | 6 +++++- deoxys/examples/collect_low_dim_states_with_spacemouse.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/deoxys/deoxys/experimental/motion_utils.py b/deoxys/deoxys/experimental/motion_utils.py index bd8146f..971eb63 100644 --- a/deoxys/deoxys/experimental/motion_utils.py +++ b/deoxys/deoxys/experimental/motion_utils.py @@ -92,6 +92,7 @@ def follow_joint_traj( joint_traj: list, num_addition_steps=30, controller_cfg: dict = None, + gripper_close=True, ): """This is a simple function to follow a given trajectory in joint space. @@ -132,7 +133,10 @@ def follow_joint_traj( else: action = target_joint_pos if len(action) == 7: - action = action + [-1.0] + if gripper_close: + action = action + [1.0] + else: + action = action + [-1.0] current_joint_pos = np.array(robot_interface.last_q) robot_interface.control( controller_type="JOINT_IMPEDANCE", diff --git a/deoxys/examples/collect_low_dim_states_with_spacemouse.py b/deoxys/examples/collect_low_dim_states_with_spacemouse.py index 72ad4fb..0c9ce92 100644 --- a/deoxys/examples/collect_low_dim_states_with_spacemouse.py +++ b/deoxys/examples/collect_low_dim_states_with_spacemouse.py @@ -97,7 +97,7 @@ def main(): time.sleep(2) - while i < 2000: + while i < 4000: logger.info(i) i += 1 start_time = time.time_ns()