Skip to content

Commit

Permalink
Fixs bc i fucked up (#36)
Browse files Browse the repository at this point in the history
* things and stuff

* fix stuff

* fix stuff
  • Loading branch information
Ishan1522 authored Sep 15, 2024
1 parent 6ff56e3 commit c01227b
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 46 deletions.
2 changes: 0 additions & 2 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public void robotInit() {
// Instantiate our RobotContainer. This will perform all our button bindings, and put our
// autonomous chooser on the dashboard.
m_robotContainer = new RobotContainer();
// uncomment the line below if there is a USB camera plugged into the RoboRIO
// CameraServer.startAutomaticCapture();
}

/**
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/frc/robot/commands/auto/BlueFiveNote.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
import frc.robot.subsystems.swerve.DriveSubsystem;
import frc.robot.subsystems.vision.VisionSubsystem;

// NOTE: Consider using this command inline, rather than writing a subclass. For more
// information, see:
// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
public class BlueFiveNote extends SequentialCommandGroup {
/** Creates a new FiveNotePath. */
public BlueFiveNote(
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/frc/robot/commands/auto/RedFiveNote.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
import frc.robot.subsystems.swerve.DriveSubsystem;
import frc.robot.subsystems.vision.VisionSubsystem;

// NOTE: Consider using this command inline, rather than writing a subclass. For more
// information, see:
// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
public class RedFiveNote extends SequentialCommandGroup {
/** Creates a new FiveNotePath. */
public RedFiveNote(
Expand Down
Original file line number Diff line number Diff line change
@@ -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 frc.robot.commands.auto;

import edu.wpi.first.wpilibj2.command.Command;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public FlywheelSpinUpAuto(ShooterSubsystem shooterSubsystem, DriveSubsystem driv
// Called when the command is initially scheduled.
@Override
public void initialize() {

speakerPos =
isRed
? new Translation2d(FieldConstants.RED_SPEAKER_X, FieldConstants.RED_SPEAKER_Y)
Expand Down
1 change: 0 additions & 1 deletion src/main/java/frc/robot/commands/shooter/ShootPass.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public void initialize() {
@Override
public void execute() {
super.execute();

// positions + distance
Translation2d robotPos = driveSubsystem.getPose().getTranslation();
double distance = robotPos.getDistance(passingPos);
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/frc/robot/extras/LimelightHelpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
public class LimelightHelpers {

public static class LimelightTarget_Retro {

@JsonProperty("t6c_ts")
private double[] cameraPose_TargetSpace;

Expand Down Expand Up @@ -261,7 +260,6 @@ public LimelightTarget_Detector() {}
}

public static class Results {

@JsonProperty("pID")
public double pipelineID;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/extras/NoteDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class NoteDetector {
private static Pose2d notePos;
private static BilinearInterpolator pixelLookupInterpolator;

public NoteDetector() {
private NoteDetector() {
pixelLookupInterpolator = new BilinearInterpolator(VisionConstants.noteDetectionLookupTable);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ else if (inputYValue < lookupTable[i][1] && inputYValue > lookupTable[i + 7][1])
};
}
}

// check for first row for only x interpolation
for (int i = 0; i < 7; i++) {
if (inputYValue == lookupTable[i][1]) {
Expand All @@ -128,7 +127,6 @@ else if (inputYValue < lookupTable[i][1] && inputYValue > lookupTable[i + 7][1])
}
}
}

// check for last row just to check for x only interpolation or point checking. (You can't do
// y_interpolation or diagonal)
for (int i = lookupTable.length - 7; i < lookupTable.length; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
import java.util.Optional;

/**
* Code modified again by FRC team 4829. hehehehhehehe
*
* <p>"Inspired" by FRC team 254. See the license file in the root directory of this project.
*
* <p>Takes a prior setpoint (ChassisSpeeds), a desired setpoint (from a driver, or from a path
* Takes a prior setpoint (ChassisSpeeds), a desired setpoint (from a driver, or from a path
* follower), and outputs a new setpoint that respects all of the kinematic constraints on module
* rotation speed and wheel velocity/acceleration. By generating a new setpoint every iteration, the
* robot will converge to the desired setpoint quickly while avoiding any intermediate state that is
Expand Down Expand Up @@ -160,28 +156,6 @@ protected double findDriveMaxS(
return findRoot(func, x_0, y_0, f_0 - offset, x_1, y_1, f_1 - offset, max_iterations);
}

// protected double findDriveMaxS(
// double x_0, double y_0, double x_1, double y_1, double max_vel_step) {
// // Our drive velocity between s=0 and s=1 is quadratic in s:
// // v^2 = ((x_1 - x_0) * s + x_0)^2 + ((y_1 - y_0) * s + y_0)^2
// // = a * s^2 + b * s + c
// // Where:
// // a = (x_1 - x_0)^2 + (y_1 - y_0)^2
// // b = 2 * x_0 * (x_1 - x_0) + 2 * y_0 * (y_1 - y_0)
// // c = x_0^2 + y_0^2
// // We want to find where this quadratic results in a velocity that is > max_vel_step from our
// // velocity at s=0:
// // sqrt(x_0^2 + y_0^2) +/- max_vel_step = ...quadratic...
// final double dx = x_1 - x_0;
// final double dy = y_1 - y_0;
// final double a = dx * dx + dy * dy;
// final double b = 2.0 * x_0 * dx + 2.0 * y_0 * dy;
// final double c = x_0 * x_0 + y_0 * y_0;
// final double v_limit_upper_2 = Math.pow(Math.hypot(x_0, y_0) + max_vel_step, 2.0);
// final double v_limit_lower_2 = Math.pow(Math.hypot(x_0, y_0) - max_vel_step, 2.0);
// return 0.0;
// }

/**
* Generate a new setpoint.
*
Expand Down

0 comments on commit c01227b

Please sign in to comment.