slowService.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 import sys
3 import rospy
4 from std_srvs.srv import Empty, EmptyResponse
5 
6 delay = 30
7 
8 
9 def handle_msg(rq):
10  print("Slow Node got request")
11  rospy.rostime.wallsleep(delay)
12  return EmptyResponse()
13 
14 
16  args = rospy.myargv(argv=sys.argv)
17  node_name = args[1] if len(args) > 1 else 'slow_node'
18 
19  rospy.init_node(node_name)
20  rospy.set_param('~slow_param', delay)
21  srv = rospy.Service('/test/slowsrv', Empty, handle_msg)
22  rospy.spin()
23  if rospy.has_param('slow_param'):
24  rospy.delete_param('~slow_param')
25 
26 if __name__ == '__main__':
27  empty_server()
def empty_server()
Definition: slowService.py:15
def handle_msg(rq)
Definition: slowService.py:9


pyros_test
Author(s): AlexV
autogenerated on Mon Jun 10 2019 14:20:23