2 from __future__
import absolute_import
7 A very simple echo ROS node, with delay. 8 - echo from topic to echo_topic 15 import std_msgs.msg
as std_msgs
16 import std_srvs.srv
as std_srvs
19 from pyros_test.srv
import StringEchoService
23 print "==> sleeping {delay} seconds ".format(delay=30)
24 rospy.rostime.wallsleep(30)
25 print "==> finally replying to {d} ".format(d=data)
29 if __name__ ==
'__main__':
31 args = rospy.myargv(argv=sys.argv)
32 node_name = args[1]
if len(args) > 1
else 'string_slow_node' 34 rospy.init_node(node_name)
35 rospy.loginfo(
'String Slow node started. [' + rospy.get_name() +
']')
37 slow_service_name = rospy.get_param(
"~slow_service_name",
"slow_service")
38 print 'Parameter {0!s} has value {1!s}'.format(rospy.resolve_name(
'~slow_service_name'), slow_service_name)
39 if slow_service_name ==
"":
40 print "{0} parameter not found".format(rospy.resolve_name(
'~slow_service_name'))
43 srv = rospy.Service(slow_service_name, StringEchoService, service_callback)
47 except rospy.ROSInterruptException:
def service_callback(data)