2 from __future__
import print_function, division
4 from scipy.optimize
import (
18 Uses SciPy to solve a constrained EndPoseProblem. Options for SciPy minimize 20 https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html 23 def __init__(self, problem=None, method=None, debug=False):
24 print(
"Initialising SciPy Solver")
37 self.problem.update(x)
38 return self.problem.get_equality()
41 self.problem.update(x)
42 return self.problem.get_equality_jacobian()
45 self.problem.update(x)
47 return -1.0 * self.problem.get_inequality()
50 self.problem.update(x)
51 return -1.0 * self.problem.get_inequality_jacobian()
54 self.problem.update(x)
55 return self.problem.get_scalar_cost(), self.problem.get_scalar_jacobian()
58 self.problem.update(x)
59 return self.problem.get_scalar_jacobian()
63 x0 = self.problem.start_state.copy()
65 self.problem.pre_update()
69 if self.
method !=
"trust-constr":
112 if self.problem.use_bounds:
114 self.problem.get_bounds()[:, 0], self.problem.get_bounds()[:, 1]
118 if self.
method ==
"trust-constr":
119 options[
"initial_tr_radius"] = 1000.0
def eq_constraint_fun(self, x)
def specifyProblem(self, problem)
def eq_constraint_jac(self, x)
def __init__(self, problem=None, method=None, debug=False)
def neq_constraint_fun(self, x)
def neq_constraint_jac(self, x)