diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index 41c5603..9f49a96 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -1,11 +1,5 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot; -import java.security.PublicKey; - import com.ctre.phoenix.motorcontrol.StatorCurrentLimitConfiguration; import com.ctre.phoenix.motorcontrol.SupplyCurrentLimitConfiguration; diff --git a/src/main/java/frc4388/robot/Main.java b/src/main/java/frc4388/robot/Main.java index e75dab2..959728f 100644 --- a/src/main/java/frc4388/robot/Main.java +++ b/src/main/java/frc4388/robot/Main.java @@ -1,16 +1,6 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.diffplug.common.base.DurianPlugins; -import com.diffplug.common.base.Errors; - import edu.wpi.first.wpilibj.RobotBase; import frc4388.utility.AnsiLogging; diff --git a/src/main/java/frc4388/robot/Robot.java b/src/main/java/frc4388/robot/Robot.java index 8d817fd..a9fe520 100644 --- a/src/main/java/frc4388/robot/Robot.java +++ b/src/main/java/frc4388/robot/Robot.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot; import java.util.logging.Level; diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 99f76a8..134c8ee 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot; import java.util.HashMap; @@ -18,6 +14,7 @@ import edu.wpi.first.util.sendable.Sendable; import edu.wpi.first.util.sendable.SendableBuilder; import edu.wpi.first.util.sendable.SendableRegistry; import edu.wpi.first.wpilibj.DriverStation; +import edu.wpi.first.wpilibj.GenericHID; import edu.wpi.first.wpilibj.PowerDistribution; import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj.smartdashboard.SendableBuilderImpl; diff --git a/src/main/java/frc4388/robot/RobotMap.java b/src/main/java/frc4388/robot/RobotMap.java index 8a5b8af..7992740 100644 --- a/src/main/java/frc4388/robot/RobotMap.java +++ b/src/main/java/frc4388/robot/RobotMap.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot; import com.ctre.phoenix.motorcontrol.NeutralMode; diff --git a/src/main/java/frc4388/robot/commands/ButtonBoxCommands/RunMiddleSwitch.java b/src/main/java/frc4388/robot/commands/ButtonBoxCommands/RunMiddleSwitch.java index 095cc9f..8af8cd4 100644 --- a/src/main/java/frc4388/robot/commands/ButtonBoxCommands/RunMiddleSwitch.java +++ b/src/main/java/frc4388/robot/commands/ButtonBoxCommands/RunMiddleSwitch.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.commands.ButtonBoxCommands; import edu.wpi.first.wpilibj2.command.CommandBase; diff --git a/src/main/java/frc4388/robot/commands/ButtonBoxCommands/TurretManual.java b/src/main/java/frc4388/robot/commands/ButtonBoxCommands/TurretManual.java index 53d772a..0ff0be5 100644 --- a/src/main/java/frc4388/robot/commands/ButtonBoxCommands/TurretManual.java +++ b/src/main/java/frc4388/robot/commands/ButtonBoxCommands/TurretManual.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.commands.ButtonBoxCommands; import edu.wpi.first.wpilibj2.command.CommandBase; diff --git a/src/main/java/frc4388/robot/commands/ClimberCommands/RunClaw.java b/src/main/java/frc4388/robot/commands/ClimberCommands/RunClaw.java index fdcd151..8b7c122 100644 --- a/src/main/java/frc4388/robot/commands/ClimberCommands/RunClaw.java +++ b/src/main/java/frc4388/robot/commands/ClimberCommands/RunClaw.java @@ -1,11 +1,6 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.commands.ClimberCommands; import edu.wpi.first.wpilibj2.command.CommandBase; -import frc4388.robot.Constants.ClawConstants; import frc4388.robot.subsystems.Claws; public class RunClaw extends CommandBase { diff --git a/src/main/java/frc4388/robot/commands/ClimberCommands/RunClimberPath.java b/src/main/java/frc4388/robot/commands/ClimberCommands/RunClimberPath.java index b469dae..cf67ae8 100644 --- a/src/main/java/frc4388/robot/commands/ClimberCommands/RunClimberPath.java +++ b/src/main/java/frc4388/robot/commands/ClimberCommands/RunClimberPath.java @@ -1,17 +1,10 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.commands.ClimberCommands; import org.opencv.core.Point; -import edu.wpi.first.wpilibj.drive.Vector2d; import edu.wpi.first.wpilibj2.command.CommandBase; -import frc4388.robot.Constants.ClimberConstants; import frc4388.robot.subsystems.Claws; import frc4388.robot.subsystems.Climber; -import frc4388.utility.Vector2dExt; public class RunClimberPath extends CommandBase { Climber climber; diff --git a/src/main/java/frc4388/robot/commands/DriveCommands/DriveWithInputForTime.java b/src/main/java/frc4388/robot/commands/DriveCommands/DriveWithInputForTime.java index b2827f7..b78fb03 100644 --- a/src/main/java/frc4388/robot/commands/DriveCommands/DriveWithInputForTime.java +++ b/src/main/java/frc4388/robot/commands/DriveCommands/DriveWithInputForTime.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.commands.DriveCommands; import edu.wpi.first.wpilibj2.command.CommandBase; diff --git a/src/main/java/frc4388/robot/commands/DriveCommands/RotateUntilTarget.java b/src/main/java/frc4388/robot/commands/DriveCommands/RotateUntilTarget.java index bef973b..fd337d9 100644 --- a/src/main/java/frc4388/robot/commands/DriveCommands/RotateUntilTarget.java +++ b/src/main/java/frc4388/robot/commands/DriveCommands/RotateUntilTarget.java @@ -1,11 +1,5 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.commands.DriveCommands; -import javax.swing.plaf.basic.BasicTreeUI.TreeCancelEditingAction; - import edu.wpi.first.wpilibj2.command.CommandBase; import frc4388.robot.subsystems.SwerveDrive; import frc4388.robot.subsystems.VisionOdometry; diff --git a/src/main/java/frc4388/robot/commands/PlaybackDriveInput.java b/src/main/java/frc4388/robot/commands/PlaybackDriveInput.java index 9827145..409c385 100644 --- a/src/main/java/frc4388/robot/commands/PlaybackDriveInput.java +++ b/src/main/java/frc4388/robot/commands/PlaybackDriveInput.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.commands; import java.io.File; diff --git a/src/main/java/frc4388/robot/commands/RecordDriveInput.java b/src/main/java/frc4388/robot/commands/RecordDriveInput.java index cc120fc..eb35638 100644 --- a/src/main/java/frc4388/robot/commands/RecordDriveInput.java +++ b/src/main/java/frc4388/robot/commands/RecordDriveInput.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.commands; import java.io.File; @@ -104,4 +100,4 @@ public class RecordDriveInput extends CommandBase { public boolean isFinished() { return false; } -} \ No newline at end of file +} diff --git a/src/main/java/frc4388/robot/commands/RunCommandForTime.java b/src/main/java/frc4388/robot/commands/RunCommandForTime.java index 5e35682..838c42f 100644 --- a/src/main/java/frc4388/robot/commands/RunCommandForTime.java +++ b/src/main/java/frc4388/robot/commands/RunCommandForTime.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.commands; import edu.wpi.first.wpilibj2.command.Command; diff --git a/src/main/java/frc4388/robot/commands/StorageCommands/ManageStorage.java b/src/main/java/frc4388/robot/commands/StorageCommands/ManageStorage.java index df54662..8132354 100644 --- a/src/main/java/frc4388/robot/commands/StorageCommands/ManageStorage.java +++ b/src/main/java/frc4388/robot/commands/StorageCommands/ManageStorage.java @@ -1,15 +1,7 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.commands.StorageCommands; import edu.wpi.first.wpilibj.DriverStation.Alliance; -import edu.wpi.first.wpilibj.util.Color; import edu.wpi.first.wpilibj2.command.CommandBase; -import edu.wpi.first.wpilibj2.command.CommandScheduler; -import edu.wpi.first.wpilibj2.command.ScheduleCommand; -import frc4388.robot.Robot; import frc4388.robot.subsystems.BoomBoom; import frc4388.robot.subsystems.Storage; import frc4388.robot.subsystems.Turret; diff --git a/src/main/java/frc4388/robot/commands/StorageCommands/SpitOutWrongColor.java b/src/main/java/frc4388/robot/commands/StorageCommands/SpitOutWrongColor.java index 5c79247..60d30f6 100644 --- a/src/main/java/frc4388/robot/commands/StorageCommands/SpitOutWrongColor.java +++ b/src/main/java/frc4388/robot/commands/StorageCommands/SpitOutWrongColor.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.commands.StorageCommands; import edu.wpi.first.wpilibj2.command.CommandBase; diff --git a/src/main/java/frc4388/robot/subsystems/BoomBoom.java b/src/main/java/frc4388/robot/subsystems/BoomBoom.java index d585c49..7cd6fb2 100644 --- a/src/main/java/frc4388/robot/subsystems/BoomBoom.java +++ b/src/main/java/frc4388/robot/subsystems/BoomBoom.java @@ -1,31 +1,19 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.subsystems; import java.io.File; import java.io.IOException; -import java.io.OutputStream; import java.nio.file.Files; import java.util.Arrays; import java.util.Comparator; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.function.Function; import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Pattern; -import java.util.stream.IntStream; import com.ctre.phoenix.motorcontrol.TalonFXControlMode; import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX; import com.diffplug.common.base.Errors; import com.diffplug.common.base.StringPrinter; -import edu.wpi.first.math.system.plant.DCMotor; -import edu.wpi.first.util.sendable.Sendable; import edu.wpi.first.wpilibj.Filesystem; import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; @@ -38,7 +26,8 @@ import frc4388.utility.NumericData; public class BoomBoom extends SubsystemBase { private static final Logger LOGGER = Logger.getLogger(BoomBoom.class.getSimpleName()); public WPI_TalonFX m_shooterFalconLeft; - public WPI_TalonFX m_shooterFalconRight; public static Gains m_drumShooterGains = ShooterConstants.DRUM_SHOOTER_GAINS; + public WPI_TalonFX m_shooterFalconRight; + public static Gains m_drumShooterGains = ShooterConstants.DRUM_SHOOTER_GAINS; public static BoomBoom m_boomBoom; double speed2; diff --git a/src/main/java/frc4388/robot/subsystems/Camera.java b/src/main/java/frc4388/robot/subsystems/Camera.java index 3ae570e..9e8bf5c 100644 --- a/src/main/java/frc4388/robot/subsystems/Camera.java +++ b/src/main/java/frc4388/robot/subsystems/Camera.java @@ -1,15 +1,7 @@ -/*----------------------------------------------------------------------------*/ -/* 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.subsystems; -import edu.wpi.first.cscore.*; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.cameraserver.CameraServer; +import edu.wpi.first.cscore.UsbCamera; import edu.wpi.first.wpilibj2.command.SubsystemBase; public class Camera extends SubsystemBase { diff --git a/src/main/java/frc4388/robot/subsystems/Claws.java b/src/main/java/frc4388/robot/subsystems/Claws.java index 5edce2a..5781d3e 100644 --- a/src/main/java/frc4388/robot/subsystems/Claws.java +++ b/src/main/java/frc4388/robot/subsystems/Claws.java @@ -1,17 +1,9 @@ package frc4388.robot.subsystems; -import java.nio.file.ClosedWatchServiceException; - -import com.ctre.phoenix.motorcontrol.LimitSwitchNormal; -import com.revrobotics.CANSparkMax; -import com.revrobotics.SparkMaxLimitSwitch; - -import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.Servo; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc4388.robot.Constants.ClawConstants; -import frc4388.robot.Constants.ClimberConstants; public class Claws extends SubsystemBase { diff --git a/src/main/java/frc4388/robot/subsystems/Climber.java b/src/main/java/frc4388/robot/subsystems/Climber.java index ba1e7e4..ecc827f 100644 --- a/src/main/java/frc4388/robot/subsystems/Climber.java +++ b/src/main/java/frc4388/robot/subsystems/Climber.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.subsystems; import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX; diff --git a/src/main/java/frc4388/robot/subsystems/Extender.java b/src/main/java/frc4388/robot/subsystems/Extender.java index 3655ac9..2db3fb5 100644 --- a/src/main/java/frc4388/robot/subsystems/Extender.java +++ b/src/main/java/frc4388/robot/subsystems/Extender.java @@ -1,12 +1,6 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.subsystems; -import com.ctre.phoenix.led.ColorFlowAnimation.Direction; import com.revrobotics.CANSparkMax; -import com.revrobotics.SparkMaxLimitSwitch; import com.revrobotics.CANSparkMax.SoftLimitDirection; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; diff --git a/src/main/java/frc4388/robot/subsystems/Hood.java b/src/main/java/frc4388/robot/subsystems/Hood.java index 57153ae..930fec2 100644 --- a/src/main/java/frc4388/robot/subsystems/Hood.java +++ b/src/main/java/frc4388/robot/subsystems/Hood.java @@ -1,20 +1,13 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.subsystems; import com.revrobotics.CANSparkMax; -import com.revrobotics.RelativeEncoder; -import com.revrobotics.SparkMaxPIDController; -import com.revrobotics.SparkMaxLimitSwitch; import com.revrobotics.CANSparkMax.ControlType; import com.revrobotics.CANSparkMax.SoftLimitDirection; -import com.revrobotics.SparkMaxRelativeEncoder.Type; +import com.revrobotics.RelativeEncoder; +import com.revrobotics.SparkMaxPIDController; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; - import frc4388.robot.Constants.ShooterConstants; import frc4388.utility.Gains; diff --git a/src/main/java/frc4388/robot/subsystems/Intake.java b/src/main/java/frc4388/robot/subsystems/Intake.java index 5b95144..1caede8 100644 --- a/src/main/java/frc4388/robot/subsystems/Intake.java +++ b/src/main/java/frc4388/robot/subsystems/Intake.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.subsystems; import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX; diff --git a/src/main/java/frc4388/robot/subsystems/LED.java b/src/main/java/frc4388/robot/subsystems/LED.java index cb6f53e..2f1d749 100644 --- a/src/main/java/frc4388/robot/subsystems/LED.java +++ b/src/main/java/frc4388/robot/subsystems/LED.java @@ -1,13 +1,7 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.subsystems; import java.util.logging.Logger; -import edu.wpi.first.wpilibj.PWM; -import edu.wpi.first.wpilibj.Servo; import edu.wpi.first.wpilibj.motorcontrol.Spark; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc4388.robot.Constants.LEDConstants; diff --git a/src/main/java/frc4388/robot/subsystems/Storage.java b/src/main/java/frc4388/robot/subsystems/Storage.java index ee1311e..16ae80f 100644 --- a/src/main/java/frc4388/robot/subsystems/Storage.java +++ b/src/main/java/frc4388/robot/subsystems/Storage.java @@ -1,19 +1,11 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.subsystems; -import edu.wpi.first.wpilibj2.command.SubsystemBase; import com.revrobotics.CANSparkMax; - -import edu.wpi.first.networktables.NetworkTable; -import edu.wpi.first.wpilibj.DigitalInput; -import edu.wpi.first.wpilibj.DriverStation; -import edu.wpi.first.wpilibj.DriverStation.Alliance; - import com.revrobotics.ColorSensorV3; + +import edu.wpi.first.wpilibj.DriverStation.Alliance; import edu.wpi.first.wpilibj.util.Color; +import edu.wpi.first.wpilibj2.command.SubsystemBase; public class Storage extends SubsystemBase { public CANSparkMax m_storageMotor; diff --git a/src/main/java/frc4388/robot/subsystems/SwerveDrive.java b/src/main/java/frc4388/robot/subsystems/SwerveDrive.java index 66feb7b..1fe6d56 100644 --- a/src/main/java/frc4388/robot/subsystems/SwerveDrive.java +++ b/src/main/java/frc4388/robot/subsystems/SwerveDrive.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.subsystems; import com.ctre.phoenix.sensors.WPI_Pigeon2; diff --git a/src/main/java/frc4388/robot/subsystems/SwerveModule.java b/src/main/java/frc4388/robot/subsystems/SwerveModule.java index 59e9e13..8c26831 100644 --- a/src/main/java/frc4388/robot/subsystems/SwerveModule.java +++ b/src/main/java/frc4388/robot/subsystems/SwerveModule.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.subsystems; import com.ctre.phoenix.motorcontrol.FeedbackDevice; diff --git a/src/main/java/frc4388/robot/subsystems/Turret.java b/src/main/java/frc4388/robot/subsystems/Turret.java index 6369591..d229113 100644 --- a/src/main/java/frc4388/robot/subsystems/Turret.java +++ b/src/main/java/frc4388/robot/subsystems/Turret.java @@ -1,24 +1,14 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.subsystems; -import com.revrobotics.CANSparkMax.ControlType; -import com.revrobotics.CANSparkMax.IdleMode; -import com.revrobotics.CANSparkMax.SoftLimitDirection; - import com.revrobotics.CANSparkMax; +import com.revrobotics.CANSparkMax.ControlType; +import com.revrobotics.CANSparkMax.SoftLimitDirection; import com.revrobotics.RelativeEncoder; import com.revrobotics.SparkMaxLimitSwitch; import com.revrobotics.SparkMaxPIDController; -import edu.wpi.first.wpilibj.interfaces.Gyro; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; - import frc4388.robot.Constants.ShooterConstants; -import frc4388.robot.subsystems.BoomBoom.ShooterTableEntry; import frc4388.utility.Gains; public class Turret extends SubsystemBase { diff --git a/src/main/java/frc4388/robot/subsystems/Vision.java b/src/main/java/frc4388/robot/subsystems/Vision.java index 08d3d5e..7357a49 100644 --- a/src/main/java/frc4388/robot/subsystems/Vision.java +++ b/src/main/java/frc4388/robot/subsystems/Vision.java @@ -1,14 +1,9 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.subsystems; -import edu.wpi.first.wpilibj2.command.SubsystemBase; +import edu.wpi.first.networktables.NetworkTableEntry; import edu.wpi.first.networktables.NetworkTableInstance; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; -import edu.wpi.first.networktables.NetworkTableEntry; - +import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc4388.robot.Constants.VisionConstants; public class Vision extends SubsystemBase { diff --git a/src/main/java/frc4388/robot/subsystems/VisionOdometry.java b/src/main/java/frc4388/robot/subsystems/VisionOdometry.java index 54b1874..c40cef1 100644 --- a/src/main/java/frc4388/robot/subsystems/VisionOdometry.java +++ b/src/main/java/frc4388/robot/subsystems/VisionOdometry.java @@ -1,10 +1,3 @@ -/*----------------------------------------------------------------------------*/ -/* 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.subsystems; import java.util.ArrayList; @@ -21,7 +14,6 @@ import org.photonvision.targeting.TargetCorner; import edu.wpi.first.math.geometry.Pose2d; import edu.wpi.first.math.geometry.Rotation2d; import edu.wpi.first.wpilibj.RobotBase; -import edu.wpi.first.wpilibj.Timer; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc4388.robot.Constants.VisionConstants; diff --git a/src/main/java/frc4388/utility/DummySensor.java b/src/main/java/frc4388/utility/DummySensor.java index dadef80..50b20b2 100644 --- a/src/main/java/frc4388/utility/DummySensor.java +++ b/src/main/java/frc4388/utility/DummySensor.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.utility; import java.util.ArrayList; diff --git a/src/main/java/frc4388/utility/Vector2dExt.java b/src/main/java/frc4388/utility/FRC4388_Vector2d.java similarity index 67% rename from src/main/java/frc4388/utility/Vector2dExt.java rename to src/main/java/frc4388/utility/FRC4388_Vector2d.java index 9a329a8..31322fc 100644 --- a/src/main/java/frc4388/utility/Vector2dExt.java +++ b/src/main/java/frc4388/utility/FRC4388_Vector2d.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.utility; import java.security.InvalidParameterException; @@ -14,19 +10,19 @@ import edu.wpi.first.wpilibj.drive.Vector2d; /** Aarav's good vector class (better than WPILib) * @author Aarav Shah */ -public class Vector2dExt extends Vector2d { - public Vector2dExt() { +public class FRC4388_Vector2d extends Vector2d { + public FRC4388_Vector2d() { this(0, 0); } - public Vector2dExt(double x, double y) { + public FRC4388_Vector2d(double x, double y) { super(x, y); this.x = x; this.y = y; } - public Vector2dExt(double[] vec) { + public FRC4388_Vector2d(double[] vec) { this(vec[0], vec[1]); if (vec.length != 2) { @@ -34,11 +30,11 @@ public class Vector2dExt extends Vector2d { } } - public Vector2dExt(Point p) { + public FRC4388_Vector2d(Point p) { this(p.x, p.y); } - public Vector2dExt(Translation2d t) { + public FRC4388_Vector2d(Translation2d t) { this(t.getX(), t.getY()); } @@ -48,15 +44,15 @@ public class Vector2dExt extends Vector2d { * @param v2 Second vector in the addition. * @return New vector which is the sum. */ - public static Vector2dExt add(Vector2dExt v1, Vector2dExt v2) { - return new Vector2dExt(v1.x + v2.x, v1.y + v2.y); + public static FRC4388_Vector2d add(FRC4388_Vector2d v1, FRC4388_Vector2d v2) { + return new FRC4388_Vector2d(v1.x + v2.x, v1.y + v2.y); } /** * Adds vector to current object * @param v Vector to add */ - public void add(Vector2dExt v) { + public void add(FRC4388_Vector2d v) { this.x += v.x; this.y += v.x; } @@ -67,15 +63,15 @@ public class Vector2dExt extends Vector2d { * @param v2 Second vector in the subtraction. * @return New vector which is the difference. */ - public static Vector2dExt subtract(Vector2dExt v1, Vector2dExt v2) { - return new Vector2dExt(v1.x - v2.x, v1.y - v2.y); + public static FRC4388_Vector2d subtract(FRC4388_Vector2d v1, FRC4388_Vector2d v2) { + return new FRC4388_Vector2d(v1.x - v2.x, v1.y - v2.y); } /** * Subtracts vector from current object * @param v Vector to subtract */ - public void subtract(Vector2dExt v) { + public void subtract(FRC4388_Vector2d v) { this.x -= v.x; this.y -= v.x; } @@ -86,8 +82,8 @@ public class Vector2dExt extends Vector2d { * @param v2 Scalar to multiply. * @return New vector which is the product. */ - public static Vector2dExt multiply(Vector2dExt v1, double scalar) { - return new Vector2dExt(scalar * v1.x, scalar * v1.y); + public static FRC4388_Vector2d multiply(FRC4388_Vector2d v1, double scalar) { + return new FRC4388_Vector2d(scalar * v1.x, scalar * v1.y); } /** @@ -105,8 +101,8 @@ public class Vector2dExt extends Vector2d { * @param v2 Scalar to divide. * @return New vector which is the division. */ - public static Vector2dExt divide(Vector2dExt v1, double scalar) { - return new Vector2dExt(v1.x / scalar, v1.y / scalar); + public static FRC4388_Vector2d divide(FRC4388_Vector2d v1, double scalar) { + return new FRC4388_Vector2d(v1.x / scalar, v1.y / scalar); } /** @@ -122,8 +118,8 @@ public class Vector2dExt extends Vector2d { * Find unit vector. * @return The unit vector. */ - public Vector2dExt unit() { - return new Vector2dExt(this.x / this.magnitude(), this.y / this.magnitude()); + public FRC4388_Vector2d unit() { + return new FRC4388_Vector2d(this.x / this.magnitude(), this.y / this.magnitude()); } /** @@ -132,10 +128,10 @@ public class Vector2dExt extends Vector2d { * @param places Number of places to round to. * @return New rounded vector. */ - public static Vector2dExt round(Vector2dExt v, int places) { + public static FRC4388_Vector2d round(FRC4388_Vector2d v, int places) { int scale = (int) Math.pow(10, places); - v = Vector2dExt.multiply(v, scale); + v = FRC4388_Vector2d.multiply(v, scale); v.x = Math.round(v.x); v.y = Math.round(v.y); diff --git a/src/main/java/frc4388/utility/Gains.java b/src/main/java/frc4388/utility/Gains.java index 13144a4..816a7e7 100644 --- a/src/main/java/frc4388/utility/Gains.java +++ b/src/main/java/frc4388/utility/Gains.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.utility; /** Add your docs here. */ diff --git a/src/main/java/frc4388/utility/LEDPatterns.java b/src/main/java/frc4388/utility/LEDPatterns.java index bc318d9..31a2fd0 100644 --- a/src/main/java/frc4388/utility/LEDPatterns.java +++ b/src/main/java/frc4388/utility/LEDPatterns.java @@ -46,4 +46,4 @@ public enum LEDPatterns { public float percentToPWM() { return (1000 + (getValue() * 1000)); } -} \ No newline at end of file +} diff --git a/src/main/java/frc4388/utility/RobotUnits.java b/src/main/java/frc4388/utility/RobotUnits.java index 28320ec..823c44c 100644 --- a/src/main/java/frc4388/utility/RobotUnits.java +++ b/src/main/java/frc4388/utility/RobotUnits.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.utility; import edu.wpi.first.math.util.Units; diff --git a/src/main/java/frc4388/utility/VelocityCorrection.java b/src/main/java/frc4388/utility/VelocityCorrection.java index 0cf49ca..94c8348 100644 --- a/src/main/java/frc4388/utility/VelocityCorrection.java +++ b/src/main/java/frc4388/utility/VelocityCorrection.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.utility; import frc4388.robot.subsystems.BoomBoom; @@ -14,29 +10,29 @@ public class VelocityCorrection { BoomBoom boomBoom; // vectors (in ft and ft/sec) - public Vector2dExt position; - public Vector2dExt cartesianVelocity; + public FRC4388_Vector2d position; + public FRC4388_Vector2d cartesianVelocity; // find - public Vector2dExt target; + public FRC4388_Vector2d target; public VelocityCorrection(SwerveDrive swerve, BoomBoom boomBoom) { this.swerve = swerve; this.boomBoom = boomBoom; - position = new Vector2dExt(5, 0);//new Vector2D(this.swerve.getOdometry().getX(), this.swerve.getOdometry().getY()); - cartesianVelocity = new Vector2dExt(-2, 3);//new Vector2D(this.swerve.getChassisSpeeds().vxMetersPerSecond, this.swerve.getChassisSpeeds().vyMetersPerSecond); + position = new FRC4388_Vector2d(5, 0);//new Vector2D(this.swerve.getOdometry().getX(), this.swerve.getOdometry().getY()); + cartesianVelocity = new FRC4388_Vector2d(-2, 3);//new Vector2D(this.swerve.getChassisSpeeds().vxMetersPerSecond, this.swerve.getChassisSpeeds().vyMetersPerSecond); target = getTargetPoint(); } - private Vector2dExt getTargetPoint() { + private FRC4388_Vector2d getTargetPoint() { double approxShotTime = 1; // TODO: get shot time from shooter tables - Vector2dExt targetPoint = Vector2dExt.multiply(this.cartesianVelocity, -1 * approxShotTime); + FRC4388_Vector2d targetPoint = FRC4388_Vector2d.multiply(this.cartesianVelocity, -1 * approxShotTime); - return Vector2dExt.round(targetPoint, 5); + return FRC4388_Vector2d.round(targetPoint, 5); } } diff --git a/src/test/java/frc4388/robot/subsystems/LEDSubsystemTest.java b/src/test/java/frc4388/robot/subsystems/LEDSubsystemTest.java index a0f6b97..532dd35 100644 --- a/src/test/java/frc4388/robot/subsystems/LEDSubsystemTest.java +++ b/src/test/java/frc4388/robot/subsystems/LEDSubsystemTest.java @@ -1,7 +1,3 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - package frc4388.robot.subsystems; import static org.junit.Assert.assertEquals;