Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
unittest
python
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()
bindings_std_vector.TestStdMap
Definition:
bindings_std_vector.py:9
bindings_std_vector.TestStdMap.test_pickle
def test_pickle(self)
Definition:
bindings_std_vector.py:14
meshcat-viewer-dae.open
open
Definition:
meshcat-viewer-dae.py:39
bindings_std_vector.TestStdMap.setUp
def setUp(self)
Definition:
bindings_std_vector.py:11
pinocchio
Author(s):
autogenerated on Tue Jun 1 2021 02:45:02