test
move_base.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
3
import
rospy
4
import
rostest
5
import
unittest
6
7
from
actionlib.simple_action_client
import
SimpleActionClient
8
from
move_base_msgs.msg
import
MoveBaseAction
9
10
11
class
TestMoveBase
(unittest.TestCase):
12
"""Verifies that move_base can handle our plugin"""
13
14
def
test_server_online
(self):
15
"""Check that server is online
16
17
move-base is very opaque compared to the move-base-flex framework;
18
We cannot simply test, if a planner has been loaded successfully.
19
20
However, we know that the move_base node crashes and dies, if the
21
planner is ill-defined.
22
Hence, we can just test, if the main action is online, to verify, that
23
the loading-process finished properly.
24
"""
25
move_base =
SimpleActionClient
(
'/move_base'
, MoveBaseAction)
26
self.assertTrue(move_base.wait_for_server(rospy.Duration(60)),
27
"{} server offline"
.format(move_base.action_client.ns))
28
29
30
if
__name__ ==
'__main__'
:
31
rospy.init_node(
"test_move_base"
)
32
rostest.rosrun(
'gpp_plugin'
,
'test_move_base'
, TestMoveBase)
actionlib::simple_action_client::SimpleActionClient
move_base.TestMoveBase.test_server_online
def test_server_online(self)
Definition:
move_base.py:14
move_base.TestMoveBase
Definition:
move_base.py:11
actionlib::simple_action_client
gpp_plugin
Author(s):
autogenerated on Wed Mar 2 2022 00:21:23