mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 08:48:07 -06:00
Revert "Revert "Merge branch 'Shooter' of https://github.com/Team4388/2022NoWayHome into Shooter""
This reverts commit 6d53d0431a.
This commit is contained in:
+101
@@ -0,0 +1,101 @@
|
|||||||
|
{
|
||||||
|
"keyboardJoysticks": [
|
||||||
|
{
|
||||||
|
"axisConfig": [
|
||||||
|
{
|
||||||
|
"decKey": 65,
|
||||||
|
"incKey": 68
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"decKey": 87,
|
||||||
|
"incKey": 83
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"decKey": 69,
|
||||||
|
"decayRate": 0.0,
|
||||||
|
"incKey": 82,
|
||||||
|
"keyRate": 0.009999999776482582
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"axisCount": 3,
|
||||||
|
"buttonCount": 4,
|
||||||
|
"buttonKeys": [
|
||||||
|
90,
|
||||||
|
88,
|
||||||
|
67,
|
||||||
|
86
|
||||||
|
],
|
||||||
|
"povConfig": [
|
||||||
|
{
|
||||||
|
"key0": 328,
|
||||||
|
"key135": 323,
|
||||||
|
"key180": 322,
|
||||||
|
"key225": 321,
|
||||||
|
"key270": 324,
|
||||||
|
"key315": 327,
|
||||||
|
"key45": 329,
|
||||||
|
"key90": 326
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"povCount": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"axisConfig": [
|
||||||
|
{
|
||||||
|
"decKey": 74,
|
||||||
|
"incKey": 76
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"decKey": 73,
|
||||||
|
"incKey": 75
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"axisCount": 2,
|
||||||
|
"buttonCount": 4,
|
||||||
|
"buttonKeys": [
|
||||||
|
77,
|
||||||
|
44,
|
||||||
|
46,
|
||||||
|
47
|
||||||
|
],
|
||||||
|
"povCount": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"axisConfig": [
|
||||||
|
{
|
||||||
|
"decKey": 263,
|
||||||
|
"incKey": 262
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"decKey": 265,
|
||||||
|
"incKey": 264
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"axisCount": 2,
|
||||||
|
"buttonCount": 6,
|
||||||
|
"buttonKeys": [
|
||||||
|
260,
|
||||||
|
268,
|
||||||
|
266,
|
||||||
|
261,
|
||||||
|
269,
|
||||||
|
267
|
||||||
|
],
|
||||||
|
"povCount": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"axisCount": 0,
|
||||||
|
"buttonCount": 0,
|
||||||
|
"povCount": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"robotJoysticks": [
|
||||||
|
{
|
||||||
|
"useGamepad": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"guid": "78696e70757401000000000000000000",
|
||||||
|
"useGamepad": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"HALProvider": {
|
||||||
|
"Other Devices": {
|
||||||
|
"SPARK MAX [10]": {
|
||||||
|
"header": {
|
||||||
|
"open": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"SPARK MAX [30]": {
|
||||||
|
"header": {
|
||||||
|
"open": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"SPARK MAX [31]": {
|
||||||
|
"header": {
|
||||||
|
"open": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NTProvider": {
|
||||||
|
"types": {
|
||||||
|
"/FMSInfo": "FMSInfo",
|
||||||
|
"/LiveWindow/BoomBoom": "Subsystem",
|
||||||
|
"/LiveWindow/Hood": "Subsystem",
|
||||||
|
"/LiveWindow/LED": "Subsystem",
|
||||||
|
"/LiveWindow/SwerveDrive": "Subsystem",
|
||||||
|
"/LiveWindow/SwerveModule": "Subsystem",
|
||||||
|
"/LiveWindow/Turret": "Subsystem",
|
||||||
|
"/LiveWindow/Ungrouped/Scheduler": "Scheduler",
|
||||||
|
"/LiveWindow/Vision": "Subsystem"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -94,9 +94,9 @@ public final class Constants {
|
|||||||
public static final SupplyCurrentLimitConfiguration SUPPLY_CURRENT_LIMIT_CONFIG = new SupplyCurrentLimitConfiguration(true, 60, 40, 0.5);
|
public static final SupplyCurrentLimitConfiguration SUPPLY_CURRENT_LIMIT_CONFIG = new SupplyCurrentLimitConfiguration(true, 60, 40, 0.5);
|
||||||
public static final int SHOOTER_FALCON_LEFT_CAN_ID = 0;
|
public static final int SHOOTER_FALCON_LEFT_CAN_ID = 0;
|
||||||
public static final int SHOOTER_FALCON_RIGHT_CAN_ID = 0;
|
public static final int SHOOTER_FALCON_RIGHT_CAN_ID = 0;
|
||||||
public static final int SHOOTER_ROTATE_ID = 0; //"unknown value" //figure out later
|
public static final int SHOOTER_ROTATE_ID = 31; //"unknown value" //figure out later
|
||||||
public static final int TURRET_RIGHT_SOFT_LIMIT = 0; //""//
|
public static final int TURRET_RIGHT_SOFT_LIMIT = 0; //""//
|
||||||
public static final int TURRET_SPEED_MULTIPLIER = 0; //""//
|
public static final double TURRET_SPEED_MULTIPLIER = 0.1d; //""//
|
||||||
public static final int DEGREES_PER_ROT = 0; //""//
|
public static final int DEGREES_PER_ROT = 0; //""//
|
||||||
public static final int TURRET_MOTOR_POS_AT_ZERO_ROT = 0; //""//
|
public static final int TURRET_MOTOR_POS_AT_ZERO_ROT = 0; //""//
|
||||||
public static final int TURRET_MOTOR_ROTS_PER_ROT = 0; //""//
|
public static final int TURRET_MOTOR_ROTS_PER_ROT = 0; //""//
|
||||||
@@ -105,7 +105,7 @@ public final class Constants {
|
|||||||
|
|
||||||
/* Turret Constants */
|
/* Turret Constants */
|
||||||
//ID
|
//ID
|
||||||
public static final int TURRET_MOTOR_CAN_ID = 0;
|
public static final int TURRET_MOTOR_CAN_ID = 30;
|
||||||
public static final Gains SHOOTER_TURRET_GAINS = new Gains(0.6, 0.0, 0.0, 0.0, 0, 1.0);
|
public static final Gains SHOOTER_TURRET_GAINS = new Gains(0.6, 0.0, 0.0, 0.0, 0, 1.0);
|
||||||
public static final Gains SHOOTER_ANGLE_GAINS = new Gains(0.05, 0.0, 0.0, 0.0, 0, 0.3);
|
public static final Gains SHOOTER_ANGLE_GAINS = new Gains(0.05, 0.0, 0.0, 0.0, 0, 0.3);
|
||||||
public static final double SHOOTER_TURRET_MIN = -1.0;
|
public static final double SHOOTER_TURRET_MIN = -1.0;
|
||||||
|
|||||||
@@ -73,11 +73,11 @@ public class RobotContainer {
|
|||||||
|
|
||||||
m_robotTurret.setDefaultCommand(
|
m_robotTurret.setDefaultCommand(
|
||||||
new RunCommand(() -> m_robotTurret.runShooterWithInput(getOperatorController().getLeftXAxis()), m_robotTurret)
|
new RunCommand(() -> m_robotTurret.runShooterWithInput(getOperatorController().getLeftXAxis()), m_robotTurret)
|
||||||
);
|
);
|
||||||
|
// m_robotTurret.setDefaultCommand(
|
||||||
|
// new RunCommand(() -> m_robotTurret.aimToCenter()));
|
||||||
|
}
|
||||||
|
|
||||||
m_robotTurret.setDefaultCommand(
|
|
||||||
new RunCommand(() -> m_robotTurret.aimToCenter()));
|
|
||||||
/**
|
/**
|
||||||
* Use this method to define your button->command mappings. Buttons can be
|
* Use this method to define your button->command mappings. Buttons can be
|
||||||
* created by instantiating a {@link GenericHID} or one of its subclasses
|
* created by instantiating a {@link GenericHID} or one of its subclasses
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ package frc4388.robot;
|
|||||||
|
|
||||||
import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX;
|
import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX;
|
||||||
import com.ctre.phoenix.sensors.CANCoder;
|
import com.ctre.phoenix.sensors.CANCoder;
|
||||||
|
import com.revrobotics.CANSparkMax;
|
||||||
|
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj.motorcontrol.Spark;
|
import edu.wpi.first.wpilibj.motorcontrol.Spark;
|
||||||
import frc4388.robot.Constants.LEDConstants;
|
import frc4388.robot.Constants.LEDConstants;
|
||||||
@@ -97,7 +99,7 @@ public class RobotMap {
|
|||||||
/*Boom Boom Subsystem*/
|
/*Boom Boom Subsystem*/
|
||||||
public final WPI_TalonFX shooterFalconLeft = new WPI_TalonFX(ShooterConstants.SHOOTER_FALCON_LEFT_CAN_ID);
|
public final WPI_TalonFX shooterFalconLeft = new WPI_TalonFX(ShooterConstants.SHOOTER_FALCON_LEFT_CAN_ID);
|
||||||
public final WPI_TalonFX shooterFalconRight = new WPI_TalonFX(ShooterConstants.SHOOTER_FALCON_RIGHT_CAN_ID);
|
public final WPI_TalonFX shooterFalconRight = new WPI_TalonFX(ShooterConstants.SHOOTER_FALCON_RIGHT_CAN_ID);
|
||||||
public final CANSparkMax shooterTurret = new CANSparkMax(ShooterConstants.SHOOTER_TURRET_CAN_ID);
|
public final CANSparkMax shooterTurret = new CANSparkMax(ShooterConstants.TURRET_MOTOR_CAN_ID, MotorType.kBrushless);
|
||||||
//Create motor CANSparkMax
|
//Create motor CANSparkMax
|
||||||
void ConfigureShooterMotorControllers() {
|
void ConfigureShooterMotorControllers() {
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
package frc4388.robot.subsystems;
|
package frc4388.robot.subsystems;
|
||||||
|
|
||||||
|
import java.io.Console;
|
||||||
import java.util.Base64.Encoder;
|
import java.util.Base64.Encoder;
|
||||||
|
|
||||||
import com.ctre.phoenix.motorcontrol.NeutralMode;
|
import com.ctre.phoenix.motorcontrol.NeutralMode;
|
||||||
@@ -27,6 +28,7 @@ public ShooterTables m_shooterTable;
|
|||||||
public static Gains m_drumShooterGains = ShooterConstants.DRUM_SHOOTER_GAINS;
|
public static Gains m_drumShooterGains = ShooterConstants.DRUM_SHOOTER_GAINS;
|
||||||
public static BoomBoom m_boomBoom;
|
public static BoomBoom m_boomBoom;
|
||||||
public static IHandController m_driverController; //not sure if driverController in 2022 = m_controller in 2020
|
public static IHandController m_driverController; //not sure if driverController in 2022 = m_controller in 2020
|
||||||
|
BangBangController m_controller = new BangBangController();
|
||||||
|
|
||||||
double velP;
|
double velP;
|
||||||
double input;
|
double input;
|
||||||
@@ -135,7 +137,6 @@ public void setShooterGains() {
|
|||||||
m_shooterFalconLeft.set(TalonFXControlMode.Velocity, targetVel); //Init
|
m_shooterFalconLeft.set(TalonFXControlMode.Velocity, targetVel); //Init
|
||||||
m_shooterFalconRight.follow(m_shooterFalconLeft);
|
m_shooterFalconRight.follow(m_shooterFalconLeft);
|
||||||
// New BoomBoom controller stuff
|
// New BoomBoom controller stuff
|
||||||
BangBangController controller = new BangBangController();
|
|
||||||
//Controls a motor with the output of the BangBang controller
|
//Controls a motor with the output of the BangBang controller
|
||||||
//Controls a motor with the output of the BangBang conroller and a feedforward
|
//Controls a motor with the output of the BangBang conroller and a feedforward
|
||||||
//Shrinks the feedforward slightly to avoid over speeding the shooter
|
//Shrinks the feedforward slightly to avoid over speeding the shooter
|
||||||
@@ -143,4 +144,4 @@ public void setShooterGains() {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,11 +67,11 @@ public class Turret extends SubsystemBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void periodic() {
|
public void periodic() {
|
||||||
SmartDashboard.putNumber("Turret Angle Raw", getboomBoomRotatePosition());
|
// SmartDashboard.putNumber("Turret Angle Raw", getboomBoomRotatePosition());
|
||||||
|
|
||||||
SmartDashboard.putData("Turret Angle", (Sendable) m_turretGyro);
|
// SmartDashboard.putData("Turret Angle", (Sendable) m_turretGyro);
|
||||||
|
|
||||||
SmartDashboard.putBoolean("Turret Aimed", m_isAimReady);
|
// SmartDashboard.putBoolean("Turret Aimed", m_isAimReady);
|
||||||
// This method will be called once per scheduler run
|
// This method will be called once per scheduler run
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user