7
7
ORIENTATION_COEFF = 1.
8
8
9
9
10
- def inverse_kinematic_optimization (chain , target_frame , starting_nodes_angles , regularization_parameter = None , max_iter = None , orientation_mode = None , no_position = False ):
10
+ def inverse_kinematic_optimization (chain , target_frame , starting_nodes_angles , regularization_parameter = None , max_iter = None , orientation_mode = None , no_position = False , optimization_method = 'L-BFGS-B' ):
11
11
"""
12
12
Computes the inverse kinematic on the specified target with an optimization method
13
13
@@ -32,6 +32,8 @@ def inverse_kinematic_optimization(chain, target_frame, starting_nodes_angles, r
32
32
* "all": Target the three axes
33
33
no_position: bool
34
34
Do not optimize against position
35
+ optimization_method: str
36
+ Optimization method to use. Defaults to 'L-BFGS-B'
35
37
"""
36
38
# Begin with the position
37
39
target = target_frame [:3 , - 1 ]
@@ -131,7 +133,7 @@ def optimize_total(x):
131
133
options ["maxiter" ] = max_iter
132
134
133
135
# Utilisation d'une optimisation L-BFGS-B
134
- res = scipy .optimize .minimize (optimize_total , chain .active_from_full (starting_nodes_angles ), method = 'L-BFGS-B' , bounds = real_bounds , options = options )
136
+ res = scipy .optimize .minimize (optimize_total , chain .active_from_full (starting_nodes_angles ), method = optimization_method , bounds = real_bounds , options = options )
135
137
136
138
logs .logger .info ("Inverse kinematic optimisation OK, done in {} iterations" .format (res .nit ))
137
139
0 commit comments