diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 97975eb..de1eda5 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -103,5 +103,16 @@ public final class Constants { public static final double TURN_FACTOR = 0.2; - public static final int BALL_VALUE = 2300; + + public static final int BALL_VALUE = 2050; + + //Panel Mech + public static final double PANEL_MECH_CREEP = 0.1; + public static final double PANEL_MECH_FAST = 0.5; + public static int PanelNum=2; + public static int SpinNum=0; + + //cameras + public static int camnum=0; + } \ No newline at end of file diff --git a/src/main/java/frc/robot/OI.java b/src/main/java/frc/robot/OI.java index f35b7f8..18444bf 100644 --- a/src/main/java/frc/robot/OI.java +++ b/src/main/java/frc/robot/OI.java @@ -3,6 +3,7 @@ import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj.buttons.Button; import edu.wpi.first.wpilibj.buttons.JoystickButton; + import frc.robot.Autons.ShooterGroupLong; import frc.robot.Autons.ShooterGroupWall; import frc.robot.Autons.Stop; @@ -14,7 +15,16 @@ import frc.robot.commands.Shooter.CloseHopperPiston; import frc.robot.commands.Shooter.LongShotHood; + import frc.robot.commands.Shooter.OpenHopperPiston; +import frc.robot.commands.Shooter.RetractHood; +import frc.robot.commands.Shooter.ExtendHood; +import frc.robot.commands.Shooter.MoveShooterWall; +import frc.robot.commands.Shooter.MoveShooterLong; +import frc.robot.commands.setCameraOne; +import frc.robot.commands.setCameraTwo; +import frc.robot.commands.setCameraThree; +import frc.robot.commands.Shooter.CheckHoodWall; // import frc.robot.commands.auto.SetLimit; import frc.robot.controller.AnalogButton; import frc.robot.controller.DPadButton; @@ -30,29 +40,29 @@ // import frc.robot.commands.CargoManipulator.ScoreInRocketCalculated; // import frc.robot.commands.CargoManipulator.ScoreInRocketDropper; // import frc.robot.commands.auto.AutoSetLifterPots; - // _____ - // | | - // | | | | - // |_____| - // ____ ___|_|___ ____ - // ()___) ()___) - // // /| |\ \\ - // // / | | \ \\ - // (___) |___________| (___) - // (___) (_______) (___) - // (___) (___) (___) - // (___) |_| (___) - // (___) ___/___\___ | | - // | | | | | | - // | | |___________| /___\ - // /___\ ||| ||| // \\ - // // \\ ||| ||| \\ // - // \\ // ||| ||| \\ // - // \\ // ()__) (__() - // /// \\\ - // /// \\\ - // _///___ ___\\\_ - // |_______| |_______| +// _____ +// | | +// | | | | +// |_____| +// ____ ___|_|___ ____ +// ()___) ()___) +// // /| |\ \\ +// // / | | \ \\ +// (___) |___________| (___) +// (___) (_______) (___) +// (___) (___) (___) +// (___) |_| (___) +// (___) ___/___\___ | | +// | | | | | | +// | | |___________| /___\ +// /___\ ||| ||| // \\ +// // \\ ||| ||| \\ // +// \\ // ||| ||| \\ // +// \\ // ()__) (__() +// /// \\\ +// /// \\\ +// _///___ ___\\\_ +// |_______| |_______| public class OI { public static Joystick driverStick; @@ -70,19 +80,22 @@ public class OI { private Button driverRX; protected Button operatorLeftJoystickUsed, operatorRightJoystickUsed, operatorDPadDown, operatorDPadLeft, operatorDPadRight; private Button operatorA, operatorB, operatorX, operatorY; + public OI() { driverStick = new Joystick(0); operatorStick = new Joystick(1); initButtons(); initUsed(); - driveButton.whileHeld(new DriveWithJoystick(driverStick, 0.1)); // TODO CHANGE DEADZONE VALUE IT MIGHT NOT BE THE SAME - - //LEAVE OUT driverStart.whileHeld(new ExtendBothLifters(.8,false,driverStick)); + driveButton.whileHeld(new DriveWithJoystick(driverStick, 0.1)); // TODO CHANGE DEADZONE VALUE IT MIGHT NOT BE + // THE SAME + + // LEAVE OUT driverStart.whileHeld(new ExtendBothLifters(.8,false,driverStick)); - //THESE TWO LINES ARE FOR TESTING - //LEAVE OUT driverA.whenPressed(new AutoSetLifterPots()); - //LEAVE OUT driverB.whenPressed(new ExtendBothLifters(.8,false,driverStick,false)); + // THESE TWO LINES ARE FOR TESTING + // LEAVE OUT driverA.whenPressed(new AutoSetLifterPots()); + // LEAVE OUT driverB.whenPressed(new + // ExtendBothLifters(.8,false,driverStick,false)); // driverA.whenPressed(new MoveShooter()); // driverA.whenReleased(new StopShooter()); @@ -100,12 +113,18 @@ public OI() { driverB.whenPressed(new OpenHopperPiston()); driverB.whenReleased(new CloseHopperPiston()); - + + driverX.whileHeld(new ExtendPanelMech()); + driverY.whileHeld(new SetPanelMech()); + + // driverRB.whenPressed(new ShooterGroupWall()); // driverRB.whenReleased(new StopShooterGroupWall()); // driverLB.whenReleased(new StopShooterGroupLong()); + // driverLB.whenPressed(new runHopperElevator()); + operatorDPadLeft.whenPressed(new ShooterGroupLong()); operatorDPadLeft.whenReleased(new Stop()); @@ -133,6 +152,7 @@ public OI() { + // driverLB.whenReleased(new stopHopperElevator()); // driverLS.whenPressed(new runElevatorShooter()); // driverLS.whenReleased(new stopElevatorShooter()); diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index fda2b89..63f68b3 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -29,6 +29,7 @@ public class Robot extends TimedRobot { // public static PanelMech panelMech; public static CameraServer Cam; public static CameraSwitch Cam_switch; + public static PanelMech panelMech; @Override public void robotInit() { @@ -36,7 +37,7 @@ public void robotInit() { shooter = new Shooter(); drivetrain = new Drivetrain(); manipulator = new Manipulator(); - // controlPan = new ControlPan(); + panelMech = new PanelMech(); pdp = new PowerDistributionPanel(RobotMap.kPDP); oi = new OI(); robotmap = new RobotMap(); @@ -81,6 +82,7 @@ public void teleopInit() { // autoCommand.cancel(); compressor.start(); System.out.println("This is init"); + } @@ -98,6 +100,7 @@ public void teleopPeriodic() { // Robot.drivetrain.setLeftTalon(.7); // Robot.drivetrain.setRightNeo(1); // 0.5 power is the sweet spot for wall, 0.8 for current at angle of 39 degrees + //Cam_switch.select(CameraSwitch.kcamera1); Scheduler.getInstance().run(); } @Override diff --git a/src/main/java/frc/robot/RobotMap.java b/src/main/java/frc/robot/RobotMap.java index 63df49a..79956e5 100644 --- a/src/main/java/frc/robot/RobotMap.java +++ b/src/main/java/frc/robot/RobotMap.java @@ -95,5 +95,7 @@ public class RobotMap { public static final int MANIPULATOR_SOLENOID = 6; public static final int MANIPULATOR_NEO = 40; public static final int MECHNECK = 50; - +//PanelMech +public static final int PANEL_NEO=50; +public static final int PANEL_SOLENOID=2; } diff --git a/src/main/java/frc/robot/commands/DefaultPanelMech.java b/src/main/java/frc/robot/commands/DefaultPanelMech.java new file mode 100644 index 0000000..39ed8e3 --- /dev/null +++ b/src/main/java/frc/robot/commands/DefaultPanelMech.java @@ -0,0 +1,43 @@ +package frc.robot.commands; +import frc.robot.Robot; +import edu.wpi.first.wpilibj.command.Command; + + +public class DefaultPanelMech extends Command { + public DefaultPanelMech() { + super("DefaultPanelMech"); + + requires(Robot.panelMech); + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + Robot.panelMech.extendPanelMech(false); + + } + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return false; + } + + // Called once after isFinished returns true + @Override + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/commands/ExtendPanelMech.java b/src/main/java/frc/robot/commands/ExtendPanelMech.java new file mode 100644 index 0000000..5f425a3 --- /dev/null +++ b/src/main/java/frc/robot/commands/ExtendPanelMech.java @@ -0,0 +1,55 @@ +package frc.robot.commands; +import frc.robot.Robot; +import edu.wpi.first.wpilibj.command.Command; +import frc.robot.Constants; + + + +public class ExtendPanelMech extends Command { + public ExtendPanelMech() { + super("ExtendPanelMech"); + + requires(Robot.panelMech); + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + Constants.SpinNum++; + if(Constants.SpinNum==2){ + Constants.SpinNum=0; + } + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + if(Constants.SpinNum==0){ + Robot.panelMech.extendPanelMech(true); + + } + else{ + Robot.panelMech.extendPanelMech(false); + } +} + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return false; + } + + // Called once after isFinished returns true + @Override + protected void end() { + Robot.panelMech.extendPanelMech(false); + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/commands/IntakeOff.java b/src/main/java/frc/robot/commands/IntakeOff.java new file mode 100644 index 0000000..84b7c2e --- /dev/null +++ b/src/main/java/frc/robot/commands/IntakeOff.java @@ -0,0 +1,46 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2018 FIRST. 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 frc.robot.commands; +import frc.robot.Constants; +import edu.wpi.first.wpilibj.command.Command; +import frc.robot.Robot; + +public class IntakeOff extends Command { + public IntakeOff() { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + Robot.manipulator.setManipulator(0); + } + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return false; + } + + // Called once after isFinished returns true + @Override + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } +} diff --git a/src/main/java/frc/robot/commands/IntakeOn.java b/src/main/java/frc/robot/commands/IntakeOn.java new file mode 100644 index 0000000..158e348 --- /dev/null +++ b/src/main/java/frc/robot/commands/IntakeOn.java @@ -0,0 +1,44 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2018 FIRST. 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 frc.robot.commands; + +import edu.wpi.first.wpilibj.command.Command; + +public class IntakeOn extends Command { + public IntakeOn() { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + } + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return false; + } + + // Called once after isFinished returns true + @Override + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } +} diff --git a/src/main/java/frc/robot/commands/SetPanelMech.java b/src/main/java/frc/robot/commands/SetPanelMech.java new file mode 100644 index 0000000..e509df1 --- /dev/null +++ b/src/main/java/frc/robot/commands/SetPanelMech.java @@ -0,0 +1,62 @@ +package frc.robot.commands; +import frc.robot.Robot; + +import edu.wpi.first.wpilibj.command.Command; +import frc.robot.Constants; +import frc.robot.util.Camera_Switch.CameraSwitch; + +public class SetPanelMech extends Command { + public SetPanelMech() { + super("SetPanelMech"); + + requires(Robot.panelMech); + + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + Constants.PanelNum++; + if(Constants.PanelNum==3){ + Constants.PanelNum=0; + } + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + if(Constants.PanelNum==1){ + Robot.panelMech.setPanelMech(Constants.PANEL_MECH_FAST); + } + else if(Constants.PanelNum==0){ + Robot.panelMech.setPanelMech(Constants.PANEL_MECH_CREEP); + } + else{ + Robot.panelMech.setPanelMech(0); + } + + + } + + + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return false; + } + + // Called once after isFinished returns true + @Override + protected void end() { + Robot.panelMech.setPanelMech(0); + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/commands/Shooter/ExtendHood.java b/src/main/java/frc/robot/commands/Shooter/ExtendHood.java new file mode 100644 index 0000000..9b71aa1 --- /dev/null +++ b/src/main/java/frc/robot/commands/Shooter/ExtendHood.java @@ -0,0 +1,44 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2018 FIRST. 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 frc.robot.commands.Shooter; + +import edu.wpi.first.wpilibj.command.Command; + +public class ExtendHood extends Command { + public ExtendHood() { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + } + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return false; + } + + // Called once after isFinished returns true + @Override + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } +} diff --git a/src/main/java/frc/robot/commands/Shooter/RetractHood.java b/src/main/java/frc/robot/commands/Shooter/RetractHood.java new file mode 100644 index 0000000..dd707df --- /dev/null +++ b/src/main/java/frc/robot/commands/Shooter/RetractHood.java @@ -0,0 +1,48 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2018 FIRST. 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 frc.robot.commands.Shooter; + +import edu.wpi.first.wpilibj.command.Command; +import frc.robot.Robot; + +public class RetractHood extends Command { + public RetractHood() { + super("RetractHood"); + requires(Robot.shooter); + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + Robot.shooter.setHood1(false); + } + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return false; + } + + // Called once after isFinished returns true + @Override + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } +} diff --git a/src/main/java/frc/robot/commands/StopPanelMech.java b/src/main/java/frc/robot/commands/StopPanelMech.java new file mode 100644 index 0000000..5a7d3d7 --- /dev/null +++ b/src/main/java/frc/robot/commands/StopPanelMech.java @@ -0,0 +1,50 @@ +package frc.robot.commands; +import frc.robot.Robot; + +import edu.wpi.first.wpilibj.command.Command; +import frc.robot.Constants; + +public class StopPanelMech extends Command { + public StopPanelMech() { + super("StopPanelMech"); + + requires(Robot.panelMech); + + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + Robot.panelMech.setPanelMech(0); + + + } + + + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return false; + } + + // Called once after isFinished returns true + @Override + protected void end() { + Robot.panelMech.setPanelMech(0); + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/commands/cycleCameras.java b/src/main/java/frc/robot/commands/cycleCameras.java new file mode 100644 index 0000000..1ca6528 --- /dev/null +++ b/src/main/java/frc/robot/commands/cycleCameras.java @@ -0,0 +1,60 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2018 FIRST. 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 frc.robot.commands; +// import frc.robot.Constants; +// import edu.wpi.first.wpilibj.command.Command; +// import frc.robot.util.Camera_Switch.CameraSwitch; +// import frc.robot.Robot; + +// public class cycleCameras extends Command { +// public cycleCameras() { +// } + +// // Called just before this Command runs the first time +// @Override +// protected void initialize() { +// Constants.camnum++; +// if(Constants.camnum==3){ +// Constants.camnum=0; +// } +// } + +// // Called repeatedly when this Command is scheduled to run +// @Override +// protected void execute() { +// if(Constants.camnum==0){ +// Robot.Cam_switch.select(CameraSwitch.kcamera1); + +// } +// else if(Constants.camnum==1){ +// Robot.Cam_switch.select(CameraSwitch.kcamera2); + +// } +// else{ +// Robot.Cam_switch.select(CameraSwitch.kcamera3); + +// } +// } + +// // Make this return true when this Command no longer needs to run execute() +// @Override +// protected boolean isFinished() { +// return false; +// } + +// // Called once after isFinished returns true +// @Override +// protected void end() { +// } + +// // Called when another command which requires one or more of the same +// // subsystems is scheduled to run +// @Override +// protected void interrupted() { +// } +// } diff --git a/src/main/java/frc/robot/commands/setCameraThree.java b/src/main/java/frc/robot/commands/setCameraThree.java new file mode 100644 index 0000000..aa5f350 --- /dev/null +++ b/src/main/java/frc/robot/commands/setCameraThree.java @@ -0,0 +1,48 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2018 FIRST. 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 frc.robot.commands; + +import edu.wpi.first.wpilibj.command.Command; +import frc.robot.Robot; +//import frc.robot.subsystems.Camera; +import frc.robot.util.Camera_Switch.CameraSwitch; + +public class setCameraThree extends Command { + public setCameraThree() { + // Use requires() here to declare subsystem dependencies + // eg. requires(chassis); + } + + // Called just before this Command runs the first time + @Override + protected void initialize() { + } + + // Called repeatedly when this Command is scheduled to run + @Override + protected void execute() { + Robot.Cam_switch.select(CameraSwitch.kcamera3); + } + + // Make this return true when this Command no longer needs to run execute() + @Override + protected boolean isFinished() { + return false; + } + + // Called once after isFinished returns true + @Override + protected void end() { + } + + // Called when another command which requires one or more of the same + // subsystems is scheduled to run + @Override + protected void interrupted() { + } +} diff --git a/src/main/java/frc/robot/subsystems/PanelMech.java b/src/main/java/frc/robot/subsystems/PanelMech.java index 05f63f9..4c00362 100644 --- a/src/main/java/frc/robot/subsystems/PanelMech.java +++ b/src/main/java/frc/robot/subsystems/PanelMech.java @@ -1,3 +1,4 @@ + /*----------------------------------------------------------------------------*/ /* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ @@ -5,6 +6,7 @@ /* the project. */ /*----------------------------------------------------------------------------*/ //IMPORTED FROM CLIMBER-MAAZ BRANCH!!! + package frc.robot.subsystems; import com.revrobotics.CANSparkMax; @@ -27,26 +29,36 @@ */ public class PanelMech extends Subsystem { private CANSparkMax panelMech_motor; - private Solenoid panelMech_soleinoid; + private Solenoid panelMech_solenoid; //private MoveShooterPassive defaultCommand; public PanelMech(){ panelMech_motor = new CANSparkMax(RobotMap.PANEL_NEO, MotorType.kBrushless); panelMech_motor.setOpenLoopRampRate(Constants.kNeoRampTime); panelMech_motor.set(0); - panelMech_soleinoid= new Solenoid(RobotMap.kPCM, RobotMap.PANEL_SOLENOID); + + panelMech_solenoid= new Solenoid(RobotMap.kPCM, RobotMap.PANEL_SOLENOID); } + + + protected void initDefaultCommand() { + + } + public void setPanelMech(final double velocity) { panelMech_motor.set(velocity); + } + public void extendPanelMech(boolean extend) { - panelMech_soleinoid.set(extend); + panelMech_solenoid.set(extend); + } - @Override - protected void initDefaultCommand() { - + + public boolean getRetracted(){ + return panelMech_solenoid.get(); } - + public void debug() { } } \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/Shooter.java b/src/main/java/frc/robot/subsystems/Shooter.java index 11a8f97..55f456a 100644 --- a/src/main/java/frc/robot/subsystems/Shooter.java +++ b/src/main/java/frc/robot/subsystems/Shooter.java @@ -18,12 +18,14 @@ import frc.robot.Robot; import frc.robot.RobotMap; +import edu.wpi.first.wpilibj.Timer; + // import frc.robot.commands.MoveShooterPassive; /** * Add your docs here. */ public class Shooter extends Subsystem { - + private Timer currentMonitorTimer; private CANSparkMax shooter_leader; private CANSparkMax shooter_follower; private Solenoid hood_1; @@ -32,6 +34,12 @@ public class Shooter extends Subsystem { public Shooter(){ + SmartDashboard.putNumber("Shooter kP", 0.000050); + SmartDashboard.putNumber("Shooter kF", 0.000165); + SmartDashboard.putNumber("Shooter max output", 0); + SmartDashboard.putNumber("Shooter setpoint (RPM)", 0); + SmartDashboard.putNumber("Shooter accelerator RPM", 0); + currentMonitorTimer = new Timer(); shooter_leader = new CANSparkMax(RobotMap.kShooterLeft, MotorType.kBrushless); shooter_follower = new CANSparkMax(RobotMap.kShooterRight, MotorType.kBrushless); shooter_leader.setOpenLoopRampRate(Constants.kNeoRampTime); diff --git a/src/main/java/frc/robot/util/Camera_Switch/CameraSwitch.java b/src/main/java/frc/robot/util/Camera_Switch/CameraSwitch.java index a9cadc4..9d8d34a 100644 --- a/src/main/java/frc/robot/util/Camera_Switch/CameraSwitch.java +++ b/src/main/java/frc/robot/util/Camera_Switch/CameraSwitch.java @@ -54,23 +54,27 @@ public void select(int camSelected){ switch (camSelected) { case kcamera1 : - // camrelay1.set(Value.kReverse); - // camrelay.set(Value.kForward); + camrelay1.set(Value.kReverse); + camrelay2.set(Value.kOff); + //camrelay.set(Value.kForward); break; case kcamera2 : - // camrelay1.set(Value.kForward); + camrelay1.set(Value.kForward); + camrelay2.set(Value.kOff); break; case kcamera3 : + camrelay1.set(Value.kOff); camrelay2.set(Value.kReverse); // camrelay.set(Value.kOn); case kcamera4 : + camrelay1.set(Value.kOff); camrelay2.set(Value.kForward); // camrelay.set(Value.kOff); break; default: - camrelay1.set(Value.kReverse); + // camrelay1.set(Value.kReverse); System.err.print("Camera not properly selected, setting to case 1,Camera1"); break; }//This switch statement is what actually writes to the relay port