5 from strands_executive_msgs
import task_utils
6 from strands_executive_msgs.msg
import Task
7 from strands_navigation_msgs.msg
import TopologicalMap
8 from mongodb_store_msgs.msg
import StringList
9 from mongodb_store.message_store
import MessageStoreProxy
11 from task_executor.task_routine
import delta_between
18 task = Task(start_node_id=waypoint_name, end_node_id=waypoint_name, action=
'simple_follow', max_duration=duration)
19 task_utils.add_int_argument(task, duration.secs)
22 def create_rgbd_record_task(waypoint_name, duration=rospy.Duration(30), camera=
'head_xtion', with_depth=
True, with_rgb=
True):
23 task = Task(start_node_id=waypoint_name, end_node_id=waypoint_name, action=
'record_camera', max_duration=duration)
24 task_utils.add_string_argument(task, camera)
25 task_utils.add_bool_argument(task, with_depth)
26 task_utils.add_bool_argument(task, with_rgb)
30 task = Task(start_node_id=waypoint_name, end_node_id=waypoint_name, action=
'ptu_pan_tilt_metric_map', max_duration=rospy.Duration(240))
31 task_utils.add_int_argument(task,
'-160')
32 task_utils.add_int_argument(task,
'20')
33 task_utils.add_int_argument(task,
'160')
34 task_utils.add_int_argument(task,
'-25')
35 task_utils.add_int_argument(task,
'25')
36 task_utils.add_int_argument(task,
'25')
40 task = Task(start_node_id=waypoint_name, end_node_id=waypoint_name, action=
'strands_image_tweets', max_duration=rospy.Duration(60))
42 task_utils.add_string_argument(task, tweet)
43 task_utils.add_bool_argument(task,
False)
44 task_utils.add_string_argument(task, image_topic)
51 task.max_duration = rospy.Duration(60 * 60 * 2)
52 task.action =
'move_mongodb_entries'
55 task_utils.add_string_argument(task, db)
58 collections = StringList(to_replicate)
59 msg_store = MessageStoreProxy()
60 object_id = msg_store.insert(collections)
61 task_utils.add_object_id_argument(task, object_id, StringList)
64 task_utils.add_duration_argument(task, rospy.Duration(60 * 60 *24))
67 task_utils.add_bool_argument(task, delete_after_move)
73 """ Creates a routine that mixes specific tasks with patrolling nodes."""
75 def __init__(self, daily_start, daily_end, tour_duration_estimate=None, idle_duration=rospy.Duration(5), charging_point =
'ChargingPoint'):
76 super(MarathonRoutine, self).
__init__(daily_start=daily_start, daily_end=daily_end, tour_duration_estimate=tour_duration_estimate, idle_duration=idle_duration, charging_point=charging_point)
80 If waypoints now supplied, use all waypoints.
86 self.
create_task_routine(tasks=tasks, daily_start=daily_start, daily_end=daily_end, repeat_delta=repeat_delta)
93 self.
create_task_routine(tasks=tasks, daily_start=daily_start, daily_end=daily_end, repeat_delta=repeat_delta)
95 def create_rgbd_record_routine(self, waypoints=None, duration=rospy.Duration(30), camera=
'head_xtion', with_depth=
True, with_rgb=
True, daily_start=
None, daily_end=
None, repeat_delta=
None):
98 tasks = [
create_rgbd_record_task(n, duration=duration, camera=camera, with_depth=with_depth, with_rgb=with_rgb)
for n
in waypoints ]
99 self.
create_task_routine(tasks=tasks, daily_start=daily_start, daily_end=daily_end, repeat_delta=repeat_delta)
102 def create_tweet_routine(self, twitter_waypoints, img_topic='/head_xtion/rgb/image_color', daily_start=None, daily_end=None, repeat_delta=None):
104 [[waypoint, tweet][waypoint, tweet]]
107 self.
create_task_routine(tasks=tasks, daily_start=daily_start, daily_end=daily_end, repeat_delta=repeat_delta)
117 PatrolRoutine.on_idle(self)
def create_mongodb_store_task
def create_3d_scan_task(waypoint_name)
def create_3d_scan_routine
def create_simple_follow_task
def add_night_task(self, task)
def create_rgbd_record_routine
def create_simple_follow_routine
def message_store_entries_to_replicate
def create_rgbd_record_task
def create_tweet_task(waypoint_name, tweet, image_topic)