Skip to content

Commit 8777493

Browse files
committed
修改L20获取温度不正确的问题
1 parent 729b8a2 commit 8777493

15 files changed

+46
-13
lines changed
-7 Bytes
Binary file not shown.
-7 Bytes
Binary file not shown.
4 Bytes
Binary file not shown.
21.9 KB
Binary file not shown.

LinkerHand/core/can/linker_hand_l10_can.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,11 @@ def get_touch(self):
341341
return [self.xb1[1],self.xb2[1],self.xb3[1],self.xb4[1],self.xb5[1],0] # The last digit is palm, currently not available
342342

343343
def get_matrix_touch(self):
344-
self.send_frame(0xb1,[0xc6],sleep=0.01)
345-
self.send_frame(0xb2,[0xc6],sleep=0.01)
346-
self.send_frame(0xb3,[0xc6],sleep=0.01)
347-
self.send_frame(0xb4,[0xc6],sleep=0.01)
348-
self.send_frame(0xb5,[0xc6],sleep=0.01)
344+
self.send_frame(0xb1,[0xc6],sleep=0.06)
345+
self.send_frame(0xb2,[0xc6],sleep=0.06)
346+
self.send_frame(0xb3,[0xc6],sleep=0.06)
347+
self.send_frame(0xb4,[0xc6],sleep=0.06)
348+
self.send_frame(0xb5,[0xc6],sleep=0.06)
349349
return self.thumb_matrix , self.index_matrix , self.middle_matrix , self.ring_matrix , self.little_matrix
350350

351351
def get_matrix_touch_v2(self):

LinkerHand/core/can/linker_hand_l20_can.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, can_channel='can0', baudrate=1000000, can_id=0x28,yaml=""):
4242
self.x06, self.x07 = [],[]
4343
# New pressure sensors
4444
self.xb0,self.xb1,self.xb2,self.xb3,self.xb4,self.xb5 = [-1] * 5,[-1] * 5,[-1] * 5,[-1] * 5,[-1] * 5,[-1] * 5
45-
45+
self.x09 = self.x0b = self.x0c = self.x0d = [-1] * 5
4646
self.thumb_matrix = np.full((12, 6), -1)
4747
self.index_matrix = np.full((12, 6), -1)
4848
self.middle_matrix = np.full((12, 6), -1)
@@ -217,6 +217,14 @@ def process_response(self, msg):
217217
self.x06 = list(response_data)
218218
elif frame_type == 0x07:
219219
self.x07 = list(response_data)
220+
elif frame_type == 0x09:
221+
self.x09 = list(response_data)
222+
elif frame_type == 0x0B:
223+
self.x0b = list(response_data)
224+
elif frame_type == 0x0C:
225+
self.x0c = list(response_data)
226+
elif frame_type == 0x0D:
227+
self.x0d = list(response_data)
220228
elif frame_type == 0x20:
221229
d = list(response_data)
222230
self.normal_force = [float(i) for i in d]
@@ -329,9 +337,15 @@ def get_fault(self):
329337
self.send_command(0x07,[])
330338
time.sleep(0.01)
331339
return self.x07
340+
332341
def get_temperature(self):
333-
'''Get motor temperature, not supported for L20'''
334-
return [0]* 10
342+
'''Get motor temperature'''
343+
self.send_command(0x09,[])
344+
self.send_command(0x0b,[])
345+
self.send_command(0x0c,[])
346+
self.send_command(0x0d,[])
347+
348+
return self.x09+self.x0b+self.x0c+self.x0d
335349
def clear_faults(self):
336350
'''Clear motor faults'''
337351
self.send_command(0x07, [1, 1, 1, 1, 1])

LinkerHand/core/can/linker_hand_l21_can.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,8 @@ def get_speed(self,j=''):
613613
l21_speed = self.state_to_cmd(l21_state=speed)
614614
return l21_speed
615615

616-
def get_finger_torque(self):
617-
return self.finger_torque()
616+
# def get_finger_torque(self):
617+
# return self.finger_torque()
618618
def get_fault(self):
619619
self.get_thumbn_fault()
620620
self.get_index_fault()
@@ -663,6 +663,7 @@ def get_finger_torque(self):
663663

664664
def get_torque(self):
665665
return self.get_finger_torque()
666+
666667
def get_thumb_touch(self):
667668
'''Get thumb tactile sensor data'''
668669
self.send_command(FrameProperty.THUMB_TOUCH,[],sleep_time=0.015)
-7 Bytes
Binary file not shown.
-7 Bytes
Binary file not shown.
-7 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)