imperative_to_declarative.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 import roslib; roslib.load_manifest('imperative_to_declarative')
00003 import rospy
00004 from std_msgs.msg import String
00005 
00006 def youinate(msg, pub):
00007     instr = msg.data
00008     outstr = "You " + instr[0].lower() + instr[1:]
00009     s = String()
00010     s.data = outstr
00011     pub.publish(s)
00012 
00013 def main():
00014     rospy.init_node('imperative_to_declarative')
00015     pub = rospy.Publisher('declarative', String)
00016     rospy.Subscriber('imperative', String, lambda msg: youinate(msg, pub))
00017     rospy.spin()
00018 
00019 if __name__ == '__main__':
00020     main()
00021 
00022 
00023 


imperative_to_declarative
Author(s): Brian Thomas
autogenerated on Fri Dec 6 2013 20:44:09