Skip to content

Commit 43b45d9

Browse files
committed
bug
1 parent ac50979 commit 43b45d9

25 files changed

+165
-136
lines changed
-86 Bytes
Binary file not shown.
3.52 KB
Binary file not shown.
48 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
-85 Bytes
Binary file not shown.

LinkerHand/core/can/linker_hand_l10_can.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,13 @@ def get_temperature(self):
258258

259259
def get_touch_type(self):
260260
'''Get touch type'''
261+
self.send_frame(0xb0,[],sleep=0.03)
261262
self.send_frame(0xb1,[],sleep=0.03)
262-
if len(self.xb1) == 2:
263+
t = []
264+
for i in range(3):
265+
t = self.xb1
266+
time.sleep(0.01)
267+
if len(t) == 2:
263268
return 2
264269
else:
265270
return -1
@@ -298,4 +303,4 @@ def close_can_interface(self):
298303
if self.receive_thread.is_alive():
299304
self.receive_thread.join()
300305
if self.bus:
301-
self.bus.shutdown()
306+
self.bus.shutdown()

LinkerHand/core/can/linker_hand_l21_can.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
current_dir = os.path.dirname(os.path.abspath(__file__))
88
target_dir = os.path.abspath(os.path.join(current_dir, ".."))
99
sys.path.append(target_dir)
10-
from utils.color_msg import ColorMsg
1110

1211
class FrameProperty(Enum):
1312
# Finger motion control - parallel control commands

LinkerHand/core/can/linker_hand_l25_can.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
current_dir = os.path.dirname(os.path.abspath(__file__))
88
target_dir = os.path.abspath(os.path.join(current_dir, ".."))
99
sys.path.append(target_dir)
10-
from utils.color_msg import ColorMsg
1110

1211
class FrameProperty(Enum):
1312
INVALID_FRAME_PROPERTY = 0x00 # Invalid CAN frame property | No response

LinkerHand/core/can/linker_hand_l7_can.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import time, sys
33
import threading
44
import numpy as np
5-
from enum import Enum
65

76

87
class LinkerHandL7Can:
@@ -222,8 +221,11 @@ def get_torque(self):
222221
def get_touch_type(self):
223222
'''Get touch type'''
224223
self.send_frame(0xb1,[])
225-
time.sleep(0.02)
226-
if len(self.xb1) == 2:
224+
t = []
225+
for i in range(3):
226+
t = self.xb1
227+
time.sleep(0.01)
228+
if len(t) == 2:
227229
return 2
228230
else:
229231
return -1
@@ -266,4 +268,4 @@ def close_can_interface(self):
266268
if self.receive_thread.is_alive():
267269
self.receive_thread.join()
268270
if self.bus:
269-
self.bus.shutdown()
271+
self.bus.shutdown()

0 commit comments

Comments
 (0)