arbitrator.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 import roslib; roslib.load_manifest('arbitrator')
00003 import rospy
00004 import random
00005 from roboframenet_msgs.msg import Procedure, FilledSemanticFrameListList
00006 
00007 def cb_fsf(msg, pub):
00008     # Make a state machine.
00009     sm = Procedure()
00010     frame_lists = msg.frame_lists
00011     random.shuffle(frame_lists)
00012     sm.frame_lists = msg.frame_lists
00013     # Send task to executor
00014     pub.publish(sm)
00015 
00016 def main():
00017     rospy.init_node('arbitrator')
00018     pub = rospy.Publisher('procedure', Procedure)
00019     rospy.Subscriber('filled_semantic_frames',
00020                      FilledSemanticFrameListList,
00021                      lambda msg: cb_fsf(msg, pub))
00022     rospy.spin()
00023 
00024 if __name__ == '__main__':
00025     main()
00026 
00027 
00028 
00029 


arbitrator
Author(s): Brian Thomas
autogenerated on Fri Dec 6 2013 20:40:39