Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MeowAzalea committed Mar 2, 2024
2 parents 04bdb5d + 2940fc5 commit 25de589
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public static class IntakeShooterConstants {
}

public static final boolean HAS_INTAKE;

public static final boolean INTAKE_REVERSE = false;
public static final boolean FLYWHEEL_REVERSE = false;

Expand Down Expand Up @@ -309,8 +309,12 @@ public static class AutoConstants {

public static class VisionConstants {

public static final Transform3d CAMERA_POSE = new Transform3d(0, 0, 0, new Rotation3d());
public static final String CAMERA_NAME = "Arducam_OV9281_USB_Camera";
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 {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/commands/FollowTag.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package frc.robot.commands;

import frc.robot.Constants.RobotMovementConstants;
import frc.robot.Constants.VisionConstants;
import frc.robot.subsystems.SwerveDrivetrain;
import frc.robot.subsystems.Vision;

Expand Down Expand Up @@ -75,6 +76,8 @@ public void execute() {
Transform3d transform = vision.getTransformToTag(tagID);

if (transform != null){
transform = transform.plus(VisionConstants.ROBOT_TO_FRONT);

double forward = transform.getX();
double left = transform.getY();
Rotation2d rotation = new Rotation2d(forward, left);
Expand Down
35 changes: 35 additions & 0 deletions src/main/java/frc/robot/commands/SpinIntakeFlywheels.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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 int speed;

private long startTime;

public SpinIntakeFlywheels(IntakeShooter intake, int speed) {
intakeShooter = intake;
this.speed = speed;
}

@Override
public void initialize() {
startTime = System.currentTimeMillis();
intakeShooter.setFlyWheelSpeed(speed);
}

// @Override
// public void execute() { }

@Override
public boolean isFinished() {
return (System.currentTimeMillis() + 1000) >= startTime;
}

@Override
public void end(boolean interrupted) {
// end
}
}

0 comments on commit 25de589

Please sign in to comment.