-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
40 lines (31 loc) · 1.57 KB
/
main.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
from func import models, excitations, calibrations, utils, execution
from func.CeinmWriter import Writer
# Define base path
base_path, ceinms_path = utils.determine__base_paths()
# # # DEFINE DoF, MODELS and SUBJECT, vCalibTrials, Trials # # #
subject = 'DapO'
uncalib_model_path = f"{base_path}/{subject}/models/1_generic_MICK_Wu_v5_test2.osim"
model_name = 'Wu' # "Wu"| 'DAS3'
v_tendon = 'stiff' # 'stiff' | 'equilibriumElastic'
trials = 'All' # | 'All' | 'AllButCalib' | 'Calib'
force_recalib = True
v_calib_trials = 1
joints = 'G' # 'G' | 'SAG"
excitation_version = 3
exec_type = 'hybrid'
model_type = models.choose(model_name)
excitations_type = excitations.choose(model_name, excitation_version)
calibrations_type = calibrations.choose(model_name, joints, v_calib_trials)
execution_type = execution.choose(model_name, joints, exec_type) # TODO with Benjamin improve approach # EMGdriven | Hydrib | Static_optim
# # # END OF THE MAIN VARIABLES # # #
# Setup the trials
model, setup_calib, setup_trials = utils.build_and_setup_model(base_path, subject, model_name, uncalib_model_path,
joints, trials, v_calib_trials, v_tendon,
model_type, excitations_type, calibrations_type,
execution_type, force_recalib)
# Write configuration and calibration files
cw = Writer(base_path, setup_calib, ceinms_path)
# Run calibration process if needed
cw.calibrate()
# Run
cw.run(setup_trials, excitations_type)