@@ -595,7 +595,14 @@ def test_SampleTimeGenerator_(self):
595
595
decimal = 7 , err_msg = error , \
596
596
verbose = True )
597
597
598
- def test_GetPointFrom (self ):
598
+ class Test_GetPointFrom (unittest .TestCase ):
599
+ def setUp (self ):
600
+ self .env = openravepy .Environment ()
601
+
602
+ def tearDown (self ):
603
+ self .env .Destroy ()
604
+
605
+ def test_GetPointFrom_Kinbody (self ):
599
606
# Check that each input type returns the correct xyz coord
600
607
601
608
# Kinbody
@@ -604,21 +611,31 @@ def test_GetPointFrom(self):
604
611
mug .SetTransform (numpy .eye (4 ))
605
612
coord_kinbody = prpy .util .GetPointFrom (mug )
606
613
expected_kinbody_coords = [0 , 0 , 0 ]
607
- # numpy.testing.assert_array_almost_equal(coord_kinbody, expected_kinbody_coords)
614
+ numpy .testing .assert_array_almost_equal (coord_kinbody , expected_kinbody_coords )
608
615
616
+ def test_GetPointFrom_Space (self ):
617
+ # Check that each input type returns the correct xyz coord
609
618
expected_coord = [1 , 3 , 4 ]
610
619
611
620
# Point in space
612
621
space_coord = numpy .array ([1 , 3 , 4 ])
613
622
space_result = prpy .util .GetPointFrom (space_coord )
614
623
numpy .testing .assert_array_almost_equal (space_result , expected_coord )
615
624
625
+ def test_GetPointFrom_Transform (self ):
626
+ # Check that each input type returns the correct xyz coord
627
+ expected_coord = [1 , 3 , 4 ]
628
+
616
629
# 4x4 Transform
617
630
trans_coord = numpy .eye (4 )
618
631
trans_coord [0 :3 , 3 ] = expected_coord
619
632
trans_result = prpy .util .GetPointFrom (trans_coord )
620
633
numpy .testing .assert_array_almost_equal (trans_result , expected_coord )
621
634
635
+ def test_GetPointFrom_List (self ):
636
+ # Check that each input type returns the correct xyz coord
637
+ expected_coord = [1 , 3 , 4 ]
638
+
622
639
# List
623
640
list_coord = [1 , 3 , 4 ]
624
641
list_result = prpy .util .GetPointFrom (list_coord )
0 commit comments