-
Notifications
You must be signed in to change notification settings - Fork 2
/
recap.py
40 lines (34 loc) · 1.05 KB
/
recap.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
"""
This script generate a recap of the Inverse Kinematics Class
"""
import inverse_kinematics as ik
import pandas as pd
model_path = "example/wu_converted_definitif_inverse_kinematics.bioMod"
c3d_path = "example/F0_aisselle_05.c3d"
df = pd.DataFrame(
columns=[
"method",
"number_of_frame",
"frequency",
"residuals",
"nb_iteration_diff",
"nb_iteration_jac",
]
)
method_list = ["trf", "lm", "only_lm"]
for method in method_list:
ik = ik.InverseKinematics(model_path, c3d_path)
ik.solve(method=method)
# ik.
ik.get_sol()
cur_dict = dict(
method=method,
number_of_frame=ik.c3d["parameters"]["POINT"]["FRAMES"]["value"][0],
frequency=ik.c3d["parameters"]["POINT"]["RATE"]["value"][0],
residuals=ik.output["residuals"],
nb_iteration_diff=ik.output["nb_iteration_diff"],
nb_iteration_jac=ik.output["nb_iteration_jac"],
)
row_df = pd.DataFrame([cur_dict])
df = pd.concat([df, row_df], ignore_index=True)
df.to_csv(f"RecapInverseKinematics")