mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 08:48:07 -06:00
some debuging subsystems
This commit is contained in:
@@ -14,7 +14,6 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import frc4388.robot.Constants.ShooterConstants;
|
||||
import frc4388.utility.ShooterTables;
|
||||
import frc4388.utility.Gains;
|
||||
import frc4388.utility.Trims;
|
||||
import frc4388.utility.controller.IHandController;
|
||||
|
||||
public class BoomBoom extends SubsystemBase {
|
||||
@@ -127,7 +126,7 @@ public void setShooterGains() {
|
||||
//Controls a motor with the output of the BangBang controller
|
||||
//Controls a motor with the output of the BangBang conroller and a feedforward
|
||||
//Shrinks the feedforward slightly to avoid over speeding the shooter
|
||||
motor.set(controller.calculate(encoder.getRate(), setpoint) + 0.9 * feedforward.calculate(setpoint)); */
|
||||
m_shooterFalconLeft.set(controller.calculate(encoder.getRate(), targetVel) + 0.9 * feedforward.calculate(targetVel)); */
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,9 +6,10 @@ package frc4388.robot.subsystems;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
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.commandBase;
|
||||
import frc4388.robot.constants.VisionConstants;
|
||||
import edu.wpi.first.wpilibj2.command.CommandBase;
|
||||
import frc4388.robot.Constants.VisionConstants;
|
||||
import frc4388.robot.subsystems.BoomBoom;
|
||||
import frc4388.robot.subsystems.Turret;
|
||||
import frc4388.robot.subsystems.Hood;
|
||||
@@ -35,14 +36,11 @@ public static double fireAngle;
|
||||
public double m_hoodTrim;
|
||||
public double m_turretTrim;
|
||||
|
||||
LimeLight m_limeLight;
|
||||
|
||||
public TrackTarget(ShooterAim aimSubsystem, LimeLight limeLight) {
|
||||
m_turret = turretSubsystem;
|
||||
m_boomBoom = m_turret.m_turretSubsystem;
|
||||
public Vision(Turret aimSubsystem, BoomBoom boomBoom) {
|
||||
m_turret = aimSubsystem;
|
||||
m_boomBoom = boomBoom;
|
||||
m_hood = m_boomBoom.m_hoodSubsystem;
|
||||
m_limeLight = limeLight;
|
||||
addRequirements(m_turret);
|
||||
//addRequirements(m_turret);
|
||||
limeOff();
|
||||
changePipeline(0);
|
||||
NetworkTableInstance.getDefault().getTable("limelight").getEntry("camMode").setNumber(0);
|
||||
@@ -50,9 +48,9 @@ public TrackTarget(ShooterAim aimSubsystem, LimeLight limeLight) {
|
||||
}
|
||||
|
||||
public void track(){
|
||||
target = getV()
|
||||
xAngle = getX()
|
||||
yAngle = getY()
|
||||
target = getV();
|
||||
xAngle = getX();
|
||||
yAngle = getY();
|
||||
|
||||
//find distance
|
||||
distance = (VisionConstants.TARGET_HEIGHT) / Math.tan((VisionConstants.LIME_ANGLE + yAngle) * (Math.PI / 180));
|
||||
@@ -68,10 +66,10 @@ public void track(){
|
||||
turnAmount = 0.1;
|
||||
}
|
||||
else if (turnAmount < 0 && turnAmount > -0.1){
|
||||
turnAmount = -0.1
|
||||
turnAmount = -0.1;
|
||||
}
|
||||
}
|
||||
m_turret.runShooterWithInput(-turnAmount);
|
||||
m_turret.turnWithJoystick(-turnAmount);
|
||||
|
||||
SmartDashboard.putNumber("Disance to Target", realDistance);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user