unittest/python/crocoddyl/state.py
def Jdiff(self, x1, x2, firstsecond='both'):
        """ Compute the partial derivatives for diff operator using Pinocchio.

        :param x1: current state
        :param x2: next state
        :param firstsecond: desired partial derivative
        :return the partial derivative(s) of the diff(x1,x2) function
        """
        assert (firstsecond in ['first', 'second', 'both'])
        if firstsecond == 'both':
            return [self.Jdiff(x1, x2, 'first'), self.Jdiff(x1, x2, 'second')]
        if firstsecond == 'second':
            dx = self.diff(x1, x2)
            q = a2m(x1[:self.model.nq])
            dq = a2m(dx[:self.model.nv])
            Jdq = pinocchio.dIntegrate(self.model, q, dq)[1]
            return block_diag(np.asarray(np.linalg.inv(Jdq)), np.eye(self.model.nv))
        else:
            dx = self.diff(x2, x1)
            q = a2m(x2[:self.model.nq])
            dq = a2m(dx[:self.model.nv])
            Jdq = pinocchio.dIntegrate(self.model, q, dq)[1]
            return -block_diag(np.asarray(np.linalg.inv(Jdq)), np.eye(self.model.nv))
 Compute the partial derivatives for diff operator using Pinocchio.

        :param x1: current state
        :param x2: next state
        :param firstsecond: desired partial derivative
        :return the partial derivative(s) of the diff(x1,x2) function
        
Compute the partial derivatives for diff operator using Pinocchio.
Compute the partial derivatives for diff operator using Pinocchio .
def Jdiff(self, x1, x2, firstsecond='both'):
        assert (firstsecond in ['first', 'second', 'both'])
        if firstsecond == 'both':
            return [self.Jdiff(x1, x2, 'first'), self.Jdiff(x1, x2, 'second')]
        if firstsecond == 'second':
            dx = self.diff(x1, x2)
            q = a2m(x1[:self.model.nq])
            dq = a2m(dx[:self.model.nv])
            Jdq = pinocchio.dIntegrate(self.model, q, dq)[1]
            return block_diag(np.asarray(np.linalg.inv(Jdq)), np.eye(self.model.nv))
        else:
            dx = self.diff(x2, x1)
            q = a2m(x2[:self.model.nq])
            dq = a2m(dx[:self.model.nv])
            Jdq = pinocchio.dIntegrate(self.model, q, dq)[1]
            return -block_diag(np.asarray(np.linalg.inv(Jdq)), np.eye(self.model.nv))
def Jdiff ( self , x1 , x2 , firstsecond = 'both' ) : assert ( firstsecond in [ 'first' , 'second' , 'both' ] ) if firstsecond == 'both' : return [ self . Jdiff ( x1 , x2 , 'first' ) , self . Jdiff ( x1 , x2 , 'second' ) ] if firstsecond == 'second' : dx = self . diff ( x1 , x2 ) q = a2m ( x1 [ : self . model . nq ] ) dq = a2m ( dx [ : self . model . nv ] ) Jdq = pinocchio . dIntegrate ( self . model , q , dq ) [ 1 ] return block_diag ( np . asarray ( np . linalg . inv ( Jdq ) ) , np . eye ( self . model . nv ) ) else : dx = self . diff ( x2 , x1 ) q = a2m ( x2 [ : self . model . nq ] ) dq = a2m ( dx [ : self . model . nv ] ) Jdq = pinocchio . dIntegrate ( self . model , q , dq ) [ 1 ] return - block_diag ( np . asarray ( np . linalg . inv ( Jdq ) ) , np . eye ( self . model . nv ) )
Compute the partial derivatives for diff operator using Pinocchio.
Compute the partial derivatives for diff operator using Pinocchio .
""" Compute the partial derivatives for diff operator using Pinocchio.

        :param x1: current state
        :param x2: next state
        :param firstsecond: desired partial derivative
        :return the partial derivative(s) of the diff(x1,x2) function
        """
self
x1
x2
firstsecond