/*----------------------------------------------------------------------------*/
/* 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();
    }
    
}

@@ -677,67 +677,258 @@
 rive
-Command;%0Aimport com.edinarobotics.zed.subsystems.Drivetrain
+StrafeCommand;%0Aimport com.edinarobotics.zed.commands.GamepadDriveRotationCommand;%0Aimport com.edinarobotics.zed.subsystems.Drivetrain;%0Aimport com.edinarobotics.zed.subsystems.DrivetrainRotation;%0Aimport com.edinarobotics.zed.subsystems.DrivetrainStrafe
 ;%0Aim
@@ -1435,32 +1435,38 @@
       Drivetrain
+Strafe
  drivetrain = Co
@@ -1452,32 +1452,38 @@
 trafe drivetrain
+Strafe
  = Components.ge
@@ -1496,32 +1496,38 @@
 nce().drivetrain
+Strafe
 ;%0A        drivet
@@ -1522,32 +1522,38 @@
       drivetrain
+Strafe
 .setDefaultComma
@@ -1582,32 +1582,223 @@
 mmand(drivetrain
+Strafe));%0A        DrivetrainRotation drivetrainRotation = Components.getInstance().drivetrainRotation;%0A        drivetrainRotation.setDefaultCommand(new MaintainStateCommand(drivetrainRotation
 ));%0A    %7D%0A%0A    /
@@ -2080,32 +2080,38 @@
       Drivetrain
+Strafe
  drivetrain = Co
@@ -2097,32 +2097,38 @@
 trafe drivetrain
+Strafe
  = Components.ge
@@ -2141,32 +2141,131 @@
 nce().drivetrain
+Strafe;%0A        DrivetrainRotation drivetrainRotation = Components.getInstance().drivetrainRotation
 ;%0A        Gamepa
@@ -2306,32 +2306,41 @@
 nce().gamepad1;%0A
+        %0A
         drivetra
@@ -2333,32 +2333,38 @@
       drivetrain
+Strafe
 .setDefaultComma
@@ -2374,32 +2374,38 @@
 new GamepadDrive
+Strafe
 Command(driveGam
@@ -2412,32 +2412,151 @@
 epad, drivetrain
+Strafe));%0A        drivetrainRotation.setDefaultCommand(new GamepadDriveRotationCommand(driveGamepad, drivetrainRotation
 ));%0A    %7D%0A%0A    /
@@ -2844,16 +2844,22 @@
 ivetrain
+Strafe
  drivetr
@@ -2861,16 +2861,22 @@
 ivetrain
+Strafe
  = Compo
@@ -2905,16 +2905,115 @@
 ivetrain
+Strafe;%0A        DrivetrainRotation drivetrainRotation = Components.getInstance().drivetrainRotation
 ;%0A      
@@ -3062,32 +3062,41 @@
 nce().gamepad1;%0A
+        %0A
         drivetra
@@ -3097,16 +3097,22 @@
 ivetrain
+Strafe
 .setDefa
@@ -3138,16 +3138,22 @@
 padDrive
+Strafe
 Command(
@@ -3176,16 +3176,135 @@
 ivetrain
+Strafe));%0A        drivetrainRotation.setDefaultCommand(new GamepadDriveRotationCommand(driveGamepad, drivetrainRotation
 ));%0A    

Add default command changing code for the drivetrain to Zed.