<commit_before>/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package com.edinarobotics.zed;


import com.edinarobotics.utils.commands.MaintainStateCommand;
import com.edinarobotics.utils.gamepad.Gamepad;
import com.edinarobotics.zed.commands.GamepadDriveCommand;
import com.edinarobotics.zed.subsystems.Drivetrain;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.command.Scheduler;

public class Zed extends IterativeRobot {
    
    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    public void robotInit() {
        Components.getInstance(); //Create all robot subsystems.
    }
    
    /**
     * This function is called once at the start of autonomous mode.
     */
    public void autonomousInit(){
        Drivetrain drivetrain = Components.getInstance().drivetrain;
        drivetrain.setDefaultCommand(new MaintainStateCommand(drivetrain));
    }

    /**
     * This function is called periodically during autonomous
     */
    public void autonomousPeriodic() {
        Scheduler.getInstance().run();
    }
    
    /**
     * This function is called once at the start of teleop mode.
     */
    public void teleopInit(){
        Drivetrain drivetrain = Components.getInstance().drivetrain;
        Gamepad driveGamepad = Controls.getInstance().gamepad1;
        drivetrain.setDefaultCommand(new GamepadDriveCommand(driveGamepad, drivetrain));
    }

    /**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() {
        Scheduler.getInstance().run();
    }
    
    /**
     * This function is called once at the start of test mode.
     */
    public void testInit(){
        Drivetrain drivetrain = Components.getInstance().drivetrain;
        Gamepad driveGamepad = Controls.getInstance().gamepad1;
        drivetrain.setDefaultCommand(new GamepadDriveCommand(driveGamepad, drivetrain));
    }
    
    /**
     * This function is called periodically during test mode
     */
    public void testPeriodic() {
        Scheduler.getInstance().run();
    }
    
}
<commit_msg>Add default command changing code for the drivetrain to Zed.<commit_after>/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package com.edinarobotics.zed;


import com.edinarobotics.utils.commands.MaintainStateCommand;
import com.edinarobotics.utils.gamepad.Gamepad;
import com.edinarobotics.zed.commands.GamepadDriveStrafeCommand;
import com.edinarobotics.zed.commands.GamepadDriveRotationCommand;
import com.edinarobotics.zed.subsystems.Drivetrain;
import com.edinarobotics.zed.subsystems.DrivetrainRotation;
import com.edinarobotics.zed.subsystems.DrivetrainStrafe;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.command.Scheduler;

public class Zed extends IterativeRobot {
    
    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    public void robotInit() {
        Components.getInstance(); //Create all robot subsystems.
    }
    
    /**
     * This function is called once at the start of autonomous mode.
     */
    public void autonomousInit(){
        DrivetrainStrafe drivetrainStrafe = Components.getInstance().drivetrainStrafe;
        drivetrainStrafe.setDefaultCommand(new MaintainStateCommand(drivetrainStrafe));
        DrivetrainRotation drivetrainRotation = Components.getInstance().drivetrainRotation;
        drivetrainRotation.setDefaultCommand(new MaintainStateCommand(drivetrainRotation));
    }

    /**
     * This function is called periodically during autonomous
     */
    public void autonomousPeriodic() {
        Scheduler.getInstance().run();
    }
    
    /**
     * This function is called once at the start of teleop mode.
     */
    public void teleopInit(){
        DrivetrainStrafe drivetrainStrafe = Components.getInstance().drivetrainStrafe;
        DrivetrainRotation drivetrainRotation = Components.getInstance().drivetrainRotation;
        Gamepad driveGamepad = Controls.getInstance().gamepad1;
        
        drivetrainStrafe.setDefaultCommand(new GamepadDriveStrafeCommand(driveGamepad, drivetrainStrafe));
        drivetrainRotation.setDefaultCommand(new GamepadDriveRotationCommand(driveGamepad, drivetrainRotation));
    }

    /**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() {
        Scheduler.getInstance().run();
    }
    
    /**
     * This function is called once at the start of test mode.
     */
    public void testInit(){
        DrivetrainStrafe drivetrainStrafe = Components.getInstance().drivetrainStrafe;
        DrivetrainRotation drivetrainRotation = Components.getInstance().drivetrainRotation;
        Gamepad driveGamepad = Controls.getInstance().gamepad1;
        
        drivetrainStrafe.setDefaultCommand(new GamepadDriveStrafeCommand(driveGamepad, drivetrainStrafe));
        drivetrainRotation.setDefaultCommand(new GamepadDriveRotationCommand(driveGamepad, drivetrainRotation));
    }
    
    /**
     * This function is called periodically during test mode
     */
    public void testPeriodic() {
        Scheduler.getInstance().run();
    }
    
}

{'fraction_non_alphanumeric': 0.13071045358478295, 'fraction_numerical': 0.0019509022923101934, 'mean_word_length': 2.3617486338797815, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2868527', 'n_tokens_mistral': 1653, 'n_tokens_neox': 1551, 'n_words': 398}