def __init__(self, daily_start, daily_end, idle_duration=rospy.Duration(5), charging_point = 'ChargingPoint'):     
		RobotRoutine.__init__(self, daily_start, daily_end, idle_duration=idle_duration, charging_point=charging_point)
		self.node_names = set()  
		self.current_node = None
		self.closest_node = None      
		self.topological_map = None
		self.current_node_msg = None
		self.closest_node_msg = None
		self.random_nodes = []
		rospy.Subscriber('topological_map', TopologicalMap, self.map_callback)
		rospy.Subscriber('current_node', String, self.current_node_callback)
		rospy.Subscriber('closest_node', String, self.closest_node_callback)

		self._ignore_waypoints = [
			'ChargingPoint',
			'WayPoint0',
			'WayPoint1',
			'WayPoint2',
			'WayPoint11',
			'WayPoint9',
			'WayPoint10',
			'WayPoint12',
			'WayPoint14',
			'WayPoint13',
			'WayPoint3',
			'WayPoint4'
		]
Example #2
0
 def __init__(self, daily_start, daily_end, tour_duration_estimate=None):
     # super(PatrolRoutine, self).__init__(daily_start, daily_end)
     RobotRoutine.__init__(self,
                           daily_start,
                           daily_end,
                           idle_duration=rospy.Duration(5))
     self.node_names = []
     self.tour_duration_estimate = tour_duration_estimate
     rospy.Subscriber('topological_map', TopologicalMap, self.map_callback)
Example #3
0
    def __init__(self, start, end):
        RobotRoutine.__init__(self,
                              start,
                              end,
                              idle_duration=rospy.Duration(5))

        self.waypoint = 'WayPoint2'

        self.start = start
        self.end = end

        rospy.sleep(0.5)

if __name__ == '__main__':
    rospy.init_node("g4s_routine")

    # start and end times -- all times should be in local timezone
    localtz = tzlocal()

    #the timezone changed to CET for soem reason
    start = time(7,30, tzinfo=localtz)
    end = time(21,00, tzinfo=localtz)

    # how long to stand idle before doing something
    idle_duration=rospy.Duration(20)

    routine = RobotRoutine(daily_start=start, daily_end=end, 
        idle_duration=idle_duration)    


    wait_wps = ['WayPoint3', 'WayPoint4', 'WayPoint5', 'WayPoint9']#, 'ChargingPoint']#, 'WayPoint13']#, 'WayPoint12']
    wait_tasks = map(create_wait_task, wait_wps)
    
    metric_wps=['WayPoint13', 'WayPoint18', 'WayPoint9']
    metric_tasks=map(create_wait_task, metric_wps)
    
    
    # set tasks and start execution
    routine.create_task_routine(wait_tasks, repeat_delta=timedelta(seconds=(15 * 60)))
    routine.create_task_routine(metric_tasks, repeat_delta=timedelta(seconds=(60 * 60)))
    
    routine.runner.add_day_off('Saturday')
    routine.runner.add_day_off('Sunday')
 def __init__(self, daily_start, daily_end, tour_duration_estimate=None):
     # super(PatrolRoutine, self).__init__(daily_start, daily_end)        
     RobotRoutine.__init__(self, daily_start, daily_end, idle_duration=rospy.Duration(5))
     self.node_names = []
     self.tour_duration_estimate = tour_duration_estimate
     rospy.Subscriber('topological_map', TopologicalMap, self.map_callback)
Example #6
0
 def __init__(self, daily_start, daily_end, idle_duration=rospy.Duration(5), charging_point = 'ChargingPoint'):
     # super(PatrolRoutine, self).__init__(daily_start, daily_end)        
     RobotRoutine.__init__(self, daily_start, daily_end, idle_duration=idle_duration, charging_point=charging_point)
Example #7
0
 def __init__(self, daily_start, daily_end, idle_duration=rospy.Duration(5), charging_point = 'ChargingPoint'):
     # super(PatrolRoutine, self).__init__(daily_start, daily_end)        
     RobotRoutine.__init__(self, daily_start, daily_end, idle_duration=idle_duration, charging_point=charging_point)
 def __init__(self, daily_start, daily_end, idle_duration=rospy.Duration(5), charging_point = 'ChargingPoint'):     
     RobotRoutine.__init__(self, daily_start, daily_end, idle_duration=idle_duration, charging_point=charging_point)
     self.node_names = set()        
     self.topological_map = None
     rospy.Subscriber('topological_map', TopologicalMap, self.map_callback)
     self.random_nodes = []