-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_calibration.py
More file actions
38 lines (33 loc) · 1.09 KB
/
test_calibration.py
File metadata and controls
38 lines (33 loc) · 1.09 KB
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
import os
import sys
import exoboot
import time
import csv
import util
import constants
def run_constant_torque(exo: exoboot.Exo):
'''This routine can be used to manually calibrate the relationship
between ankle and motor angles. Move through the full RoM!!!'''
exo.update_gains(Kp=constants.DEFAULT_KP, Ki=constants.DEFAULT_KI,
Kd=constants.DEFAULT_KD, ff=constants.DEFAULT_FF)
print('begin!')
for _ in range(500):
time.sleep(0.01)
if exo.data.ankle_angle > 44:
print('ankle angle too high')
# exo.command_torque(desired_torque=0)
# break
exo.command_torque(desired_torque=3)
else:
exo.command_torque(desired_torque=3)
exo.read_data()
exo.write_data()
print('Done! File saved.')
if __name__ == '__main__':
exo_list = exoboot.connect_to_exos(file_ID='test_torque_control')
if len(exo_list) > 1:
raise ValueError("Just turn on one exo for calibration")
exo = exo_list[0]
exo.standing_calibration()
run_constant_torque(exo=exo)
exo.close()