Commit dca8d095 authored by Steve Tonneau's avatar Steve Tonneau
Browse files

added getPolytopeInequalities

parent 4decf74e
......@@ -26,6 +26,16 @@ boost::python::tuple wrapComputeEquilibriumRobustness(Equilibrium& self, const V
return boost::python::make_tuple(status, robustness);
}
boost::python::tuple wrapGetPolytopeInequalities(Equilibrium& self)
{
MatrixXX H;
VectorX h;
self.getPolytopeInequalities(H,h);
MatrixXXColMajor _H = H;
return boost::python::make_tuple(_H, h);
}
BOOST_PYTHON_MODULE(centroidal_dynamics)
{
......@@ -33,7 +43,9 @@ BOOST_PYTHON_MODULE(centroidal_dynamics)
eigenpy::enableEigenPy();
eigenpy::enableEigenPySpecific<MatrixX3ColMajor,MatrixX3ColMajor>();
eigenpy::enableEigenPySpecific<MatrixXXColMajor,MatrixXXColMajor>();
eigenpy::enableEigenPySpecific<Vector3,Vector3>();
eigenpy::enableEigenPySpecific<VectorX,VectorX>();
/*eigenpy::exposeAngleAxis();
eigenpy::exposeQuaternion();*/
......@@ -83,6 +95,7 @@ BOOST_PYTHON_MODULE(centroidal_dynamics)
.def("setNewContacts", setNewContacts)
.def("computeEquilibriumRobustness", wrapComputeQuasiEquilibriumRobustness)
.def("computeEquilibriumRobustness", wrapComputeEquilibriumRobustness)
.def("getPolytopeInequalities", wrapGetPolytopeInequalities)
;
}
......
......@@ -40,3 +40,8 @@ ddc= asmatrix(array([1000.,0.,0.]))
status, robustness = eq.computeEquilibriumRobustness(c,ddc)
assert (status == LP_STATUS_OPTIMAL), "LP should not fail"
assert (robustness < 0), "first test should NOT be in equilibrirum"
#now, use polytope projection algorithm
eq.setNewContacts(asmatrix(P),asmatrix(N),0.3,EquilibriumAlgorithm.EQUILIBRIUM_ALGORITHM_PP)
H,h = eq.getPolytopeInequalities()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment