mirror of
https://github.com/Team4388/2026KPopRobotHunters.git
synced 2026-06-08 16:28:05 -06:00
summary
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
{
|
{
|
||||||
|
"System Joysticks": {
|
||||||
|
"window": {
|
||||||
|
"enabled": false
|
||||||
|
}
|
||||||
|
},
|
||||||
"keyboardJoysticks": [
|
"keyboardJoysticks": [
|
||||||
{
|
{
|
||||||
"axisConfig": [
|
"axisConfig": [
|
||||||
|
|||||||
@@ -4,10 +4,22 @@
|
|||||||
"type": "sequential",
|
"type": "sequential",
|
||||||
"data": {
|
"data": {
|
||||||
"commands": [
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "Robot Rev Up"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "parallel",
|
"type": "parallel",
|
||||||
"data": {
|
"data": {
|
||||||
"commands": [
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "Robot Shoot"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"data": {
|
"data": {
|
||||||
@@ -19,12 +31,6 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"name": "Robot Shoot Driving"
|
"name": "Robot Shoot Driving"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "named",
|
|
||||||
"data": {
|
|
||||||
"name": "Robot Shoot"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,8 +154,8 @@ public class Robot extends LoggedRobot {
|
|||||||
|
|
||||||
double rumble = (info.remainingInShift() < 5. && info.remainingInShift() > 0.1) ? 1 : 0;
|
double rumble = (info.remainingInShift() < 5. && info.remainingInShift() > 0.1) ? 1 : 0;
|
||||||
|
|
||||||
m_robotContainer.getDeadbandedDriverController().setRumble(RumbleType.kBothRumble, rumble);
|
// m_robotContainer.getDeadbandedDriverController().setRumble(RumbleType.kBothRumble, rumble);
|
||||||
m_robotContainer.getDeadbandedOperatorController().setRumble(RumbleType.kBothRumble, rumble);
|
// m_robotContainer.getDeadbandedOperatorController().setRumble(RumbleType.kBothRumble, rumble);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ public class RobotContainer {
|
|||||||
//new AutoAlign(m_robotSwerveDrive, m_vision, new Pose2d(FieldPositions.HUB_POSITION, new Rotation2d(0)), false),
|
//new AutoAlign(m_robotSwerveDrive, m_vision, new Pose2d(FieldPositions.HUB_POSITION, new Rotation2d(0)), false),
|
||||||
new WaitUntilCommand(m_robotShooter::isShooterUpToSpeed),
|
new WaitUntilCommand(m_robotShooter::isShooterUpToSpeed),
|
||||||
new InstantCommand(()-> m_robotShooter.allowShooting(), m_robotShooter),
|
new InstantCommand(()-> m_robotShooter.allowShooting(), m_robotShooter),
|
||||||
new WaitCommand(2),
|
new WaitCommand(5),
|
||||||
IntakeRetracted,
|
IntakeRetracted,
|
||||||
new WaitCommand(5),
|
new WaitCommand(5),
|
||||||
new InstantCommand(() -> m_robotShooter.denyShooting(), m_robotShooter),
|
new InstantCommand(() -> m_robotShooter.denyShooting(), m_robotShooter),
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ public final class BuildConstants {
|
|||||||
public static final String MAVEN_GROUP = "";
|
public static final String MAVEN_GROUP = "";
|
||||||
public static final String MAVEN_NAME = "2026KPopRobotHunters";
|
public static final String MAVEN_NAME = "2026KPopRobotHunters";
|
||||||
public static final String VERSION = "unspecified";
|
public static final String VERSION = "unspecified";
|
||||||
public static final int GIT_REVISION = 171;
|
public static final int GIT_REVISION = 180;
|
||||||
public static final String GIT_SHA = "08f1e26f3a6a9eefad99783748191b0d98056b07";
|
public static final String GIT_SHA = "89a1f34a4a4751acadc1509890fed15d6d870930";
|
||||||
public static final String GIT_DATE = "2026-03-19 16:06:31 MDT";
|
public static final String GIT_DATE = "2026-03-20 23:50:03 MDT";
|
||||||
public static final String GIT_BRANCH = "gurt";
|
public static final String GIT_BRANCH = "MiraOrg";
|
||||||
public static final String BUILD_DATE = "2026-03-19 16:29:01 MDT";
|
public static final String BUILD_DATE = "2026-03-21 13:00:47 MDT";
|
||||||
public static final long BUILD_UNIX_TIME = 1773959341836L;
|
public static final long BUILD_UNIX_TIME = 1774119647384L;
|
||||||
public static final int DIRTY = 1;
|
public static final int DIRTY = 1;
|
||||||
|
|
||||||
private BuildConstants(){}
|
private BuildConstants(){}
|
||||||
|
|||||||
@@ -133,8 +133,7 @@ public class Shooter extends SubsystemBase {
|
|||||||
chassisSpeeds.vyMetersPerSecond
|
chassisSpeeds.vyMetersPerSecond
|
||||||
);
|
);
|
||||||
Translation2d fieldPosLead = robotSpeed.times(ShooterConstants.AIM_LEAD_TIME.get()).plus(FieldPositions.HUB_POSITION);
|
Translation2d fieldPosLead = robotSpeed.times(ShooterConstants.AIM_LEAD_TIME.get()).plus(FieldPositions.HUB_POSITION);
|
||||||
Rotation2d ang = m_SwerveDrive.getPose2d().getTranslation().minus(fieldPosLead).getAngle();
|
Rotation2d ang = m_SwerveDrive.getPose2d().getTranslation().minus(fieldPosLead).getAngle().minus(m_SwerveDrive.getPose2d().getRotation());
|
||||||
|
|
||||||
Pose2d robotPose2d = m_SwerveDrive.getPose2d();
|
Pose2d robotPose2d = m_SwerveDrive.getPose2d();
|
||||||
|
|
||||||
if (TimesNegativeOne.isRed) {
|
if (TimesNegativeOne.isRed) {
|
||||||
@@ -154,7 +153,8 @@ public class Shooter extends SubsystemBase {
|
|||||||
// XYSpeed <= ShooterConstants.ROBOT_SPEED_TOLERANCE.get() |
|
// XYSpeed <= ShooterConstants.ROBOT_SPEED_TOLERANCE.get() |
|
||||||
// AngSpeed <= ShooterConstants.ROBOT_ANG_SPEED_TOLERANCE.get() |
|
// AngSpeed <= ShooterConstants.ROBOT_ANG_SPEED_TOLERANCE.get() |
|
||||||
distanceToHub <= ShooterConstants.ROBOT_MIN_HUB.get() |
|
distanceToHub <= ShooterConstants.ROBOT_MIN_HUB.get() |
|
||||||
distanceToHub >= ShooterConstants.ROBOT_MAX_HUB.get();
|
distanceToHub >= ShooterConstants.ROBOT_MAX_HUB.get() |
|
||||||
|
Math.abs(ang.getDegrees()) > ShooterConstants.AIM_ANGLE.get();
|
||||||
|
|
||||||
|
|
||||||
double shooterSpeed = Math.abs(state.motor1Velocity.in(RotationsPerSecond) + state.motor2Velocity.in(RotationsPerSecond)) / 2;
|
double shooterSpeed = Math.abs(state.motor1Velocity.in(RotationsPerSecond) + state.motor2Velocity.in(RotationsPerSecond)) / 2;
|
||||||
@@ -186,9 +186,7 @@ public class Shooter extends SubsystemBase {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 0b001: // No errors and shoot button is pressed
|
case 0b001: // No errors and shoot button is pressed
|
||||||
if (ang.getDegrees() < ShooterConstants.AIM_ANGLE.get()){ // robot is aimed at hub
|
|
||||||
io.setIndexerOutput(state, ShooterConstants.INDEXER_FORWARD_OUTPUT.get());
|
io.setIndexerOutput(state, ShooterConstants.INDEXER_FORWARD_OUTPUT.get());
|
||||||
}
|
|
||||||
m_robotLED.setMode(Constants.LEDConstants.OPREADY);
|
m_robotLED.setMode(Constants.LEDConstants.OPREADY);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class ShooterConstants {
|
|||||||
public static final ConfigurableDouble ROBOT_MIN_HUB = new ConfigurableDouble("Shoot min dist M", 1.8);
|
public static final ConfigurableDouble ROBOT_MIN_HUB = new ConfigurableDouble("Shoot min dist M", 1.8);
|
||||||
public static final ConfigurableDouble ROBOT_MAX_HUB = new ConfigurableDouble("Shoot max dist M", 4.8);
|
public static final ConfigurableDouble ROBOT_MAX_HUB = new ConfigurableDouble("Shoot max dist M", 4.8);
|
||||||
|
|
||||||
public static final ConfigurableDouble AIM_ANGLE = new ConfigurableDouble("Aim angle tolerance", 5);
|
public static final ConfigurableDouble AIM_ANGLE = new ConfigurableDouble("Aim angle tolerance", 15);
|
||||||
public static final ConfigurableDouble ROBOT_ANG_TOLERANCE = new ConfigurableDouble("Ang tolerance DEG", 360);
|
public static final ConfigurableDouble ROBOT_ANG_TOLERANCE = new ConfigurableDouble("Ang tolerance DEG", 360);
|
||||||
|
|
||||||
public static final ConfigurableDouble ROBOT_SPEED_TOLERANCE = new ConfigurableDouble("Speed tolerance MS", 1);
|
public static final ConfigurableDouble ROBOT_SPEED_TOLERANCE = new ConfigurableDouble("Speed tolerance MS", 1);
|
||||||
|
|||||||
@@ -57,22 +57,22 @@ public class ShooterReal implements ShooterIO {
|
|||||||
@Override
|
@Override
|
||||||
public void motorStalled(ShooterState state, Intake m_Intake, LED m_robotLED) {
|
public void motorStalled(ShooterState state, Intake m_Intake, LED m_robotLED) {
|
||||||
motorStall = "";
|
motorStall = "";
|
||||||
// if (Math.abs(state.motor1TargetVelocity.in(RotationsPerSecond)) - Math.abs(state.motor1Velocity.in(RotationsPerSecond)) > 40) {
|
if (Math.abs(state.motor1TargetVelocity.in(RotationsPerSecond)) - Math.abs(state.motor1Velocity.in(RotationsPerSecond)) > 40) {
|
||||||
// if (!m_shooterStalling) {
|
if (!m_shooterStalling) {
|
||||||
// m_shooterStalling = true;
|
m_shooterStalling = true;
|
||||||
// m_stallTimerShooter.restart();
|
m_stallTimerShooter.restart();
|
||||||
// }
|
}
|
||||||
// if (m_stallTimerShooter.hasElapsed(5.0)) {
|
if (m_stallTimerShooter.hasElapsed(5.0)) {
|
||||||
// m_robotLED.setMode(Constants.LEDConstants.MOTOR_STALLED);
|
m_robotLED.setMode(Constants.LEDConstants.MOTOR_STALLED);
|
||||||
// motorStall = "Shooter Stalled";
|
motorStall = "Shooter Stalled";
|
||||||
// System.out.println("Shooter Stalled: " + (Math.abs(state.motor1TargetVelocity.in(RotationsPerSecond)) - Math.abs(state.motor1Velocity.in(RotationsPerSecond))));
|
System.out.println("Shooter Stalled: " + (Math.abs(state.motor1TargetVelocity.in(RotationsPerSecond)) - Math.abs(state.motor1Velocity.in(RotationsPerSecond))));
|
||||||
// System.out.println("Target Velocity: " + Math.abs(state.motor1TargetVelocity.in(RotationsPerSecond)));
|
System.out.println("Target Velocity: " + Math.abs(state.motor1TargetVelocity.in(RotationsPerSecond)));
|
||||||
// System.out.println("Actual Velocity: " + Math.abs(state.motor1Velocity.in(RotationsPerSecond)));
|
System.out.println("Actual Velocity: " + Math.abs(state.motor1Velocity.in(RotationsPerSecond)));
|
||||||
// }
|
}
|
||||||
// } else {
|
} else {
|
||||||
// m_shooterStalling = false;
|
m_shooterStalling = false;
|
||||||
// m_stallTimerShooter.reset();
|
m_stallTimerShooter.reset();
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (Math.abs(state.indexerTargetOutput) - Math.abs(state.indexerOutput) > 0.3) {
|
if (Math.abs(state.indexerTargetOutput) - Math.abs(state.indexerOutput) > 0.3) {
|
||||||
if (!m_indexerStalling) {
|
if (!m_indexerStalling) {
|
||||||
|
|||||||
Reference in New Issue
Block a user