File size: 772 Bytes
cf8614b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import unittest
from tests.core import TestCore
from pyrep.objects.cartesian_path import CartesianPath
class TestCartesianPaths(TestCore):
def setUp(self):
super().setUp()
self.cart_path = CartesianPath('cartesian_path')
def test_create_cartesian_path(self):
p = CartesianPath.create()
self.assertIsInstance(p, CartesianPath)
def test_get_pose_on_path(self):
pos, ori = self.cart_path.get_pose_on_path(0.5)
self.assertEqual(len(pos), 3)
self.assertEqual(len(ori), 3)
def test_insert_control_points(self):
points = [[0.1] * 6]
# Just check that it does not throw an exception.
self.cart_path.insert_control_points(points)
if __name__ == '__main__':
unittest.main()
|