bindings_std_vector.py
Go to the documentation of this file.
1 import unittest
2 from test_case import PinocchioTestCase as TestCase
3 
4 import pinocchio as pin
5 import numpy as np
6 
7 import pickle
8 
9 class TestStdMap(TestCase):
10 
11  def setUp(self):
12  pass
13 
14  def test_pickle(self):
15  vec = pin.StdVec_Vector3()
16  for k in range(100):
17  vec.append(np.random.rand((3)))
18 
19  pickle.dump( vec, open( "save_std_vec.p", "wb" ) )
20 
21  vec_loaded = pickle.load( open( "save_std_vec.p", "rb" ) )
22  for k in range(len(vec)):
23  self.assertApprox(vec[k],vec_loaded[k])
24 
25 if __name__ == '__main__':
26  unittest.main()


pinocchio
Author(s):
autogenerated on Tue Jun 1 2021 02:45:02