diff --git a/Massage/MassageControl/MassageRobot_nova5.py b/Massage/MassageControl/MassageRobot_nova5.py index 58f8627..4ebf2fb 100644 --- a/Massage/MassageControl/MassageRobot_nova5.py +++ b/Massage/MassageControl/MassageRobot_nova5.py @@ -336,7 +336,7 @@ class MassageRobot: # 线程 self.exit_event.clear() self.arm_measure_thread = threading.Thread(target=self.arm_measure_loop) - self.arm_control_thread = threading.Thread(target=self.arm_command_loop_traj) + self.arm_control_thread = threading.Thread(target=self.arm_command_loop) # 线程启动 self.arm_measure_thread.start() ## 测量线程 position,quat_rot = self.arm.get_arm_position() @@ -496,11 +496,12 @@ if __name__ == "__main__": try: robot_thread = threading.Thread(target=robot.start) robot_thread.start() + except KeyboardInterrupt: print("用户中断操作。") except Exception as e: print("Exception occurred at line:", e.__traceback__.tb_lineno) print("发生异常:", e) - - + + robot_thread.join() # 等待机械臂线程结束 # robot.arm.disableRobot() \ No newline at end of file diff --git a/Massage/MassageControl/config/admittance.yaml b/Massage/MassageControl/config/admittance.yaml index f627f9f..e04f831 100644 --- a/Massage/MassageControl/config/admittance.yaml +++ b/Massage/MassageControl/config/admittance.yaml @@ -8,7 +8,9 @@ mass_rot: [0.11, 0.11, 0.11] # P # stiff_tran: [300, 300, 300] # stiff_rot: [7, 7, 7] -stiff_tran: [270, 270, 270] +# stiff_tran: [270, 270, 270] +# stiff_rot: [11, 11, 11] +stiff_tran: [0, 0, 0] stiff_rot: [11, 11, 11] # stiff_tran: [100, 100, 100] # stiff_rot: [1, 1, 1] diff --git a/Massage/MassageControl/hardware/__pycache__/dobot_nova5.cpython-39.pyc b/Massage/MassageControl/hardware/__pycache__/dobot_nova5.cpython-39.pyc index cf3df8c..88e09f4 100644 Binary files a/Massage/MassageControl/hardware/__pycache__/dobot_nova5.cpython-39.pyc and b/Massage/MassageControl/hardware/__pycache__/dobot_nova5.cpython-39.pyc differ diff --git a/Massage/MassageControl/hardware/__pycache__/force_sensor.cpython-39.pyc b/Massage/MassageControl/hardware/__pycache__/force_sensor.cpython-39.pyc index 945dc93..304bf5a 100644 Binary files a/Massage/MassageControl/hardware/__pycache__/force_sensor.cpython-39.pyc and b/Massage/MassageControl/hardware/__pycache__/force_sensor.cpython-39.pyc differ diff --git a/Massage/MassageControl/hardware/force_sensor.py b/Massage/MassageControl/hardware/force_sensor.py index 6494472..b62ca4c 100644 --- a/Massage/MassageControl/hardware/force_sensor.py +++ b/Massage/MassageControl/hardware/force_sensor.py @@ -1,9 +1,11 @@ import struct import serial +import serial.tools.list_ports import numpy as np import atexit import threading import time +import yaml import subprocess import psutil