-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript_test.py
52 lines (40 loc) · 1.48 KB
/
script_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import odrive
from odrive.enums import *
from actuator import *
SN_L0 = '384D34783539'
SN_L1 = '383F34723539'
odrv0 = odrive.find_any(serial_number=SN_L0)
odrv1 = odrive.find_any(serial_number=SN_L1)
leftFinger0 = Actuator(odrv0, 0.96, 1, 45)
leftFinger1 = Actuator(odrv1, 0.97, 1, 45)
print(str(leftFinger0.encoder))
print(str(leftFinger1.encoder))
print(str(leftFinger0.motor_pos))
odrv0.clear_errors()
odrv1.clear_errors()
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv1.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
# print(str(odrv0))
# print(str(odrv1))
# print(str(odrv0.encoder_estimator1.pos_estimate))
# print(str(odrv1.encoder_estimator1.pos_estimate))
# while(True)
# odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
# odrv1.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
# 1. Attack point 1
# odrv0.axis0.controller.input_pos = 0.80
# odrv1.axis0.controller.input_pos = 1.09
# odrv0.axis0.controller.input_pos = 1.06
# odrv1.axis0.controller.input_pos = 0.99
# 2. Attack point 2
# odrv0.axis0.controller.input_pos = 0.80
# odrv1.axis0.controller.input_pos = 1.12
# odrv0.axis0.controller.input_pos = 0.93
# odrv1.axis0.controller.input_pos = 1.10
# 3. Attack point 3
# odrv0.axis0.controller.input_pos = 0.93
# odrv1.axis0.controller.input_pos = 1.03
# odrv0.axis0.controller.input_pos = 1.03
# odrv1.axis0.controller.input_pos = 1.0
# odrv0.axis0.requested_state = AXIS_STATE_IDLE
# odrv1.axis0.requested_state = AXIS_STATE_IDLE