Exemplo n.º 1
0
 def __init__(self,
              data_container: Type[exoboot.Exo.DataContainer],
              acc_threshold_x: float = 0.2,
              time_out: float = 5,
              max_acc_y: float = 0.1,
              max_acc_z: float = 0.1,
              do_filter_accels=True,
              required_seconds_of_stillness=0,
              return_did_slip=False,
              start_active=False):
     '''Last working with 0.5, 0.2, 0.2, no filter.'''
     self.data_container = data_container
     self.acc_threshold_x = acc_threshold_x
     self.max_acc_y = max_acc_y
     self.max_acc_z = max_acc_z
     self.refractory_timer = util.DelayTimer(time_out, true_until=True)
     self.do_filter_accels = do_filter_accels
     self.return_did_slip = return_did_slip
     self.accel_x_filter = filters.Butterworth(
         N=2, Wn=0.01, btype='high')
     self.accel_y_filter = filters.Butterworth(
         N=2, Wn=0.01, btype='high')
     self.accel_z_filter = filters.Butterworth(
         N=2, Wn=0.01, btype='high')
     self.slip_detect_active = start_active
     print('slip_detect_active: ', self.slip_detect_active)
     self.shuffling_timer = util.DelayTimer(
         delay_time=required_seconds_of_stillness)
Exemplo n.º 2
0
 def __init__(self,
              exo_1: Type[exoboot.Exo],
              exo_2: Type[exoboot.Exo],
              acc_threshold_x: float = 0.2,  # 0.2
              time_out: float = 5,
              max_acc_y: float = 0.1,  # 0.1
              max_acc_z: float = 0.1,  # 0.1
              do_filter_accels=True,
              required_seconds_of_stillness=0,
              return_did_slip=False,
              start_active=False):
     self.exo_list = [exo_1, exo_2]
     self.acc_threshold_x = acc_threshold_x
     self.max_acc_y = max_acc_y
     self.max_acc_z = max_acc_z
     self.refractory_timer = util.DelayTimer(time_out, true_until=True)
     self.do_filter_accels = do_filter_accels
     self.return_did_slip = return_did_slip
     self.filter_list = [[
         filters.Butterworth(N=2, Wn=0.01, btype='high'),
         filters.Butterworth(N=2, Wn=0.01, btype='high'),
         filters.Butterworth(N=2, Wn=0.01, btype='high')],
         [filters.Butterworth(N=2, Wn=0.01, btype='high'),
          filters.Butterworth(N=2, Wn=0.01, btype='high'),
          filters.Butterworth(N=2, Wn=0.01, btype='high')]]
     self.slip_detect_active = start_active
     print('slip_detect_active: ', self.slip_detect_active)
     self.shuffling_timer = util.DelayTimer(
         delay_time=required_seconds_of_stillness,
         true_until=True)
     self.print_counter = 0
Exemplo n.º 3
0
 def __init__(self, height: float, gyro_filter: Type[filters.Filter], delay=0):
     self.height = height
     self.gyro_filter = gyro_filter
     self.gyro_history = deque([0, 0, 0], maxlen=3)
     self.delay = delay
     # self.timer_active = False
     self.timer = util.DelayTimer(delay_time=self.delay)
Exemplo n.º 4
0
    def __init__(
            self,
            exo: Exo,
            reel_in_mV: int = 1200,
            slack_cutoff: float = 1500,
            time_out: float = 0.3,
            Kp: int = 30,  # 50  150
            Ki: int = 300,  # 10   50
            Kd: int = 0,
            ff: int = 0):
        '''This controller uses voltage control to get to zero slack, checking for a cutoff..

        Arguments:
            exo: exo.Exo instance
            slack_cutoff: the amount of slack (in motor counts) for the controller to be completed
            time_out: defines maximum amount of time to reel in
        Returns:
            Bool describing whether reel in operation has completed.
         '''
        self.exo = exo
        super().update_controller_gains(Kp=Kp, Ki=Ki, Kd=Kd, ff=ff)
        self.slack_cutoff = slack_cutoff
        # set maximum time for controller
        self.delay_timer = util.DelayTimer(delay_time=time_out)
        self.reel_in_mV = reel_in_mV
Exemplo n.º 5
0
 def __init__(self,
              exo: Type[Exo],
              standing_controller: Type[controllers.Controller],
              slip_controller: Type[controllers.Controller],
              slip_recovery_time: float = 1.5):
     self.exo = exo
     self.standing_controller = standing_controller
     self.slip_controller = slip_controller
     self.slip_ctrl_timer = util.DelayTimer(delay_time=slip_recovery_time)
     self.controller_now = self.standing_controller
Exemplo n.º 6
0
 def __init__(self,
              exo: Exo,
              desired_slack: float = 7000,
              Kp: int = 100,
              Ki: int = 10,
              Kd: int = 0,
              ff: int = 0):
     '''This controller uses position control with low gains to reach the desired slack.'''
     self.exo = exo
     super().update_controller_gains(Kp=Kp, Ki=Ki, Kd=Kd, ff=ff)
     self.desired_slack = desired_slack
     # set maximum time for controller
     self.delay_timer = util.DelayTimer(delay_time=0.2)
Exemplo n.º 7
0
 def __init__(self,
              left_exo: Type[Exo],
              right_exo: Type[Exo],
              left_standing_controller: Type[controllers.Controller],
              right_standing_controller: Type[controllers.Controller],
              left_slip_controller: Type[controllers.Controller],
              right_slip_controller: Type[controllers.Controller],
              slip_recovery_time: float = 1.5):
     self.left_exo = left_exo
     self.right_exo = right_exo
     self.left_standing_controller = left_standing_controller
     self.right_standing_controller = left_standing_controller
     self.left_slip_controller = left_slip_controller
     self.right_slip_controller = right_slip_controller
     self.slip_ctrl_timer = util.DelayTimer(delay_time=slip_recovery_time)
     self.left_controller_now = self.left_standing_controller
     self.right_controller_now = self.right_standing_controller