test_node.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 from __future__ import print_function
4 
5 import rospy
6 from std_msgs.msg import String
7 
8 
9 rospy.init_node('test_node')
10 
11 pub = rospy.Publisher('~output', String, queue_size=10)
12 
13 def callback(data):
14  print("Test node got", repr(data))
15  pub.publish(data.data)
16 
17 sub = rospy.Subscriber('~input', String, callback)
18 
19 rospy.spin()
def callback(data)
Definition: test_node.py:13


rosmon_core
Author(s): Max Schwarz
autogenerated on Sat Jan 9 2021 03:35:43