def loadModelFromString(self, urdfString, rootJointType=pinocchio.JointModelFreeFlyer, removeMimicJoints=True): """ Load a URDF model contained in a string - param rootJointType: the root joint type. None for no root joint. - param removeMimicJoints: if True, all the mimic joints found in the model are removed. """ if rootJointType is None: self.pinocchioModel = pinocchio.buildModelFromXML(urdfString) else: self.pinocchioModel = pinocchio.buildModelFromXML(urdfString, rootJointType()) self.pinocchioData = pinocchio.Data(self.pinocchioModel) if removeMimicJoints: self._removeMimicJoints(urdfString=urdfString)
def test_xml(self): with open(self.model_path) as model: file_content = model.read() model_ref = pin.buildModelFromUrdf(self.model_path, pin.JointModelFreeFlyer()) model = pin.buildModelFromXML(file_content,pin.JointModelFreeFlyer()) self.assertEqual(model,model_ref) model_self = pin.Model() pin.buildModelFromXML(file_content,pin.JointModelFreeFlyer(),model_self) self.assertEqual(model_self,model_ref)