Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CloneRepo.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
del ./src/
git init
git remote add origin https://github.com/FRC3236/DeepSpace.git
git fetch
git pull --rebase
git checkout -t origin/vision -b vision
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/CommandBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ public class CommandBase {
public static VisionRocket visionRocket = new VisionRocket();
public static OI controls = new OI();
public static DriveTrain drivetrain = new DriveTrain();
public static Elevator elevator = new Elevator();
public static Arm arm = new Arm();
}

195 changes: 96 additions & 99 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import edu.wpi.first.wpilibj.command.Scheduler;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import frc.robot.commands.ExampleCommand;
import frc.robot.commands.TeleopDefault;
import frc.robot.commands.TeleopTriggerControl;
import frc.robot.commands.TeleopEric;
import frc.robot.commands.TeleopVision;
import frc.robot.subsystems.ExampleSubsystem;

/**
Expand All @@ -25,113 +25,110 @@
* project.
*/
public class Robot extends TimedRobot {
public static ExampleSubsystem m_subsystem = new ExampleSubsystem();
public static CommandBase cmdBase;
public static TeleopDefault teleop;

Command m_autonomousCommand;
SendableChooser<Command> m_chooser = new SendableChooser<>();
public enum TeleopMode {
VISION, DEFAULT, ERIC
}

/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
@Override
public void robotInit() {
cmdBase = new CommandBase();
//CommandBase.drivetrain.InvertTalons();
teleop = new TeleopDefault();
m_chooser.setDefaultOption("Default Auto", new ExampleCommand());
// chooser.addOption("My Auto", new MyAutoCommand());
SmartDashboard.putData("Auto mode", m_chooser);
}
// Create a dropdown box for them all //
SendableChooser<TeleopMode> teleopChooser = new SendableChooser<TeleopMode>();

/**
* This function is called every robot packet, no matter the mode. Use
* this for items like diagnostics that you want ran during disabled,
* autonomous, teleoperated and test.
*
* <p>This runs after the mode specific periodic functions, but before
* LiveWindow and SmartDashboard integrated updating.
*/
@Override
public void robotPeriodic() {
}
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
@Override
public void robotInit() {

}

/**
* This function is called once each time the robot enters Disabled mode.
* You can use it to reset any subsystem information you want to clear when
* the robot is disabled.
*/
@Override
public void disabledInit() {
}
/**
* This function is called every robot packet, no matter the mode. Use
* this for items like diagnostics that you want ran during disabled,
* autonomous, teleoperated and test.
*
* <p>This runs after the mode specific periodic functions, but before
* LiveWindow and SmartDashboard integrated updating.
*/
@Override
public void robotPeriodic() {
}

@Override
public void disabledPeriodic() {
Scheduler.getInstance().run();
}
/**
* This function is called once each time the robot enters Disabled mode.
* You can use it to reset any subsystem information you want to clear when
* the robot is disabled.
*/
@Override
public void disabledInit() {
System.out.println("Disabled init");
// Load all of the teleop modes into the chooser //
teleopChooser.setDefaultOption("Default Teleop", TeleopMode.DEFAULT);
teleopChooser.addOption("Vision Tracking Testing", TeleopMode.VISION);
teleopChooser.addOption("Eric's Teleop Testing", TeleopMode.ERIC);

/**
* This autonomous (along with the chooser code above) shows how to select
* between different autonomous modes using the dashboard. The sendable
* chooser code works with the Java SmartDashboard. If you prefer the
* LabVIEW Dashboard, remove all of the chooser code and uncomment the
* getString code to get the auto name from the text box below the Gyro
*
* <p>You can add additional auto modes by adding additional commands to the
* chooser code above (like the commented example) or additional comparisons
* to the switch structure below with additional strings & commands.
*/
@Override
public void autonomousInit() {
m_autonomousCommand = m_chooser.getSelected();
// Add the chooser to the Shuffleboard //
SmartDashboard.putData("Teleop Mode", teleopChooser);
}

/*
* String autoSelected = SmartDashboard.getString("Auto Selector",
* "Default"); switch(autoSelected) { case "My Auto": autonomousCommand
* = new MyAutoCommand(); break; case "Default Auto": default:
* autonomousCommand = new ExampleCommand(); break; }
*/
@Override
public void disabledPeriodic() {
Scheduler.getInstance().run();
}

// schedule the autonomous command (example)
if (m_autonomousCommand != null) {
m_autonomousCommand.start();
}
}
/**
* This autonomous (along with the chooser code above) shows how to select
* between different autonomous modes using the dashboard. The sendable
* chooser code works with the Java SmartDashboard. If you prefer the
* LabVIEW Dashboard, remove all of the chooser code and uncomment the
* getString code to get the auto name from the text box below the Gyro
*
* <p>You can add additional auto modes by adding additional commands to the
* chooser code above (like the commented example) or additional comparisons
* to the switch structure below with additional strings & commands.
*/
@Override
public void autonomousInit() {

}

/**
* This function is called periodically during autonomous.
*/
@Override
public void autonomousPeriodic() {
Scheduler.getInstance().run();
}
/**
* This function is called periodically during autonomous.
*/
@Override
public void autonomousPeriodic() {
Scheduler.getInstance().run();
}

@Override
public void teleopInit() {
// This makes sure that the autonomous stops running when
// teleop starts running. If you want the autonomous to
// continue until interrupted by another command, remove
// this line or comment it out.
if (m_autonomousCommand != null) {
m_autonomousCommand.cancel();
}
teleop.start();
}
@Override
public void teleopInit() {
// Get what the teleop chooser says //
/*TeleopMode selectedMode = teleopChooser.getSelected();
if (selectedMode == TeleopMode.DEFAULT) {
(new TeleopDefault()).start();
} else if (selectedMode == TeleopMode.ERIC) {
(new TeleopEric()).start();
} else if (selectedMode == TeleopMode.VISION) {
(new TeleopVision()).start();
}
else{
new TeleopVision().start();
} */
new TeleopEric().start();
}

/**
* This function is called periodically during operator control.
*/
@Override
public void teleopPeriodic() {
Scheduler.getInstance().run();
}
/**
* This function is called periodically during operator control.
*/
@Override
public void teleopPeriodic() {
Scheduler.getInstance().run();
}

/**
* This function is called periodically during test mode.
*/
@Override
public void testPeriodic() {
}
/**
* This function is called periodically during test mode.
*/
@Override
public void testPeriodic() {
}
}
26 changes: 22 additions & 4 deletions src/main/java/frc/robot/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,28 @@ public class RobotMap {
public static int LEFTXBOX = 0;
public static int RIGHTXBOX = 1;

public static int LEFTTALONA = 0;
public static int LEFTTALONB = 1;
public static int RIGHTTALONA = 2;
public static int RIGHTTALONB = 3;
public static int LEFTVICTORA = 0;
public static int LEFTVICTORB = 1;
public static int RIGHTVICTORA = 2;
public static int RIGHTVICTORB = 3;


public static int ELEVATORTALON = 4;
public static int ELEVATORTALONENC = 5;

public static int HATCHLEVELONE = 500;
public static int HATCHLEVELTWO = 1200;
public static int HATCHLEVELTHREE = 3000;

public static int CARGOLEVELONE = 600;
public static int CARGOLEVELTWO = 1000;
public static int CARGOLEVELTHREE = 2200;
public static int CARGOLEVELSHIP = 3500;

public static final int INTAKE = 6;
public static final int ACTUATOR = 7;




// If you are using multiple modules, make sure to define both the port
Expand Down
48 changes: 0 additions & 48 deletions src/main/java/frc/robot/commands/ExampleCommand.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/TeleopDefault.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected void execute() {

CommandBase.visionRocket.GetContourPairs();

CommandBase.drivetrain.Drive(lateralSpeed - forwardSpeed, lateralSpeed + forwardSpeed);
CommandBase.drivetrain.drive(lateralSpeed - forwardSpeed, lateralSpeed + forwardSpeed);
}

// Make this return true when this Command no longer needs to run execute()
Expand Down
Loading