Go to the documentation of this file.00001
00002
00003
00004 __author__ = "Minglong Li"
00005
00006 import rospy
00007 import node
00008 import send
00009 import receive
00010 from std_msgs.msg import String
00011
00012 class FunctionUnit(node.Node, receive.Receive, send.Send):
00013 def __init__(self, node_name):
00014
00015 super(FunctionUnit, self).__init__()
00016 self._node_name = node_name
00017
00018 def init_node(self):
00019 rospy.init_node(self._node_name)
00020
00021 def spin(self):
00022 rospy.spin()
00023
00024 def run(self):
00025 pass
00026
00027
00028
00029
00030
00031 def create_receive(self, topic, msg_type, on_received):
00032 return receive.Receive(topic, msg_type, on_received)
00033
00034 def create_send(self, topic, msg_type):
00035 return send.Send(topic, msg_type)
00036
00037 def rebuild_receive(self, receive, old_msg_type, new_topic):
00038 receive.unregister()
00039 del receive
00040 return receive.Receive(new_topic, old_msg_type, on_received)
00041 '''
00042 def on_received1(self, msg):
00043 print "message received"
00044 print msg
00045 #receive1.start()
00046 #MARK:test hello
00047 '''
00048
00049 '''
00050 def receive1.on_received(msg):
00051 print "On_received method start!"
00052 print msg.data
00053 '''