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