Commit ba06ab63 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

fix libname

parent b09c0750
......@@ -58,7 +58,7 @@ boost::python::tuple wrapGetPolytopeInequalities(Equilibrium& self)
BOOST_PYTHON_MODULE(centroidal_dynamics)
BOOST_PYTHON_MODULE(hpp_centroidal_dynamics)
{
/** BEGIN eigenpy init**/
eigenpy::enableEigenPy();
......
from centroidal_dynamics import *
from hpp_centroidal_dynamics import *
#testing constructors
eq = Equilibrium("test", 54., 4)
eq = Equilibrium("test", 54., 4, SolverLP.SOLVER_LP_QPOASES )
eq = Equilibrium("test", 54., 4, SolverLP.SOLVER_LP_QPOASES )
eq = Equilibrium("test", 54., 4, SolverLP.SOLVER_LP_QPOASES, False)
eq = Equilibrium("test", 54., 4, SolverLP.SOLVER_LP_QPOASES, False, 1)
eq = Equilibrium("test", 54., 4, SolverLP.SOLVER_LP_QPOASES, True, 1, True )
eq = Equilibrium("test", 54., 4)
eq = Equilibrium("test", 54., 4, SolverLP.SOLVER_LP_QPOASES )
eq = Equilibrium("test", 54., 4, SolverLP.SOLVER_LP_QPOASES )
eq = Equilibrium("test", 54., 4, SolverLP.SOLVER_LP_QPOASES, False)
eq = Equilibrium("test", 54., 4, SolverLP.SOLVER_LP_QPOASES, False, 1)
eq = Equilibrium("test", 54., 4, SolverLP.SOLVER_LP_QPOASES, True, 1, True )
#whether useWarmStart is enable (True by default)
previous = eq.useWarmStart()
......@@ -25,7 +25,7 @@ z = array([0.,0.,1.])
P = asmatrix(array([array([x,y,0]) for x in [-0.05,0.05] for y in [-0.1,0.1]]))
N = asmatrix(array([z for _ in range(4)]))
#setting contact positions and normals, as well as friction coefficients
#setting contact positions and normals, as well as friction coefficients
eq.setNewContacts(asmatrix(P),asmatrix(N),0.3,EquilibriumAlgorithm.EQUILIBRIUM_ALGORITHM_LP)
c= asmatrix(array([0.,0.,1.])).T
......@@ -34,7 +34,7 @@ c= asmatrix(array([0.,0.,1.])).T
status, robustness = eq.computeEquilibriumRobustness(c)
assert (status == LP_STATUS_OPTIMAL), "LP should not fail"
assert (robustness > 0), "first test should be in equilibrirum"
#computing robustness of a given configuration with non zero acceleration
ddc= asmatrix(array([1000.,0.,0.])).T
status, robustness = eq.computeEquilibriumRobustness(c,ddc)
......@@ -58,10 +58,10 @@ import numpy as np
def compute_w(c, ddc, dL=array([0.,0.,0.]), m = 54., g_vec=array([0.,0.,-9.81])):
w1 = m * (ddc - g_vec)
return array(w1.tolist() + (cross(c, w1) + dL).tolist())
def is_stable(H,c=array([0.,0.,1.]), ddc=array([0.,0.,0.]), dL=array([0.,0.,0.]), m = 54., g_vec=array([0.,0.,-9.81]), robustness = 0.):
w = compute_w(c, ddc, dL, m, g_vec)
w = compute_w(c, ddc, dL, m, g_vec)
return (H.dot(-w)<=-robustness).all()
assert(is_stable(H))
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