mbf_costmap_nav.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 mbf_msgs.msg import GetPathAction, GetPathGoal, GetPathResult
9 
10 
11 class TestMbfCostmapNav(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  In this simple setup, we don't really want to generate a plan.
18  Instread, we can ask for a plan on our planner (gpp_gp), and verify,
19  that the generated error-message is not INVALID_PLUGIN
20 
21  See https://github.com/magazino/move_base_flex/blob/596ed881bfcbd847e9d296c6d38e4d3fa3b74a4d/mbf_msgs/action/GetPath.action
22  for reference.
23  """
24  # setup the client
25  get_path = SimpleActionClient('move_base_flex/get_path', GetPathAction)
26  self.assertTrue(get_path.wait_for_server(rospy.Duration(60)),
27  "{} server offline".format(get_path.action_client.ns))
28 
29  # send a dummy goal with the right planner
30  goal = GetPathGoal()
31  goal.planner = 'gpp_gp'
32  get_path.send_goal_and_wait(goal, rospy.Duration(1))
33  result = get_path.get_result()
34 
35  # we are happy as long the plugin is known
36  self.assertNotEqual(result.outcome, GetPathResult.INVALID_PLUGIN)
37 
38 
39 if __name__ == '__main__':
40  rospy.init_node("test_mbf_costmap_nav")
41  rostest.rosrun('gpp_plugin', 'test_mbf_costmap_nav', TestMbfCostmapNav)
actionlib::simple_action_client::SimpleActionClient
mbf_costmap_nav.TestMbfCostmapNav.test_server_online
def test_server_online(self)
Definition: mbf_costmap_nav.py:14
actionlib::simple_action_client
mbf_costmap_nav.TestMbfCostmapNav
Definition: mbf_costmap_nav.py:11


gpp_plugin
Author(s):
autogenerated on Wed Mar 2 2022 00:21:23