From edc1467710d8941576ee0729c2f2205a91f587c8 Mon Sep 17 00:00:00 2001 From: Aarav Shah Date: Sat, 7 Mar 2020 14:24:10 -0700 Subject: [PATCH 01/20] halfed the feeback coefficient --- .../robot/commands/drive/DriveStraightToPositionMM.java | 4 ++-- .../robot/commands/drive/DriveStraightToPositionPID.java | 4 ++-- src/main/java/frc4388/robot/subsystems/Drive.java | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionMM.java b/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionMM.java index a2be80e..1ec57b0 100644 --- a/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionMM.java +++ b/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionMM.java @@ -33,9 +33,9 @@ public class DriveStraightToPositionMM extends CommandBase { m_pneumatics = subsystem2; try { if (m_pneumatics.m_isSpeedShiftHigh) { - m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_HIGH * 2; + m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_HIGH; } else { - m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW * 2; + m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW; } } catch (Exception e) { System.err.println("Error In Motion Magic Switch Gains."); diff --git a/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionPID.java b/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionPID.java index 337ff6d..b910380 100644 --- a/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionPID.java +++ b/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionPID.java @@ -31,9 +31,9 @@ public class DriveStraightToPositionPID extends CommandBase { m_pneumatics = subsystem2; try { if (m_pneumatics.m_isSpeedShiftHigh) { - m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_HIGH * 2; + m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_HIGH; } else { - m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW * 2; + m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW; } } catch (Exception e) { System.err.println("Error In Motion Magic Switch Gains."); diff --git a/src/main/java/frc4388/robot/subsystems/Drive.java b/src/main/java/frc4388/robot/subsystems/Drive.java index bf19e3f..a07f2ec 100644 --- a/src/main/java/frc4388/robot/subsystems/Drive.java +++ b/src/main/java/frc4388/robot/subsystems/Drive.java @@ -195,6 +195,8 @@ public class Drive extends SubsystemBase { m_rightFrontMotor.configSelectedFeedbackSensor(FeedbackDevice.SensorDifference, DriveConstants.PID_PRIMARY, DriveConstants.DRIVE_TIMEOUT_MS); + m_rightFrontMotor.configSelectedFeedbackCoefficient(0.5, DriveConstants.PID_PRIMARY, DriveConstants.DRIVE_TIMEOUT_MS); + /* * Configure the Pigeon IMU to the other Remote Slot available on the right * Talon @@ -826,6 +828,9 @@ public class Drive extends SubsystemBase { public void updateSmartDashboard() { try { + + + // SmartDashboard.putNumber("Pigeon Yaw", getGyroYaw()); // SmartDashboard.putNumber("Pigeon Pitch", getGyroPitch()); // SmartDashboard.putNumber("Pigeon Roll", getGyroRoll()); From 5484c2262b5622f646461bff0e28630a5661dffb Mon Sep 17 00:00:00 2001 From: Aarav Shah Date: Sat, 7 Mar 2020 14:50:46 -0700 Subject: [PATCH 02/20] haha --- .../java/frc4388/robot/subsystems/Drive.java | 26 ++++++++++++++----- .../frc4388/robot/subsystems/Shooter.java | 2 ++ .../frc4388/robot/subsystems/ShooterAim.java | 4 +++ .../frc4388/robot/subsystems/ShooterHood.java | 2 ++ 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/main/java/frc4388/robot/subsystems/Drive.java b/src/main/java/frc4388/robot/subsystems/Drive.java index a07f2ec..ab42034 100644 --- a/src/main/java/frc4388/robot/subsystems/Drive.java +++ b/src/main/java/frc4388/robot/subsystems/Drive.java @@ -709,6 +709,16 @@ public class Drive extends SubsystemBase { return meters * DriveConstants.INCHES_PER_METER; } + /** + * Converts a value in inches per second to miles per hour + * @param ips The value in inches per second to convert + * @return The value in miles per hour + */ + public double inchesPerSecondToMilesPerHour(double ips) { + double mph = ips * (3600) * (1/63360); + return mph; + } + public void setRightMotorGains(boolean isHighGear) { if (!isHighGear) { m_rightFrontMotor.selectProfileSlot(DriveConstants.SLOT_VELOCITY, DriveConstants.PID_PRIMARY); @@ -828,8 +838,6 @@ public class Drive extends SubsystemBase { public void updateSmartDashboard() { try { - - // SmartDashboard.putNumber("Pigeon Yaw", getGyroYaw()); // SmartDashboard.putNumber("Pigeon Pitch", getGyroPitch()); @@ -838,6 +846,14 @@ public class Drive extends SubsystemBase { SmartDashboard.putData("Pigeon Gyro", m_pigeonGyro); SmartDashboard.putData("Drive Train", m_driveTrain); + SmartDashboard.putNumber("Left Motor Position Raw", m_leftFrontMotor.getSensorCollection().getIntegratedSensorPosition()); + SmartDashboard.putNumber("Right Motor Position Raw", m_rightFrontMotor.getSensorCollection().getIntegratedSensorPosition()); + + SmartDashboard.putNumber("Average Motor Position Raw", m_rightFrontMotor.getSelectedSensorPosition(DriveConstants.PID_PRIMARY)); + + double avgSpeedMPH = inchesPerSecondToMilesPerHour(10 * ticksToInches(m_rightFrontMotor.getSelectedSensorVelocity(DriveConstants.PID_PRIMARY))); + + SmartDashboard.putNumber("Avg Speed MPH", avgSpeedMPH); //SmartDashboard.putNumber("Left Front Output", m_leftFrontMotor.get()); //SmartDashboard.putNumber("Right Front Output", m_rightFrontMotor.get()); @@ -852,8 +868,6 @@ public class Drive extends SubsystemBase { //SmartDashboard.putNumber("Left Back Motor Velocity Raw", m_leftBackMotor.getSelectedSensorVelocity()); //SmartDashboard.putNumber("Right Back Motor Velocity Raw", m_rightBackMotor.getSelectedSensorVelocity()); - //SmartDashboard.putNumber("Left Motor Position Raw", m_leftFrontMotor.getSelectedSensorPosition()); - //SmartDashboard.putNumber("Right Motor Position Raw", m_rightFrontMotor.getSelectedSensorPosition(0)); //SmartDashboard.putNumber("Right Motor Velocity Int Sensor", m_rightFrontMotor.getSensorCollection().getIntegratedSensorVelocity()); //SmartDashboard.putNumber("Left Motor Velocity Int Sensor", m_leftFrontMotor.getSensorCollection().getIntegratedSensorVelocity()); @@ -889,8 +903,8 @@ public class Drive extends SubsystemBase { //SmartDashboard.putString("Odometry Values Meters", getPose().toString()); //SmartDashboard.putNumber("Odometry Heading", getHeading()); - SmartDashboard.putNumber("Time Seconds", m_currentTimeSec); - SmartDashboard.putNumber("Delta Time", m_deltaTimeMs); + //SmartDashboard.putNumber("Time Seconds", m_currentTimeSec); + //SmartDashboard.putNumber("Delta Time", m_deltaTimeMs); if (m_currentSong != m_songChooser.getSelected()){ m_currentSong = m_songChooser.getSelected(); diff --git a/src/main/java/frc4388/robot/subsystems/Shooter.java b/src/main/java/frc4388/robot/subsystems/Shooter.java index d8bb022..c2186f0 100644 --- a/src/main/java/frc4388/robot/subsystems/Shooter.java +++ b/src/main/java/frc4388/robot/subsystems/Shooter.java @@ -91,6 +91,8 @@ public class Shooter extends SubsystemBase { SmartDashboard.putNumber("Shooter Current", m_shooterFalcon.getSupplyCurrent()); + SmartDashboard.putBoolean("Drum Ready", m_isDrumReady); + //SmartDashboard.putNumber("Hood Position", m_shooter.getAnglePosition()); } diff --git a/src/main/java/frc4388/robot/subsystems/ShooterAim.java b/src/main/java/frc4388/robot/subsystems/ShooterAim.java index a34d59f..6433d52 100644 --- a/src/main/java/frc4388/robot/subsystems/ShooterAim.java +++ b/src/main/java/frc4388/robot/subsystems/ShooterAim.java @@ -17,6 +17,7 @@ import com.revrobotics.CANSparkMax.SoftLimitDirection; import com.revrobotics.CANSparkMaxLowLevel.MotorType; import com.revrobotics.ControlType; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc4388.robot.Constants.ShooterConstants; import frc4388.utility.Gains; @@ -57,6 +58,9 @@ public class ShooterAim extends SubsystemBase { @Override public void periodic() { // This method will be called once per scheduler run + SmartDashboard.putNumber("Turret Angle Raw", getShooterRotatePosition()); + + SmartDashboard.putBoolean("Aim Ready", m_isAimReady); } /** diff --git a/src/main/java/frc4388/robot/subsystems/ShooterHood.java b/src/main/java/frc4388/robot/subsystems/ShooterHood.java index c177c38..1cb3b9b 100644 --- a/src/main/java/frc4388/robot/subsystems/ShooterHood.java +++ b/src/main/java/frc4388/robot/subsystems/ShooterHood.java @@ -58,6 +58,8 @@ public class ShooterHood extends SubsystemBase { public void periodic() { // This method will be called once per scheduler run SmartDashboard.putNumber("Fire Angle CSV", m_fireAngle); + + SmartDashboard.putNumber("Hood Angle Raw", getAnglePosition()); } /** From 74f60f0e853bb54f22c214740c79f655fcac3be9 Mon Sep 17 00:00:00 2001 From: Aarav Shah Date: Sat, 7 Mar 2020 15:24:25 -0700 Subject: [PATCH 03/20] Add Gyro for Turret Angle Co-Authored-By: Keenan D. Buckley --- .../frc4388/robot/subsystems/Shooter.java | 17 +++----- .../frc4388/robot/subsystems/ShooterAim.java | 40 +++++++++++++++++++ 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/src/main/java/frc4388/robot/subsystems/Shooter.java b/src/main/java/frc4388/robot/subsystems/Shooter.java index c2186f0..7ed9f10 100644 --- a/src/main/java/frc4388/robot/subsystems/Shooter.java +++ b/src/main/java/frc4388/robot/subsystems/Shooter.java @@ -83,21 +83,16 @@ public class Shooter extends SubsystemBase { public void periodic() { // This method will be called once per scheduler run try{ - SmartDashboard.putNumber("Drum Velocity", m_shooterFalcon.getSelectedSensorVelocity()); + SmartDashboard.putNumber("Drum Velocity", m_shooterFalcon.getSelectedSensorVelocity()); - SmartDashboard.putNumber("Drum Velocity CSV", m_fireVel); + SmartDashboard.putNumber("Drum Velocity CSV", m_fireVel); - SmartDashboard.putNumber("Shooter Temp C", m_shooterFalcon.getTemperature()); + SmartDashboard.putNumber("Shooter Temp C", m_shooterFalcon.getTemperature()); - SmartDashboard.putNumber("Shooter Current", m_shooterFalcon.getSupplyCurrent()); + SmartDashboard.putNumber("Shooter Current", m_shooterFalcon.getSupplyCurrent()); - SmartDashboard.putBoolean("Drum Ready", m_isDrumReady); - - //SmartDashboard.putNumber("Hood Position", m_shooter.getAnglePosition()); - } - - catch(Exception e) - { + SmartDashboard.putBoolean("Drum Ready", m_isDrumReady); + } catch(Exception e) { } } diff --git a/src/main/java/frc4388/robot/subsystems/ShooterAim.java b/src/main/java/frc4388/robot/subsystems/ShooterAim.java index 6433d52..3709d90 100644 --- a/src/main/java/frc4388/robot/subsystems/ShooterAim.java +++ b/src/main/java/frc4388/robot/subsystems/ShooterAim.java @@ -17,6 +17,7 @@ import com.revrobotics.CANSparkMax.SoftLimitDirection; import com.revrobotics.CANSparkMaxLowLevel.MotorType; import com.revrobotics.ControlType; +import edu.wpi.first.wpilibj.GyroBase; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc4388.robot.Constants.ShooterConstants; @@ -28,6 +29,7 @@ public class ShooterAim extends SubsystemBase { public CANSparkMax m_shooterRotateMotor = new CANSparkMax(ShooterConstants.SHOOTER_ROTATE_ID, MotorType.kBrushless); public static Gains m_shooterTurretGains = ShooterConstants.SHOOTER_TURRET_GAINS; CANDigitalInput m_shooterRightLimit, m_shooterLeftLimit; + public GyroBase m_turretGyro; public boolean m_isAimReady = false; @@ -42,6 +44,8 @@ public class ShooterAim extends SubsystemBase { //resetGyroShooterRotate(); m_shooterRotateMotor.setIdleMode(IdleMode.kBrake); + m_turretGyro = getGyroInterface(); + m_shooterLeftLimit = m_shooterRotateMotor.getReverseLimitSwitch(LimitSwitchPolarity.kNormallyOpen); m_shooterRightLimit = m_shooterRotateMotor.getForwardLimitSwitch(LimitSwitchPolarity.kNormallyOpen); m_shooterRightLimit.enableLimitSwitch(true); @@ -61,8 +65,44 @@ public class ShooterAim extends SubsystemBase { SmartDashboard.putNumber("Turret Angle Raw", getShooterRotatePosition()); SmartDashboard.putBoolean("Aim Ready", m_isAimReady); + + SmartDashboard.putData("Turret Angle", m_turretGyro); } + public GyroBase getGyroInterface() { + return new GyroBase(){ + + @Override + public void close() throws Exception { + // TODO Auto-generated method stub + + } + + @Override + public void reset() { + // TODO Auto-generated method stub + + } + + @Override + public double getRate() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public double getAngle() { + // TODO Auto-generated method stub + return getShooterRotatePosition(); + } + + @Override + public void calibrate() { + // TODO Auto-generated method stub + + } + }; + } /** * Passes subsystem needed. * @param subsystem Subsystem needed. From 7e760c1b556786b0e75084d7456b391fe255a2c4 Mon Sep 17 00:00:00 2001 From: "Keenan D. Buckley" Date: Sun, 8 Mar 2020 15:20:55 -0600 Subject: [PATCH 04/20] Add Conversion to degrees on Hood and Turret --- src/main/java/frc4388/robot/Constants.java | 4 + .../frc4388/robot/subsystems/ShooterAim.java | 76 ++++++++++--------- .../frc4388/robot/subsystems/ShooterHood.java | 6 +- 3 files changed, 50 insertions(+), 36 deletions(-) diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index 096f898..3da8fc8 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -138,12 +138,16 @@ public final class Constants { public static final int TURRET_LEFT_SOFT_LIMIT = -55; public static final double TURRET_SPEED_MULTIPLIER = 0.3; public static final double TURRET_CALIBRATE_SPEED = 0.075; + public static final double TURRET_MOTOR_ROTS_PER_ROT = 1; //TODO: Find + public static final double TURRET_MOTOR_POS_AT_ZERO_ROT = 0; //TODO: Find public static final int HOOD_UP_SOFT_LIMIT = 33; public static final int HOOD_DOWN_SOFT_LIMIT = 3; public static final double HOOD_CONVERT_SLOPE = 0.47; public static final double HOOD_CONVERT_B = 40.5; public static final double HOOD_CALIBRATE_SPEED = 0.2; + public static final double HOOD_MOTOR_ROTS_PER_ROT = 1; //TODO: Find + public static final double HOOD_MOTOR_POS_AT_ZERO_ROT = 0; //TODO: Find public static final double DRUM_RAMP_LIMIT = 1000; public static final double DRUM_VELOCITY_BOUND = 300; diff --git a/src/main/java/frc4388/robot/subsystems/ShooterAim.java b/src/main/java/frc4388/robot/subsystems/ShooterAim.java index 3709d90..ae3f5c5 100644 --- a/src/main/java/frc4388/robot/subsystems/ShooterAim.java +++ b/src/main/java/frc4388/robot/subsystems/ShooterAim.java @@ -69,40 +69,6 @@ public class ShooterAim extends SubsystemBase { SmartDashboard.putData("Turret Angle", m_turretGyro); } - public GyroBase getGyroInterface() { - return new GyroBase(){ - - @Override - public void close() throws Exception { - // TODO Auto-generated method stub - - } - - @Override - public void reset() { - // TODO Auto-generated method stub - - } - - @Override - public double getRate() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public double getAngle() { - // TODO Auto-generated method stub - return getShooterRotatePosition(); - } - - @Override - public void calibrate() { - // TODO Auto-generated method stub - - } - }; - } /** * Passes subsystem needed. * @param subsystem Subsystem needed. @@ -140,6 +106,46 @@ public class ShooterAim extends SubsystemBase { public double getShooterRotatePosition() { - return m_shooterRotateMotor.getEncoder().getPosition(); + return m_shooterRotateEncoder.getPosition(); + } + + public double getShooterRotatePositionDegrees() + { + return (m_shooterRotateEncoder.getPosition() - ShooterConstants.TURRET_MOTOR_POS_AT_ZERO_ROT) * 360/ShooterConstants.TURRET_MOTOR_ROTS_PER_ROT; + } + + public GyroBase getGyroInterface() { + return new GyroBase(){ + + @Override + public void close() throws Exception { + // TODO Auto-generated method stub + + } + + @Override + public void reset() { + // TODO Auto-generated method stub + + } + + @Override + public double getRate() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public double getAngle() { + // TODO Auto-generated method stub + return getShooterRotatePositionDegrees(); + } + + @Override + public void calibrate() { + // TODO Auto-generated method stub + + } + }; } } diff --git a/src/main/java/frc4388/robot/subsystems/ShooterHood.java b/src/main/java/frc4388/robot/subsystems/ShooterHood.java index 1cb3b9b..5cd3ac3 100644 --- a/src/main/java/frc4388/robot/subsystems/ShooterHood.java +++ b/src/main/java/frc4388/robot/subsystems/ShooterHood.java @@ -59,7 +59,7 @@ public class ShooterHood extends SubsystemBase { // This method will be called once per scheduler run SmartDashboard.putNumber("Fire Angle CSV", m_fireAngle); - SmartDashboard.putNumber("Hood Angle Raw", getAnglePosition()); + SmartDashboard.putNumber("Hood Angle Raw", getAnglePositionDegrees()); } /** @@ -95,4 +95,8 @@ public class ShooterHood extends SubsystemBase { public double getAnglePosition(){ return m_angleEncoder.getPosition(); } + + public double getAnglePositionDegrees(){ + return (m_angleEncoder.getPosition() - ShooterConstants.HOOD_MOTOR_POS_AT_ZERO_ROT) * 360/ShooterConstants.HOOD_MOTOR_ROTS_PER_ROT; + } } From 584ccd0a5bd19789d9859bf9405b934f236196d4 Mon Sep 17 00:00:00 2001 From: "Keenan D. Buckley" Date: Sun, 8 Mar 2020 15:23:13 -0600 Subject: [PATCH 05/20] Rotate Hood 0 degrees back 90 degrees --- src/main/java/frc4388/robot/subsystems/ShooterHood.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc4388/robot/subsystems/ShooterHood.java b/src/main/java/frc4388/robot/subsystems/ShooterHood.java index 5cd3ac3..6f3bda9 100644 --- a/src/main/java/frc4388/robot/subsystems/ShooterHood.java +++ b/src/main/java/frc4388/robot/subsystems/ShooterHood.java @@ -97,6 +97,6 @@ public class ShooterHood extends SubsystemBase { } public double getAnglePositionDegrees(){ - return (m_angleEncoder.getPosition() - ShooterConstants.HOOD_MOTOR_POS_AT_ZERO_ROT) * 360/ShooterConstants.HOOD_MOTOR_ROTS_PER_ROT; + return ((m_angleEncoder.getPosition() - ShooterConstants.HOOD_MOTOR_POS_AT_ZERO_ROT) * 360/ShooterConstants.HOOD_MOTOR_ROTS_PER_ROT) - 90; } } From ba715805d3767eeb91cdc362cf88f3364d1c8196 Mon Sep 17 00:00:00 2001 From: ryan123rudder <42309874+ryan123rudder@users.noreply.github.com> Date: Tue, 10 Mar 2020 18:36:16 -0600 Subject: [PATCH 06/20] Added driver station config stuff --- .../driverStation/GOAT DRIVERSTATION.json | 691 ++++++++++++++++++ .../themes/Ridgbotics/ridgeboticstheme.css | 9 + 2 files changed, 700 insertions(+) create mode 100644 src/main/deploy/driverStation/GOAT DRIVERSTATION.json create mode 100644 src/main/deploy/driverStation/themes/Ridgbotics/ridgeboticstheme.css diff --git a/src/main/deploy/driverStation/GOAT DRIVERSTATION.json b/src/main/deploy/driverStation/GOAT DRIVERSTATION.json new file mode 100644 index 0000000..d28b08f --- /dev/null +++ b/src/main/deploy/driverStation/GOAT DRIVERSTATION.json @@ -0,0 +1,691 @@ +{ + "tabPane": [ + { + "title": "SmartDashboard", + "autoPopulate": true, + "autoPopulatePrefix": "SmartDashboard/", + "widgetPane": { + "gridSize": 128.0, + "showGrid": true, + "hgap": 16.0, + "vgap": 16.0, + "tiles": { + "0,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Shooter Current", + "_title": "Shooter Current" + } + }, + "1,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Delta Time", + "_title": "Delta Time" + } + }, + "2,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Time Seconds", + "_title": "Time Seconds" + } + }, + "3,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Shooter Temp C", + "_title": "Shooter Temp C" + } + }, + "4,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Auto?", + "_title": "Auto?" + } + }, + "5,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Fire Angle CSV", + "_title": "Fire Angle CSV" + } + }, + "6,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Drum Velocity", + "_title": "Drum Velocity" + } + }, + "7,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Drum Velocity CSV", + "_title": "Drum Velocity CSV" + } + }, + "8,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/limelight_PipelineName", + "_title": "limelight_PipelineName" + } + }, + "9,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/limelight_Interface", + "_title": "limelight_Interface" + } + }, + "0,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/limelight_Stream", + "_title": "limelight_Stream" + } + }, + "1,1": { + "size": [ + 2, + 2 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///SmartDashboard/Pigeon Gyro", + "_title": "Pigeon Gyro", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "3,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Climber Safety", + "_title": "Climber Safety", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "4,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Rachet", + "_title": "Rachet", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "5,1": { + "size": [ + 3, + 2 + ], + "content": { + "_type": "Differential Drivebase", + "_source0": "network_table:///SmartDashboard/Drive Train", + "_title": "Drive Train", + "Wheels/Number of wheels": 4, + "Wheels/Wheel diameter": 80.0, + "Visuals/Show velocity vectors": true + } + }, + "8,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Gear Shift", + "_title": "Gear Shift", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + } + } + } + }, + { + "title": "LiveWindow", + "autoPopulate": true, + "autoPopulatePrefix": "LiveWindow/", + "widgetPane": { + "gridSize": 128.0, + "showGrid": true, + "hgap": 16.0, + "vgap": 16.0, + "tiles": { + "0,0": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Climber", + "_title": "Climber", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "2,0": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Ungrouped", + "_title": "Ungrouped", + "Layout/Label position": "BOTTOM", + "_children": [ + { + "_type": "Speed Controller", + "_source0": "network_table:///LiveWindow/Ungrouped/Talon FX [5]", + "_title": "Talon FX [5]", + "Visuals/Orientation": "HORIZONTAL" + }, + { + "_type": "Differential Drivebase", + "_source0": "network_table:///LiveWindow/Ungrouped/DifferentialDrive[1]", + "_title": "DifferentialDrive[1]", + "Wheels/Number of wheels": 4, + "Wheels/Wheel diameter": 80.0, + "Visuals/Show velocity vectors": true + }, + { + "_type": "Speed Controller", + "_source0": "network_table:///LiveWindow/Ungrouped/Talon FX [3]", + "_title": "Talon FX [3]", + "Visuals/Orientation": "HORIZONTAL" + }, + { + "_type": "Speed Controller", + "_source0": "network_table:///LiveWindow/Ungrouped/Spark[0]", + "_title": "Spark[0]", + "Visuals/Orientation": "HORIZONTAL" + }, + { + "_type": "Speed Controller", + "_source0": "network_table:///LiveWindow/Ungrouped/Talon FX [8]", + "_title": "Talon FX [8]", + "Visuals/Orientation": "HORIZONTAL" + }, + { + "_type": "Text View", + "_source0": "network_table:///LiveWindow/Ungrouped/Servo[4]/Value", + "_title": "Servo[4]/Value" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[3]/Value", + "_title": "DigitalInput[3]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[1]/Value", + "_title": "DigitalInput[1]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Text View", + "_source0": "network_table:///LiveWindow/Ungrouped/DoubleSolenoid[7,0]/Value", + "_title": "DoubleSolenoid[7,0]/Value" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[4]/Value", + "_title": "DigitalInput[4]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[2]/Value", + "_title": "DigitalInput[2]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Text View", + "_source0": "network_table:///LiveWindow/Ungrouped/DoubleSolenoid[7,3]/Value", + "_title": "DoubleSolenoid[7,3]/Value" + } + ] + } + }, + "4,0": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/LimeLight", + "_title": "LimeLight", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "6,0": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Leveler", + "_title": "Leveler", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "8,0": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Drive", + "_title": "Drive", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "0,4": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Intake", + "_title": "Intake", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "2,4": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/ShooterHood", + "_title": "ShooterHood", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "4,4": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/LED", + "_title": "LED", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "6,4": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Shooter", + "_title": "Shooter", + "Layout/Label position": "BOTTOM", + "_children": [ + { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/ShooterHood", + "_title": "LiveWindow/ShooterHood", + "Layout/Label position": "BOTTOM", + "_children": [] + }, + { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/ShooterAim", + "_title": "LiveWindow/ShooterAim", + "Layout/Label position": "BOTTOM", + "_children": [] + } + ] + } + }, + "8,4": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Camera", + "_title": "Camera", + "Layout/Label position": "BOTTOM", + "_children": [] + } + } + } + } + }, + { + "title": "Driver Station", + "autoPopulate": false, + "autoPopulatePrefix": "", + "widgetPane": { + "gridSize": 128.0, + "showGrid": true, + "hgap": 16.0, + "vgap": 16.0, + "tiles": { + "8,6": { + "size": [ + 2, + 2 + ], + "content": { + "_type": "Gyro", + "_title": "Gyro", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "8,8": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_title": "Boolean Box", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "9,8": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_title": "Boolean Box", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "8,5": { + "size": [ + 2, + 1 + ], + "content": { + "_type": "Simple Dial", + "_title": "Simple Dial", + "Range/Min": 0.0, + "Range/Max": 100.0, + "Visuals/Show value": true + } + }, + "6,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_title": "Boolean Box", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "4,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_title": "Boolean Box", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "5,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_title": "Boolean Box", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "7,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_title": "Boolean Box", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "8,0": { + "size": [ + 2, + 1 + ], + "content": { + "_type": "Simple Dial", + "_title": "Simple Dial", + "Range/Min": 0.0, + "Range/Max": 100.0, + "Visuals/Show value": true + } + }, + "0,0": { + "size": [ + 4, + 4 + ], + "content": { + "_type": "Camera Stream", + "_source0": "camera_server://front", + "_title": "front", + "Crosshair/Show crosshair": true, + "Crosshair/Crosshair color": "#FFFFFFFF", + "Controls/Show controls": true, + "Controls/Rotation": "NONE", + "compression": -1.0, + "fps": -1, + "imageWidth": 0, + "imageHeight": 0 + } + }, + "3,4": { + "size": [ + 5, + 5 + ], + "content": { + "_type": "Camera Stream", + "_source0": "camera_server://limelight", + "_title": "limelight", + "Crosshair/Show crosshair": true, + "Crosshair/Crosshair color": "#FFFFFFFF", + "Controls/Show controls": true, + "Controls/Rotation": "NONE", + "compression": -1.0, + "fps": -1, + "imageWidth": -1, + "imageHeight": -1 + } + }, + "8,4": { + "size": [ + 2, + 1 + ], + "content": { + "_type": "Simple Dial", + "_source0": "network_table:///SmartDashboard/Drum Velocity", + "_title": "SmartDashboard/Drum Velocity", + "Range/Min": 0.0, + "Range/Max": 20000.0, + "Visuals/Show value": true + } + }, + "7,1": { + "size": [ + 3, + 3 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///SmartDashboard/Pigeon Gyro", + "_title": "SmartDashboard/Pigeon Gyro", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "4,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Gear Shift", + "_title": "Gear Shift", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "5,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Rachet", + "_title": "Rachet", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "6,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Climber Safety", + "_title": "Climber Safety", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "4,1": { + "size": [ + 3, + 2 + ], + "content": { + "_type": "Differential Drivebase", + "_source0": "network_table:///SmartDashboard/Drive Train", + "_title": "SmartDashboard/Drive Train", + "Wheels/Number of wheels": 4, + "Wheels/Wheel diameter": 80.0, + "Visuals/Show velocity vectors": true + } + } + } + } + } + ], + "windowGeometry": { + "x": 47.20000076293945, + "y": 148.8000030517578, + "width": 1553.5999755859375, + "height": 1448.0 + } +} \ No newline at end of file diff --git a/src/main/deploy/driverStation/themes/Ridgbotics/ridgeboticstheme.css b/src/main/deploy/driverStation/themes/Ridgbotics/ridgeboticstheme.css new file mode 100644 index 0000000..cb762ec --- /dev/null +++ b/src/main/deploy/driverStation/themes/Ridgbotics/ridgeboticstheme.css @@ -0,0 +1,9 @@ +@import "/edu/wpi/first/shuffleboard/app/midnight.css"; + +.root{ + -swatch-100: #66FF66; + -swatch-200: #4DFF4D; + -swatch-300: #1AFF1A; + -swatch-400: #00CC00; + -swatch-500: #009900; +} \ No newline at end of file From 41597c99de0af470f7fe7e43dc62f17e671a654f Mon Sep 17 00:00:00 2001 From: "Keenan D. Buckley" Date: Tue, 10 Mar 2020 18:41:56 -0600 Subject: [PATCH 07/20] Shooter Aim Angles --- src/main/java/frc4388/robot/Constants.java | 2 +- .../java/frc4388/robot/RobotContainer.java | 2 +- .../robot/commands/shooter/TrackTarget.java | 1 + .../frc4388/robot/subsystems/ShooterAim.java | 36 ++++++++++++++++--- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index 3da8fc8..47e2c81 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -138,7 +138,7 @@ public final class Constants { public static final int TURRET_LEFT_SOFT_LIMIT = -55; public static final double TURRET_SPEED_MULTIPLIER = 0.3; public static final double TURRET_CALIBRATE_SPEED = 0.075; - public static final double TURRET_MOTOR_ROTS_PER_ROT = 1; //TODO: Find + public static final double TURRET_MOTOR_ROTS_PER_ROT = 89.56696; public static final double TURRET_MOTOR_POS_AT_ZERO_ROT = 0; //TODO: Find public static final int HOOD_UP_SOFT_LIMIT = 33; diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index bbe5ff6..91c05ab 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -100,7 +100,7 @@ public class RobotContainer { m_robotShooter.passRequiredSubsystem(m_robotShooterHood, m_robotShooterAim); m_robotShooterHood.passRequiredSubsystem(m_robotShooter); - m_robotShooterAim.passRequiredSubsystem(m_robotShooter); + m_robotShooterAim.passRequiredSubsystem(m_robotShooter, m_robotDrive); m_robotLeveler.passRequiredSubsystem(m_robotClimber); diff --git a/src/main/java/frc4388/robot/commands/shooter/TrackTarget.java b/src/main/java/frc4388/robot/commands/shooter/TrackTarget.java index 6d35f49..7e61550 100644 --- a/src/main/java/frc4388/robot/commands/shooter/TrackTarget.java +++ b/src/main/java/frc4388/robot/commands/shooter/TrackTarget.java @@ -103,6 +103,7 @@ public class TrackTarget extends CommandBase { m_shooter.m_fireVel = fireVel; m_shooterHood.m_fireAngle = fireAngle;// + m_shooter.shooterTrims.m_hoodTrim; + m_shooterAim.m_targetDistance = distance; } } diff --git a/src/main/java/frc4388/robot/subsystems/ShooterAim.java b/src/main/java/frc4388/robot/subsystems/ShooterAim.java index ae3f5c5..c1c4ebc 100644 --- a/src/main/java/frc4388/robot/subsystems/ShooterAim.java +++ b/src/main/java/frc4388/robot/subsystems/ShooterAim.java @@ -25,12 +25,15 @@ import frc4388.utility.Gains; public class ShooterAim extends SubsystemBase { public Shooter m_shooterSubsystem; + public Drive m_driveSubsystem; public CANSparkMax m_shooterRotateMotor = new CANSparkMax(ShooterConstants.SHOOTER_ROTATE_ID, MotorType.kBrushless); public static Gains m_shooterTurretGains = ShooterConstants.SHOOTER_TURRET_GAINS; CANDigitalInput m_shooterRightLimit, m_shooterLeftLimit; public GyroBase m_turretGyro; + public double m_targetDistance = 0; + public boolean m_isAimReady = false; // Configure PID Controllers @@ -73,8 +76,9 @@ public class ShooterAim extends SubsystemBase { * Passes subsystem needed. * @param subsystem Subsystem needed. */ - public void passRequiredSubsystem(Shooter subsystem) { - m_shooterSubsystem = subsystem; + public void passRequiredSubsystem(Shooter subsystem0, Drive subsystem1) { + m_shooterSubsystem = subsystem0; + m_driveSubsystem = subsystem1; } public void runShooterWithInput(double input) { @@ -109,11 +113,33 @@ public class ShooterAim extends SubsystemBase { return m_shooterRotateEncoder.getPosition(); } - public double getShooterRotatePositionDegrees() - { + public double getShooterAngleDegrees() { return (m_shooterRotateEncoder.getPosition() - ShooterConstants.TURRET_MOTOR_POS_AT_ZERO_ROT) * 360/ShooterConstants.TURRET_MOTOR_ROTS_PER_ROT; } + /** + * Gets the angle of the Shooter relative to the target. + */ + public double getTargetAngleDegrees() { + return m_driveSubsystem.getHeading() + getShooterAngleDegrees(); + } + + public double getTargetXDisplacement() { + return m_targetDistance * Math.cos(getTargetAngleDegrees()); + } + + public double getTargetYDisplacement() { + return m_targetDistance * Math.sin(getTargetAngleDegrees()); + } + + /** + * Gets the angle of the Shooter relative to the inner port. + * Use for tuning the Shooter Displacement + */ + public double getInnerPortAngleDegrees() { + return Math.atan( getTargetYDisplacement() / (getTargetXDisplacement() + 29.25) ); + } + public GyroBase getGyroInterface() { return new GyroBase(){ @@ -138,7 +164,7 @@ public class ShooterAim extends SubsystemBase { @Override public double getAngle() { // TODO Auto-generated method stub - return getShooterRotatePositionDegrees(); + return getShooterAngleDegrees(); } @Override From 8b554eb38d712bf3495f1e9cb8aadf0e03fc3fde Mon Sep 17 00:00:00 2001 From: ryan123rudder <42309874+ryan123rudder@users.noreply.github.com> Date: Tue, 10 Mar 2020 18:44:53 -0600 Subject: [PATCH 08/20] Added IDs --- src/main/java/frc4388/robot/Constants.java | 1 + src/main/java/frc4388/robot/RobotContainer.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index c20a589..4c0689a 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -215,5 +215,6 @@ public final class Constants { public static final class OIConstants { public static final int XBOX_DRIVER_ID = 0; public static final int XBOX_OPERATOR_ID = 1; + public static final int BUTTON_BOX_ID = 2; } } diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 1a0365e..955fc51 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -88,6 +88,7 @@ public class RobotContainer { /* Controllers */ private final XboxController m_driverXbox = new XboxController(OIConstants.XBOX_DRIVER_ID); private final XboxController m_operatorXbox = new XboxController(OIConstants.XBOX_OPERATOR_ID); + private final XboxController m_buttonBox = new XboxController(OIConstants. BUTTON_BOX_ID); /** From 6cc3e63b8648cf74c9b2d048137a58ae23aa3ec9 Mon Sep 17 00:00:00 2001 From: ryan123rudder <42309874+ryan123rudder@users.noreply.github.com> Date: Tue, 10 Mar 2020 18:47:22 -0600 Subject: [PATCH 09/20] fox --- src/main/java/frc4388/robot/Constants.java | 2 +- src/main/java/frc4388/robot/RobotContainer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index 4c0689a..9a1cf41 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -215,6 +215,6 @@ public final class Constants { public static final class OIConstants { public static final int XBOX_DRIVER_ID = 0; public static final int XBOX_OPERATOR_ID = 1; - public static final int BUTTON_BOX_ID = 2; + public static final int BUTTON_FOX_ID = 2; } } diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 955fc51..b7cbfee 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -88,7 +88,7 @@ public class RobotContainer { /* Controllers */ private final XboxController m_driverXbox = new XboxController(OIConstants.XBOX_DRIVER_ID); private final XboxController m_operatorXbox = new XboxController(OIConstants.XBOX_OPERATOR_ID); - private final XboxController m_buttonBox = new XboxController(OIConstants. BUTTON_BOX_ID); + private final XboxController m_buttonFox = new XboxController(OIConstants. BUTTON_FOX_ID); /** From 69657ace52217259c241173e2ce4d5d3d09d6409 Mon Sep 17 00:00:00 2001 From: ryan123rudder <42309874+ryan123rudder@users.noreply.github.com> Date: Tue, 10 Mar 2020 19:37:34 -0600 Subject: [PATCH 10/20] Added Storage Manual and ButtonFox.java --- .../java/frc4388/robot/RobotContainer.java | 50 +++++++++++++++++++ .../robot/commands/storage/ManageStorage.java | 11 +++- .../frc4388/utility/controller/ButtonFox.java | 20 ++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 src/main/java/frc4388/utility/controller/ButtonFox.java diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index b7cbfee..8e9854f 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -35,6 +35,7 @@ import frc4388.robot.commands.climber.RunClimberWithTriggers; import frc4388.robot.commands.climber.RunLevelerWithJoystick; import frc4388.robot.commands.drive.DriveStraightToPositionMM; import frc4388.robot.commands.drive.DriveWithJoystick; +import frc4388.robot.commands.drive.PlaySongDrive; import frc4388.robot.commands.drive.TurnDegrees; import frc4388.robot.commands.intake.RunIntakeWithTriggers; import frc4388.robot.commands.shooter.CalibrateShooter; @@ -56,6 +57,7 @@ import frc4388.robot.subsystems.Shooter; import frc4388.robot.subsystems.ShooterAim; import frc4388.robot.subsystems.ShooterHood; import frc4388.robot.subsystems.Storage; +import frc4388.utility.controller.ButtonFox; import frc4388.utility.controller.IHandController; import frc4388.utility.controller.XboxController; import frc4388.utility.controller.XboxTriggerButton; @@ -169,6 +171,9 @@ public class RobotContainer { new JoystickButton(getDriverJoystick(), XboxController.BACK_BUTTON) .whileHeld(new DisengageRachet(m_robotClimber)); + + + /* Operator Buttons */ // shoots until released new JoystickButton(getOperatorJoystick(), XboxController.RIGHT_BUMPER_BUTTON) @@ -235,6 +240,35 @@ public class RobotContainer { .whileHeld(new ShootPrepGroup(m_robotShooter, m_robotShooterAim, m_robotShooterHood, m_robotStorage), false) //.whenReleased(new ManageStorage(m_robotStorage, StorageMode.RESET)) .whenReleased(new InstantCommand(() -> m_robotLime.limeOff())); + + + + + /* Button Fox */ + // Storage Manual + new JoystickButton(getButtonFox(), ButtonFox.LEFT_SWITCH) + .whileHeld(new ManageStorage(m_robotStorage, StorageMode.MANUAL)) + .whenReleased(new ManageStorage(m_robotStorage, StorageMode.RESET)); + + // Meg + new JoystickButton(getButtonFox(), ButtonFox.MIDDLE_SWITCH) + .whileHeld(new PlaySongDrive(m_robotDrive)) + .whenReleased(new InterruptSubystem(m_robotDrive)); + + // Shooter Manual + new JoystickButton(getButtonFox(), ButtonFox.RIGHT_SWITCH) + .whileHeld(new PlaySongDrive(m_robotDrive)) + .whenReleased(new InterruptSubystem(m_robotDrive)); + + // Goal Shooter Position + new JoystickButton(getButtonFox(), ButtonFox.LEFT_BUTTON) + .whileHeld(new PlaySongDrive(m_robotDrive)) + .whenReleased(new InterruptSubystem(m_robotDrive)); + + // Trench Shooter Position + new JoystickButton(getButtonFox(), ButtonFox.RIGHT_BUTTON) + .whileHeld(new PlaySongDrive(m_robotDrive)) + .whenReleased(new InterruptSubystem(m_robotDrive)); } /** @@ -339,6 +373,11 @@ public class RobotContainer { return m_operatorXbox; } + public IHandController getButtonFoxObject() + { + return m_buttonFox; + } + /** * Gets the {@link edu.wpi.first.wpilibj.GenericHID#GenericHID(int) Generic HID} for the Operator Xbox Controller. * Generic HIDs/Joysticks can be used to set up JoystickButtons. @@ -358,4 +397,15 @@ public class RobotContainer { { return m_driverXbox.getJoyStick(); } + + /** + * Gets the {@link edu.wpi.first.wpilibj.GenericHID#GenericHID(int) Generic HID} for the Button Fox. + * Generic HIDs/Joysticks can be used to set up JoystickButtons. + * @return The IHandController interface for the Button Fox. + */ + public Joystick getButtonFox() + { + return m_buttonFox.getJoyStick(); + } + } diff --git a/src/main/java/frc4388/robot/commands/storage/ManageStorage.java b/src/main/java/frc4388/robot/commands/storage/ManageStorage.java index 68cfd71..5f3537c 100644 --- a/src/main/java/frc4388/robot/commands/storage/ManageStorage.java +++ b/src/main/java/frc4388/robot/commands/storage/ManageStorage.java @@ -27,7 +27,7 @@ public class ManageStorage extends CommandBase { /* Used for intaking a ball. Keeps track off when the 2nd ball in storage has moved */ boolean m_isStorageEmpty = true; - public enum StorageMode{IDLE, INTAKE, RESET}; + public enum StorageMode{IDLE, INTAKE, RESET, MANUAL}; StorageMode m_storageMode = StorageMode.IDLE; /** @@ -74,6 +74,8 @@ public class ManageStorage extends CommandBase { runIntake(); } else if (m_storageMode == StorageMode.RESET) { runReset(); + } else if (m_storageMode == StorageMode.MANUAL) { + runManual(); } } @@ -127,6 +129,13 @@ public class ManageStorage extends CommandBase { m_isStorageEmpty = !m_isBallInStorage; } + /** + * Switches Storage to Manual only + */ + private void runManual() { + m_storage.runStorage(0); + } + // Called once the command ends or is interrupted. @Override public void end(boolean interrupted) { diff --git a/src/main/java/frc4388/utility/controller/ButtonFox.java b/src/main/java/frc4388/utility/controller/ButtonFox.java new file mode 100644 index 0000000..5b4da00 --- /dev/null +++ b/src/main/java/frc4388/utility/controller/ButtonFox.java @@ -0,0 +1,20 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2018-2019 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 frc4388.utility.controller; + +/** + * button fox + * @author Ryan Manley + */ +public class ButtonFox { + public static final int RIGHT_SWITCH = 1; + public static final int MIDDLE_SWITCH = 2; + public static final int LEFT_SWITCH = 3; + public static final int RIGHT_BUTTON = 4; + public static final int LEFT_BUTTON = 5; +} From 713ab60c424e4c10b1b8c2fead19c9a4ca7d7f97 Mon Sep 17 00:00:00 2001 From: ryan123rudder <42309874+ryan123rudder@users.noreply.github.com> Date: Tue, 10 Mar 2020 20:14:28 -0600 Subject: [PATCH 11/20] Fixed Enums for Manual --- .../java/frc4388/robot/RobotContainer.java | 8 ++-- .../commands/shooter/ShooterGoalPosition.java | 40 +++++++++++++++++++ .../shooter/ShooterTrenchPosition.java | 40 +++++++++++++++++++ .../robot/commands/storage/ManageStorage.java | 29 ++++++-------- .../commands/storage/ManageStoragePID.java | 26 ++++++------ .../frc4388/robot/subsystems/Storage.java | 7 ++++ 6 files changed, 116 insertions(+), 34 deletions(-) create mode 100644 src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java create mode 100644 src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 8e9854f..1ba7be0 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -44,7 +44,6 @@ import frc4388.robot.commands.shooter.TrackTarget; import frc4388.robot.commands.shooter.TrimShooter; import frc4388.robot.commands.storage.ManageStorage; import frc4388.robot.commands.storage.StoragePrep; -import frc4388.robot.commands.storage.ManageStorage.StorageMode; import frc4388.robot.subsystems.Camera; import frc4388.robot.subsystems.Climber; import frc4388.robot.subsystems.Drive; @@ -57,6 +56,7 @@ import frc4388.robot.subsystems.Shooter; import frc4388.robot.subsystems.ShooterAim; import frc4388.robot.subsystems.ShooterHood; import frc4388.robot.subsystems.Storage; +import frc4388.robot.subsystems.Storage.StorageMode; import frc4388.utility.controller.ButtonFox; import frc4388.utility.controller.IHandController; import frc4388.utility.controller.XboxController; @@ -129,7 +129,7 @@ public class RobotContainer { m_robotLED.setDefaultCommand(new RunCommand(() -> m_robotLED.updateLED(), m_robotLED)); // runs the storage not //m_robotStorage.setDefaultCommand(new RunCommand(() -> m_robotStorage.runStorage(0), m_robotStorage)); - m_robotStorage.setDefaultCommand(new ManageStorage(m_robotStorage, StorageMode.IDLE)); + m_robotStorage.setDefaultCommand(new InstantCommand(() -> m_robotStorage.changeStorageMode(StorageMode.IDLE))); //m_robotLime.setDefaultCommand(new RunCommand(() -> m_robotLime.limeOff(), m_robotLime)); } @@ -247,8 +247,8 @@ public class RobotContainer { /* Button Fox */ // Storage Manual new JoystickButton(getButtonFox(), ButtonFox.LEFT_SWITCH) - .whileHeld(new ManageStorage(m_robotStorage, StorageMode.MANUAL)) - .whenReleased(new ManageStorage(m_robotStorage, StorageMode.RESET)); + .whenPressed(new InstantCommand(() -> m_robotStorage.changeStorageMode(StorageMode.MANUAL))) + .whenReleased(new InstantCommand(() -> m_robotStorage.changeStorageMode(StorageMode.RESET))); // Meg new JoystickButton(getButtonFox(), ButtonFox.MIDDLE_SWITCH) diff --git a/src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java b/src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java new file mode 100644 index 0000000..acf2366 --- /dev/null +++ b/src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java @@ -0,0 +1,40 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2019 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 frc4388.robot.commands.shooter; + +import edu.wpi.first.wpilibj2.command.CommandBase; + +public class ShooterGoalPosition extends CommandBase { + /** + * Creates a new ShooterGoalPosition. + */ + public ShooterGoalPosition() { + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() { + } + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java b/src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java new file mode 100644 index 0000000..f5408f2 --- /dev/null +++ b/src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java @@ -0,0 +1,40 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2019 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 frc4388.robot.commands.shooter; + +import edu.wpi.first.wpilibj2.command.CommandBase; + +public class ShooterTrenchPosition extends CommandBase { + /** + * Creates a new ShooterTrenchPosition. + */ + public ShooterTrenchPosition() { + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() { + } + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc4388/robot/commands/storage/ManageStorage.java b/src/main/java/frc4388/robot/commands/storage/ManageStorage.java index 5f3537c..8b55380 100644 --- a/src/main/java/frc4388/robot/commands/storage/ManageStorage.java +++ b/src/main/java/frc4388/robot/commands/storage/ManageStorage.java @@ -11,6 +11,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.CommandBase; import frc4388.robot.Constants.StorageConstants; import frc4388.robot.subsystems.Storage; +import frc4388.robot.subsystems.Storage.StorageMode; public class ManageStorage extends CommandBase { Storage m_storage; @@ -26,17 +27,13 @@ public class ManageStorage extends CommandBase { /* Used for intaking a ball. Keeps track off when the 2nd ball in storage has moved */ boolean m_isStorageEmpty = true; - - public enum StorageMode{IDLE, INTAKE, RESET, MANUAL}; - StorageMode m_storageMode = StorageMode.IDLE; /** * Creates a new ManageStorage. */ - public ManageStorage(Storage m_robotStorage, StorageMode storageMode) { + public ManageStorage(Storage m_robotStorage) { // Use addRequirements() here to declare subsystem dependencies. m_storage = m_robotStorage; - m_storageMode = storageMode; addRequirements(m_storage); } @@ -50,7 +47,7 @@ public class ManageStorage extends CommandBase { m_isStorageEmpty = !m_isBallInStorage; - if (m_storageMode == StorageMode.RESET) { + if (m_storage.m_storageMode == StorageMode.RESET) { m_resetStartTime = System.currentTimeMillis(); } } @@ -68,13 +65,13 @@ public class ManageStorage extends CommandBase { SmartDashboard.putBoolean("!Ball Storage!", m_isBallInStorage); SmartDashboard.putBoolean("!Ball Shooter!", m_isBallInShooter); - if (m_storageMode == StorageMode.IDLE) { + if (m_storage.m_storageMode == StorageMode.IDLE) { runIdle(); - } else if (m_storageMode == StorageMode.INTAKE) { + } else if (m_storage.m_storageMode == StorageMode.INTAKE) { runIntake(); - } else if (m_storageMode == StorageMode.RESET) { + } else if (m_storage.m_storageMode == StorageMode.RESET) { runReset(); - } else if (m_storageMode == StorageMode.MANUAL) { + } else if (m_storage.m_storageMode == StorageMode.MANUAL) { runManual(); } } @@ -93,10 +90,10 @@ public class ManageStorage extends CommandBase { } if (m_isStorageEmpty && m_isBallInStorage) { // If Ball moves into storage, set storage to full and swtich to idle mode m_isStorageEmpty = false; - m_storageMode = StorageMode.IDLE; + m_storage.changeStorageMode(StorageMode.IDLE); } } else { - m_storageMode = StorageMode.IDLE; + m_storage.changeStorageMode(StorageMode.IDLE); } } @@ -108,7 +105,7 @@ public class ManageStorage extends CommandBase { m_storage.runStorage(0); if (m_isBallInIntake) { - m_storageMode = StorageMode.INTAKE; + m_storage.changeStorageMode(StorageMode.INTAKE); } m_isStorageEmpty = !m_isBallInStorage; } @@ -122,9 +119,9 @@ public class ManageStorage extends CommandBase { m_storage.runStorage(-StorageConstants.STORAGE_SPEED); if (m_isBallInIntake) { - m_storageMode = StorageMode.INTAKE; + m_storage.changeStorageMode(StorageMode.INTAKE); } else if (m_resetStartTime + StorageConstants.STORAGE_TIMEOUT < System.currentTimeMillis()) { - m_storageMode = StorageMode.IDLE; + m_storage.changeStorageMode(StorageMode.IDLE); } m_isStorageEmpty = !m_isBallInStorage; } @@ -139,7 +136,7 @@ public class ManageStorage extends CommandBase { // Called once the command ends or is interrupted. @Override public void end(boolean interrupted) { - m_storageMode = StorageMode.RESET; + m_storage.changeStorageMode(StorageMode.RESET); } // Returns true when the command should end. diff --git a/src/main/java/frc4388/robot/commands/storage/ManageStoragePID.java b/src/main/java/frc4388/robot/commands/storage/ManageStoragePID.java index 6ed4fd3..97ff356 100644 --- a/src/main/java/frc4388/robot/commands/storage/ManageStoragePID.java +++ b/src/main/java/frc4388/robot/commands/storage/ManageStoragePID.java @@ -11,6 +11,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.CommandBase; import frc4388.robot.Constants.StorageConstants; import frc4388.robot.subsystems.Storage; +import frc4388.robot.subsystems.Storage.StorageMode; public class ManageStoragePID extends CommandBase { Storage m_storage; @@ -30,16 +31,13 @@ public class ManageStoragePID extends CommandBase { /* Used for intaking a ball. Keeps track off when the 2nd ball in storage has moved */ boolean m_isStorageEmpty = true; - public enum StorageMode{IDLE, INTAKE, RESET}; - StorageMode m_storageMode = StorageMode.IDLE; /** * Creates a new ManageStorage. */ - public ManageStoragePID(Storage m_robotStorage, StorageMode storageMode) { + public ManageStoragePID(Storage m_robotStorage) { // Use addRequirements() here to declare subsystem dependencies. m_storage = m_robotStorage; - m_storageMode = storageMode; addRequirements(m_storage); } @@ -55,7 +53,7 @@ public class ManageStoragePID extends CommandBase { m_intakeStartPos = m_storage.getEncoderPosInches(); - if (m_storageMode == StorageMode.RESET) { + if (m_storage.m_storageMode == StorageMode.RESET) { m_resetStartTime = System.currentTimeMillis(); } } @@ -73,11 +71,11 @@ public class ManageStoragePID extends CommandBase { SmartDashboard.putBoolean("!Ball Storage!", m_isBallInStorage); SmartDashboard.putBoolean("!Ball Shooter!", m_isBallInShooter); - if (m_storageMode == StorageMode.IDLE) { + if (m_storage.m_storageMode == StorageMode.IDLE) { runIdle(); - } else if (m_storageMode == StorageMode.INTAKE) { + } else if (m_storage.m_storageMode == StorageMode.INTAKE) { runIntake(); - } else if (m_storageMode == StorageMode.RESET) { + } else if (m_storage.m_storageMode == StorageMode.RESET) { runReset(); } } @@ -93,10 +91,10 @@ public class ManageStoragePID extends CommandBase { double error = (m_intakeStartPos + StorageConstants.STORAGE_FULL_BALL) - m_storage.getEncoderPosInches(); if (m_storage.getEncoderVel() == 0 && Math.abs(error) < 0.5) { - m_storageMode = StorageMode.IDLE; + m_storage.changeStorageMode(StorageMode.IDLE); } } else { - m_storageMode = StorageMode.IDLE; + m_storage.changeStorageMode(StorageMode.IDLE); } } @@ -108,7 +106,7 @@ public class ManageStoragePID extends CommandBase { m_storage.runStorage(0); if (m_isBallInIntake) { - m_storageMode = StorageMode.INTAKE; + m_storage.changeStorageMode(StorageMode.INTAKE); m_intakeStartPos = m_storage.getEncoderPosInches(); } m_isStorageEmpty = !m_isBallInStorage; @@ -123,10 +121,10 @@ public class ManageStoragePID extends CommandBase { m_storage.runStorage(-StorageConstants.STORAGE_SPEED); if (m_isBallInIntake) { - m_storageMode = StorageMode.INTAKE; + m_storage.changeStorageMode(StorageMode.INTAKE); m_intakeStartPos = m_storage.getEncoderPosInches(); } else if (m_resetStartTime + StorageConstants.STORAGE_TIMEOUT < System.currentTimeMillis()) { - m_storageMode = StorageMode.IDLE; + m_storage.changeStorageMode(StorageMode.IDLE); } m_isStorageEmpty = !m_isBallInStorage; } @@ -134,7 +132,7 @@ public class ManageStoragePID extends CommandBase { // Called once the command ends or is interrupted. @Override public void end(boolean interrupted) { - m_storageMode = StorageMode.RESET; + m_storage.changeStorageMode(StorageMode.RESET); } // Returns true when the command should end. diff --git a/src/main/java/frc4388/robot/subsystems/Storage.java b/src/main/java/frc4388/robot/subsystems/Storage.java index 403de25..98bc3b3 100644 --- a/src/main/java/frc4388/robot/subsystems/Storage.java +++ b/src/main/java/frc4388/robot/subsystems/Storage.java @@ -36,6 +36,9 @@ public class Storage extends SubsystemBase { public boolean m_isStorageReadyToFire = false; + public enum StorageMode{IDLE, INTAKE, RESET, MANUAL}; + public StorageMode m_storageMode = StorageMode.IDLE; + /** * Creates a new Storage. */ @@ -134,4 +137,8 @@ public class Storage extends SubsystemBase { public boolean getBeamIntake(){ return m_beamIntake.get(); } + + public void changeStorageMode(StorageMode storageMode){ + m_storageMode = storageMode; + } } From b55974b01c0f8680fcc1f29be5739b8527897ca1 Mon Sep 17 00:00:00 2001 From: ryan123rudder <42309874+ryan123rudder@users.noreply.github.com> Date: Tue, 10 Mar 2020 20:23:32 -0600 Subject: [PATCH 12/20] Added Goal and Trench Position Commands Untested --- src/main/java/frc4388/robot/RobotContainer.java | 14 ++++++++++---- .../commands/shooter/ShooterGoalPosition.java | 16 ++++++++++++++-- .../commands/shooter/ShooterTrenchPosition.java | 16 ++++++++++++++-- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 1ba7be0..3612c9d 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -40,6 +40,8 @@ import frc4388.robot.commands.drive.TurnDegrees; import frc4388.robot.commands.intake.RunIntakeWithTriggers; import frc4388.robot.commands.shooter.CalibrateShooter; import frc4388.robot.commands.shooter.ShootPrepGroup; +import frc4388.robot.commands.shooter.ShooterGoalPosition; +import frc4388.robot.commands.shooter.ShooterTrenchPosition; import frc4388.robot.commands.shooter.TrackTarget; import frc4388.robot.commands.shooter.TrimShooter; import frc4388.robot.commands.storage.ManageStorage; @@ -262,13 +264,17 @@ public class RobotContainer { // Goal Shooter Position new JoystickButton(getButtonFox(), ButtonFox.LEFT_BUTTON) - .whileHeld(new PlaySongDrive(m_robotDrive)) - .whenReleased(new InterruptSubystem(m_robotDrive)); + .whileHeld(new ShooterGoalPosition(m_robotShooter, m_robotShooterHood, m_robotShooterAim)) + .whenReleased(new InterruptSubystem(m_robotShooter)) + .whenReleased(new InterruptSubystem(m_robotShooterHood)) + .whenReleased(new InterruptSubystem(m_robotShooterAim)); // Trench Shooter Position new JoystickButton(getButtonFox(), ButtonFox.RIGHT_BUTTON) - .whileHeld(new PlaySongDrive(m_robotDrive)) - .whenReleased(new InterruptSubystem(m_robotDrive)); + .whileHeld(new ShooterTrenchPosition(m_robotShooter, m_robotShooterHood, m_robotShooterAim)) + .whenReleased(new InterruptSubystem(m_robotShooter)) + .whenReleased(new InterruptSubystem(m_robotShooterHood)) + .whenReleased(new InterruptSubystem(m_robotShooterAim)); } /** diff --git a/src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java b/src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java index acf2366..b750c66 100644 --- a/src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java +++ b/src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java @@ -8,13 +8,22 @@ package frc4388.robot.commands.shooter; import edu.wpi.first.wpilibj2.command.CommandBase; +import frc4388.robot.subsystems.Shooter; +import frc4388.robot.subsystems.ShooterAim; +import frc4388.robot.subsystems.ShooterHood; public class ShooterGoalPosition extends CommandBase { + Shooter m_shooter; + ShooterHood m_hood; + ShooterAim m_aim; /** * Creates a new ShooterGoalPosition. */ - public ShooterGoalPosition() { - // Use addRequirements() here to declare subsystem dependencies. + public ShooterGoalPosition(Shooter shooterSub, ShooterHood hoodSub, ShooterAim aimSub) { + m_shooter = shooterSub; + m_hood = hoodSub; + m_aim = aimSub; + addRequirements(m_shooter,m_hood,m_aim); } // Called when the command is initially scheduled. @@ -25,6 +34,9 @@ public class ShooterGoalPosition extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { + m_shooter.runDrumShooterVelocityPID(5000); + m_hood.runAngleAdjustPID(3); + m_aim.runshooterRotatePID(-26.5); } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java b/src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java index f5408f2..ba452b7 100644 --- a/src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java +++ b/src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java @@ -8,13 +8,22 @@ package frc4388.robot.commands.shooter; import edu.wpi.first.wpilibj2.command.CommandBase; +import frc4388.robot.subsystems.Shooter; +import frc4388.robot.subsystems.ShooterAim; +import frc4388.robot.subsystems.ShooterHood; public class ShooterTrenchPosition extends CommandBase { + Shooter m_shooter; + ShooterHood m_hood; + ShooterAim m_aim; /** * Creates a new ShooterTrenchPosition. */ - public ShooterTrenchPosition() { - // Use addRequirements() here to declare subsystem dependencies. + public ShooterTrenchPosition(Shooter shooterSub, ShooterHood hoodSub, ShooterAim aimSub) { + m_shooter = shooterSub; + m_hood = hoodSub; + m_aim = aimSub; + addRequirements(m_shooter,m_hood,m_aim); } // Called when the command is initially scheduled. @@ -25,6 +34,9 @@ public class ShooterTrenchPosition extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { + m_shooter.runDrumShooterVelocityPID(5000); + m_hood.runAngleAdjustPID(3); + m_aim.runshooterRotatePID(-26.5); } // Called once the command ends or is interrupted. From a1632fa6880ba84f9ddf4515c40c3ef3bb09247d Mon Sep 17 00:00:00 2001 From: "Keenan D. Buckley" Date: Wed, 11 Mar 2020 08:26:27 -0600 Subject: [PATCH 13/20] Tune Shooter and Work on DriverStation --- .../driverStation/GOAT DRIVERSTATION.json | 485 +++++++++++++++--- src/main/java/frc4388/robot/Constants.java | 2 +- .../shooter/ShooterVelocityControlPID.java | 23 +- .../frc4388/robot/subsystems/Shooter.java | 2 +- .../frc4388/robot/subsystems/ShooterAim.java | 2 - 5 files changed, 423 insertions(+), 91 deletions(-) diff --git a/src/main/deploy/driverStation/GOAT DRIVERSTATION.json b/src/main/deploy/driverStation/GOAT DRIVERSTATION.json index d28b08f..8fa33b4 100644 --- a/src/main/deploy/driverStation/GOAT DRIVERSTATION.json +++ b/src/main/deploy/driverStation/GOAT DRIVERSTATION.json @@ -198,6 +198,305 @@ "Colors/Color when true": "#7CFC00FF", "Colors/Color when false": "#8B0000FF" } + }, + "9,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Drum Ready", + "_title": "Drum Ready", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "0,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Shooter Beam", + "_title": "Shooter Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "3,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Upper Beam", + "_title": "Upper Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "4,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Turret Aimed", + "_title": "Turret Aimed", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "8,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Intake Beam", + "_title": "Intake Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "9,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Storage Beam", + "_title": "Storage Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "0,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Left Motor Position Raw", + "_title": "Left Motor Position Raw" + } + }, + "1,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Right Motor Position Raw", + "_title": "Right Motor Position Raw" + } + }, + "2,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Average Motor Position Raw", + "_title": "Average Motor Position Raw" + } + }, + "3,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Avg Speed MPH", + "_title": "Avg Speed MPH" + } + }, + "4,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Turret Angle Raw", + "_title": "Turret Angle Raw" + } + }, + "5,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Aim Ready", + "_title": "Aim Ready", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "6,3": { + "size": [ + 2, + 2 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///SmartDashboard/Turret Angle", + "_title": "Turret Angle", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "8,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Hood Angle Raw", + "_title": "Hood Angle Raw" + } + }, + "9,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/!Ball in Intake!", + "_title": "!Ball in Intake!", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "0,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/!Ball Storage!", + "_title": "!Ball Storage!", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "1,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/!Ball Shooter!", + "_title": "!Ball Shooter!", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "2,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Distance to Target", + "_title": "Distance to Target" + } + }, + "3,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Center Displacement", + "_title": "Center Displacement" + } + }, + "4,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Is Auto Start?", + "_title": "Is Auto Start?" + } + }, + "5,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Left Motor Pos Inches", + "_title": "Left Motor Pos Inches" + } + }, + "8,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Right Motor Pos Inches", + "_title": "Right Motor Pos Inches" + } + }, + "9,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Left Motor Pos Meters", + "_title": "Left Motor Pos Meters" + } + }, + "0,5": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Right Motor Pos Meters", + "_title": "Right Motor Pos Meters" + } + }, + "1,5": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Odometry Values Meters", + "_title": "Odometry Values Meters" + } } } } @@ -310,6 +609,34 @@ "_type": "Text View", "_source0": "network_table:///LiveWindow/Ungrouped/DoubleSolenoid[7,3]/Value", "_title": "DoubleSolenoid[7,3]/Value" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[13]/Value", + "_title": "DigitalInput[13]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[11]/Value", + "_title": "DigitalInput[11]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[14]/Value", + "_title": "DigitalInput[14]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[12]/Value", + "_title": "DigitalInput[12]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" } ] } @@ -460,30 +787,6 @@ "Visuals/Counter clockwise": false } }, - "8,8": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_title": "Boolean Box", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "9,8": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_title": "Boolean Box", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, "8,5": { "size": [ 2, @@ -497,54 +800,6 @@ "Visuals/Show value": true } }, - "6,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_title": "Boolean Box", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "4,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_title": "Boolean Box", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "5,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_title": "Boolean Box", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "7,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_title": "Boolean Box", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, "8,0": { "size": [ 2, @@ -677,15 +932,93 @@ "Wheels/Wheel diameter": 80.0, "Visuals/Show velocity vectors": true } + }, + "8,8": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Turret Aimed", + "_title": "/SmartDashboard/Turret Aimed", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "9,8": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Drum Ready", + "_title": "/SmartDashboard/Drum Ready", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "6,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Upper Beam", + "_title": "/SmartDashboard/Upper Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "5,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Storage Beam", + "_title": "/SmartDashboard/Storage Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "7,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Shooter Beam", + "_title": "/SmartDashboard/Shooter Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "4,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Intake Beam", + "_title": "/SmartDashboard/Intake Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } } } } } ], "windowGeometry": { - "x": 47.20000076293945, - "y": 148.8000030517578, - "width": 1553.5999755859375, - "height": 1448.0 + "x": -7.199999809265137, + "y": -7.199999809265137, + "width": 1550.4000244140625, + "height": 878.4000244140625 } } \ No newline at end of file diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index e3a6bcf..c6a8a3e 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -116,7 +116,7 @@ public final class Constants { public static final int SHOOTER_SLOT_IDX = 0; public static final int SHOOTER_PID_LOOP_IDX = 1; public static final int SHOOTER_TIMEOUT_MS = 30; - public static final Gains DRUM_SHOOTER_GAINS = new Gains(0.55, 0.0, 100, 0.0, 0, 1.0); + public static final Gains DRUM_SHOOTER_GAINS = new Gains(1.5, 0.0, 100, 0.055, 0, 1.0); public static final Gains SHOOTER_TURRET_GAINS = new Gains(0.0, 0.0, 0.0, 0.0, 0, 1.0); public static final Gains SHOOTER_ANGLE_GAINS = new Gains(0.05, 0.0, 0.0, 0.0, 0, 0.3); public static final double SHOOTER_TURRET_MIN = -1.0; diff --git a/src/main/java/frc4388/robot/commands/shooter/ShooterVelocityControlPID.java b/src/main/java/frc4388/robot/commands/shooter/ShooterVelocityControlPID.java index 75a6896..b3d3ac1 100644 --- a/src/main/java/frc4388/robot/commands/shooter/ShooterVelocityControlPID.java +++ b/src/main/java/frc4388/robot/commands/shooter/ShooterVelocityControlPID.java @@ -34,7 +34,18 @@ public class ShooterVelocityControlPID extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - m_shooter.runDrumShooterVelocityPID(m_shooter.addFireVel()); + //Tells whether the target velocity has been reached + m_actualVel = m_shooter.m_shooterFalcon.getSelectedSensorPosition(); + m_targetVel = m_shooter.addFireVel(); + double error = m_actualVel - m_targetVel; + if (Math.abs(error) < ShooterConstants.DRUM_VELOCITY_BOUND){ + m_shooter.m_isDrumReady = true; + m_shooter.runDrumShooterVelocityPID(m_targetVel); + } + else{ + m_shooter.m_isDrumReady = false; + m_shooter.runDrumShooterVelocityPID(m_targetVel); + } } // Called once the command ends or is interrupted. @@ -45,16 +56,6 @@ public class ShooterVelocityControlPID extends CommandBase { // Returns true when the command should end. @Override public boolean isFinished() { - //Tells whether the target velocity has been reached - double upperBound = m_targetVel + ShooterConstants.DRUM_VELOCITY_BOUND; - double lowerBound = m_targetVel - ShooterConstants.DRUM_VELOCITY_BOUND; - if (m_actualVel < upperBound && m_actualVel > lowerBound){ - m_shooter.m_isDrumReady = true; - } - else{ - m_shooter.m_isDrumReady = false; - } - return false; } } diff --git a/src/main/java/frc4388/robot/subsystems/Shooter.java b/src/main/java/frc4388/robot/subsystems/Shooter.java index 0351968..89e1bfb 100644 --- a/src/main/java/frc4388/robot/subsystems/Shooter.java +++ b/src/main/java/frc4388/robot/subsystems/Shooter.java @@ -54,7 +54,7 @@ public class Shooter extends SubsystemBase { m_shooterFalcon.setNeutralMode(NeutralMode.Coast); m_shooterFalcon.setInverted(true); m_shooterFalcon.configOpenloopRamp(1, ShooterConstants.SHOOTER_TIMEOUT_MS); - m_shooterFalcon.configClosedloopRamp(1.0, ShooterConstants.SHOOTER_TIMEOUT_MS); + //m_shooterFalcon.configClosedloopRamp(1.0, ShooterConstants.SHOOTER_TIMEOUT_MS); setShooterGains(); m_shooterFalcon.configPeakOutputReverse(0, ShooterConstants.SHOOTER_TIMEOUT_MS); diff --git a/src/main/java/frc4388/robot/subsystems/ShooterAim.java b/src/main/java/frc4388/robot/subsystems/ShooterAim.java index 4922509..db9d231 100644 --- a/src/main/java/frc4388/robot/subsystems/ShooterAim.java +++ b/src/main/java/frc4388/robot/subsystems/ShooterAim.java @@ -67,8 +67,6 @@ public class ShooterAim extends SubsystemBase { // This method will be called once per scheduler run SmartDashboard.putNumber("Turret Angle Raw", getShooterRotatePosition()); - SmartDashboard.putBoolean("Aim Ready", m_isAimReady); - SmartDashboard.putData("Turret Angle", m_turretGyro); SmartDashboard.putBoolean("Turret Aimed" , m_isAimReady); From db128a328a938186c55240b93ca53f442ab10ac7 Mon Sep 17 00:00:00 2001 From: ryan123rudder <42309874+ryan123rudder@users.noreply.github.com> Date: Wed, 11 Mar 2020 20:56:18 -0600 Subject: [PATCH 14/20] Added Hood with joy, full manual all programmed but not might not work --- .../java/frc4388/robot/RobotContainer.java | 36 +++++++------ .../commands/shooter/RunHoodWithJoystick.java | 54 +++++++++++++++++++ .../robot/commands/shooter/ShooterManual.java | 45 ++++++++++++++++ .../frc4388/robot/subsystems/ShooterHood.java | 5 ++ .../controller/JoystickManualButton.java | 53 ++++++++++++++++++ .../utility/controller/XboxController.java | 4 ++ 6 files changed, 181 insertions(+), 16 deletions(-) create mode 100644 src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java create mode 100644 src/main/java/frc4388/robot/commands/shooter/ShooterManual.java create mode 100644 src/main/java/frc4388/utility/controller/JoystickManualButton.java diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 3612c9d..cfd064b 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -39,9 +39,12 @@ import frc4388.robot.commands.drive.PlaySongDrive; import frc4388.robot.commands.drive.TurnDegrees; import frc4388.robot.commands.intake.RunIntakeWithTriggers; import frc4388.robot.commands.shooter.CalibrateShooter; +import frc4388.robot.commands.shooter.RunHoodWithJoystick; import frc4388.robot.commands.shooter.ShootPrepGroup; import frc4388.robot.commands.shooter.ShooterGoalPosition; +import frc4388.robot.commands.shooter.ShooterManual; import frc4388.robot.commands.shooter.ShooterTrenchPosition; +import frc4388.robot.commands.shooter.ShooterVelocityControlPID; import frc4388.robot.commands.shooter.TrackTarget; import frc4388.robot.commands.shooter.TrimShooter; import frc4388.robot.commands.storage.ManageStorage; @@ -61,6 +64,7 @@ import frc4388.robot.subsystems.Storage; import frc4388.robot.subsystems.Storage.StorageMode; import frc4388.utility.controller.ButtonFox; import frc4388.utility.controller.IHandController; +import frc4388.utility.controller.JoystickManualButton; import frc4388.utility.controller.XboxController; import frc4388.utility.controller.XboxTriggerButton; @@ -90,10 +94,12 @@ public class RobotContainer { private final LimeLight m_robotLime = new LimeLight(); /* Controllers */ - private final XboxController m_driverXbox = new XboxController(OIConstants.XBOX_DRIVER_ID); - private final XboxController m_operatorXbox = new XboxController(OIConstants.XBOX_OPERATOR_ID); - private final XboxController m_buttonFox = new XboxController(OIConstants. BUTTON_FOX_ID); + private static XboxController m_driverXbox = new XboxController(OIConstants.XBOX_DRIVER_ID); + private static XboxController m_operatorXbox = new XboxController(OIConstants.XBOX_OPERATOR_ID); + private static XboxController m_buttonFox = new XboxController(OIConstants. BUTTON_FOX_ID); + private static XboxController m_manualXbox = new XboxController(3); + public static boolean m_isShooterManual = false; /** * The container for the robot. Contains subsystems, OI devices, and commands. @@ -121,6 +127,8 @@ public class RobotContainer { m_robotIntake.setDefaultCommand(new RunIntakeWithTriggers(m_robotIntake, getOperatorController())); // runs the turret with joystick m_robotShooterAim.setDefaultCommand(new RunCommand(() -> m_robotShooterAim.runShooterWithInput(-m_operatorXbox.getLeftXAxis()), m_robotShooterAim)); + // runs the hood with joystick + m_robotShooterHood.setDefaultCommand(new RunHoodWithJoystick(m_robotShooterHood, getOperatorController())); // moves the drum not m_robotShooter.setDefaultCommand(new RunCommand(() -> m_robotShooter.runDrumShooterVelocityPID(1500), m_robotShooter)); // drives climber with input from triggers on the opperator controller @@ -226,23 +234,18 @@ public class RobotContainer { new JoystickButton(getOperatorJoystick(), XboxController.START_BUTTON) .whileHeld(new CalibrateShooter(m_robotShooter, m_robotShooterAim, m_robotShooterHood)); - //Prepares storage for intaking - //new XboxTriggerButton(m_operatorXbox, XboxTriggerButton.LEFT_TRIGGER) - //.whileHeld(new RunCommand(() -> m_robotStorage.runStorage(0.8))) - //.whenReleased(new RunCommand(() -> m_robotStorage.runStorage(0.0))); - //.whileHeld(new StorageIntake(m_robotIntake, m_robotStorage)); - - //Runs storage to outtake - //new XboxTriggerButton(m_operatorXbox, XboxTriggerButton.RIGHT_TRIGGER) - //.whileHeld(new RunCommand(() -> m_robotStorage.runStorage(-0.8))) - //.whenReleased(new RunCommand(() -> m_robotStorage.runStorage(0.0))); //Run drum - new JoystickButton(getOperatorJoystick(), XboxController.B_BUTTON) + new JoystickManualButton(getOperatorJoystick(), XboxController.B_BUTTON, false) .whileHeld(new ShootPrepGroup(m_robotShooter, m_robotShooterAim, m_robotShooterHood, m_robotStorage), false) //.whenReleased(new ManageStorage(m_robotStorage, StorageMode.RESET)) .whenReleased(new InstantCommand(() -> m_robotLime.limeOff())); + //Run drum manual + new JoystickManualButton(getOperatorJoystick(), XboxController.B_BUTTON, true) + .whileHeld(new RunCommand(() -> m_robotShooter.runDrumShooterVelocityPID(10000))) + .whenReleased(new RunCommand(() -> m_robotShooter.runDrumShooterVelocityPID(0))); + @@ -259,8 +262,8 @@ public class RobotContainer { // Shooter Manual new JoystickButton(getButtonFox(), ButtonFox.RIGHT_SWITCH) - .whileHeld(new PlaySongDrive(m_robotDrive)) - .whenReleased(new InterruptSubystem(m_robotDrive)); + .whileHeld(new ShooterManual(true)) + .whenReleased(new ShooterManual(false)); // Goal Shooter Position new JoystickButton(getButtonFox(), ButtonFox.LEFT_BUTTON) @@ -384,6 +387,7 @@ public class RobotContainer { return m_buttonFox; } + /** * Gets the {@link edu.wpi.first.wpilibj.GenericHID#GenericHID(int) Generic HID} for the Operator Xbox Controller. * Generic HIDs/Joysticks can be used to set up JoystickButtons. diff --git a/src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java b/src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java new file mode 100644 index 0000000..29ca105 --- /dev/null +++ b/src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java @@ -0,0 +1,54 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2019 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 frc4388.robot.commands.shooter; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc4388.robot.subsystems.Leveler; +import frc4388.robot.subsystems.ShooterHood; +import frc4388.utility.controller.IHandController; + +public class RunHoodWithJoystick extends CommandBase { + private ShooterHood m_hood; + private IHandController m_controller; + + /** + * Creates a new RunLevelerWithJoystick to control the leveler with an Xbox controller. + * @param subsystem pass the Hood subsystem from {@link frc4388.robot.RobotContainer#RobotContainer() RobotContainer} + * @param controller pass the Operator {@link frc4388.utility.controller.IHandController#getClass() IHandController} using the + * {@link frc4388.robot.RobotContainer#getOperatorJoystick() getOperatorJoystick()} method in + * {@link frc4388.robot.RobotContainer#RobotContainer() RobotContainer} + */ + public RunHoodWithJoystick(ShooterHood subsystem, IHandController controller) { + m_hood = subsystem; + m_controller = controller; + addRequirements(m_hood); + } + + // Called when the command is initially scheduled. + @Override + public void initialize() { + } + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + double input = m_controller.getRightXAxis(); + m_hood.runHood(input); + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc4388/robot/commands/shooter/ShooterManual.java b/src/main/java/frc4388/robot/commands/shooter/ShooterManual.java new file mode 100644 index 0000000..2017ff4 --- /dev/null +++ b/src/main/java/frc4388/robot/commands/shooter/ShooterManual.java @@ -0,0 +1,45 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2019 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 frc4388.robot.commands.shooter; + +import edu.wpi.first.wpilibj.XboxController; +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc4388.robot.RobotContainer; + +public class ShooterManual extends CommandBase { + public boolean isManual = false; + /** + * Creates a new ShooterManual. + */ + public ShooterManual(boolean man) { + isManual = man; + } + + // Called when the command is initially scheduled. + @Override + public void initialize() { + } + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + RobotContainer.m_isShooterManual = isManual; + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + RobotContainer.m_isShooterManual = isManual; + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc4388/robot/subsystems/ShooterHood.java b/src/main/java/frc4388/robot/subsystems/ShooterHood.java index c177c38..e286a2e 100644 --- a/src/main/java/frc4388/robot/subsystems/ShooterHood.java +++ b/src/main/java/frc4388/robot/subsystems/ShooterHood.java @@ -86,6 +86,11 @@ public class ShooterHood extends SubsystemBase { m_angleAdjustPIDController.setReference(targetAngle, ControlType.kPosition); } + public void runHood(double input) + { + m_angleAdjustMotor.set(input); + } + public void resetGyroAngleAdj(){ m_angleEncoder.setPosition(0); } diff --git a/src/main/java/frc4388/utility/controller/JoystickManualButton.java b/src/main/java/frc4388/utility/controller/JoystickManualButton.java new file mode 100644 index 0000000..6455639 --- /dev/null +++ b/src/main/java/frc4388/utility/controller/JoystickManualButton.java @@ -0,0 +1,53 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2008-2019 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 frc4388.utility.controller; + +import edu.wpi.first.wpilibj.GenericHID; +import edu.wpi.first.wpilibj2.command.button.Button; +import frc4388.robot.RobotContainer; + +import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam; + +/** + * A {@link Button} that gets its state from a {@link GenericHID}. + */ +public class JoystickManualButton extends Button { + private final GenericHID m_joystick; + private final int m_buttonNumber; + private boolean m_buttonType; + + /** + * Creates a joystick button for triggering commands. + * + * @param joystick The GenericHID object that has the button (e.g. Joystick, + * KinectStick, etc) + * @param buttonNumber The button number (see + * {@link GenericHID#getRawButton(int) } + */ + public JoystickManualButton(GenericHID joystick, int buttonNumber, boolean buttonType) { + requireNonNullParam(joystick, "joystick", "JoystickButton"); + + m_joystick = joystick; + m_buttonNumber = buttonNumber; + } + + /** + * Gets the value of the joystick button. + * + * @return The value of the joystick button + */ + @Override + public boolean get() { + boolean m = RobotContainer.m_isShooterManual; + if (m_buttonType == m) { + return m_joystick.getRawButton(m_buttonNumber); + } else { + return false; + } + } +} diff --git a/src/main/java/frc4388/utility/controller/XboxController.java b/src/main/java/frc4388/utility/controller/XboxController.java index 4353d1e..38c4736 100644 --- a/src/main/java/frc4388/utility/controller/XboxController.java +++ b/src/main/java/frc4388/utility/controller/XboxController.java @@ -60,6 +60,10 @@ public class XboxController implements IHandController m_stick = new Joystick(portNumber); } + public void setJoystick(Joystick joy) { + m_stick = joy; + } + /** * @return Joystick for Xbox Controller */ From 3960f3ff55c45ae86a6e5c7a1a18dc314c319101 Mon Sep 17 00:00:00 2001 From: "Keenan D. Buckley" Date: Thu, 12 Mar 2020 19:15:36 -0600 Subject: [PATCH 15/20] Tune Shooter --- src/main/deploy/Robot Data - Distances.csv | 19 +- src/main/deploy/Robot Data - DistancesOLD.csv | 8 + .../driverStation/GOAT DRIVERSTATION.json | 615 +++++++----------- .../themes/Ridgbotics/ridgeboticstheme.css | 0 src/main/java/frc4388/robot/Constants.java | 11 +- .../frc4388/robot/subsystems/Shooter.java | 2 +- 6 files changed, 249 insertions(+), 406 deletions(-) create mode 100644 src/main/deploy/Robot Data - DistancesOLD.csv rename src/main/{deploy => }/driverStation/GOAT DRIVERSTATION.json (84%) rename src/main/{deploy => }/driverStation/themes/Ridgbotics/ridgeboticstheme.css (100%) diff --git a/src/main/deploy/Robot Data - Distances.csv b/src/main/deploy/Robot Data - Distances.csv index a63fa24..e33cc7b 100644 --- a/src/main/deploy/Robot Data - Distances.csv +++ b/src/main/deploy/Robot Data - Distances.csv @@ -1,14 +1,7 @@ Distance (in),Hood Ext. (u),Drum Velocity (u/ds),Center Displacment (deg) -1,10,8000,2 -70,21,8000,2, check -100,24,9000,2 -145,28,10000,1 -230,31,12000,0,Add a 270 -246,32,15000,0 -320,32,17000,0,change 17000 and mark them lower -331,33,17000,0 -397,33,16000,0 -415,33,16250,0 -436,31,18000,0 -500,33,18000,0 -501,33,18000,0 \ No newline at end of file +70,20,7000,2.5, +127,27,8467,2, +223,31.25,10398,2.75, +272,32.4,11776,2.5, +342,33,13733,2, +458,30.5,17000,0, \ No newline at end of file diff --git a/src/main/deploy/Robot Data - DistancesOLD.csv b/src/main/deploy/Robot Data - DistancesOLD.csv new file mode 100644 index 0000000..a15874a --- /dev/null +++ b/src/main/deploy/Robot Data - DistancesOLD.csv @@ -0,0 +1,8 @@ +Distance (in),Hood Ext. (u),Drum Velocity (u/ds),Center Displacment (deg) +1,10,7769,0 +70,21,7769,0, check +100,24,8580,0 +145,28,9390,0 +230,31,11010,0,Add a 270 +397,33,14250,0 +415,33,14452,0 \ No newline at end of file diff --git a/src/main/deploy/driverStation/GOAT DRIVERSTATION.json b/src/main/driverStation/GOAT DRIVERSTATION.json similarity index 84% rename from src/main/deploy/driverStation/GOAT DRIVERSTATION.json rename to src/main/driverStation/GOAT DRIVERSTATION.json index 8fa33b4..a191e6e 100644 --- a/src/main/deploy/driverStation/GOAT DRIVERSTATION.json +++ b/src/main/driverStation/GOAT DRIVERSTATION.json @@ -17,88 +17,11 @@ ], "content": { "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Shooter Current", - "_title": "Shooter Current" + "_source0": "network_table:///SmartDashboard/limelight_Stream", + "_title": "limelight_Stream" } }, "1,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Delta Time", - "_title": "Delta Time" - } - }, - "2,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Time Seconds", - "_title": "Time Seconds" - } - }, - "3,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Shooter Temp C", - "_title": "Shooter Temp C" - } - }, - "4,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Auto?", - "_title": "Auto?" - } - }, - "5,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Fire Angle CSV", - "_title": "Fire Angle CSV" - } - }, - "6,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Drum Velocity", - "_title": "Drum Velocity" - } - }, - "7,0": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Drum Velocity CSV", - "_title": "Drum Velocity CSV" - } - }, - "8,0": { "size": [ 1, 1 @@ -109,7 +32,7 @@ "_title": "limelight_PipelineName" } }, - "9,0": { + "2,0": { "size": [ 1, 1 @@ -120,18 +43,18 @@ "_title": "limelight_Interface" } }, - "0,1": { + "3,0": { "size": [ 1, 1 ], "content": { "_type": "Text View", - "_source0": "network_table:///SmartDashboard/limelight_Stream", - "_title": "limelight_Stream" + "_source0": "network_table:///SmartDashboard/Auto?", + "_title": "Auto?" } }, - "1,1": { + "4,0": { "size": [ 2, 2 @@ -146,33 +69,7 @@ "Visuals/Counter clockwise": false } }, - "3,1": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/Climber Safety", - "_title": "Climber Safety", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "4,1": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/Rachet", - "_title": "Rachet", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "5,1": { + "6,0": { "size": [ 3, 2 @@ -186,7 +83,51 @@ "Visuals/Show velocity vectors": true } }, - "8,1": { + "9,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Left Motor Position Raw", + "_title": "Left Motor Position Raw" + } + }, + "0,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Right Motor Position Raw", + "_title": "Right Motor Position Raw" + } + }, + "1,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Average Motor Position Raw", + "_title": "Average Motor Position Raw" + } + }, + "2,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Avg Speed MPH", + "_title": "Avg Speed MPH" + } + }, + "3,1": { "size": [ 1, 1 @@ -205,11 +146,9 @@ 1 ], "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/Drum Ready", - "_title": "Drum Ready", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Drum Velocity", + "_title": "Drum Velocity" } }, "0,2": { @@ -218,11 +157,31 @@ 1 ], "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/Shooter Beam", - "_title": "Shooter Beam", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Drum Velocity CSV", + "_title": "Drum Velocity CSV" + } + }, + "1,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Shooter Temp C", + "_title": "Shooter Temp C" + } + }, + "2,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Shooter Current", + "_title": "Shooter Current" } }, "3,2": { @@ -232,13 +191,39 @@ ], "content": { "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/Upper Beam", - "_title": "Upper Beam", + "_source0": "network_table:///SmartDashboard/Drum Ready", + "_title": "Drum Ready", "Colors/Color when true": "#7CFC00FF", "Colors/Color when false": "#8B0000FF" } }, "4,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Turret Angle Raw", + "_title": "Turret Angle Raw" + } + }, + "5,2": { + "size": [ + 2, + 2 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///SmartDashboard/Turret Angle", + "_title": "Turret Angle", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "7,2": { "size": [ 1, 1 @@ -252,6 +237,54 @@ } }, "8,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Fire Angle CSV", + "_title": "Fire Angle CSV" + } + }, + "9,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Hood Angle Raw", + "_title": "Hood Angle Raw" + } + }, + "0,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Climber Safety", + "_title": "Climber Safety", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "1,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Rachet", + "_title": "Rachet", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "2,3": { "size": [ 1, 1 @@ -264,7 +297,7 @@ "Colors/Color when false": "#8B0000FF" } }, - "9,2": { + "3,3": { "size": [ 1, 1 @@ -277,226 +310,31 @@ "Colors/Color when false": "#8B0000FF" } }, - "0,3": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Left Motor Position Raw", - "_title": "Left Motor Position Raw" - } - }, - "1,3": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Right Motor Position Raw", - "_title": "Right Motor Position Raw" - } - }, - "2,3": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Average Motor Position Raw", - "_title": "Average Motor Position Raw" - } - }, - "3,3": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Avg Speed MPH", - "_title": "Avg Speed MPH" - } - }, "4,3": { "size": [ 1, 1 ], "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Turret Angle Raw", - "_title": "Turret Angle Raw" + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Upper Beam", + "_title": "Upper Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" } }, - "5,3": { + "7,3": { "size": [ 1, 1 ], "content": { "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/Aim Ready", - "_title": "Aim Ready", + "_source0": "network_table:///SmartDashboard/Shooter Beam", + "_title": "Shooter Beam", "Colors/Color when true": "#7CFC00FF", "Colors/Color when false": "#8B0000FF" } - }, - "6,3": { - "size": [ - 2, - 2 - ], - "content": { - "_type": "Gyro", - "_source0": "network_table:///SmartDashboard/Turret Angle", - "_title": "Turret Angle", - "Visuals/Major tick spacing": 45.0, - "Visuals/Starting angle": 180.0, - "Visuals/Show tick mark ring": true, - "Visuals/Counter clockwise": false - } - }, - "8,3": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Hood Angle Raw", - "_title": "Hood Angle Raw" - } - }, - "9,3": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/!Ball in Intake!", - "_title": "!Ball in Intake!", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "0,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/!Ball Storage!", - "_title": "!Ball Storage!", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "1,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Boolean Box", - "_source0": "network_table:///SmartDashboard/!Ball Shooter!", - "_title": "!Ball Shooter!", - "Colors/Color when true": "#7CFC00FF", - "Colors/Color when false": "#8B0000FF" - } - }, - "2,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Distance to Target", - "_title": "Distance to Target" - } - }, - "3,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Center Displacement", - "_title": "Center Displacement" - } - }, - "4,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Is Auto Start?", - "_title": "Is Auto Start?" - } - }, - "5,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Left Motor Pos Inches", - "_title": "Left Motor Pos Inches" - } - }, - "8,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Right Motor Pos Inches", - "_title": "Right Motor Pos Inches" - } - }, - "9,4": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Left Motor Pos Meters", - "_title": "Left Motor Pos Meters" - } - }, - "0,5": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Right Motor Pos Meters", - "_title": "Right Motor Pos Meters" - } - }, - "1,5": { - "size": [ - 1, - 1 - ], - "content": { - "_type": "Text View", - "_source0": "network_table:///SmartDashboard/Odometry Values Meters", - "_title": "Odometry Values Meters" - } } } } @@ -773,46 +611,6 @@ "hgap": 16.0, "vgap": 16.0, "tiles": { - "8,6": { - "size": [ - 2, - 2 - ], - "content": { - "_type": "Gyro", - "_title": "Gyro", - "Visuals/Major tick spacing": 45.0, - "Visuals/Starting angle": 180.0, - "Visuals/Show tick mark ring": true, - "Visuals/Counter clockwise": false - } - }, - "8,5": { - "size": [ - 2, - 1 - ], - "content": { - "_type": "Simple Dial", - "_title": "Simple Dial", - "Range/Min": 0.0, - "Range/Max": 100.0, - "Visuals/Show value": true - } - }, - "8,0": { - "size": [ - 2, - 1 - ], - "content": { - "_type": "Simple Dial", - "_title": "Simple Dial", - "Range/Min": 0.0, - "Range/Max": 100.0, - "Visuals/Show value": true - } - }, "0,0": { "size": [ 4, @@ -865,21 +663,6 @@ "Visuals/Show value": true } }, - "7,1": { - "size": [ - 3, - 3 - ], - "content": { - "_type": "Gyro", - "_source0": "network_table:///SmartDashboard/Pigeon Gyro", - "_title": "SmartDashboard/Pigeon Gyro", - "Visuals/Major tick spacing": 45.0, - "Visuals/Starting angle": 180.0, - "Visuals/Show tick mark ring": true, - "Visuals/Counter clockwise": false - } - }, "4,3": { "size": [ 1, @@ -1010,15 +793,73 @@ "Colors/Color when true": "#7CFC00FF", "Colors/Color when false": "#8B0000FF" } + }, + "8,6": { + "size": [ + 2, + 2 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///SmartDashboard/Turret Angle", + "_title": "SmartDashboard/Turret Angle", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "7,1": { + "size": [ + 3, + 3 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///SmartDashboard/Pigeon Gyro", + "_title": "SmartDashboard/Pigeon Gyro", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "8,0": { + "size": [ + 2, + 1 + ], + "content": { + "_type": "Simple Dial", + "_source0": "network_table:///SmartDashboard/Avg Speed MPH", + "_title": "SmartDashboard/Avg Speed MPH", + "Range/Min": 0.0, + "Range/Max": 100.0, + "Visuals/Show value": true + } + }, + "8,5": { + "size": [ + 2, + 1 + ], + "content": { + "_type": "Simple Dial", + "_source0": "network_table:///SmartDashboard/Hood Angle Raw", + "_title": "SmartDashboard/Hood Angle Raw", + "Range/Min": 0.0, + "Range/Max": 66.0, + "Visuals/Show value": true + } } } } } ], "windowGeometry": { - "x": -7.199999809265137, - "y": -7.199999809265137, - "width": 1550.4000244140625, - "height": 878.4000244140625 + "x": 40.0, + "y": 142.39999389648438, + "width": 1547.199951171875, + "height": 1481.5999755859375 } } \ No newline at end of file diff --git a/src/main/deploy/driverStation/themes/Ridgbotics/ridgeboticstheme.css b/src/main/driverStation/themes/Ridgbotics/ridgeboticstheme.css similarity index 100% rename from src/main/deploy/driverStation/themes/Ridgbotics/ridgeboticstheme.css rename to src/main/driverStation/themes/Ridgbotics/ridgeboticstheme.css diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index c6a8a3e..9956c75 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -117,7 +117,8 @@ public final class Constants { public static final int SHOOTER_PID_LOOP_IDX = 1; public static final int SHOOTER_TIMEOUT_MS = 30; public static final Gains DRUM_SHOOTER_GAINS = new Gains(1.5, 0.0, 100, 0.055, 0, 1.0); - public static final Gains SHOOTER_TURRET_GAINS = new Gains(0.0, 0.0, 0.0, 0.0, 0, 1.0); + //public static final Gains DRUM_SHOOTER_GAINS = new Gains(0.55, 0.0, 100, 0.0, 0, 1.0); + public static final Gains SHOOTER_TURRET_GAINS = new Gains(0.6, 0.0, 0.0, 0.0, 0, 1.0); public static final Gains SHOOTER_ANGLE_GAINS = new Gains(0.05, 0.0, 0.0, 0.0, 0, 0.3); public static final double SHOOTER_TURRET_MIN = -1.0; public static final double ENCODER_TICKS_PER_REV = 2048; @@ -131,8 +132,8 @@ public final class Constants { public static final int TURRET_LEFT_SOFT_LIMIT = -55; public static final double TURRET_SPEED_MULTIPLIER = 0.3; public static final double TURRET_CALIBRATE_SPEED = 0.075; - public static final double TURRET_MOTOR_ROTS_PER_ROT = 89.56696; - public static final double TURRET_MOTOR_POS_AT_ZERO_ROT = 0; //TODO: Find + public static final double TURRET_MOTOR_ROTS_PER_ROT = 101.04972; //89.56696; + public static final double TURRET_MOTOR_POS_AT_ZERO_ROT = -28.452166; public static final int HOOD_UP_SOFT_LIMIT = 33; public static final int HOOD_DOWN_SOFT_LIMIT = 3; @@ -208,9 +209,9 @@ public final class Constants { public static final double FOV = 29.8; //Field of view of limelight public static final double TARGET_HEIGHT = 71.5; public static final double LIME_ANGLE = 24.7; - public static final double TURN_P_VALUE = 0.6; + public static final double TURN_P_VALUE = 0.8; public static final double X_ANGLE_ERROR = 1.3; - public static final double MOTOR_DEAD_ZONE = 0.3; + public static final double MOTOR_DEAD_ZONE = 0.2; public static final double DISTANCE_ERROR_EQUATION_M = 1.1279; public static final double DISTANCE_ERROR_EQUATION_B = -15.0684; public static final double GRAV = 385.83; diff --git a/src/main/java/frc4388/robot/subsystems/Shooter.java b/src/main/java/frc4388/robot/subsystems/Shooter.java index 89e1bfb..890e0f7 100644 --- a/src/main/java/frc4388/robot/subsystems/Shooter.java +++ b/src/main/java/frc4388/robot/subsystems/Shooter.java @@ -54,7 +54,7 @@ public class Shooter extends SubsystemBase { m_shooterFalcon.setNeutralMode(NeutralMode.Coast); m_shooterFalcon.setInverted(true); m_shooterFalcon.configOpenloopRamp(1, ShooterConstants.SHOOTER_TIMEOUT_MS); - //m_shooterFalcon.configClosedloopRamp(1.0, ShooterConstants.SHOOTER_TIMEOUT_MS); + m_shooterFalcon.configClosedloopRamp(0.75, ShooterConstants.SHOOTER_TIMEOUT_MS); setShooterGains(); m_shooterFalcon.configPeakOutputReverse(0, ShooterConstants.SHOOTER_TIMEOUT_MS); From d1254f1e1d6b27de70ab9151f197fd556e619e57 Mon Sep 17 00:00:00 2001 From: "Keenan D. Buckley" Date: Fri, 13 Mar 2020 08:37:28 -0600 Subject: [PATCH 16/20] Program Simple Auto --- PathWeaver/Groups/TenBallAuto | 2 + PathWeaver/Paths/TenBallMidComplete | 2 - .../driverStation/GOAT DRIVERSTATION.json | 159 +++++++++++++++++- src/main/java/frc4388/robot/Constants.java | 2 +- .../java/frc4388/robot/RobotContainer.java | 12 +- .../commands/auto/TenBallAutoMiddle.java | 35 +++- .../commands/shooter/CalibrateShooter.java | 5 + .../robot/commands/shooter/PrepChecker.java | 52 ++++++ 8 files changed, 255 insertions(+), 14 deletions(-) create mode 100644 PathWeaver/Groups/TenBallAuto create mode 100644 src/main/java/frc4388/robot/commands/shooter/PrepChecker.java diff --git a/PathWeaver/Groups/TenBallAuto b/PathWeaver/Groups/TenBallAuto new file mode 100644 index 0000000..87ec839 --- /dev/null +++ b/PathWeaver/Groups/TenBallAuto @@ -0,0 +1,2 @@ +SixBallMidComplete +TenBallMidComplete diff --git a/PathWeaver/Paths/TenBallMidComplete b/PathWeaver/Paths/TenBallMidComplete index ead609f..a87ff34 100644 --- a/PathWeaver/Paths/TenBallMidComplete +++ b/PathWeaver/Paths/TenBallMidComplete @@ -1,6 +1,4 @@ X,Y,Tangent X,Tangent Y,Fixed Theta,Name -3.2,-2.4,0.2,2.5,true, -5.0,-1.1,3.0,0.0,true, 7.2,-1.1,1.5,0.0,true, 6.981146126504424,-1.7267749571307522,-0.16656954801462032,-0.6424825423421034,true, 6.766985279057057,-2.6072139966365975,-0.1189782485818709,-0.2974456214546768,true, diff --git a/src/main/driverStation/GOAT DRIVERSTATION.json b/src/main/driverStation/GOAT DRIVERSTATION.json index a191e6e..e61f688 100644 --- a/src/main/driverStation/GOAT DRIVERSTATION.json +++ b/src/main/driverStation/GOAT DRIVERSTATION.json @@ -335,6 +335,155 @@ "Colors/Color when true": "#7CFC00FF", "Colors/Color when false": "#8B0000FF" } + }, + "8,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Distance to Target", + "_title": "Distance to Target" + } + }, + "9,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/!Ball in Intake!", + "_title": "!Ball in Intake!", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "0,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/!Ball Storage!", + "_title": "!Ball Storage!", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "1,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/!Ball Shooter!", + "_title": "!Ball Shooter!", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "2,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Center Displacement", + "_title": "Center Displacement" + } + }, + "3,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Is Auto Start?", + "_title": "Is Auto Start?" + } + }, + "4,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/trajectoryPath Initial", + "_title": "trajectoryPath Initial" + } + }, + "5,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Left Motor Pos Inches", + "_title": "Left Motor Pos Inches" + } + }, + "6,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Right Motor Pos Inches", + "_title": "Right Motor Pos Inches" + } + }, + "7,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Left Motor Pos Meters", + "_title": "Left Motor Pos Meters" + } + }, + "8,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Right Motor Pos Meters", + "_title": "Right Motor Pos Meters" + } + }, + "9,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Odometry Values Meters", + "_title": "Odometry Values Meters" + } + }, + "0,5": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Trajectory Total Time", + "_title": "Trajectory Total Time" + } } } } @@ -645,8 +794,8 @@ "Controls/Rotation": "NONE", "compression": -1.0, "fps": -1, - "imageWidth": -1, - "imageHeight": -1 + "imageWidth": 0, + "imageHeight": 0 } }, "8,4": { @@ -857,9 +1006,9 @@ } ], "windowGeometry": { - "x": 40.0, - "y": 142.39999389648438, + "x": -6.400000095367432, + "y": 1.600000023841858, "width": 1547.199951171875, - "height": 1481.5999755859375 + "height": 828.7999877929688 } } \ No newline at end of file diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index a69160e..543cbb5 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -171,7 +171,7 @@ public final class Constants { public static final int STORAGE_CAN_ID = 11; public static final double STORAGE_PARTIAL_BALL = 2; public static final double STORAGE_FULL_BALL = 7; - public static final double STORAGE_SPEED = 1.0; + public static final double STORAGE_SPEED = 0.5; public static final double STORAGE_TIMEOUT = 3000; /* Storage Characteristics */ diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index dca2c7e..788f91b 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -269,6 +269,8 @@ public class RobotContainer { } public void buildAutos() { + resetOdometry(new Pose2d(0, 0, new Rotation2d(180))); + String[] sixBallAutoMiddlePaths = new String[]{ "SixBallMidComplete" }; @@ -300,10 +302,12 @@ public class RobotContainer { m_fiveBallAutoMiddle = new FiveBallAutoMiddle(m_robotDrive, buildPaths(fiveBallAutoMiddlePaths)); String[] tenBallAutoMiddlePaths = new String[]{ + "SixBallMidComplete", "TenBallMidComplete" }; - m_tenBallAutoMiddle = new TenBallAutoMiddle(m_robotDrive, buildPaths(tenBallAutoMiddlePaths)); + m_tenBallAutoMiddle = new TenBallAutoMiddle(m_robotShooterHood, m_robotStorage, m_robotIntake, m_robotShooter, + m_robotShooterAim, m_robotDrive,buildPaths(tenBallAutoMiddlePaths)); } /** @@ -321,12 +325,12 @@ public class RobotContainer { try { SmartDashboard.putNumber("Trajectory Total Time", m_totalTimeAuto); - return m_sixBallAutoMiddle.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); + //return m_sixBallAutoMiddle.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); //return m_eightBallAutoMiddle.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); //return m_driveOffLineForward.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); - //return m_driveOffLineBackward.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); + //return m_driveOffLinfeBackward.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); //return m_fiveBallAutoMiddle.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); - //return m_tenBallAutoMiddle.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0)); + return m_tenBallAutoMiddle.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0)); } catch (Exception e) { System.err.println("ERROR"); diff --git a/src/main/java/frc4388/robot/commands/auto/TenBallAutoMiddle.java b/src/main/java/frc4388/robot/commands/auto/TenBallAutoMiddle.java index 7ff19da..28ae59c 100644 --- a/src/main/java/frc4388/robot/commands/auto/TenBallAutoMiddle.java +++ b/src/main/java/frc4388/robot/commands/auto/TenBallAutoMiddle.java @@ -7,9 +7,21 @@ package frc4388.robot.commands.auto; +import edu.wpi.first.wpilibj2.command.ParallelDeadlineGroup; import edu.wpi.first.wpilibj2.command.RamseteCommand; +import edu.wpi.first.wpilibj2.command.RunCommand; import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; +import frc4388.robot.Constants.IntakeConstants; +import frc4388.robot.commands.shooter.CalibrateShooter; +import frc4388.robot.commands.shooter.PrepChecker; +import frc4388.robot.commands.shooter.ShootPrepGroup; +import frc4388.robot.commands.storage.RunStorage; import frc4388.robot.subsystems.Drive; +import frc4388.robot.subsystems.Intake; +import frc4388.robot.subsystems.Shooter; +import frc4388.robot.subsystems.ShooterAim; +import frc4388.robot.subsystems.ShooterHood; +import frc4388.robot.subsystems.Storage; // NOTE: Consider using this command inline, rather than writing a subclass. For more // information, see: @@ -18,11 +30,30 @@ public class TenBallAutoMiddle extends SequentialCommandGroup { /** * Creates a new TenBallAutoMiddle. */ - public TenBallAutoMiddle(Drive drive, RamseteCommand[] paths) { + public TenBallAutoMiddle(ShooterHood shooterHood, Storage storage, Intake intake, Shooter shooter, ShooterAim shooterAim, Drive drive, RamseteCommand[] paths) { // Add your commands in the super() call, e.g. // super(new FooCommand(), new BarCommand()); addCommands( - paths[0] + new ParallelDeadlineGroup( + new Wait(drive, 0.1, 0), + new CalibrateShooter(shooter, shooterAim, shooterHood) + ), + new ParallelDeadlineGroup( + new Wait(drive, 1, 0), + new RunCommand(() -> shooterAim.runShooterWithInput(-0.75), shooterAim) + ), + new ParallelDeadlineGroup( + new Wait(drive, 4, 0), + new PrepChecker(shooter, shooterAim), + new RunCommand(() -> intake.runExtender(IntakeConstants.EXTENDER_SPEED), intake), + new ShootPrepGroup(shooter, shooterAim, shooterHood, storage) + ), + new ParallelDeadlineGroup( + new ShootPrepGroup(shooter, shooterAim, shooterHood, storage), + new RunStorage(storage) + ) + //paths[0], + //paths[1] ); } } diff --git a/src/main/java/frc4388/robot/commands/shooter/CalibrateShooter.java b/src/main/java/frc4388/robot/commands/shooter/CalibrateShooter.java index 23be5fa..5e28114 100644 --- a/src/main/java/frc4388/robot/commands/shooter/CalibrateShooter.java +++ b/src/main/java/frc4388/robot/commands/shooter/CalibrateShooter.java @@ -7,6 +7,7 @@ package frc4388.robot.commands.shooter; +import com.revrobotics.CANDigitalInput.LimitSwitchPolarity; import com.revrobotics.CANSparkMax.SoftLimitDirection; import edu.wpi.first.wpilibj2.command.CommandBase; @@ -59,6 +60,10 @@ public class CalibrateShooter extends CommandBase { // Returns true when the command should end. @Override public boolean isFinished() { + if (m_shooterAim.m_shooterRotateMotor.getReverseLimitSwitch(LimitSwitchPolarity.kNormallyOpen).get() && + m_shooterHood.m_angleAdjustMotor.getReverseLimitSwitch(LimitSwitchPolarity.kNormallyOpen).get()) { + return true; + } return false; } } diff --git a/src/main/java/frc4388/robot/commands/shooter/PrepChecker.java b/src/main/java/frc4388/robot/commands/shooter/PrepChecker.java new file mode 100644 index 0000000..cc978fd --- /dev/null +++ b/src/main/java/frc4388/robot/commands/shooter/PrepChecker.java @@ -0,0 +1,52 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2019 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 frc4388.robot.commands.shooter; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc4388.robot.subsystems.Shooter; +import frc4388.robot.subsystems.ShooterAim; + +public class PrepChecker extends CommandBase { + Shooter m_shooter; + ShooterAim m_shooterAim; + + /** + * Creates a new PrepChecker. + */ + public PrepChecker(Shooter shooter, ShooterAim shooterAim) { + // Use addRequirements() here to declare subsystem dependencies. + m_shooter = shooter; + m_shooterAim = shooterAim; + } + + // Called when the command is initially scheduled. + @Override + public void initialize() { + } + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + if (m_shooterAim.m_isAimReady && m_shooter.m_isDrumReady) { + return true; + } + + return false; + } +} From bb9c325479daabcf8eabdc401c2e80752cf88626 Mon Sep 17 00:00:00 2001 From: ryan123rudder <42309874+ryan123rudder@users.noreply.github.com> Date: Fri, 13 Mar 2020 17:10:44 -0600 Subject: [PATCH 17/20] doneish --- src/main/java/frc4388/robot/RobotContainer.java | 4 ++-- .../frc4388/robot/commands/shooter/RunHoodWithJoystick.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index cfd064b..eaaab06 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -139,7 +139,7 @@ public class RobotContainer { m_robotLED.setDefaultCommand(new RunCommand(() -> m_robotLED.updateLED(), m_robotLED)); // runs the storage not //m_robotStorage.setDefaultCommand(new RunCommand(() -> m_robotStorage.runStorage(0), m_robotStorage)); - m_robotStorage.setDefaultCommand(new InstantCommand(() -> m_robotStorage.changeStorageMode(StorageMode.IDLE))); + m_robotStorage.setDefaultCommand(new ManageStorage(m_robotStorage)); //m_robotLime.setDefaultCommand(new RunCommand(() -> m_robotLime.limeOff(), m_robotLime)); } @@ -257,7 +257,7 @@ public class RobotContainer { // Meg new JoystickButton(getButtonFox(), ButtonFox.MIDDLE_SWITCH) - .whileHeld(new PlaySongDrive(m_robotDrive)) + .whenPressed(new PlaySongDrive(m_robotDrive)) .whenReleased(new InterruptSubystem(m_robotDrive)); // Shooter Manual diff --git a/src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java b/src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java index 29ca105..f406e04 100644 --- a/src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java +++ b/src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java @@ -37,7 +37,7 @@ public class RunHoodWithJoystick extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - double input = m_controller.getRightXAxis(); + double input = m_controller.getRightYAxis(); m_hood.runHood(input); } From a62a91f5f3c1ef52a5a753b87069f6fba85b9325 Mon Sep 17 00:00:00 2001 From: ryan123rudder <42309874+ryan123rudder@users.noreply.github.com> Date: Fri, 13 Mar 2020 20:51:06 -0600 Subject: [PATCH 18/20] highlanders fin --- .VSCodeCounter/details.md | 98 ++++++++++++++ .VSCodeCounter/results.csv | 85 ++++++++++++ .VSCodeCounter/results.md | 41 ++++++ .VSCodeCounter/results.txt | 127 ++++++++++++++++++ .../java/frc4388/robot/RobotContainer.java | 22 +-- .../commands/drive/DriveWithJoystick.java | 2 +- .../robot/commands/drive/PlaySongDrive.java | 5 +- .../robot/commands/drive/SkipSong.java | 56 ++++++++ .../java/frc4388/robot/subsystems/Drive.java | 14 +- .../controller/JoystickManualButton.java | 1 + 10 files changed, 434 insertions(+), 17 deletions(-) create mode 100644 .VSCodeCounter/details.md create mode 100644 .VSCodeCounter/results.csv create mode 100644 .VSCodeCounter/results.md create mode 100644 .VSCodeCounter/results.txt create mode 100644 src/main/java/frc4388/robot/commands/drive/SkipSong.java diff --git a/.VSCodeCounter/details.md b/.VSCodeCounter/details.md new file mode 100644 index 0000000..1306275 --- /dev/null +++ b/.VSCodeCounter/details.md @@ -0,0 +1,98 @@ +# Details + +Date : 2020-03-13 19:46:18 + +Directory c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main + +Total : 83 files, 4888 codes, 1770 comments, 1110 blanks, all 7768 lines + +[summary](results.md) + +## Files +| filename | language | code | comment | blank | total | +| :--- | :--- | ---: | ---: | ---: | ---: | +| [src/main/deploy/paths/DriveOffLineBackward.wpilib.json](/src/main/deploy/paths/DriveOffLineBackward.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/DriveOffLineForward.wpilib.json](/src/main/deploy/paths/DriveOffLineForward.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/EightBallMid0.wpilib.json](/src/main/deploy/paths/EightBallMid0.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/EightBallMid1.wpilib.json](/src/main/deploy/paths/EightBallMid1.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/EightBallMid2.wpilib.json](/src/main/deploy/paths/EightBallMid2.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/EightBallMidComplete.wpilib.json](/src/main/deploy/paths/EightBallMidComplete.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/FiveBallMidComplete.wpilib.json](/src/main/deploy/paths/FiveBallMidComplete.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/SixBallMid0.wpilib.json](/src/main/deploy/paths/SixBallMid0.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/SixBallMid1.wpilib.json](/src/main/deploy/paths/SixBallMid1.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/SixBallMidComplete.wpilib.json](/src/main/deploy/paths/SixBallMidComplete.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/TenBallMidComplete.wpilib.json](/src/main/deploy/paths/TenBallMidComplete.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/driverStation/GOAT DRIVERSTATION.json](/src/main/driverStation/GOAT DRIVERSTATION.json) | JSON | 1,014 | 0 | 0 | 1,014 | +| [src/main/driverStation/themes/Ridgbotics/ridgeboticstheme.css](/src/main/driverStation/themes/Ridgbotics/ridgeboticstheme.css) | CSS | 8 | 0 | 1 | 9 | +| [src/main/java/frc4388/robot/Constants.java](/src/main/java/frc4388/robot/Constants.java) | Java | 157 | 32 | 41 | 230 | +| [src/main/java/frc4388/robot/Main.java](/src/main/java/frc4388/robot/Main.java) | Java | 9 | 16 | 5 | 30 | +| [src/main/java/frc4388/robot/Robot.java](/src/main/java/frc4388/robot/Robot.java) | Java | 59 | 63 | 24 | 146 | +| [src/main/java/frc4388/robot/RobotContainer.java](/src/main/java/frc4388/robot/RobotContainer.java) | Java | 312 | 145 | 96 | 553 | +| [src/main/java/frc4388/robot/commands/InterruptSubystem.java](/src/main/java/frc4388/robot/commands/InterruptSubystem.java) | Java | 21 | 14 | 8 | 43 | +| [src/main/java/frc4388/robot/commands/auto/AutoPath1FromCenter.java](/src/main/java/frc4388/robot/commands/auto/AutoPath1FromCenter.java) | Java | 22 | 19 | 6 | 47 | +| [src/main/java/frc4388/robot/commands/auto/AutoPath2FromRight.java](/src/main/java/frc4388/robot/commands/auto/AutoPath2FromRight.java) | Java | 26 | 23 | 6 | 55 | +| [src/main/java/frc4388/robot/commands/auto/DriveOffLineBackward.java](/src/main/java/frc4388/robot/commands/auto/DriveOffLineBackward.java) | Java | 13 | 14 | 5 | 32 | +| [src/main/java/frc4388/robot/commands/auto/DriveOffLineForward.java](/src/main/java/frc4388/robot/commands/auto/DriveOffLineForward.java) | Java | 11 | 14 | 5 | 30 | +| [src/main/java/frc4388/robot/commands/auto/EightBallAutoMiddle.java](/src/main/java/frc4388/robot/commands/auto/EightBallAutoMiddle.java) | Java | 11 | 14 | 5 | 30 | +| [src/main/java/frc4388/robot/commands/auto/FiveBallAutoMiddle.java](/src/main/java/frc4388/robot/commands/auto/FiveBallAutoMiddle.java) | Java | 12 | 13 | 4 | 29 | +| [src/main/java/frc4388/robot/commands/auto/SixBallAutoMiddle.java](/src/main/java/frc4388/robot/commands/auto/SixBallAutoMiddle.java) | Java | 16 | 14 | 6 | 36 | +| [src/main/java/frc4388/robot/commands/auto/TankDriveVelocity.java](/src/main/java/frc4388/robot/commands/auto/TankDriveVelocity.java) | Java | 42 | 14 | 12 | 68 | +| [src/main/java/frc4388/robot/commands/auto/TenBallAutoMiddle.java](/src/main/java/frc4388/robot/commands/auto/TenBallAutoMiddle.java) | Java | 40 | 16 | 4 | 60 | +| [src/main/java/frc4388/robot/commands/auto/Wait.java](/src/main/java/frc4388/robot/commands/auto/Wait.java) | Java | 40 | 16 | 16 | 72 | +| [src/main/java/frc4388/robot/commands/climber/DisengageRachet.java](/src/main/java/frc4388/robot/commands/climber/DisengageRachet.java) | Java | 26 | 14 | 9 | 49 | +| [src/main/java/frc4388/robot/commands/climber/RunClimberWithTriggers.java](/src/main/java/frc4388/robot/commands/climber/RunClimberWithTriggers.java) | Java | 42 | 15 | 9 | 66 | +| [src/main/java/frc4388/robot/commands/climber/RunLevelerWithJoystick.java](/src/main/java/frc4388/robot/commands/climber/RunLevelerWithJoystick.java) | Java | 28 | 17 | 9 | 54 | +| [src/main/java/frc4388/robot/commands/drive/DrivePositionMPAux.java](/src/main/java/frc4388/robot/commands/drive/DrivePositionMPAux.java) | Java | 60 | 25 | 9 | 94 | +| [src/main/java/frc4388/robot/commands/drive/DriveStraightAtVelocityPID.java](/src/main/java/frc4388/robot/commands/drive/DriveStraightAtVelocityPID.java) | Java | 29 | 17 | 7 | 53 | +| [src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionMM.java](/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionMM.java) | Java | 56 | 22 | 9 | 87 | +| [src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionPID.java](/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionPID.java) | Java | 49 | 22 | 9 | 80 | +| [src/main/java/frc4388/robot/commands/drive/DriveWithJoystick.java](/src/main/java/frc4388/robot/commands/drive/DriveWithJoystick.java) | Java | 54 | 43 | 14 | 111 | +| [src/main/java/frc4388/robot/commands/drive/DriveWithJoystickAuxPID.java](/src/main/java/frc4388/robot/commands/drive/DriveWithJoystickAuxPID.java) | Java | 48 | 17 | 13 | 78 | +| [src/main/java/frc4388/robot/commands/drive/DriveWithJoystickDriveStraight.java](/src/main/java/frc4388/robot/commands/drive/DriveWithJoystickDriveStraight.java) | Java | 93 | 31 | 19 | 143 | +| [src/main/java/frc4388/robot/commands/drive/DriveWithJoystickUsingDeadAssistPID.java](/src/main/java/frc4388/robot/commands/drive/DriveWithJoystickUsingDeadAssistPID.java) | Java | 132 | 41 | 22 | 195 | +| [src/main/java/frc4388/robot/commands/drive/GotoCoordinatesFieldRelative.java](/src/main/java/frc4388/robot/commands/drive/GotoCoordinatesFieldRelative.java) | Java | 10 | 14 | 5 | 29 | +| [src/main/java/frc4388/robot/commands/drive/GotoCoordinatesRobotRelative.java](/src/main/java/frc4388/robot/commands/drive/GotoCoordinatesRobotRelative.java) | Java | 54 | 14 | 20 | 88 | +| [src/main/java/frc4388/robot/commands/drive/PlaySongDrive.java](/src/main/java/frc4388/robot/commands/drive/PlaySongDrive.java) | Java | 28 | 16 | 9 | 53 | +| [src/main/java/frc4388/robot/commands/drive/SkipSong.java](/src/main/java/frc4388/robot/commands/drive/SkipSong.java) | Java | 32 | 14 | 11 | 57 | +| [src/main/java/frc4388/robot/commands/drive/TurnDegrees.java](/src/main/java/frc4388/robot/commands/drive/TurnDegrees.java) | Java | 41 | 16 | 17 | 74 | +| [src/main/java/frc4388/robot/commands/intake/RunExtenderOutIn.java](/src/main/java/frc4388/robot/commands/intake/RunExtenderOutIn.java) | Java | 46 | 16 | 16 | 78 | +| [src/main/java/frc4388/robot/commands/intake/RunIntake.java](/src/main/java/frc4388/robot/commands/intake/RunIntake.java) | Java | 25 | 14 | 8 | 47 | +| [src/main/java/frc4388/robot/commands/intake/RunIntakeWithTriggers.java](/src/main/java/frc4388/robot/commands/intake/RunIntakeWithTriggers.java) | Java | 36 | 19 | 9 | 64 | +| [src/main/java/frc4388/robot/commands/shooter/CalibrateShooter.java](/src/main/java/frc4388/robot/commands/shooter/CalibrateShooter.java) | Java | 44 | 15 | 11 | 70 | +| [src/main/java/frc4388/robot/commands/shooter/HoodPositionPID.java](/src/main/java/frc4388/robot/commands/shooter/HoodPositionPID.java) | Java | 33 | 18 | 9 | 60 | +| [src/main/java/frc4388/robot/commands/shooter/PrepChecker.java](/src/main/java/frc4388/robot/commands/shooter/PrepChecker.java) | Java | 28 | 14 | 11 | 53 | +| [src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java](/src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java) | Java | 29 | 17 | 9 | 55 | +| [src/main/java/frc4388/robot/commands/shooter/ShootPrepGroup.java](/src/main/java/frc4388/robot/commands/shooter/ShootPrepGroup.java) | Java | 16 | 15 | 4 | 35 | +| [src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java](/src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java) | Java | 32 | 13 | 8 | 53 | +| [src/main/java/frc4388/robot/commands/shooter/ShooterManual.java](/src/main/java/frc4388/robot/commands/shooter/ShooterManual.java) | Java | 25 | 13 | 8 | 46 | +| [src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java](/src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java) | Java | 32 | 13 | 8 | 53 | +| [src/main/java/frc4388/robot/commands/shooter/ShooterVelocityControlPID.java](/src/main/java/frc4388/robot/commands/shooter/ShooterVelocityControlPID.java) | Java | 37 | 15 | 10 | 62 | +| [src/main/java/frc4388/robot/commands/shooter/TrackTarget.java](/src/main/java/frc4388/robot/commands/shooter/TrackTarget.java) | Java | 84 | 30 | 22 | 136 | +| [src/main/java/frc4388/robot/commands/shooter/TrimShooter.java](/src/main/java/frc4388/robot/commands/shooter/TrimShooter.java) | Java | 41 | 14 | 11 | 66 | +| [src/main/java/frc4388/robot/commands/storage/ManageStorage.java](/src/main/java/frc4388/robot/commands/storage/ManageStorage.java) | Java | 90 | 35 | 23 | 148 | +| [src/main/java/frc4388/robot/commands/storage/ManageStoragePID.java](/src/main/java/frc4388/robot/commands/storage/ManageStoragePID.java) | Java | 86 | 33 | 24 | 143 | +| [src/main/java/frc4388/robot/commands/storage/RunStorage.java](/src/main/java/frc4388/robot/commands/storage/RunStorage.java) | Java | 25 | 14 | 8 | 47 | +| [src/main/java/frc4388/robot/commands/storage/StoragePrep.java](/src/main/java/frc4388/robot/commands/storage/StoragePrep.java) | Java | 33 | 14 | 8 | 55 | +| [src/main/java/frc4388/robot/subsystems/Camera.java](/src/main/java/frc4388/robot/subsystems/Camera.java) | Java | 24 | 15 | 6 | 45 | +| [src/main/java/frc4388/robot/subsystems/Climber.java](/src/main/java/frc4388/robot/subsystems/Climber.java) | Java | 58 | 20 | 16 | 94 | +| [src/main/java/frc4388/robot/subsystems/Drive.java](/src/main/java/frc4388/robot/subsystems/Drive.java) | Java | 506 | 275 | 148 | 929 | +| [src/main/java/frc4388/robot/subsystems/Intake.java](/src/main/java/frc4388/robot/subsystems/Intake.java) | Java | 36 | 36 | 14 | 86 | +| [src/main/java/frc4388/robot/subsystems/LED.java](/src/main/java/frc4388/robot/subsystems/LED.java) | Java | 44 | 32 | 12 | 88 | +| [src/main/java/frc4388/robot/subsystems/Leveler.java](/src/main/java/frc4388/robot/subsystems/Leveler.java) | Java | 29 | 18 | 11 | 58 | +| [src/main/java/frc4388/robot/subsystems/LimeLight.java](/src/main/java/frc4388/robot/subsystems/LimeLight.java) | Java | 18 | 10 | 8 | 36 | +| [src/main/java/frc4388/robot/subsystems/Pneumatics.java](/src/main/java/frc4388/robot/subsystems/Pneumatics.java) | Java | 50 | 27 | 14 | 91 | +| [src/main/java/frc4388/robot/subsystems/Shooter.java](/src/main/java/frc4388/robot/subsystems/Shooter.java) | Java | 73 | 38 | 32 | 143 | +| [src/main/java/frc4388/robot/subsystems/ShooterAim.java](/src/main/java/frc4388/robot/subsystems/ShooterAim.java) | Java | 108 | 31 | 39 | 178 | +| [src/main/java/frc4388/robot/subsystems/ShooterHood.java](/src/main/java/frc4388/robot/subsystems/ShooterHood.java) | Java | 65 | 20 | 23 | 108 | +| [src/main/java/frc4388/robot/subsystems/Storage.java](/src/main/java/frc4388/robot/subsystems/Storage.java) | Java | 84 | 33 | 28 | 145 | +| [src/main/java/frc4388/utility/Gains.java](/src/main/java/frc4388/utility/Gains.java) | Java | 33 | 28 | 5 | 66 | +| [src/main/java/frc4388/utility/LEDPatterns.java](/src/main/java/frc4388/utility/LEDPatterns.java) | Java | 30 | 10 | 6 | 46 | +| [src/main/java/frc4388/utility/ShooterTables.java](/src/main/java/frc4388/utility/ShooterTables.java) | Java | 125 | 15 | 31 | 171 | +| [src/main/java/frc4388/utility/Trims.java](/src/main/java/frc4388/utility/Trims.java) | Java | 9 | 6 | 3 | 18 | +| [src/main/java/frc4388/utility/controller/ButtonFox.java](/src/main/java/frc4388/utility/controller/ButtonFox.java) | Java | 8 | 10 | 3 | 21 | +| [src/main/java/frc4388/utility/controller/IHandController.java](/src/main/java/frc4388/utility/controller/IHandController.java) | Java | 10 | 3 | 9 | 22 | +| [src/main/java/frc4388/utility/controller/JoystickManualButton.java](/src/main/java/frc4388/utility/controller/JoystickManualButton.java) | Java | 24 | 22 | 8 | 54 | +| [src/main/java/frc4388/utility/controller/XboxController.java](/src/main/java/frc4388/utility/controller/XboxController.java) | Java | 151 | 26 | 46 | 223 | +| [src/main/java/frc4388/utility/controller/XboxTriggerButton.java](/src/main/java/frc4388/utility/controller/XboxTriggerButton.java) | Java | 55 | 8 | 6 | 69 | + +[summary](results.md) \ No newline at end of file diff --git a/.VSCodeCounter/results.csv b/.VSCodeCounter/results.csv new file mode 100644 index 0000000..bcfdb2f --- /dev/null +++ b/.VSCodeCounter/results.csv @@ -0,0 +1,85 @@ +filename, language, JSON, Java, CSS, comment, blank, total +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\DriveOffLineBackward.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\DriveOffLineForward.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMid0.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMid1.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMid2.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMidComplete.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\FiveBallMidComplete.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\SixBallMid0.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\SixBallMid1.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\SixBallMidComplete.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\TenBallMidComplete.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\driverStation\GOAT DRIVERSTATION.json, JSON, 1014, 0, 0, 0, 0, 1014 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\driverStation\themes\Ridgbotics\ridgeboticstheme.css, CSS, 0, 0, 8, 0, 1, 9 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\Constants.java, Java, 0, 157, 0, 32, 41, 230 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\Main.java, Java, 0, 9, 0, 16, 5, 30 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\Robot.java, Java, 0, 59, 0, 63, 24, 146 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\RobotContainer.java, Java, 0, 312, 0, 145, 96, 553 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\InterruptSubystem.java, Java, 0, 21, 0, 14, 8, 43 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\AutoPath1FromCenter.java, Java, 0, 22, 0, 19, 6, 47 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\AutoPath2FromRight.java, Java, 0, 26, 0, 23, 6, 55 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\DriveOffLineBackward.java, Java, 0, 13, 0, 14, 5, 32 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\DriveOffLineForward.java, Java, 0, 11, 0, 14, 5, 30 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\EightBallAutoMiddle.java, Java, 0, 11, 0, 14, 5, 30 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\FiveBallAutoMiddle.java, Java, 0, 12, 0, 13, 4, 29 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\SixBallAutoMiddle.java, Java, 0, 16, 0, 14, 6, 36 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\TankDriveVelocity.java, Java, 0, 42, 0, 14, 12, 68 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\TenBallAutoMiddle.java, Java, 0, 40, 0, 16, 4, 60 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\Wait.java, Java, 0, 40, 0, 16, 16, 72 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\climber\DisengageRachet.java, Java, 0, 26, 0, 14, 9, 49 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\climber\RunClimberWithTriggers.java, Java, 0, 42, 0, 15, 9, 66 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\climber\RunLevelerWithJoystick.java, Java, 0, 28, 0, 17, 9, 54 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DrivePositionMPAux.java, Java, 0, 60, 0, 25, 9, 94 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveStraightAtVelocityPID.java, Java, 0, 29, 0, 17, 7, 53 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveStraightToPositionMM.java, Java, 0, 56, 0, 22, 9, 87 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveStraightToPositionPID.java, Java, 0, 49, 0, 22, 9, 80 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystick.java, Java, 0, 54, 0, 43, 14, 111 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystickAuxPID.java, Java, 0, 48, 0, 17, 13, 78 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystickDriveStraight.java, Java, 0, 93, 0, 31, 19, 143 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystickUsingDeadAssistPID.java, Java, 0, 132, 0, 41, 22, 195 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\GotoCoordinatesFieldRelative.java, Java, 0, 10, 0, 14, 5, 29 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\GotoCoordinatesRobotRelative.java, Java, 0, 54, 0, 14, 20, 88 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\PlaySongDrive.java, Java, 0, 28, 0, 16, 9, 53 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\SkipSong.java, Java, 0, 32, 0, 14, 11, 57 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\TurnDegrees.java, Java, 0, 41, 0, 16, 17, 74 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\intake\RunExtenderOutIn.java, Java, 0, 46, 0, 16, 16, 78 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\intake\RunIntake.java, Java, 0, 25, 0, 14, 8, 47 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\intake\RunIntakeWithTriggers.java, Java, 0, 36, 0, 19, 9, 64 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\CalibrateShooter.java, Java, 0, 44, 0, 15, 11, 70 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\HoodPositionPID.java, Java, 0, 33, 0, 18, 9, 60 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\PrepChecker.java, Java, 0, 28, 0, 14, 11, 53 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\RunHoodWithJoystick.java, Java, 0, 29, 0, 17, 9, 55 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShootPrepGroup.java, Java, 0, 16, 0, 15, 4, 35 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterGoalPosition.java, Java, 0, 32, 0, 13, 8, 53 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterManual.java, Java, 0, 25, 0, 13, 8, 46 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterTrenchPosition.java, Java, 0, 32, 0, 13, 8, 53 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterVelocityControlPID.java, Java, 0, 37, 0, 15, 10, 62 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\TrackTarget.java, Java, 0, 84, 0, 30, 22, 136 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\TrimShooter.java, Java, 0, 41, 0, 14, 11, 66 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\ManageStorage.java, Java, 0, 90, 0, 35, 23, 148 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\ManageStoragePID.java, Java, 0, 86, 0, 33, 24, 143 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\RunStorage.java, Java, 0, 25, 0, 14, 8, 47 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\StoragePrep.java, Java, 0, 33, 0, 14, 8, 55 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Camera.java, Java, 0, 24, 0, 15, 6, 45 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Climber.java, Java, 0, 58, 0, 20, 16, 94 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Drive.java, Java, 0, 506, 0, 275, 148, 929 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Intake.java, Java, 0, 36, 0, 36, 14, 86 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\LED.java, Java, 0, 44, 0, 32, 12, 88 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Leveler.java, Java, 0, 29, 0, 18, 11, 58 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\LimeLight.java, Java, 0, 18, 0, 10, 8, 36 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Pneumatics.java, Java, 0, 50, 0, 27, 14, 91 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Shooter.java, Java, 0, 73, 0, 38, 32, 143 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\ShooterAim.java, Java, 0, 108, 0, 31, 39, 178 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\ShooterHood.java, Java, 0, 65, 0, 20, 23, 108 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Storage.java, Java, 0, 84, 0, 33, 28, 145 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\Gains.java, Java, 0, 33, 0, 28, 5, 66 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\LEDPatterns.java, Java, 0, 30, 0, 10, 6, 46 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\ShooterTables.java, Java, 0, 125, 0, 15, 31, 171 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\Trims.java, Java, 0, 9, 0, 6, 3, 18 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\ButtonFox.java, Java, 0, 8, 0, 10, 3, 21 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\IHandController.java, Java, 0, 10, 0, 3, 9, 22 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\JoystickManualButton.java, Java, 0, 24, 0, 22, 8, 54 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\XboxController.java, Java, 0, 151, 0, 26, 46, 223 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\XboxTriggerButton.java, Java, 0, 55, 0, 8, 6, 69 +Total, -, 1025, 3855, 8, 1770, 1110, 7768 \ No newline at end of file diff --git a/.VSCodeCounter/results.md b/.VSCodeCounter/results.md new file mode 100644 index 0000000..47eec3f --- /dev/null +++ b/.VSCodeCounter/results.md @@ -0,0 +1,41 @@ +# Summary + +Date : 2020-03-13 19:46:18 + +Directory c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main + +Total : 83 files, 4888 codes, 1770 comments, 1110 blanks, all 7768 lines + +[details](details.md) + +## Languages +| language | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | +| Java | 70 | 3,855 | 1,770 | 1,109 | 6,734 | +| JSON | 12 | 1,025 | 0 | 0 | 1,025 | +| CSS | 1 | 8 | 0 | 1 | 9 | + +## Directories +| path | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | +| . | 83 | 4,888 | 1,770 | 1,110 | 7,768 | +| deploy | 11 | 11 | 0 | 0 | 11 | +| deploy\paths | 11 | 11 | 0 | 0 | 11 | +| driverStation | 2 | 1,022 | 0 | 1 | 1,023 | +| driverStation\themes | 1 | 8 | 0 | 1 | 9 | +| driverStation\themes\Ridgbotics | 1 | 8 | 0 | 1 | 9 | +| java | 70 | 3,855 | 1,770 | 1,109 | 6,734 | +| java\frc4388 | 70 | 3,855 | 1,770 | 1,109 | 6,734 | +| java\frc4388\robot | 61 | 3,410 | 1,642 | 992 | 6,044 | +| java\frc4388\robot\commands | 45 | 1,778 | 831 | 475 | 3,084 | +| java\frc4388\robot\commands\auto | 10 | 233 | 157 | 69 | 459 | +| java\frc4388\robot\commands\climber | 3 | 96 | 46 | 27 | 169 | +| java\frc4388\robot\commands\drive | 13 | 686 | 292 | 164 | 1,142 | +| java\frc4388\robot\commands\intake | 3 | 107 | 49 | 33 | 189 | +| java\frc4388\robot\commands\shooter | 11 | 401 | 177 | 111 | 689 | +| java\frc4388\robot\commands\storage | 4 | 234 | 96 | 63 | 393 | +| java\frc4388\robot\subsystems | 12 | 1,095 | 555 | 351 | 2,001 | +| java\frc4388\utility | 9 | 445 | 128 | 117 | 690 | +| java\frc4388\utility\controller | 5 | 248 | 69 | 72 | 389 | + +[details](details.md) \ No newline at end of file diff --git a/.VSCodeCounter/results.txt b/.VSCodeCounter/results.txt new file mode 100644 index 0000000..78f07a1 --- /dev/null +++ b/.VSCodeCounter/results.txt @@ -0,0 +1,127 @@ +Date : 2020-03-13 19:46:18 +Directory : c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main +Total : 83 files, 4888 codes, 1770 comments, 1110 blanks, all 7768 lines + +Languages ++----------+------------+------------+------------+------------+------------+ +| language | files | code | comment | blank | total | ++----------+------------+------------+------------+------------+------------+ +| Java | 70 | 3,855 | 1,770 | 1,109 | 6,734 | +| JSON | 12 | 1,025 | 0 | 0 | 1,025 | +| CSS | 1 | 8 | 0 | 1 | 9 | ++----------+------------+------------+------------+------------+------------+ + +Directories ++-------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ +| path | files | code | comment | blank | total | ++-------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ +| . | 83 | 4,888 | 1,770 | 1,110 | 7,768 | +| deploy | 11 | 11 | 0 | 0 | 11 | +| deploy\paths | 11 | 11 | 0 | 0 | 11 | +| driverStation | 2 | 1,022 | 0 | 1 | 1,023 | +| driverStation\themes | 1 | 8 | 0 | 1 | 9 | +| driverStation\themes\Ridgbotics | 1 | 8 | 0 | 1 | 9 | +| java | 70 | 3,855 | 1,770 | 1,109 | 6,734 | +| java\frc4388 | 70 | 3,855 | 1,770 | 1,109 | 6,734 | +| java\frc4388\robot | 61 | 3,410 | 1,642 | 992 | 6,044 | +| java\frc4388\robot\commands | 45 | 1,778 | 831 | 475 | 3,084 | +| java\frc4388\robot\commands\auto | 10 | 233 | 157 | 69 | 459 | +| java\frc4388\robot\commands\climber | 3 | 96 | 46 | 27 | 169 | +| java\frc4388\robot\commands\drive | 13 | 686 | 292 | 164 | 1,142 | +| java\frc4388\robot\commands\intake | 3 | 107 | 49 | 33 | 189 | +| java\frc4388\robot\commands\shooter | 11 | 401 | 177 | 111 | 689 | +| java\frc4388\robot\commands\storage | 4 | 234 | 96 | 63 | 393 | +| java\frc4388\robot\subsystems | 12 | 1,095 | 555 | 351 | 2,001 | +| java\frc4388\utility | 9 | 445 | 128 | 117 | 690 | +| java\frc4388\utility\controller | 5 | 248 | 69 | 72 | 389 | ++-------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ + +Files ++-------------------------------------------------------------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+ +| filename | language | code | comment | blank | total | ++-------------------------------------------------------------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+ +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\DriveOffLineBackward.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\DriveOffLineForward.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMid0.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMid1.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMid2.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMidComplete.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\FiveBallMidComplete.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\SixBallMid0.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\SixBallMid1.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\SixBallMidComplete.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\TenBallMidComplete.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\driverStation\GOAT DRIVERSTATION.json | JSON | 1,014 | 0 | 0 | 1,014 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\driverStation\themes\Ridgbotics\ridgeboticstheme.css | CSS | 8 | 0 | 1 | 9 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\Constants.java | Java | 157 | 32 | 41 | 230 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\Main.java | Java | 9 | 16 | 5 | 30 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\Robot.java | Java | 59 | 63 | 24 | 146 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\RobotContainer.java | Java | 312 | 145 | 96 | 553 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\InterruptSubystem.java | Java | 21 | 14 | 8 | 43 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\AutoPath1FromCenter.java | Java | 22 | 19 | 6 | 47 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\AutoPath2FromRight.java | Java | 26 | 23 | 6 | 55 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\DriveOffLineBackward.java | Java | 13 | 14 | 5 | 32 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\DriveOffLineForward.java | Java | 11 | 14 | 5 | 30 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\EightBallAutoMiddle.java | Java | 11 | 14 | 5 | 30 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\FiveBallAutoMiddle.java | Java | 12 | 13 | 4 | 29 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\SixBallAutoMiddle.java | Java | 16 | 14 | 6 | 36 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\TankDriveVelocity.java | Java | 42 | 14 | 12 | 68 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\TenBallAutoMiddle.java | Java | 40 | 16 | 4 | 60 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\Wait.java | Java | 40 | 16 | 16 | 72 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\climber\DisengageRachet.java | Java | 26 | 14 | 9 | 49 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\climber\RunClimberWithTriggers.java | Java | 42 | 15 | 9 | 66 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\climber\RunLevelerWithJoystick.java | Java | 28 | 17 | 9 | 54 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DrivePositionMPAux.java | Java | 60 | 25 | 9 | 94 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveStraightAtVelocityPID.java | Java | 29 | 17 | 7 | 53 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveStraightToPositionMM.java | Java | 56 | 22 | 9 | 87 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveStraightToPositionPID.java | Java | 49 | 22 | 9 | 80 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystick.java | Java | 54 | 43 | 14 | 111 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystickAuxPID.java | Java | 48 | 17 | 13 | 78 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystickDriveStraight.java | Java | 93 | 31 | 19 | 143 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystickUsingDeadAssistPID.java | Java | 132 | 41 | 22 | 195 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\GotoCoordinatesFieldRelative.java | Java | 10 | 14 | 5 | 29 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\GotoCoordinatesRobotRelative.java | Java | 54 | 14 | 20 | 88 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\PlaySongDrive.java | Java | 28 | 16 | 9 | 53 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\SkipSong.java | Java | 32 | 14 | 11 | 57 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\TurnDegrees.java | Java | 41 | 16 | 17 | 74 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\intake\RunExtenderOutIn.java | Java | 46 | 16 | 16 | 78 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\intake\RunIntake.java | Java | 25 | 14 | 8 | 47 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\intake\RunIntakeWithTriggers.java | Java | 36 | 19 | 9 | 64 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\CalibrateShooter.java | Java | 44 | 15 | 11 | 70 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\HoodPositionPID.java | Java | 33 | 18 | 9 | 60 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\PrepChecker.java | Java | 28 | 14 | 11 | 53 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\RunHoodWithJoystick.java | Java | 29 | 17 | 9 | 55 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShootPrepGroup.java | Java | 16 | 15 | 4 | 35 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterGoalPosition.java | Java | 32 | 13 | 8 | 53 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterManual.java | Java | 25 | 13 | 8 | 46 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterTrenchPosition.java | Java | 32 | 13 | 8 | 53 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterVelocityControlPID.java | Java | 37 | 15 | 10 | 62 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\TrackTarget.java | Java | 84 | 30 | 22 | 136 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\TrimShooter.java | Java | 41 | 14 | 11 | 66 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\ManageStorage.java | Java | 90 | 35 | 23 | 148 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\ManageStoragePID.java | Java | 86 | 33 | 24 | 143 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\RunStorage.java | Java | 25 | 14 | 8 | 47 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\StoragePrep.java | Java | 33 | 14 | 8 | 55 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Camera.java | Java | 24 | 15 | 6 | 45 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Climber.java | Java | 58 | 20 | 16 | 94 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Drive.java | Java | 506 | 275 | 148 | 929 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Intake.java | Java | 36 | 36 | 14 | 86 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\LED.java | Java | 44 | 32 | 12 | 88 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Leveler.java | Java | 29 | 18 | 11 | 58 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\LimeLight.java | Java | 18 | 10 | 8 | 36 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Pneumatics.java | Java | 50 | 27 | 14 | 91 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Shooter.java | Java | 73 | 38 | 32 | 143 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\ShooterAim.java | Java | 108 | 31 | 39 | 178 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\ShooterHood.java | Java | 65 | 20 | 23 | 108 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Storage.java | Java | 84 | 33 | 28 | 145 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\Gains.java | Java | 33 | 28 | 5 | 66 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\LEDPatterns.java | Java | 30 | 10 | 6 | 46 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\ShooterTables.java | Java | 125 | 15 | 31 | 171 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\Trims.java | Java | 9 | 6 | 3 | 18 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\ButtonFox.java | Java | 8 | 10 | 3 | 21 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\IHandController.java | Java | 10 | 3 | 9 | 22 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\JoystickManualButton.java | Java | 24 | 22 | 8 | 54 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\XboxController.java | Java | 151 | 26 | 46 | 223 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\XboxTriggerButton.java | Java | 55 | 8 | 6 | 69 | +| Total | | 4,888 | 1,770 | 1,110 | 7,768 | ++-------------------------------------------------------------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+ \ No newline at end of file diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index b2d88f1..940694c 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -49,6 +49,7 @@ import frc4388.robot.commands.climber.RunLevelerWithJoystick; import frc4388.robot.commands.drive.DriveStraightToPositionMM; import frc4388.robot.commands.drive.DriveWithJoystick; import frc4388.robot.commands.drive.PlaySongDrive; +import frc4388.robot.commands.drive.SkipSong; import frc4388.robot.commands.drive.TurnDegrees; import frc4388.robot.commands.intake.RunIntakeWithTriggers; import frc4388.robot.commands.shooter.CalibrateShooter; @@ -136,7 +137,7 @@ public class RobotContainer { public RobotContainer() { /* Passing Drive and Pneumatics Subsystems */ m_robotPneumatics.passRequiredSubsystem(m_robotDrive); - m_robotDrive.passRequiredSubsystem(m_robotPneumatics); + m_robotDrive.passRequiredSubsystem(m_robotPneumatics, m_robotShooter); m_robotShooter.passRequiredSubsystem(m_robotShooterHood, m_robotShooterAim); m_robotShooterHood.passRequiredSubsystem(m_robotShooter); @@ -184,8 +185,8 @@ public class RobotContainer { private void configureButtonBindings() { /* Test Buttons */ // A driver test button - new JoystickButton(getDriverJoystick(), XboxController.A_BUTTON) - .whileHeld(new InstantCommand(() -> m_robotDrive.tankDriveVelocity(1, -1), m_robotDrive)); + /*new JoystickButton(getDriverJoystick(), XboxController.A_BUTTON) + .whileHeld(new InstantCommand(() -> m_robotDrive.tankDriveVelocity(1, -1), m_robotDrive));*/ // B driver test button new JoystickButton(getDriverJoystick(), XboxController.B_BUTTON) @@ -289,7 +290,7 @@ public class RobotContainer { // Meg new JoystickButton(getButtonFox(), ButtonFox.MIDDLE_SWITCH) - .whenPressed(new PlaySongDrive(m_robotDrive)) + .whileHeld(new PlaySongDrive(m_robotDrive, m_robotShooter)) .whenReleased(new InterruptSubystem(m_robotDrive)); // Shooter Manual @@ -298,22 +299,21 @@ public class RobotContainer { .whenReleased(new ShooterManual(false)); // Goal Shooter Position - new JoystickButton(getButtonFox(), ButtonFox.LEFT_BUTTON) - .whileHeld(new ShooterGoalPosition(m_robotShooter, m_robotShooterHood, m_robotShooterAim)) - .whenReleased(new InterruptSubystem(m_robotShooter)) - .whenReleased(new InterruptSubystem(m_robotShooterHood)) - .whenReleased(new InterruptSubystem(m_robotShooterAim)); + new JoystickButton(getButtonFox(), ButtonFox.RIGHT_BUTTON) + .whileHeld(new PlaySongDrive(m_robotDrive, m_robotShooter)) + .whenReleased(new InterruptSubystem(m_robotDrive)); // Trench Shooter Position - new JoystickButton(getButtonFox(), ButtonFox.RIGHT_BUTTON) + new JoystickButton(getButtonFox(), ButtonFox.LEFT_BUTTON) .whileHeld(new ShooterTrenchPosition(m_robotShooter, m_robotShooterHood, m_robotShooterAim)) .whenReleased(new InterruptSubystem(m_robotShooter)) .whenReleased(new InterruptSubystem(m_robotShooterHood)) .whenReleased(new InterruptSubystem(m_robotShooterAim)); + //.whenPressed(new SkipSong(m_robotDrive, 1)); } public void buildAutos() { - resetOdometry(new Pose2d(0, 0, new Rotation2d(180))); + //resetOdometry(new Pose2d(0, 0, new Rotation2d(180))); String[] sixBallAutoMiddlePaths = new String[]{ "SixBallMidComplete" diff --git a/src/main/java/frc4388/robot/commands/drive/DriveWithJoystick.java b/src/main/java/frc4388/robot/commands/drive/DriveWithJoystick.java index 75ab279..b2aba9c 100644 --- a/src/main/java/frc4388/robot/commands/drive/DriveWithJoystick.java +++ b/src/main/java/frc4388/robot/commands/drive/DriveWithJoystick.java @@ -94,7 +94,7 @@ public class DriveWithJoystick extends CommandBase { } */ - m_drive.driveWithInput(moveOutput, steerOutput); + m_drive.driveWithInput(-moveOutput, steerOutput); } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc4388/robot/commands/drive/PlaySongDrive.java b/src/main/java/frc4388/robot/commands/drive/PlaySongDrive.java index eaa0f07..10a99ee 100644 --- a/src/main/java/frc4388/robot/commands/drive/PlaySongDrive.java +++ b/src/main/java/frc4388/robot/commands/drive/PlaySongDrive.java @@ -9,6 +9,7 @@ package frc4388.robot.commands.drive; import edu.wpi.first.wpilibj2.command.CommandBase; import frc4388.robot.subsystems.Drive; +import frc4388.robot.subsystems.Shooter; public class PlaySongDrive extends CommandBase { private Drive m_drive; @@ -16,10 +17,10 @@ public class PlaySongDrive extends CommandBase { /** * Creates a new PlaySongDrive. */ - public PlaySongDrive(Drive subsystem) { + public PlaySongDrive(Drive subsystem, Shooter shooter) { // Use addRequirements() here to declare subsystem dependencies. m_drive = subsystem; - addRequirements(m_drive); + addRequirements(m_drive, shooter); } // Called when the command is initially scheduled. diff --git a/src/main/java/frc4388/robot/commands/drive/SkipSong.java b/src/main/java/frc4388/robot/commands/drive/SkipSong.java new file mode 100644 index 0000000..0d020a1 --- /dev/null +++ b/src/main/java/frc4388/robot/commands/drive/SkipSong.java @@ -0,0 +1,56 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2019 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 frc4388.robot.commands.drive; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc4388.robot.subsystems.Drive; + +public class SkipSong extends CommandBase { + Drive m_drive; + int m_index; + + /** + * Creates a new SkipSong. + */ + public SkipSong(Drive m_robotDrive, int index) { + // Use addRequirements() here to declare subsystem dependencies. + m_drive = m_robotDrive; + m_index = index; + } + + // Called when the command is initially scheduled. + @Override + public void initialize() { + + } + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + String[] songs = m_drive.songsStrings; + String song = m_drive.m_currentSong; + + for (int i = 0; i < songs.length; i++) { + if (songs[i] == song) { + m_drive.selectSong(songs[i + m_index]); + break; + } + } + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return true; + } +} diff --git a/src/main/java/frc4388/robot/subsystems/Drive.java b/src/main/java/frc4388/robot/subsystems/Drive.java index f833621..5860235 100644 --- a/src/main/java/frc4388/robot/subsystems/Drive.java +++ b/src/main/java/frc4388/robot/subsystems/Drive.java @@ -54,6 +54,7 @@ public class Drive extends SubsystemBase { /* Pneumatics Subsystem */ public Pneumatics m_pneumaticsSubsystem; + Shooter m_shooter; /* Low Gear Gains */ public static Gains m_gainsDistanceLow = DriveConstants.DRIVE_DISTANCE_GAINS_LOW; @@ -96,7 +97,8 @@ public class Drive extends SubsystemBase { SendableChooser m_songChooser = new SendableChooser(); /* Misc */ - String m_currentSong = ""; + public String m_currentSong = ""; + public String[] songsStrings; /** * Add your docs here. @@ -283,11 +285,12 @@ public class Drive extends SubsystemBase { /* Create chooser to choose song to play */ File songsDir = new File(Filesystem.getDeployDirectory().getAbsolutePath() + "/songs"); System.err.println(songsDir.getPath()); - String[] songsStrings = songsDir.list(); + songsStrings = songsDir.list(); for (String songString : songsStrings) { m_songChooser.addOption(songString, songsDir.getAbsolutePath() + "/" + songString); } Shuffleboard.getTab("Songs").add(m_songChooser); + selectSong(songsStrings[0]); /* Start counting time */ m_lastTimeMs = System.currentTimeMillis(); @@ -306,8 +309,10 @@ public class Drive extends SubsystemBase { * * @param subsystem Subsystem needed. */ - public void passRequiredSubsystem(Pneumatics subsystem) { + public void passRequiredSubsystem(Pneumatics subsystem, Shooter shooter) { m_pneumaticsSubsystem = subsystem; + m_shooter = shooter; + m_orchestra.addInstrument(m_shooter.m_shooterFalcon); } public void updateTime() { @@ -913,6 +918,7 @@ public class Drive extends SubsystemBase { if (m_currentSong != m_songChooser.getSelected()){ m_currentSong = m_songChooser.getSelected(); selectSong(m_currentSong); + //System.err.println(m_currentSong); } } catch (Exception e) { @@ -920,4 +926,6 @@ public class Drive extends SubsystemBase { // e.printStackTrace(System.err); } } + + } diff --git a/src/main/java/frc4388/utility/controller/JoystickManualButton.java b/src/main/java/frc4388/utility/controller/JoystickManualButton.java index 6455639..53db6f4 100644 --- a/src/main/java/frc4388/utility/controller/JoystickManualButton.java +++ b/src/main/java/frc4388/utility/controller/JoystickManualButton.java @@ -34,6 +34,7 @@ public class JoystickManualButton extends Button { m_joystick = joystick; m_buttonNumber = buttonNumber; + m_buttonType = buttonType; } /** From aa1db6bb43f3ba47de2e6e5c9fb17e02e1433f55 Mon Sep 17 00:00:00 2001 From: "Keenan D. Buckley" Date: Fri, 27 Mar 2020 19:02:46 +0000 Subject: [PATCH 19/20] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9020b7f..2114a04 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# Robot-Essentials - Basic code for any Ridgebotics robot project +# Rise-of-Ridgebotics +The codebase which has never lost us a single match From b3373e68e9fd6be9b581a48c24762159087833ea Mon Sep 17 00:00:00 2001 From: "Keenan D. Buckley" Date: Sun, 12 Apr 2020 19:19:25 +0000 Subject: [PATCH 20/20] Fix typo in README.md (To get this repo to the top of the stack) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2114a04..df29521 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # Rise-of-Ridgebotics -The codebase which has never lost us a single match +The codebase which never lost us a single match