Refactor IK functionalities in Timor
-
Left overs from C++ IK group? -
Check coverage in test of options in ik_jacobian, ik_scipy (e.g., https://tum-cps.pages.gitlab.lrz.de/-/timor-python/-/jobs/6337151/artifacts/ci/coverage/html/d_f38d6f5a87caded8_Robot_py.html)
The following discussion from !134 (merged) should be addressed:
-
@MatthiasMayer started a discussion: (+1 comment) Considering the recently failed CI: Maybe Refactor ik solution functions? Sth. like:
def any_ik(ik_solution_function, goal, ...): closest_sol = q_init best_distance = distance_function(q_init, goal) while max_iter > 0:# # All restart methods/options q_suggestion, IK_result, used_iter = ik_solution_function(q_init, goal, max_iter, other_constraints) max_iter -= used_iter # All additional tests whether valid; if not, continue if IK_result.success: return ... elif IK_result_distance < best_distance: closest_sol = q_suggestion
Would refactor the recursion into a loop and could help break down the ik logic more as many parts are shared between Jacobian and Scipy optimization. The
ik_solution_function
would then contain the method specific single solution algorithm, e.g., https://gitlab.lrz.de/tum-cps/timor-python/-/blob/main/src/timor/Robot.py#L397 till 406