5 from datetime
import time, timedelta, datetime
11 if __name__ ==
'__main__':
12 rospy.init_node(
"marathon_routine")
18 now = datetime.now(localtz).time().replace(tzinfo=localtz)
22 start = time(8,00, tzinfo=localtz)
23 end = time(00,00, tzinfo=localtz)
26 idle_duration=rospy.Duration(5)
30 tour_duration_estimate = rospy.Duration(60 * 40 * 2)
33 idle_duration=idle_duration, tour_duration_estimate=tour_duration_estimate)
39 routine.random_nodes = routine.all_waypoints_except([
'WayPoint2',
'WayPoint3'])
44 ten_am = time(10,00, tzinfo=localtz)
45 two_pm = time(14,00, tzinfo=localtz)
47 thirty_mins = timedelta(minutes = 30)
48 sixty_mins = timedelta(minutes = 60)
49 ninety_mins = timedelta(minutes = 90)
53 routine.create_patrol_routine(waypoints=[
'WayPoint2',
'WayPoint3'], daily_start=start, daily_end=ten_am, repeat_delta=thirty_mins)
56 routine.create_patrol_routine(waypoints=routine.all_waypoints_except([
'WayPoint2',
'WayPoint3']), daily_start=ten_am, daily_end=two_pm, repeat_delta=sixty_mins)
59 routine.create_patrol_routine(waypoints=routine.all_waypoints(), daily_start=two_pm, daily_end=end, repeat_delta=ninety_mins)
63 scan_waypoints = [
'WayPoint2',
'WayPoint3']
64 routine.create_3d_scan_routine(waypoints=scan_waypoints, repeat_delta=timedelta(hours=1))
67 twitter_waypoints = [[
'WayPoint6',
'I hope everyone is working hard today #ERW14 #RobotMarathon'],
68 [
'WayPoint2',
'Knowledge is power for @UoBLibServices #ERW14 #RobotMarathon']]
70 routine.create_tweet_routine(twitter_waypoints)
74 rgbd_waypoints = [
'WayPoint2',
'WayPoint3']
75 routine.create_rgbd_record_routine(waypoints=rgbd_waypoints, duration=rospy.Duration(60), repeat_delta=timedelta(hours=2))
80 collections = [
'heads',
'metric_map_data',
'rosout_agg',
'robot_pose',
'task_events',
'scheduling_problems',
'ws_observations',
'monitored_nav_events',
'people_perception']
81 routine.message_store_entries_to_replicate(collections, db=db)
84 collections = [
'head_xtion_compressed_depth_libav',
'head_xtion_compressed_rgb_theora',
'head_xtion_compressed_rgb_compressed']
85 routine.message_store_entries_to_replicate(collections, db=db)
88 collections = [
'data',
'summary']
89 routine.message_store_entries_to_replicate(collections, db=db)
92 routine.start_routine()