diff --git a/simgui-ds.json b/simgui-ds.json index 1c28509..387ca3b 100644 --- a/simgui-ds.json +++ b/simgui-ds.json @@ -101,7 +101,12 @@ ], "robotJoysticks": [ { - "guid": "Keyboard0" + "guid": "78696e70757401000000000000000000", + "useGamepad": true + }, + { + "guid": "78696e70757401000000000000000000", + "useGamepad": true } ] } diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index ad52269..c44edd7 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -325,13 +325,22 @@ public static class AutoConstants { } public static class VisionConstants { - + static { + switch (currentBot) { + case WOOD_BOT: + CAMERA_NAME = "Arducam_OV2311_USB_Camera"; + break; + case COMP_BOT: + default: + CAMERA_NAME = "Arducam_OV9281_USB_Camera"; + break; + } + } + public static final String CAMERA_NAME; public static final Transform3d CAMERA_POSE = new Transform3d(Units.inchesToMeters(13), 0, Units.inchesToMeters(11), new Rotation3d(0, Units.degreesToRadians(-20), 0)); public static final Transform3d ROBOT_TO_FRONT = new Transform3d(Units.inchesToMeters(-13), 0, 0, new Rotation3d()); - public static final String CAMERA_NAME = "Arducam_OV2311_USB_Camera"; - // public static final String CAMERA_NAME = "Arducam_OV9281_USB_Camera"; } public static class LightConstants { diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 2c7a554..5d1e726 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -32,6 +32,7 @@ import com.kauailabs.navx.frc.AHRS; import edu.wpi.first.wpilibj.GenericHID; +import edu.wpi.first.wpilibj.TimedRobot; import edu.wpi.first.wpilibj.GenericHID.HIDType; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; @@ -174,7 +175,7 @@ public void setUpDriveController() { final CommandJoystick joystick = new CommandJoystick(genericHID.getPort()); - inputs = new ChassisDriveInputs( + ChassisDriveInputs inputs = new ChassisDriveInputs( joystick::getX, -1, joystick::getY, -1, joystick::getTwist, -1, @@ -195,7 +196,7 @@ public void setUpDriveController() { final CommandXboxController xbox = new CommandXboxController(genericHID.getPort()); - inputs = new ChassisDriveInputs( + ChassisDriveInputs inputs = new ChassisDriveInputs( xbox::getLeftX, -1, xbox::getLeftY, -1, xbox::getRightX, -1, diff --git a/src/main/java/frc/robot/commands/SpinIntakeFlywheels.java b/src/main/java/frc/robot/commands/SpinIntakeFlywheels.java new file mode 100644 index 0000000..1344304 --- /dev/null +++ b/src/main/java/frc/robot/commands/SpinIntakeFlywheels.java @@ -0,0 +1,32 @@ +package frc.robot.commands; + +import edu.wpi.first.wpilibj2.command.Command; +import frc.robot.subsystems.intake.IntakeShooter; + +public class SpinIntakeFlywheels extends Command { + private IntakeShooter intakeShooter; + private double speed; + + public SpinIntakeFlywheels(IntakeShooter intake, double speed) { + intakeShooter = intake; + this.speed = speed; + } + + @Override + public void initialize() { + intakeShooter.setFlyWheelSpeed(speed); + } + + // @Override + // public void execute() { } + + @Override + public boolean isFinished() { + return true; + } + + @Override + public void end(boolean interrupted) { + // end + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/commands/SpinIntakeWheels.java b/src/main/java/frc/robot/commands/SpinIntakeWheels.java new file mode 100644 index 0000000..797cace --- /dev/null +++ b/src/main/java/frc/robot/commands/SpinIntakeWheels.java @@ -0,0 +1,32 @@ +package frc.robot.commands; + +import edu.wpi.first.wpilibj2.command.Command; +import frc.robot.subsystems.intake.IntakeShooter; + +public class SpinIntakeWheels extends Command { + private IntakeShooter intakeShooter; + private double speed; + + public SpinIntakeWheels(IntakeShooter intake, double speed) { + intakeShooter = intake; + this.speed = speed; + } + + @Override + public void initialize() { + intakeShooter.setIntakeSpeed(speed); + } + + // @Override + // public void execute() { } + + @Override + public boolean isFinished() { + return true; + } + + @Override + public void end(boolean interrupted) { + // end + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/Vision.java b/src/main/java/frc/robot/subsystems/Vision.java index 8b35a17..dad7fec 100644 --- a/src/main/java/frc/robot/subsystems/Vision.java +++ b/src/main/java/frc/robot/subsystems/Vision.java @@ -15,7 +15,7 @@ /** Vision subsystem */ public class Vision extends SubsystemBase { - private final static boolean DEBUG_INFO = false; + private final static boolean DEBUG_INFO = true; private boolean visionEnabled = true; diff --git a/vendordeps/photonlib.json b/vendordeps/photonlib.json index 46211fc..8c56503 100644 --- a/vendordeps/photonlib.json +++ b/vendordeps/photonlib.json @@ -1,7 +1,7 @@ { "fileName": "photonlib.json", "name": "photonlib", - "version": "v2024.2.4", + "version": "v2024.2.8", "uuid": "515fe07e-bfc6-11fa-b3de-0242ac130004", "frcYear": "2024", "mavenUrls": [ @@ -14,7 +14,7 @@ { "groupId": "org.photonvision", "artifactId": "photonlib-cpp", - "version": "v2024.2.4", + "version": "v2024.2.8", "libName": "photonlib", "headerClassifier": "headers", "sharedLibrary": true, @@ -29,7 +29,7 @@ { "groupId": "org.photonvision", "artifactId": "photontargeting-cpp", - "version": "v2024.2.4", + "version": "v2024.2.8", "libName": "photontargeting", "headerClassifier": "headers", "sharedLibrary": true, @@ -46,12 +46,12 @@ { "groupId": "org.photonvision", "artifactId": "photonlib-java", - "version": "v2024.2.4" + "version": "v2024.2.8" }, { "groupId": "org.photonvision", "artifactId": "photontargeting-java", - "version": "v2024.2.4" + "version": "v2024.2.8" } ] } \ No newline at end of file