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

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

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


class TestTalosWalkContact(unittest.TestCase):
    def test_talos_walk_contacts(self):
13
14
        with ServerManager('hpp-rbprm-server'):
            module_scenario = import_module(PATH + ".talos_flatGround")
Guilhem Saurel's avatar
Guilhem Saurel committed
15
            self.assertTrue(hasattr(module_scenario, 'ContactGenerator'))
16
17
18
            ContactGenerator = getattr(module_scenario, 'ContactGenerator')
            cg = ContactGenerator()
            cg.run()
Guilhem Saurel's avatar
Guilhem Saurel committed
19
20
            self.assertGreater(len(cg.configs), 5)
            self.assertLess(len(cg.configs), 10)
21
22
            self.assertEqual(cg.q_init, cg.configs[0])
            self.assertEqual(cg.q_goal, cg.configs[-1])
23
24
25
26


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