Browse Source
[fix] state transition
when STOP = True, START should be False
main
silencht
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
0 deletions
-
teleop/teleop_hand_and_arm.py
|
|
@ -48,6 +48,7 @@ def on_press(key): |
|
|
if key == 'r': |
|
|
if key == 'r': |
|
|
START = True |
|
|
START = True |
|
|
elif key == 'q': |
|
|
elif key == 'q': |
|
|
|
|
|
START = False |
|
|
STOP = True |
|
|
STOP = True |
|
|
elif key == 's' and START == True: |
|
|
elif key == 's' and START == True: |
|
|
RECORD_TOGGLE = True |
|
|
RECORD_TOGGLE = True |
|
|
@ -268,6 +269,7 @@ if __name__ == '__main__': |
|
|
# opencv GUI communication |
|
|
# opencv GUI communication |
|
|
key = cv2.waitKey(1) & 0xFF |
|
|
key = cv2.waitKey(1) & 0xFF |
|
|
if key == ord('q'): |
|
|
if key == ord('q'): |
|
|
|
|
|
START = False |
|
|
STOP = True |
|
|
STOP = True |
|
|
if args.sim: |
|
|
if args.sim: |
|
|
publish_reset_category(2, reset_pose_publisher) |
|
|
publish_reset_category(2, reset_pose_publisher) |
|
|
@ -313,6 +315,7 @@ if __name__ == '__main__': |
|
|
if args.xr_mode == "controller" and args.motion: |
|
|
if args.xr_mode == "controller" and args.motion: |
|
|
# quit teleoperate |
|
|
# quit teleoperate |
|
|
if tele_data.tele_state.right_aButton: |
|
|
if tele_data.tele_state.right_aButton: |
|
|
|
|
|
START = False |
|
|
STOP = True |
|
|
STOP = True |
|
|
# 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: |
|
|
|