This piece of example code: ''' import numpy as np import pydrake.solvers.mathematicalprogram as mp from pydrake.solvers.ipopt import IpoptSolver def foo(x): return np.sign(x)
prog = mp.MathematicalProgram()
x = prog.NewContinuousVariables(1)
prog.AddConstraint(foo, [1.], [1.], vars=x)
prog.AddLinearCost(1 * x[0])
result = mp.Solve(prog, np.array([10.]), None)
print(result.is_success())
print(result.GetSolution(x))
''' returns the error: Segmentation fault (core dumped), when I run it under termial opened by the jupyter notebook, provided by the course: http://underactuated.csail.mit.edu/Spring2019/install_drake_docker.html. (while the code itself already proved right here,https://github.com/RobotLocomotion/drake/issues/12410)