update displaytable rotation
This commit is contained in:
parent
2f87a2626c
commit
20514be419
@ -8,7 +8,7 @@ class ControlUtil:
|
|||||||
|
|
||||||
__fa:FrankaArm = None
|
__fa:FrankaArm = None
|
||||||
__ser: serial.Serial = None
|
__ser: serial.Serial = None
|
||||||
cnt_rotation = 0
|
curr_rotation = 0
|
||||||
|
|
||||||
BASE_TO_WORLD:np.ndarray = np.asarray([
|
BASE_TO_WORLD:np.ndarray = np.asarray([
|
||||||
[1, 0, 0, -0.61091665],
|
[1, 0, 0, -0.61091665],
|
||||||
@ -64,13 +64,14 @@ class ControlUtil:
|
|||||||
"left": 1,
|
"left": 1,
|
||||||
"right": 0
|
"right": 0
|
||||||
}
|
}
|
||||||
ControlUtil.cnt_rotation += degree
|
delta_degree = degree - ControlUtil.curr_rotation
|
||||||
|
ControlUtil.curr_rotation += delta_degree
|
||||||
print(f"Table rotated {ControlUtil.cnt_rotation} degree")
|
print(f"Table rotated {ControlUtil.cnt_rotation} degree")
|
||||||
if degree >= 0:
|
if degree >= 0:
|
||||||
turn_angle = degree
|
turn_angle = delta_degree
|
||||||
turn_direction = turn_directions["right"]
|
turn_direction = turn_directions["right"]
|
||||||
else:
|
else:
|
||||||
turn_angle = -degree
|
turn_angle = -delta_degree
|
||||||
turn_direction = turn_directions["left"]
|
turn_direction = turn_directions["left"]
|
||||||
write_len = ControlUtil.__ser.write(f"CT+TRUNSINGLE({turn_direction},{turn_angle});".encode('utf-8'))
|
write_len = ControlUtil.__ser.write(f"CT+TRUNSINGLE({turn_direction},{turn_angle});".encode('utf-8'))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user