From 95e342d5be1572b446f85eb8cb39d6952b471776 Mon Sep 17 00:00:00 2001 From: silencht Date: Fri, 26 Dec 2025 10:57:53 +0800 Subject: [PATCH] [update] submodule and lazy import --- .gitmodules | 4 ++-- teleop/teleimager | 2 +- teleop/teleop_hand_and_arm.py | 16 +++++++++++----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.gitmodules b/.gitmodules index c0ebaa3..dc64108 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "teleop/televuer"] path = teleop/televuer - url = https://github.com/silencht/televuer + url = https://github.com/unitreerobotics/televuer [submodule "teleop/robot_control/dex-retargeting"] path = teleop/robot_control/dex-retargeting url = https://github.com/silencht/dex-retargeting [submodule "teleop/teleimager"] path = teleop/teleimager - url = https://github.com/silencht/teleimager.git + url = https://github.com/unitreerobotics/teleimager.git diff --git a/teleop/teleimager b/teleop/teleimager index 81720e0..89d4613 160000 --- a/teleop/teleimager +++ b/teleop/teleimager @@ -1 +1 @@ -Subproject commit 81720e0bb384d9f79cb10160e9e604d505f1e1a2 +Subproject commit 89d461330479ed0d71d642e092acea9e9fe71494 diff --git a/teleop/teleop_hand_and_arm.py b/teleop/teleop_hand_and_arm.py index 18c96b7..ce49819 100644 --- a/teleop/teleop_hand_and_arm.py +++ b/teleop/teleop_hand_and_arm.py @@ -15,9 +15,6 @@ sys.path.append(parent_dir) from televuer import TeleVuerWrapper from teleop.robot_control.robot_arm import G1_29_ArmController, G1_23_ArmController, H1_2_ArmController, H1_ArmController from teleop.robot_control.robot_arm_ik import G1_29_ArmIK, G1_23_ArmIK, H1_2_ArmIK, H1_ArmIK -from teleop.robot_control.robot_hand_unitree import Dex3_1_Controller, Dex1_1_Gripper_Controller -from teleop.robot_control.robot_hand_inspire import Inspire_Controller_DFX, Inspire_Controller_FTP -from teleop.robot_control.robot_hand_brainco import Brainco_Controller from teleimager.image_client import ImageClient from teleop.utils.episode_writer import EpisodeWriter from teleop.utils.ipc import IPC_Server @@ -154,6 +151,7 @@ if __name__ == '__main__': # end-effector if args.ee == "dex3": + from teleop.robot_control.robot_hand_unitree import Dex3_1_Controller left_hand_pos_array = Array('d', 75, lock = True) # [input] right_hand_pos_array = Array('d', 75, lock = True) # [input] dual_hand_data_lock = Lock() @@ -162,6 +160,7 @@ if __name__ == '__main__': hand_ctrl = Dex3_1_Controller(left_hand_pos_array, right_hand_pos_array, dual_hand_data_lock, dual_hand_state_array, dual_hand_action_array, simulation_mode=args.sim) elif args.ee == "dex1": + from teleop.robot_control.robot_hand_unitree import Dex1_1_Gripper_Controller left_gripper_value = Value('d', 0.0, lock=True) # [input] right_gripper_value = Value('d', 0.0, lock=True) # [input] dual_gripper_data_lock = Lock() @@ -170,6 +169,7 @@ if __name__ == '__main__': gripper_ctrl = Dex1_1_Gripper_Controller(left_gripper_value, right_gripper_value, dual_gripper_data_lock, dual_gripper_state_array, dual_gripper_action_array, simulation_mode=args.sim) elif args.ee == "inspire_dfx": + from teleop.robot_control.robot_hand_inspire import Inspire_Controller_DFX left_hand_pos_array = Array('d', 75, lock = True) # [input] right_hand_pos_array = Array('d', 75, lock = True) # [input] dual_hand_data_lock = Lock() @@ -177,6 +177,7 @@ if __name__ == '__main__': dual_hand_action_array = Array('d', 12, lock = False) # [output] current left, right hand action(12) data. hand_ctrl = Inspire_Controller_DFX(left_hand_pos_array, right_hand_pos_array, dual_hand_data_lock, dual_hand_state_array, dual_hand_action_array, simulation_mode=args.sim) elif args.ee == "inspire_ftp": + from teleop.robot_control.robot_hand_inspire import Inspire_Controller_FTP left_hand_pos_array = Array('d', 75, lock = True) # [input] right_hand_pos_array = Array('d', 75, lock = True) # [input] dual_hand_data_lock = Lock() @@ -184,6 +185,7 @@ if __name__ == '__main__': dual_hand_action_array = Array('d', 12, lock = False) # [output] current left, right hand action(12) data. hand_ctrl = Inspire_Controller_FTP(left_hand_pos_array, right_hand_pos_array, dual_hand_data_lock, dual_hand_state_array, dual_hand_action_array, simulation_mode=args.sim) elif args.ee == "brainco": + from teleop.robot_control.robot_hand_brainco import Brainco_Controller left_hand_pos_array = Array('d', 75, lock = True) # [input] right_hand_pos_array = Array('d', 75, lock = True) # [input] dual_hand_data_lock = Lock() @@ -463,6 +465,9 @@ if __name__ == '__main__': except KeyboardInterrupt: logger_mp.info("KeyboardInterrupt, exiting program...") + except Exception: + import traceback + logger_mp.error(traceback.format_exc()) finally: try: arm_ctrl.ctrl_dual_arm_go_home() @@ -490,8 +495,9 @@ if __name__ == '__main__': try: if not args.motion: - status, result = motion_switcher.Exit_Debug_Mode() - logger_mp.info(f"Exit debug mode: {'Success' if status == 3104 else 'Failed'}") + pass + # status, result = motion_switcher.Exit_Debug_Mode() + # logger_mp.info(f"Exit debug mode: {'Success' if status == 3104 else 'Failed'}") except Exception as e: logger_mp.error(f"Failed to exit debug mode: {e}")