完整正赛
This commit is contained in:
@@ -10,6 +10,12 @@
|
|||||||
"pathName": "Back To Shoot Blue"
|
"pathName": "Back To Shoot Blue"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "shoot"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
|
|||||||
@@ -0,0 +1,152 @@
|
|||||||
|
{
|
||||||
|
"version": "2025.0",
|
||||||
|
"command": {
|
||||||
|
"type": "sequential",
|
||||||
|
"data": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "parallel",
|
||||||
|
"data": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "path",
|
||||||
|
"data": {
|
||||||
|
"pathName": "Back To Shoot Red"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "intaker_down"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "parallel",
|
||||||
|
"data": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "shoot"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "intaker_down"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "start_intake_and_conveyor"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "parallel",
|
||||||
|
"data": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "path",
|
||||||
|
"data": {
|
||||||
|
"pathName": "Shoot to Depot Red"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "parallel",
|
||||||
|
"data": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "path",
|
||||||
|
"data": {
|
||||||
|
"pathName": "Depot Intake Red"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "parallel",
|
||||||
|
"data": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "AutoAim"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "stop_intake_and_conveyor"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "parallel",
|
||||||
|
"data": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "AutoShoot"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "Shake"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "intaker_up"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "parallel",
|
||||||
|
"data": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "AutoShoot"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "Shake"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "intaker_up"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"resetOdom": true,
|
||||||
|
"folder": "Red Middle",
|
||||||
|
"choreoAuto": false
|
||||||
|
}
|
||||||
@@ -19,12 +19,6 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"name": "intaker_down"
|
"name": "intaker_down"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "named",
|
|
||||||
"data": {
|
|
||||||
"name": "climber_init"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -129,21 +123,21 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"commands": [
|
"commands": [
|
||||||
{
|
{
|
||||||
"type": "path",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
"pathName": "blue depot go 1"
|
"name": "AutoShoot"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
"name": "start_intake"
|
"name": "Shake"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "named",
|
"type": "named",
|
||||||
"data": {
|
"data": {
|
||||||
"name": "reset_backboard0"
|
"name": "intaker_up"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -107,6 +107,12 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"name": "Shake"
|
"name": "Shake"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "intaker_up"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -126,6 +132,12 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"name": "Shake"
|
"name": "Shake"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "intaker_up"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class Robot extends TimedRobot {
|
|||||||
public void disabledInit() {
|
public void disabledInit() {
|
||||||
System.out.println("Robot disabledInit called");
|
System.out.println("Robot disabledInit called");
|
||||||
m_robotContainer.shooterSubsystem.stopAll();
|
m_robotContainer.shooterSubsystem.stopAll();
|
||||||
m_robotContainer.climberSubsystem.stopAll();
|
// m_robotContainer.climberSubsystem.stopAll();
|
||||||
m_robotContainer.IntakerSubsystem.stopAll();
|
m_robotContainer.IntakerSubsystem.stopAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class RobotContainer {
|
|||||||
|
|
||||||
// Phoenix TunerX 生成的底盘
|
// Phoenix TunerX 生成的底盘
|
||||||
public final CommandSwerveDrivetrain drivetrain = TunerConstants.createDrivetrain();
|
public final CommandSwerveDrivetrain drivetrain = TunerConstants.createDrivetrain();
|
||||||
public final ClimberSubsystem climberSubsystem = new ClimberSubsystem();
|
//public final ClimberSubsystem climberSubsystem = new ClimberSubsystem();
|
||||||
public final ShooterSubsystem shooterSubsystem = new ShooterSubsystem();
|
public final ShooterSubsystem shooterSubsystem = new ShooterSubsystem();
|
||||||
public final IntakerSubsystem IntakerSubsystem = new IntakerSubsystem();
|
public final IntakerSubsystem IntakerSubsystem = new IntakerSubsystem();
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ public class RobotContainer {
|
|||||||
|
|
||||||
public final DriveControls driveControls = new DriveControls(drivetrain, controllerlower, robotStatusManager );
|
public final DriveControls driveControls = new DriveControls(drivetrain, controllerlower, robotStatusManager );
|
||||||
private final ShooterControls shooterControls = new ShooterControls(shooterSubsystem, controllerupper,robotStatusManager);
|
private final ShooterControls shooterControls = new ShooterControls(shooterSubsystem, controllerupper,robotStatusManager);
|
||||||
private final ClimberControls climberControls = new ClimberControls(climberSubsystem, controllerupper);
|
//private final ClimberControls climberControls = new ClimberControls(climberSubsystem, controllerupper);
|
||||||
private final IntakerControls intakerControls = new IntakerControls(IntakerSubsystem, shooterSubsystem, controllerupper);
|
private final IntakerControls intakerControls = new IntakerControls(IntakerSubsystem, shooterSubsystem, controllerupper);
|
||||||
private final DriveGainsTuner driveGainsTuner = new DriveGainsTuner(drivetrain);
|
private final DriveGainsTuner driveGainsTuner = new DriveGainsTuner(drivetrain);
|
||||||
private ConfigTalonFXMotorTuner configFlywheelTuner = new ConfigTalonFXMotorTuner(shooterSubsystem.flywheelMotorLeft, "flywheel", Constants.Shooter.flyWheelSlot0Configs);
|
private ConfigTalonFXMotorTuner configFlywheelTuner = new ConfigTalonFXMotorTuner(shooterSubsystem.flywheelMotorLeft, "flywheel", Constants.Shooter.flyWheelSlot0Configs);
|
||||||
@@ -79,11 +79,19 @@ public class RobotContainer {
|
|||||||
drivetrain.resetPose(startingPose);
|
drivetrain.resetPose(startingPose);
|
||||||
configueSwerve();
|
configueSwerve();
|
||||||
configueShooter();
|
configueShooter();
|
||||||
configueClimber();
|
// configueClimber();
|
||||||
bingdingLED();
|
bingdingLED();
|
||||||
configueIntaker();
|
configueIntaker();
|
||||||
|
// Autocommand.preNameCommands(
|
||||||
|
// climberSubsystem,
|
||||||
|
// IntakerSubsystem,
|
||||||
|
// drivetrain,
|
||||||
|
// shooterSubsystem,
|
||||||
|
// driveControls,
|
||||||
|
// shooterControls
|
||||||
|
// );
|
||||||
|
|
||||||
Autocommand.preNameCommands(
|
Autocommand.preNameCommands(
|
||||||
climberSubsystem,
|
|
||||||
IntakerSubsystem,
|
IntakerSubsystem,
|
||||||
drivetrain,
|
drivetrain,
|
||||||
shooterSubsystem,
|
shooterSubsystem,
|
||||||
@@ -197,17 +205,17 @@ public class RobotContainer {
|
|||||||
shooterSubsystem.setRightFollowLeft();
|
shooterSubsystem.setRightFollowLeft();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configueClimber() {
|
// private void configueClimber() {
|
||||||
climberSubsystem.setDefaultCommand(climberControls.defaultClimberCommand());
|
// climberSubsystem.setDefaultCommand(climberControls.defaultClimberCommand());
|
||||||
}
|
// }
|
||||||
|
|
||||||
private void configueIntaker() {
|
private void configueIntaker() {
|
||||||
IntakerSubsystem.setDefaultCommand(intakerControls.defaultIntakerCommand());
|
IntakerSubsystem.setDefaultCommand(intakerControls.defaultIntakerCommand());
|
||||||
controllerupper.a().onTrue(intakerControls.resetIntakerRotaterEncoderCommand(IntakerSubsystem));
|
//controllerupper.a().onTrue(intakerControls.resetIntakerRotaterEncoderCommand(IntakerSubsystem));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClimberSubsystem getClimberSubsystem() {
|
// public ClimberSubsystem getClimberSubsystem() {
|
||||||
return climberSubsystem;
|
// return climberSubsystem;
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,15 +23,15 @@ import frc.robot.Constants.RobotStatus;
|
|||||||
public class Autocommand extends SequentialCommandGroup{
|
public class Autocommand extends SequentialCommandGroup{
|
||||||
|
|
||||||
public static void preNameCommands(
|
public static void preNameCommands(
|
||||||
ClimberSubsystem climber,
|
// ClimberSubsystem climber,
|
||||||
IntakerSubsystem intaker,
|
IntakerSubsystem intaker,
|
||||||
CommandSwerveDrivetrain drivetrain,
|
CommandSwerveDrivetrain drivetrain,
|
||||||
ShooterSubsystem shooter,
|
ShooterSubsystem shooter,
|
||||||
DriveControls driveControls,
|
DriveControls driveControls,
|
||||||
ShooterControls shooterControls
|
ShooterControls shooterControls
|
||||||
) {
|
) {
|
||||||
NamedCommands.registerCommand("climb_up", climb_up(climber));
|
// NamedCommands.registerCommand("climb_up", climb_up(climber));
|
||||||
NamedCommands.registerCommand("climb_down", climb_down(climber));
|
// NamedCommands.registerCommand("climb_down", climb_down(climber));
|
||||||
NamedCommands.registerCommand("start_intake", start_intake(intaker));
|
NamedCommands.registerCommand("start_intake", start_intake(intaker));
|
||||||
NamedCommands.registerCommand("start_intake_and_conveyor", start_intake_and_conveyor(intaker,shooter));
|
NamedCommands.registerCommand("start_intake_and_conveyor", start_intake_and_conveyor(intaker,shooter));
|
||||||
NamedCommands.registerCommand("stop_intake_and_conveyor", stop_intake_and_conveyor(intaker,shooter));
|
NamedCommands.registerCommand("stop_intake_and_conveyor", stop_intake_and_conveyor(intaker,shooter));
|
||||||
@@ -44,7 +44,7 @@ import frc.robot.Constants.RobotStatus;
|
|||||||
NamedCommands.registerCommand("Shake", shake(driveControls));
|
NamedCommands.registerCommand("Shake", shake(driveControls));
|
||||||
NamedCommands.registerCommand("AutoAim", autoAim(driveControls));
|
NamedCommands.registerCommand("AutoAim", autoAim(driveControls));
|
||||||
NamedCommands.registerCommand("AutoShoot", autoShoot(shooterControls));
|
NamedCommands.registerCommand("AutoShoot", autoShoot(shooterControls));
|
||||||
NamedCommands.registerCommand("climber_init", climber_Zeroencoder(climber));
|
// NamedCommands.registerCommand("climber_init", climber_Zeroencoder(climber));
|
||||||
NamedCommands.registerCommand("reset_backboard0", resetBackboard0Command(shooterControls));
|
NamedCommands.registerCommand("reset_backboard0", resetBackboard0Command(shooterControls));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user