<commit_before>/**
 * Created by github.com/josephmjoy (mentor for FTC#12598 & FRC#1899) on 9/26/2017.
 */
package gjb.experimental;

import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DcMotorSimple;

import gjb.interfaces.LoggingInterface;
import gjb.interfaces.RuntimeSupportInterface;
import gjb.interfaces.SubSystemInterface;

public class SubSysMecDrive implements SubSystemInterface {
    final String THIS_COMPONENT = "S2MD"; // For "simple 2-motor drive"
    final public RuntimeSupportInterface rt;
    final public LoggingInterface log;
    final public Config config;

    public DcMotor leftDrive = null;
    public DcMotor rightDrive = null;
    public DcMotor fleftDrive = null;
    public DcMotor frightDrive = null;

    // Configuration parameters for this drive go here. Avoid hardcoded constants unless they are
    // unlikely to be changed even if there are changes to the drive details.
    public static class Config {
        public String leftMotorName;
        public String rightMotorName;
        public String fleftMotorName;
        public String frightMotorName;
        public boolean reverseMotors;

        public Config leftMotorName(String name) {
            this.leftMotorName = name;
            return this;
        }

        public Config rightMotorName(String name) {
            this.rightMotorName = name;
            return this;
        }
        public Config fleftMotorName(String name) {
            this.fleftMotorName = name;
            return this;
        }

        public Config frightMotorName(String name) {
            this.frightMotorName = name;
            return this;
        }

        public Config reverseMotors(boolean reverse) {
            this.reverseMotors = reverse;
            return this;
        }
    }

    public SubSysMecDrive(RuntimeSupportInterface rt, Config c) {
        this.rt = rt;
        this.log = rt.getRootLog().newLogger(THIS_COMPONENT); // Create a child log.
        config = c;
    }

    @Override
    public void init() {
        this.log.pri1(LoggingInterface.INIT_START, "");

        // Define and Initialize Motors
        leftDrive  = rt.hwLookup().getDcMotor("left_drive");
        rightDrive = rt.hwLookup().getDcMotor("right_drive");
        leftDrive.setDirection(DcMotor.Direction.FORWARD); // Set to REVERSE if using AndyMark motors
        rightDrive.setDirection(DcMotor.Direction.REVERSE);// Set to FORWARD if using AndyMark motors

        fleftDrive  = rt.hwLookup().getDcMotor("fleft_drive");
        frightDrive = rt.hwLookup().getDcMotor("fright_drive");
        fleftDrive.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors
        frightDrive.setDirection(DcMotor.Direction.REVERSE);// Set to FORWARD if using AndyMark motors

<commit_msg>Making sure wheels are going in right direction<commit_after>/**
 * Created by github.com/josephmjoy (mentor for FTC#12598 & FRC#1899) on 9/26/2017.
 */
package gjb.experimental;

import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DcMotorSimple;

import gjb.interfaces.LoggingInterface;
import gjb.interfaces.RuntimeSupportInterface;
import gjb.interfaces.SubSystemInterface;

public class SubSysMecDrive implements SubSystemInterface {
    final String THIS_COMPONENT = "S2MD"; // For "simple 2-motor drive"
    final public RuntimeSupportInterface rt;
    final public LoggingInterface log;
    final public Config config;

    public DcMotor leftDrive = null;
    public DcMotor rightDrive = null;
    public DcMotor fleftDrive = null;
    public DcMotor frightDrive = null;

    // Configuration parameters for this drive go here. Avoid hardcoded constants unless they are
    // unlikely to be changed even if there are changes to the drive details.
    public static class Config {
        public String leftMotorName;
        public String rightMotorName;
        public String fleftMotorName;
        public String frightMotorName;
        public boolean reverseMotors;

        public Config leftMotorName(String name) {
            this.leftMotorName = name;
            return this;
        }

        public Config rightMotorName(String name) {
            this.rightMotorName = name;
            return this;
        }
        public Config fleftMotorName(String name) {
            this.fleftMotorName = name;
            return this;
        }

        public Config frightMotorName(String name) {
            this.frightMotorName = name;
            return this;
        }

        public Config reverseMotors(boolean reverse) {
            this.reverseMotors = reverse;
            return this;
        }
    }

    public SubSysMecDrive(RuntimeSupportInterface rt, Config c) {
        this.rt = rt;
        this.log = rt.getRootLog().newLogger(THIS_COMPONENT); // Create a child log.
        config = c;
    }

    @Override
    public void init() {
        this.log.pri1(LoggingInterface.INIT_START, "");

        // Define and Initialize Motors
        leftDrive  = rt.hwLookup().getDcMotor("left_drive");
        rightDrive = rt.hwLookup().getDcMotor("right_drive");
        leftDrive.setDirection(DcMotor.Direction. FORWARD); // Set to REVERSE if using AndyMark motors, was FORWARD
        rightDrive.setDirection(DcMotor.Direction.REVERSE);// Set to FORWARD if using AndyMark motors, was REVERSE

        fleftDrive  = rt.hwLookup().getDcMotor("fleft_drive");
        frightDrive = rt.hwLookup().getDcMotor("fright_drive");
        fleftDrive.setDirection(DcMotor.Direction.FORWARD); // Set to REVERSE if using AndyMark motors, was REVERSE
        frightDrive.setDirection(DcMotor.Direction.REVERSE);// Set to FORWARD if using AndyMark motors, was FORWARD


{'fraction_non_alphanumeric': 0.0783289817232376, 'fraction_numerical': 0.006614447345517842, 'mean_word_length': 2.7482061317677755, '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': '7058613', 'n_tokens_mistral': 1787, 'n_tokens_neox': 1623, 'n_words': 440}