5 from std_srvs.srv
import Empty
6 from std_srvs.srv
import EmptyResponse
7 from std_srvs.srv
import SetBool
8 from std_srvs.srv
import SetBoolResponse
9 from std_srvs.srv
import Trigger
10 from std_srvs.srv
import TriggerResponse
16 rospy.Service(
'dummy/buttonA', SetBool, self.
_set_bool_cb),
17 rospy.Service(
'dummy/buttonB', SetBool, self.
_set_bool_cb),
18 rospy.Service(
'dummy/buttonC', SetBool, self.
_set_bool_cb),
19 rospy.Service(
'dummy/buttonD', Trigger, self.
_trigger_cb),
20 rospy.Service(
'dummy/buttonE', Empty, self.
_empty_cb),
21 rospy.Service(
'dummy/buttonF', Empty, self.
_empty_cb),
25 rospy.loginfo(
'SetBool service called: req.data={}'.format(req.data))
26 return SetBoolResponse(success=
True)
29 rospy.loginfo(
'Trigger service called')
30 return TriggerResponse(success=
True)
33 rospy.loginfo(
'Empty service called')
34 return EmptyResponse()
37 if __name__ ==
'__main__':
38 rospy.init_node(
'sample_service_buttons')