test_talos_walk_path.py 1 KB
Newer Older
1
2
3
4
# Copyright (c) 2020, CNRS
# Authors: Pierre Fernbach <pfernbac@laas.fr>
import os
import unittest
5
6
7
from importlib import import_module

from hpp.corbaserver.rbprm.utils import ServerManager
8
9
10
11
12
13

PATH = "hpp.corbaserver.rbprm.scenarios.demos"


class TestTalosWalkPath(unittest.TestCase):
    def test_talos_walk_path(self):
14
15
        with ServerManager('hpp-rbprm-server'):
            module_scenario = import_module(PATH + ".talos_flatGround_path")
Guilhem Saurel's avatar
Guilhem Saurel committed
16
            self.assertTrue(hasattr(module_scenario, 'PathPlanner'))
17
18
19
20
            PathPlanner = getattr(module_scenario, 'PathPlanner')
            planner = PathPlanner()
            planner.run()
            ps = planner.ps
21
            self.assertEqual(ps.numberPaths(), 1)
Guilhem Saurel's avatar
Guilhem Saurel committed
22
23
            self.assertGreater(ps.pathLength(0), 6.)
            self.assertLess(ps.pathLength(0), 7.)
24
25
            self.assertEqual(planner.q_init, ps.configAtParam(0, 0))
            self.assertEqual(planner.q_goal, ps.configAtParam(0, ps.pathLength(0)))
26
27
28
29


if __name__ == '__main__':
    unittest.main()