3 import pinocchio
as pin
4 from test_case
import PinocchioTestCase
as TestCase
6 main_path =
"./serialization-data"
11 model = pin.buildSampleModelHumanoidRandom()
12 filename = main_path +
"/model.txt"
13 model.saveToText(filename)
16 model2.loadFromText(filename)
18 self.assertTrue(model == model2)
21 model = pin.buildSampleModelHumanoidRandom()
22 filename = main_path +
"/model.xml"
24 model.saveToXML(filename, tag_name)
27 model2.loadFromXML(filename, tag_name)
29 self.assertTrue(model == model2)
32 model = pin.buildSampleModelHumanoidRandom()
33 filename = main_path +
"/model.bin"
34 model.saveToBinary(filename)
37 model2.loadFromBinary(filename)
39 self.assertTrue(model == model2)
42 if __name__ ==
"__main__":