unittest/python/crocoddyl/action.py
def calc(model, data, x, u=None):
        """ Update the next state and the cost function.

        :param model: action model
        :params data: action data
        :params x: time-discrete state vector
        :params u: time-discrete control vector
        :returns the next state and cost value
        """
        if u is None:
            u = model.unone
        data.xnext[:] = np.dot(model.Fx, x) + np.dot(model.Fu, u) + model.f0
        data.cost = 0.5 * np.dot(x, np.dot(model.Lxx, x)) + 0.5 * np.dot(u, np.dot(model.Luu, u))
        data.cost += np.dot(x, np.dot(model.Lxu, u)) + np.dot(model.lx, x) + np.dot(model.lu, u)
        return data.xnext, data.cost
 Update the next state and the cost function.

        :param model: action model
        :params data: action data
        :params x: time-discrete state vector
        :params u: time-discrete control vector
        :returns the next state and cost value
        
Update the next state and the cost function.
Update the next state and the cost function .
def calc(model, data, x, u=None):
        if u is None:
            u = model.unone
        data.xnext[:] = np.dot(model.Fx, x) + np.dot(model.Fu, u) + model.f0
        data.cost = 0.5 * np.dot(x, np.dot(model.Lxx, x)) + 0.5 * np.dot(u, np.dot(model.Luu, u))
        data.cost += np.dot(x, np.dot(model.Lxu, u)) + np.dot(model.lx, x) + np.dot(model.lu, u)
        return data.xnext, data.cost
def calc ( model , data , x , u = None ) : if u is None : u = model . unone data . xnext [ : ] = np . dot ( model . Fx , x ) + np . dot ( model . Fu , u ) + model . f0 data . cost = 0.5 * np . dot ( x , np . dot ( model . Lxx , x ) ) + 0.5 * np . dot ( u , np . dot ( model . Luu , u ) ) data . cost += np . dot ( x , np . dot ( model . Lxu , u ) ) + np . dot ( model . lx , x ) + np . dot ( model . lu , u ) return data . xnext , data . cost
Update the next state and the cost function.
Update the next state and the cost function .
""" Update the next state and the cost function.

        :param model: action model
        :params data: action data
        :params x: time-discrete state vector
        :params u: time-discrete control vector
        :returns the next state and cost value
        """
model
data
x
u