def __init__(self, waypoints_name, is_random, n_iterations):

        # Create the main state machine
        self.long_term_patrol_sm = WaypointPatrollerWithPulse(
            waypoints_name, is_random, n_iterations)

        # Create a logger
        logger = PatrollLogger("autonomous_patrolling")
        self.long_term_patrol_sm.set_logger(logger)

        # dynamic reconfiguration of battery tresholds
        self.srv = Server(PatrollerTresholdsConfig, self.reconfigure_callback)

        pass
class LongTermPatroller(object):
    """
    Constructor.
    :param waypoints_name: str, name of waypoints as appears in the datacentre
    :param is_random: bool, should the waypoints be visited in random order
    :param n_iterations: int, how many times to visit all the waypoints
    """
    def __init__(self, waypoints_name, is_random, n_iterations):
    
        # Create the main state machine
        self.long_term_patrol_sm = WaypointPatrollerWithPulse(waypoints_name,
                                                              is_random,
                                                              n_iterations)
        
        # Create a logger
        logger =  PatrollLogger("autonomous_patrolling")
        self.long_term_patrol_sm.set_logger(logger)
        
        # dynamic reconfiguration of battery tresholds
        self.srv = Server(PatrollerTresholdsConfig, self.reconfigure_callback)
    
        pass
        
    """ Dyanmic reconfigure callback for the battery tresholds """
    def reconfigure_callback(self, config, level):
        self.long_term_patrol_sm.set_patroller_thresholds(config.very_low_battery,
                                                        config.low_battery, 
                                                        config.charged_battery,
                                                        config.max_bumper_recovery_attempts,
                                                        config.max_move_base_recovery_attempts)
        #ParameterStore().CHARGED_BATTERY = config.charged_battery
        #ParameterStore().LOW_BATTERY = config.low_battery
        #ParameterStore().VERY_LOW_BATTERY = config.very_low_battery
        return config

    
    """ The Main start point for Long Term Patroller """
    def main(self):
        # Execute SMACH plan
        sis = smach_ros.IntrospectionServer('server_name',
                                            self.long_term_patrol_sm,
                                            '/SM_ROOT')
        sis.start()
        outcome = self.long_term_patrol_sm.execute()
    
        rospy.spin()
        sis.stop()
class LongTermPatroller(object):
    """
    Constructor.
    :param waypoints_name: str, name of waypoints as appears in the datacentre
    :param is_random: bool, should the waypoints be visited in random order
    :param n_iterations: int, how many times to visit all the waypoints
    """
    def __init__(self, waypoints_name, is_random, n_iterations):

        # Create the main state machine
        self.long_term_patrol_sm = WaypointPatrollerWithPulse(
            waypoints_name, is_random, n_iterations)

        # Create a logger
        logger = PatrollLogger("autonomous_patrolling")
        self.long_term_patrol_sm.set_logger(logger)

        # dynamic reconfiguration of battery tresholds
        self.srv = Server(PatrollerTresholdsConfig, self.reconfigure_callback)

        pass

    """ Dyanmic reconfigure callback for the battery tresholds """

    def reconfigure_callback(self, config, level):
        self.long_term_patrol_sm.set_patroller_thresholds(
            config.very_low_battery, config.low_battery,
            config.charged_battery, config.max_bumper_recovery_attempts,
            config.max_move_base_recovery_attempts)
        #ParameterStore().CHARGED_BATTERY = config.charged_battery
        #ParameterStore().LOW_BATTERY = config.low_battery
        #ParameterStore().VERY_LOW_BATTERY = config.very_low_battery
        return config

    """ The Main start point for Long Term Patroller """

    def main(self):
        # Execute SMACH plan
        sis = smach_ros.IntrospectionServer('server_name',
                                            self.long_term_patrol_sm,
                                            '/SM_ROOT')
        sis.start()
        outcome = self.long_term_patrol_sm.execute()

        rospy.spin()
        sis.stop()
 def __init__(self, waypoints_name, is_random, n_iterations):
 
     # Create the main state machine
     self.long_term_patrol_sm = WaypointPatrollerWithPulse(waypoints_name,
                                                           is_random,
                                                           n_iterations)
     
     # Create a logger
     logger =  PatrollLogger("autonomous_patrolling")
     self.long_term_patrol_sm.set_logger(logger)
     
     # dynamic reconfiguration of battery tresholds
     self.srv = Server(PatrollerTresholdsConfig, self.reconfigure_callback)
 
     pass