23 from std_srvs.srv
import Trigger, TriggerResponse
24 from move_base_msgs.msg
import MoveBaseAction
25 from control_msgs.msg
import FollowJointTrajectoryAction
26 from simple_script_server
import *
32 super(TestTrigger, self).
__init__(*args)
33 rospy.init_node(
'test_trigger')
46 self.fail(
'sss.init() failed. script server error_code: ' + str(handle.get_error_code()))
49 as_name =
"/move_base" 51 handle = sss.stop(
"base")
52 if not handle.get_error_code() == 0:
53 self.fail(
'sss.stop("base") failed. script server error_code: ' + str(handle.get_error_code()))
54 handle = sss.stop(
"base", mode=
"omni")
55 if not handle.get_error_code() == 0:
56 self.fail(
'sss.stop("base", mode="omni") failed. script server error_code: ' + str(handle.get_error_code()))
58 as_name =
"/move_base_diff" 60 handle = sss.stop(
"base", mode=
"diff")
61 if not handle.get_error_code() == 0:
62 self.fail(
'sss.stop("base", mode="diff") failed. script server error_code: ' + str(handle.get_error_code()))
64 as_name =
"/move_base_linear" 66 handle = sss.stop(
"base", mode=
"linear")
67 if not handle.get_error_code() == 0:
68 self.fail(
'sss.stop("base", mode="linear") failed. script server error_code: ' + str(handle.get_error_code()))
72 if not handle.get_error_code() == 0:
73 self.fail(
'sss.stop("arm") failed. script server error_code: ' + str(handle.get_error_code()))
80 self.fail(
'sss.recover() failed. script server error_code: ' + str(handle.get_error_code()))
87 self.fail(
'sss.halt() failed. script server error_code: ' + str(handle.get_error_code()))
91 res = TriggerResponse()
96 while not self.as_server.is_preempt_requested():
98 self.as_server.set_preempted()
100 if __name__ ==
'__main__':
102 rostest.rosrun(
'cob_script_server',
'trigger', TestTrigger)
def action_cb(self, goal)
This test checks the correct call to commands from the cob_script_server.
Simple script server class.