unittest/python/crocoddyl/state.py
def Jintegrate(self, x, dx, firstsecond='both'):
        """ Compute the partial derivatives for integrate operator using Pinocchio.

        :param x: current state
        :param dx: displacement of the state
        :param firstsecond: desired partial derivative
        :return the partial derivative(s) of the integrate(x,dx) function
        """
        assert (firstsecond in ['first', 'second', 'both'])
        assert (x.shape == (self.nx, ) and dx.shape == (self.ndx, ))
        if firstsecond == 'both':
            return [self.Jintegrate(x, dx, 'first'), self.Jintegrate(x, dx, 'second')]
        q = a2m(x[:self.model.nq])
        dq = a2m(dx[:self.model.nv])
        Jq, Jdq = pinocchio.dIntegrate(self.model, q, dq)
        if firstsecond == 'first':
            # Derivative wrt x
            return block_diag(np.asarray(Jq), np.eye(self.model.nv))
        else:
            # Derivative wrt v
            return block_diag(np.asarray(Jdq), np.eye(self.model.nv))
 Compute the partial derivatives for integrate operator using Pinocchio.

        :param x: current state
        :param dx: displacement of the state
        :param firstsecond: desired partial derivative
        :return the partial derivative(s) of the integrate(x,dx) function
        
Compute the partial derivatives for integrate operator using Pinocchio.
Compute the partial derivatives for integrate operator using Pinocchio .
def Jintegrate(self, x, dx, firstsecond='both'):
        assert (firstsecond in ['first', 'second', 'both'])
        assert (x.shape == (self.nx, ) and dx.shape == (self.ndx, ))
        if firstsecond == 'both':
            return [self.Jintegrate(x, dx, 'first'), self.Jintegrate(x, dx, 'second')]
        q = a2m(x[:self.model.nq])
        dq = a2m(dx[:self.model.nv])
        Jq, Jdq = pinocchio.dIntegrate(self.model, q, dq)
        if firstsecond == 'first':
            return block_diag(np.asarray(Jq), np.eye(self.model.nv))
        else:
            return block_diag(np.asarray(Jdq), np.eye(self.model.nv))
def Jintegrate ( self , x , dx , firstsecond = 'both' ) : assert ( firstsecond in [ 'first' , 'second' , 'both' ] ) assert ( x . shape == ( self . nx , ) and dx . shape == ( self . ndx , ) ) if firstsecond == 'both' : return [ self . Jintegrate ( x , dx , 'first' ) , self . Jintegrate ( x , dx , 'second' ) ] q = a2m ( x [ : self . model . nq ] ) dq = a2m ( dx [ : self . model . nv ] ) Jq , Jdq = pinocchio . dIntegrate ( self . model , q , dq ) if firstsecond == 'first' : return block_diag ( np . asarray ( Jq ) , np . eye ( self . model . nv ) ) else : return block_diag ( np . asarray ( Jdq ) , np . eye ( self . model . nv ) )
Compute the partial derivatives for integrate operator using Pinocchio.
Compute the partial derivatives for integrate operator using Pinocchio .
""" Compute the partial derivatives for integrate operator using Pinocchio.

        :param x: current state
        :param dx: displacement of the state
        :param firstsecond: desired partial derivative
        :return the partial derivative(s) of the integrate(x,dx) function
        """ # Derivative wrt x # Derivative wrt v
self
x
dx
firstsecond