Go to the documentation of this file.00001
00002 import sys
00003
00004 import rospy
00005 from std_srvs.srv import Empty, EmptyResponse
00006
00007
00008 def handle_msg(rq):
00009 print("Empty Node got request")
00010
00011 return EmptyResponse()
00012
00013
00014 def empty_server():
00015
00016 args = rospy.myargv(argv=sys.argv)
00017 node_name = args[1] if len(args) > 1 else 'empty_node'
00018
00019 rospy.init_node(node_name)
00020
00021
00022
00023
00024
00025
00026
00027 srv = rospy.Service('/test/empsrv', Empty, handle_msg)
00028 rospy.spin()
00029 if rospy.has_param('empty_param'):
00030 rospy.delete_param('~empty_param')
00031
00032 if __name__ == '__main__':
00033 empty_server()