Go to the documentation of this file.00001
00002
00003 __author__ = 'Minglong Li'
00004
00005
00006
00007
00008 from robot_patrol_area_0 import RobotPatrolArea0
00009 from robot_patrol_area_1 import RobotPatrolArea1
00010 from robot_patrol_area_2 import RobotPatrolArea2
00011 from motivational_behavior import MotivationalBehavior
00012 from switch import Switch
00013 from std_msgs.msg import Bool
00014 from geometry_msgs.msg import Twist
00015 from robot_detect import RobotDetect2
00016 from robot_follow import RobotFollow2
00017 import move_base_msgs.msg
00018
00019 bs0 = RobotPatrolArea0("robot_2/move_base/switch0","robot_2_partrol0_node")
00020 bs1 = RobotPatrolArea1("robot_2/move_base/switch1","robot_2_partrol1_node")
00021 bs2 = RobotPatrolArea2("robot_2/move_base/switch2","robot_2_partrol2_node")
00022 bs0.start()
00023 bs1.start()
00024 bs2.start()
00025
00026 mb0 = MotivationalBehavior('r2_mb0',2,0,'robot2_switch0_patrol/activate')
00027 mb0.set_fast(10)
00028 mb0.enable_random_inc()
00029 mb0.set_sensory_feedback(1)
00030 mb0.set_sensor('robot_2/patrol_sensory_feedback')
00031 mb0.start()
00032 s0 = Switch('robot2_switch0_patrol','robot_2/move_base/switch0/goal',move_base_msgs.msg.MoveBaseActionGoal,'robot_2/move_base/goal','/robot_2/move_base/result', move_base_msgs.msg.MoveBaseActionResult, '/robot_2/move_base/switch0/result')
00033 s0.add_action('robot_2/move_base/switch0','robot_2/move_base')
00034 s0.start()
00035
00036 mb1 = MotivationalBehavior('r2_mb1',2,1,'robot2_switch1_patrol/activate')
00037 mb1.set_fast(10)
00038 mb1.enable_random_inc()
00039 mb1.set_sensory_feedback(1)
00040 mb1.set_sensor('robot_2/patrol_sensory_feedback')
00041 mb1.start()
00042 s1 = Switch('robot2_switch1_patrol','robot_2/move_base/switch1/goal',move_base_msgs.msg.MoveBaseActionGoal,'robot_2/move_base/goal','/robot_2/move_base/result', move_base_msgs.msg.MoveBaseActionResult, '/robot_2/move_base/switch1/result')
00043 s1.add_action('robot_2/move_base/switch1','robot_2/move_base')
00044 s1.start()
00045
00046 mb2 = MotivationalBehavior('r2_mb2',2,2,'robot2_switch2_patrol/activate')
00047 mb2.set_fast(20)
00048 mb2.enable_random_inc()
00049 mb2.set_sensory_feedback(1)
00050 mb2.set_sensor('robot_2/patrol_sensory_feedback')
00051 mb2.start()
00052 s2 = Switch('robot2_switch2_patrol','robot_2/move_base/switch2/goal',move_base_msgs.msg.MoveBaseActionGoal,'robot_2/move_base/goal','/robot_2/move_base/result', move_base_msgs.msg.MoveBaseActionResult, '/robot_2/move_base/switch2/result')
00053 s2.add_action('robot_2/move_base/switch2','robot_2/move_base')
00054 s2.start()
00055
00056 rDetect = RobotDetect2()
00057 rDetect.start()
00058 bs4 = RobotFollow2()
00059 bs4.start()
00060 mb4 = MotivationalBehavior('r2_mb4',2,4,'robot2_switch_follow/activate')
00061 mb4.set_fast(110)
00062 mb4.set_sensor('robot_2/follow_sensory_feedback')
00063 mb4.start()
00064 ob7 = Switch('robot2_switch_follow','robot_2/cmd_vel/follow',Twist,'robot_2/cmd_vel')
00065 ob7.start()