Browse Source

[fix] sshkeboard exit bug

main
silencht 8 months ago
parent
commit
f657ff8bea
  1. 2
      teleop/robot_control/robot_arm.py
  2. 2
      teleop/teleop_hand_and_arm.py

2
teleop/robot_control/robot_arm.py

@ -232,7 +232,7 @@ class G1_29_ArmController:
current_q = self.get_current_dual_arm_q() current_q = self.get_current_dual_arm_q()
if np.all(np.abs(current_q) < tolerance): if np.all(np.abs(current_q) < tolerance):
if self.motion_mode: if self.motion_mode:
for weight in np.arange(1, 0, -0.01):
for weight in np.linspace(1, 0, num=101):
self.msg.motor_cmd[G1_29_JointIndex.kNotUsedJoint0].q = weight; self.msg.motor_cmd[G1_29_JointIndex.kNotUsedJoint0].q = weight;
time.sleep(0.02) time.sleep(0.02)
logger_mp.info("[G1_29_ArmController] both arms have reached the home position.") logger_mp.info("[G1_29_ArmController] both arms have reached the home position.")

2
teleop/teleop_hand_and_arm.py

@ -213,7 +213,6 @@ if __name__ == '__main__':
cv2.imshow("record image", tv_resized_image) cv2.imshow("record image", tv_resized_image)
key = cv2.waitKey(1) & 0xFF key = cv2.waitKey(1) & 0xFF
if key == ord('q'): if key == ord('q'):
stop_listening()
running = False running = False
if args.sim: if args.sim:
publish_reset_category(2, reset_pose_publisher) publish_reset_category(2, reset_pose_publisher)
@ -260,6 +259,7 @@ if __name__ == '__main__':
# quit teleoperate # quit teleoperate
if tele_data.tele_state.right_aButton: if tele_data.tele_state.right_aButton:
running = False running = False
stop_listening()
# command robot to enter damping mode. soft emergency stop function # command robot to enter damping mode. soft emergency stop function
if tele_data.tele_state.left_thumbstick_state and tele_data.tele_state.right_thumbstick_state: if tele_data.tele_state.left_thumbstick_state and tele_data.tele_state.right_thumbstick_state:
sport_client.Damp() sport_client.Damp()

Loading…
Cancel
Save