The thingy

This commit is contained in:
TheRealGreydon 2026-10-08 19:44:01 -04:00
parent 8868183c62
commit c0b14150fe
2 changed files with 4 additions and 15 deletions

View File

@ -1,28 +1,17 @@
package frc.robot.commands; package frc.robot.commands;
import org.littletonrobotics.junction.Logger; import org.littletonrobotics.junction.Logger;
import edu.wpi.first.math.geometry.Pose3d;
import edu.wpi.first.units.Units;
import edu.wpi.first.units.measure.Angle;
import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.DriverStation.Alliance; import edu.wpi.first.wpilibj.DriverStation.Alliance;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.*;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import edu.wpi.first.wpilibj2.command.Commands;
import frc.robot.Constants; import frc.robot.Constants;
import frc.robot.Utils; import frc.robot.Utils;
import frc.robot.subsystems.DriveSubsystem; import frc.robot.subsystems.*;
import frc.robot.subsystems.HopperSubsystem;
import frc.robot.subsystems.IntakeSubsystem;
import frc.robot.subsystems.TurretSubsystem;
public class AutoTurretShootCommand extends Command{ public class AutoTurretShootCommand extends Command{
private HopperSubsystem hopperSubsystem; private HopperSubsystem hopperSubsystem;
private TurretSubsystem turretSubsystem; private TurretSubsystem turretSubsystem;
private IntakeSubsystem intakeSubsystem;
private DriveSubsystem driveSubsystem; private DriveSubsystem driveSubsystem;
private Command waitCommand = Commands.waitSeconds(1.5); private Command waitCommand = Commands.waitSeconds(1.5);
@ -31,7 +20,6 @@ public class AutoTurretShootCommand extends Command{
public AutoTurretShootCommand(HopperSubsystem hopperSubsystem, TurretSubsystem turretSubsystem, IntakeSubsystem intakeSubsystem, DriveSubsystem driveSubsystem){ public AutoTurretShootCommand(HopperSubsystem hopperSubsystem, TurretSubsystem turretSubsystem, IntakeSubsystem intakeSubsystem, DriveSubsystem driveSubsystem){
this.hopperSubsystem = hopperSubsystem; this.hopperSubsystem = hopperSubsystem;
this.turretSubsystem = turretSubsystem; this.turretSubsystem = turretSubsystem;
this.intakeSubsystem = intakeSubsystem;
this.driveSubsystem = driveSubsystem; this.driveSubsystem = driveSubsystem;
addRequirements(hopperSubsystem, intakeSubsystem); addRequirements(hopperSubsystem, intakeSubsystem);

View File

@ -182,12 +182,13 @@ public class TurretSubsystem extends TestableSubsystem {
int maxAngle = Constants.ShooterConstants.HOOD_ANGLE_MAX_DEG; int maxAngle = Constants.ShooterConstants.HOOD_ANGLE_MAX_DEG;
// Confirm target is within expected range. If not, do nothing. // Confirm target is within expected range. If not, do nothing.
double pos;
if ((angleDegrees <= maxAngle) && if ((angleDegrees <= maxAngle) &&
(angleDegrees >= minAngle)) { (angleDegrees >= minAngle)) {
// Map so that min angle maps to "0" and max angle maps to "1." // Map so that min angle maps to "0" and max angle maps to "1."
// The min angle corresponds to the hood's tallest physical position. // The min angle corresponds to the hood's tallest physical position.
double pos = (double)(angleDegrees - minAngle) / (maxAngle - minAngle); pos = (double)(angleDegrees - minAngle) / (maxAngle - minAngle);
// Actuate the hood. // Actuate the hood.
hood.set(pos); hood.set(pos);