Merge branch 'main' of https://github.com/FairportRobotics/Castor2026
This commit is contained in:
commit
fe41bbd735
|
|
@ -7,7 +7,7 @@
|
||||||
{
|
{
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"data": {
|
"data": {
|
||||||
"pathName": "1.1 Hub to Shoot Path"
|
"pathName": "1.1 Hub to Shoot"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,12 @@
|
||||||
"data": {
|
"data": {
|
||||||
"pathName": "9.1 Chaos Monkey Path"
|
"pathName": "9.1 Chaos Monkey Path"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "Shoot preload"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@
|
||||||
"pointTowardsZones": [],
|
"pointTowardsZones": [],
|
||||||
"eventMarkers": [],
|
"eventMarkers": [],
|
||||||
"globalConstraints": {
|
"globalConstraints": {
|
||||||
"maxVelocity": 3.0,
|
"maxVelocity": 1.5,
|
||||||
"maxAcceleration": 3.0,
|
"maxAcceleration": 1.5,
|
||||||
"maxAngularVelocity": 540.0,
|
"maxAngularVelocity": 540.0,
|
||||||
"maxAngularAcceleration": 720.0,
|
"maxAngularAcceleration": 720.0,
|
||||||
"nominalVoltage": 12.0,
|
"nominalVoltage": 12.0,
|
||||||
|
|
@ -42,13 +42,17 @@
|
||||||
},
|
},
|
||||||
"goalEndState": {
|
"goalEndState": {
|
||||||
"velocity": 0,
|
"velocity": 0,
|
||||||
"rotation": 0.0
|
"rotation": -177.9047474356738
|
||||||
},
|
},
|
||||||
"reversed": false,
|
"reversed": false,
|
||||||
"folder": null,
|
"folder": null,
|
||||||
"idealStartingState": {
|
"idealStartingState": {
|
||||||
"velocity": 0,
|
"velocity": 0,
|
||||||
|
<<<<<<< HEAD:src/main/deploy/pathplanner/paths/Hub to Depot.path
|
||||||
|
"rotation": -179.99999999992184
|
||||||
|
=======
|
||||||
"rotation": -179.69626968995792
|
"rotation": -179.69626968995792
|
||||||
|
>>>>>>> c2fa27aa5cc22124b930645e802b8176658edb7a:src/main/deploy/pathplanner/paths/1.1 Hub to Shoot Path.path
|
||||||
},
|
},
|
||||||
"useDefaultConstraints": true
|
"useDefaultConstraints": false
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
"version": "2025.0",
|
||||||
|
"waypoints": [
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 3.5,
|
||||||
|
"y": 4.0
|
||||||
|
},
|
||||||
|
"prevControl": null,
|
||||||
|
"nextControl": {
|
||||||
|
"x": 2.75,
|
||||||
|
"y": 4.0
|
||||||
|
},
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anchor": {
|
||||||
|
"x": 2.0,
|
||||||
|
"y": 4.0
|
||||||
|
},
|
||||||
|
"prevControl": {
|
||||||
|
"x": 2.75,
|
||||||
|
"y": 4.0
|
||||||
|
},
|
||||||
|
"nextControl": null,
|
||||||
|
"isLocked": false,
|
||||||
|
"linkedName": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rotationTargets": [],
|
||||||
|
"constraintZones": [],
|
||||||
|
"pointTowardsZones": [],
|
||||||
|
"eventMarkers": [],
|
||||||
|
"globalConstraints": {
|
||||||
|
"maxVelocity": 3.0,
|
||||||
|
"maxAcceleration": 3.0,
|
||||||
|
"maxAngularVelocity": 540.0,
|
||||||
|
"maxAngularAcceleration": 720.0,
|
||||||
|
"nominalVoltage": 12.0,
|
||||||
|
"unlimited": false
|
||||||
|
},
|
||||||
|
"goalEndState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": 177.4888349270938
|
||||||
|
},
|
||||||
|
"reversed": false,
|
||||||
|
"folder": null,
|
||||||
|
"idealStartingState": {
|
||||||
|
"velocity": 0,
|
||||||
|
"rotation": -179.0393266954795
|
||||||
|
},
|
||||||
|
"useDefaultConstraints": true
|
||||||
|
}
|
||||||
|
|
@ -33,16 +33,16 @@
|
||||||
"pointTowardsZones": [],
|
"pointTowardsZones": [],
|
||||||
"eventMarkers": [],
|
"eventMarkers": [],
|
||||||
"globalConstraints": {
|
"globalConstraints": {
|
||||||
"maxVelocity": 3.0,
|
"maxVelocity": 1.5,
|
||||||
"maxAcceleration": 3.0,
|
"maxAcceleration": 1.5,
|
||||||
"maxAngularVelocity": 540.0,
|
"maxAngularVelocity": 100.0,
|
||||||
"maxAngularAcceleration": 720.0,
|
"maxAngularAcceleration": 100.0,
|
||||||
"nominalVoltage": 12.0,
|
"nominalVoltage": 12.0,
|
||||||
"unlimited": false
|
"unlimited": false
|
||||||
},
|
},
|
||||||
"goalEndState": {
|
"goalEndState": {
|
||||||
"velocity": 0,
|
"velocity": 0,
|
||||||
"rotation": 0.0
|
"rotation": -179.02897806892076
|
||||||
},
|
},
|
||||||
"reversed": false,
|
"reversed": false,
|
||||||
"folder": null,
|
"folder": null,
|
||||||
|
|
@ -50,5 +50,5 @@
|
||||||
"velocity": 0,
|
"velocity": 0,
|
||||||
"rotation": -179.69626968995792
|
"rotation": -179.69626968995792
|
||||||
},
|
},
|
||||||
"useDefaultConstraints": true
|
"useDefaultConstraints": false
|
||||||
}
|
}
|
||||||
|
|
@ -82,10 +82,11 @@ public class RobotContainer {
|
||||||
// m_driverController:wa.a().whileTrue(new AutoShootCommandChassisTurret(driveSubsystem, hopperSubsystem, turretSubsystem));
|
// m_driverController:wa.a().whileTrue(new AutoShootCommandChassisTurret(driveSubsystem, hopperSubsystem, turretSubsystem));
|
||||||
|
|
||||||
m_driverController.leftBumper().onTrue(Commands.runOnce(() -> turretSubsystem.homeTurret(), turretSubsystem));
|
m_driverController.leftBumper().onTrue(Commands.runOnce(() -> turretSubsystem.homeTurret(), turretSubsystem));
|
||||||
m_driverController.rightBumper().onTrue(intakeSubsystem.intake());
|
m_driverController.rightBumper().onTrue(Commands.parallel(intakeSubsystem.intake()));
|
||||||
m_driverController.y().whileTrue(new RelayCommand(hopperSubsystem, turretSubsystem, intakeSubsystem));
|
m_driverController.y().whileTrue(new RelayCommand(hopperSubsystem, turretSubsystem, intakeSubsystem));
|
||||||
m_driverController.start().whileTrue(intakeSubsystem.resetDeploy());
|
m_driverController.start().whileTrue(intakeSubsystem.resetDeploy());
|
||||||
m_driverController.x().toggleOnTrue(new AutoShootCommandChassisTurret(driveSubsystem, hopperSubsystem, turretSubsystem));
|
m_driverController.x().whileTrue(new AutoShootCommandChassisTurret(driveSubsystem, hopperSubsystem, turretSubsystem));
|
||||||
|
m_driverController.b().toggleOnTrue(new ZoneCheck(driveSubsystem));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ public class AutoShootCommandChassisTurret extends Command{
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
turretSubsystem.setLauncher(6000);
|
turretSubsystem.setLauncher(3000);
|
||||||
turretSubsystem.setTargetElevation(Constants.ShooterConstants.DEFLECTOR_STORED_ANGLE);
|
turretSubsystem.setTargetElevation(Constants.ShooterConstants.DEFLECTOR_STORED_ANGLE);
|
||||||
hopperSubsystem.spindexerOn();
|
hopperSubsystem.spindexerOn();
|
||||||
cameraAutoCenterController.calculate(-100);
|
cameraAutoCenterController.calculate(-100);
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,13 @@ public class ZoneCheck extends Command {
|
||||||
switch (zone) {
|
switch (zone) {
|
||||||
case Blue:
|
case Blue:
|
||||||
System.out.println("BLUE");
|
System.out.println("BLUE");
|
||||||
|
break;
|
||||||
case Neutral:
|
case Neutral:
|
||||||
System.out.println("NEUTRAL");
|
System.out.println("NEUTRAL");
|
||||||
|
break;
|
||||||
case Red:
|
case Red:
|
||||||
System.out.println("RED");
|
System.out.println("RED");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
System.out.println("****");
|
System.out.println("****");
|
||||||
}
|
}
|
||||||
|
|
@ -52,10 +55,13 @@ public class ZoneCheck extends Command {
|
||||||
switch (zone) {
|
switch (zone) {
|
||||||
case Blue:
|
case Blue:
|
||||||
System.out.println("BLUE");
|
System.out.println("BLUE");
|
||||||
|
break;
|
||||||
case Neutral:
|
case Neutral:
|
||||||
System.out.println("NEUTRAL");
|
System.out.println("NEUTRAL");
|
||||||
|
break;
|
||||||
case Red:
|
case Red:
|
||||||
System.out.println("RED");
|
System.out.println("RED");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
System.out.println("****");
|
System.out.println("****");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,8 +165,8 @@ public class DriveSubsystem extends TestableSubsystem {
|
||||||
driveSystem::getRobotRelativeSpeeds,
|
driveSystem::getRobotRelativeSpeeds,
|
||||||
(speeds, feedforwards) -> driveSystem.setChassisSpeed(speeds, new Translation2d()),
|
(speeds, feedforwards) -> driveSystem.setChassisSpeed(speeds, new Translation2d()),
|
||||||
new PPHolonomicDriveController(
|
new PPHolonomicDriveController(
|
||||||
new PIDConstants(1.5, 0, 0),
|
new PIDConstants(3, 0, 0),
|
||||||
new PIDConstants(Math.PI / 2, 0, 0)),
|
new PIDConstants(Math.PI, 0, 0)),
|
||||||
config,
|
config,
|
||||||
() -> {
|
() -> {
|
||||||
var alliance = DriverStation.getAlliance();
|
var alliance = DriverStation.getAlliance();
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import com.ctre.phoenix6.hardware.TalonFX;
|
||||||
import edu.wpi.first.units.AngularVelocityUnit;
|
import edu.wpi.first.units.AngularVelocityUnit;
|
||||||
import edu.wpi.first.units.Units;
|
import edu.wpi.first.units.Units;
|
||||||
import edu.wpi.first.units.measure.AngularVelocity;
|
import edu.wpi.first.units.measure.AngularVelocity;
|
||||||
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
|
||||||
import static org.fairportrobotics.frc.posty.assertions.Assertions.*;
|
import static org.fairportrobotics.frc.posty.assertions.Assertions.*;
|
||||||
import frc.robot.Constants;
|
import frc.robot.Constants;
|
||||||
|
|
@ -64,13 +65,13 @@ public class HopperSubsystem extends TestableSubsystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void feedKicker() {
|
public void feedKicker() {
|
||||||
kickerMotor.setControl(kickerControl.withVelocity(1000));
|
//kickerMotor.setControl(kickerControl.withVelocity(1000));
|
||||||
// kickerMotor.set(0.75);
|
kickerMotor.set(0.75);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reverseKicker() {
|
public void reverseKicker() {
|
||||||
kickerMotor.setControl(kickerControl.withVelocity(-500));
|
//kickerMotor.setControl(kickerControl.withVelocity(-500));
|
||||||
// kickerMotor.set(-0.5);
|
kickerMotor.set(-0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopKicker() {kickerMotor.stopMotor();}
|
public void stopKicker() {kickerMotor.stopMotor();}
|
||||||
|
|
|
||||||
|
|
@ -110,8 +110,8 @@ public class TurretSubsystem extends TestableSubsystem {
|
||||||
SparkMaxConfig config = new SparkMaxConfig().apply((SparkMaxConfig) SparkMaxConfig.Presets.REV_NEO);
|
SparkMaxConfig config = new SparkMaxConfig().apply((SparkMaxConfig) SparkMaxConfig.Presets.REV_NEO);
|
||||||
config.inverted(Constants.ShooterConstants.LAUNCHER_MOTOR_INVERTED);
|
config.inverted(Constants.ShooterConstants.LAUNCHER_MOTOR_INVERTED);
|
||||||
config.voltageCompensation(10);
|
config.voltageCompensation(10);
|
||||||
config.closedLoop.p(0.0001).i(0).d(0.0); // I = 0.0000001
|
config.closedLoop.p(0.0002).i(0.000001).d(0.0005); // I = 0.0000001
|
||||||
config.closedLoop.feedForward.kS(0.2).kV(0.002).kA(0.00);
|
config.closedLoop.feedForward.kS(0.2).kV(0.000).kA(0.000);
|
||||||
// config.closedLoop.allowedClosedLoopError(10, ClosedLoopSlot.kSlot0);
|
// config.closedLoop.allowedClosedLoopError(10, ClosedLoopSlot.kSlot0);
|
||||||
config.closedLoop.feedbackSensor(FeedbackSensor.kPrimaryEncoder);
|
config.closedLoop.feedbackSensor(FeedbackSensor.kPrimaryEncoder);
|
||||||
config.closedLoop.positionWrappingEnabled(false);
|
config.closedLoop.positionWrappingEnabled(false);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue