<commit_before>import ctrl.bbb as ctrl

class Controller(ctrl.Controller):

    def __init__(self, *vargs, **kwargs):

        # Initialize controller
        super().__init__(*vargs, **kwargs)

    def __reset(self):

        # call super
        super().__reset()

        # add source: encoder1
        self.add_device('encoder1',
                        'ctrl.bbb.encoder', 'Encoder',
                        type = 'source',
                        outputs = ['encoder1'],
                        encoder = 2, 
                        ratio = 60 * 35.557)

        # add source: encoder2
        self.add_device('encoder2',
                        'ctrl.bbb.encoder', 'Encoder',
                        type = 'source',
                        outputs = ['encoder2'],
                        encoder = 1, 
                        ratio = 60 * 35.557)

        # add source: imu
        self.add_device('imu',
                        'ctrl.bbb.mpu6050', 'IMU',
                        type = 'source',
                        outputs = ['imu'])

        # add sink: motor1
        self.add_device('motor1', 
                        'ctrl.bbb.motor', 'Motor',
                        type = 'sink',
                        enable = True,
                        inputs = ['motor1'],
                        pwm_pin = 'P9_14',
                        dir_A = 'P9_12',
                        dir_B = 'P9_13',
                        enable_pin = 'P9_41') 

        # add sink: motor2
        self.add_device('motor2', 
                        'ctrl.bbb.motor', 'Motor',
                        type = 'sink',<commit_msg>Switched motor2 direction in mip.py<commit_after>import ctrl.bbb as ctrl

class Controller(ctrl.Controller):

    def __init__(self, *vargs, **kwargs):

        # Initialize controller
        super().__init__(*vargs, **kwargs)

    def __reset(self):

        # call super
        super().__reset()

        # add source: encoder1
        self.add_device('encoder1',
                        'ctrl.bbb.encoder', 'Encoder',
                        type = 'source',
                        outputs = ['encoder1'],
                        encoder = 2, 
                        ratio = 60 * 35.557)

        # add source: encoder2
        self.add_device('encoder2',
                        'ctrl.bbb.encoder', 'Encoder',
                        type = 'source',
                        outputs = ['encoder2'],
                        encoder = 1, 
                        ratio = - 60 * 35.557)

        # add source: imu
        self.add_device('imu',
                        'ctrl.bbb.mpu6050', 'IMU',
                        type = 'source',
                        outputs = ['imu'])

        # add sink: motor1
        self.add_device('motor1', 
                        'ctrl.bbb.motor', 'Motor',
                        type = 'sink',
                        enable = True,
                        inputs = ['motor1'],
                        pwm_pin = 'P9_14',
                        dir_A = 'P9_12',
                        dir_B = 'P9_13',
                        enable_pin = 'P9_41') 

        # add sink: motor2
        self.add_device('motor2', 
                        'ctrl.bbb.motor', 'Motor',
                        type = 'sink',
{'fraction_non_alphanumeric': 0.11321909424724602, 'fraction_numerical': 0.026621787025703794, 'mean_word_length': 0.9812121212121212, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '599669', 'n_tokens_mistral': 947, 'n_tokens_neox': 810, 'n_words': 177}