eq.setNewContacts(P, N, 0.3, EquilibriumAlgorithm.EQUILIBRIUM_ALGORITHM_PP)
```
Then, we will define the initial state of our robot:
```
#c0 is the initial center of mass position
c0 = matrix([0.,0.,1.]) .T
c0 = array([0., 0., 1.])
#we set the inital speed dc0 to a rather slow 10 cm / s along the x axis
dc0 = matrix([0.1,0.,0.]).T
l0 = matrix([0.,0.,0.]).T
T = 1.2
tstep = -1.
dc0 = array([0.1, 0., 0.])
l0 = array([0., 0., 0.])
```
And finally, some optimization parameters:
...
...
@@ -129,9 +129,8 @@ tstep = -1.
We can now solve the problem:
```
# the boolean value indicates whether to use or not angular momentum
result = zeroStepCapturability(eq,c0,dc0,l0,False,T,tstep)
print result.success
result = zeroStepCapturability(eq, c0, dc0, l0, False, T, tstep)
print(result.success)
#True the problem was feasible, and a trajectory was successfully computed
```
...
...
@@ -139,16 +138,14 @@ print result.success
The found centroidal trajectory is accessible from the returned object, only if the problem
was feasible
```
res.c_of_t # a bezier curve object describing the com trajectory
result.c_of_t # a bezier curve object describing the com trajectory
#We can check that the end velocity is indeed zero:
dc_of_t = res.c_of_t.compute_derivate(1) # computing first derivative
printnp.linalg.norm(dc_of_t(dc_of_t.max()))
dc_of_t = result.c_of_t.compute_derivate(1) # computing first derivative
print(np.linalg.norm(dc_of_t(dc_of_t.max())))
# 0.0
```
refer to the [test file](https://gitlab.com/stonneau/bezier_COM_traj/blob/master/python/test/binding_tests.py) for more advanced problems, including kinematic constraints,
mutiple contact phases handling and angular momentum