parameters: (self, supportFootIds, swingFootTask)
return_statement: return model
docstring: Action model for pseudo-impulse models.
  
          A pseudo-impulse model consists of adding high-penalty cost for the contact velocities.
          :param swingFootTask: swinging foot task
          :return pseudo-impulse differential action model
docstring_summary: Action model for pseudo-impulse models.
docstring_tokens: Action model for pseudo - impulse models .
function: def createPseudoImpulseModel(self, supportFootIds, swingFootTask):
          """ Action model for pseudo-impulse models.
  
          A pseudo-impulse model consists of adding high-penalty cost for the contact velocities.
          :param swingFootTask: swinging foot task
          :return pseudo-impulse differential action model
          """
  
          # Creating a 6D multi-contact model, and then including the supporting
          # foot
          nu = self.actuation.nu
          contactModel = crocoddyl.ContactModelMultiple(self.state, nu)
          for i in supportFootIds:
              supportContactModel = crocoddyl.ContactModel6D(self.state, i, pinocchio.SE3.Identity(), nu,
                                                             np.array([0., 0.]))
              contactModel.addContact(self.rmodel.frames[i].name + "_contact", supportContactModel)
  
          # Creating the cost model for a contact phase
          costModel = crocoddyl.CostModelSum(self.state, nu)
          for i in supportFootIds:
              cone = crocoddyl.WrenchCone(self.Rsurf, self.mu, np.array([0.1, 0.05]))
              wrenchResidual = crocoddyl.ResidualModelContactWrenchCone(self.state, i, cone, nu)
              wrenchActivation = crocoddyl.ActivationModelQuadraticBarrier(crocoddyl.ActivationBounds(cone.lb, cone.ub))
              wrenchCone = crocoddyl.CostModelResidual(self.state, wrenchActivation, wrenchResidual)
              costModel.addCost(self.rmodel.frames[i].name + "_wrenchCone", wrenchCone, 1e1)
  
          if swingFootTask is not None:
              for i in swingFootTask:
                  framePlacementResidual = crocoddyl.ResidualModelFramePlacement(self.state, i[0], i[1], nu)
                  frameVelocityResidual = crocoddyl.ResidualModelFrameVelocity(self.state, i[0], pinocchio.Motion.Zero(),
                                                                               pinocchio.LOCAL, nu)
                  footTrack = crocoddyl.CostModelResidual(self.state, framePlacementResidual)
                  impulseFootVelCost = crocoddyl.CostModelResidual(self.state, frameVelocityResidual)
                  costModel.addCost(self.rmodel.frames[i[0]].name + "_footTrack", footTrack, 1e8)
                  costModel.addCost(self.rmodel.frames[i[0]].name + "_impulseVel", impulseFootVelCost, 1e6)
  
          stateWeights = np.array([0.] * 3 + [500.] * 3 + [0.01] * (self.state.nv - 6) + [10] * self.state.nv)
          stateResidual = crocoddyl.ResidualModelState(self.state, self.rmodel.defaultState, nu)
          stateActivation = crocoddyl.ActivationModelWeightedQuad(stateWeights**2)
          ctrlResidual = crocoddyl.ResidualModelControl(self.state, nu)
          stateReg = crocoddyl.CostModelResidual(self.state, stateActivation, stateResidual)
          ctrlReg = crocoddyl.CostModelResidual(self.state, ctrlResidual)
          costModel.addCost("stateReg", stateReg, 1e1)
          costModel.addCost("ctrlReg", ctrlReg, 1e-3)
  
          # Creating the action model for the KKT dynamics with simpletic Euler
          # integration scheme
          dmodel = crocoddyl.DifferentialActionModelContactFwdDynamics(self.state, self.actuation, contactModel,
                                                                       costModel, 0., True)
          model = crocoddyl.IntegratedActionModelEuler(dmodel, 0.)
          return model
function_tokens: def createPseudoImpulseModel ( self , supportFootIds , swingFootTask ) : # Creating a 6D multi-contact model, and then including the supporting # foot nu = self . actuation . nu contactModel = crocoddyl . ContactModelMultiple ( self . state , nu ) for i in supportFootIds : supportContactModel = crocoddyl . ContactModel6D ( self . state , i , pinocchio . SE3 . Identity ( ) , nu , np . array ( [ 0. , 0. ] ) ) contactModel . addContact ( self . rmodel . frames [ i ] . name + "_contact" , supportContactModel ) # Creating the cost model for a contact phase costModel = crocoddyl . CostModelSum ( self . state , nu ) for i in supportFootIds : cone = crocoddyl . WrenchCone ( self . Rsurf , self . mu , np . array ( [ 0.1 , 0.05 ] ) ) wrenchResidual = crocoddyl . ResidualModelContactWrenchCone ( self . state , i , cone , nu ) wrenchActivation = crocoddyl . ActivationModelQuadraticBarrier ( crocoddyl . ActivationBounds ( cone . lb , cone . ub ) ) wrenchCone = crocoddyl . CostModelResidual ( self . state , wrenchActivation , wrenchResidual ) costModel . addCost ( self . rmodel . frames [ i ] . name + "_wrenchCone" , wrenchCone , 1e1 ) if swingFootTask is not None : for i in swingFootTask : framePlacementResidual = crocoddyl . ResidualModelFramePlacement ( self . state , i [ 0 ] , i [ 1 ] , nu ) frameVelocityResidual = crocoddyl . ResidualModelFrameVelocity ( self . state , i [ 0 ] , pinocchio . Motion . Zero ( ) , pinocchio . LOCAL , nu ) footTrack = crocoddyl . CostModelResidual ( self . state , framePlacementResidual ) impulseFootVelCost = crocoddyl . CostModelResidual ( self . state , frameVelocityResidual ) costModel . addCost ( self . rmodel . frames [ i [ 0 ] ] . name + "_footTrack" , footTrack , 1e8 ) costModel . addCost ( self . rmodel . frames [ i [ 0 ] ] . name + "_impulseVel" , impulseFootVelCost , 1e6 ) stateWeights = np . array ( [ 0. ] * 3 + [ 500. ] * 3 + [ 0.01 ] * ( self . state . nv - 6 ) + [ 10 ] * self . state . nv ) stateResidual = crocoddyl . ResidualModelState ( self . state , self . rmodel . defaultState , nu ) stateActivation = crocoddyl . ActivationModelWeightedQuad ( stateWeights ** 2 ) ctrlResidual = crocoddyl . ResidualModelControl ( self . state , nu ) stateReg = crocoddyl . CostModelResidual ( self . state , stateActivation , stateResidual ) ctrlReg = crocoddyl . CostModelResidual ( self . state , ctrlResidual ) costModel . addCost ( "stateReg" , stateReg , 1e1 ) costModel . addCost ( "ctrlReg" , ctrlReg , 1e-3 ) # Creating the action model for the KKT dynamics with simpletic Euler # integration scheme dmodel = crocoddyl . DifferentialActionModelContactFwdDynamics ( self . state , self . actuation , contactModel , costModel , 0. , True ) model = crocoddyl . IntegratedActionModelEuler ( dmodel , 0. ) return model