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
append-urdf-model-with-another-model.open
open
Definition:
append-urdf-model-with-another-model.py:66
bindings_std_vector.TestStdMap.test_pickle
def test_pickle(self)
Definition:
bindings_std_vector.py:14
bindings_std_vector.TestStdMap.setUp
def setUp(self)
Definition:
bindings_std_vector.py:11
pinocchio
Author(s):
autogenerated on Fri Jun 23 2023 02:38:28