tesdrfhgjbn
This commit is contained in:
parent
8bee4280be
commit
426d7e9885
@ -14,6 +14,11 @@ import edu.wpi.first.wpilibj2.command.RunCommand;
|
||||
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
|
||||
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
||||
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
|
||||
import frc.robot.commands.Avancer;
|
||||
import frc.robot.commands.Force1;
|
||||
import frc.robot.commands.Force6;
|
||||
import frc.robot.commands.Force7;
|
||||
import frc.robot.commands.Reculer;
|
||||
import frc.robot.subsystems.Accumulateur;
|
||||
import frc.robot.subsystems.Drive;
|
||||
import frc.robot.subsystems.Lanceur;
|
||||
@ -21,6 +26,9 @@ import frc.robot.subsystems.Lanceur;
|
||||
public class RobotContainer {
|
||||
Lanceur lanceur = new Lanceur();
|
||||
Accumulateur accumulateur = new Accumulateur();
|
||||
Force7 Force7 = new Force7(lanceur, null, accumulateur);
|
||||
|
||||
Force1 Force1 = new Force1(lanceur, accumulateur, null);
|
||||
ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard");
|
||||
ShuffleboardLayout forces = Shuffleboard.getTab("Dashboard")
|
||||
.getLayout("limitswitchsgratte", BuiltInLayouts.kList)
|
||||
@ -54,6 +62,7 @@ public class RobotContainer {
|
||||
}
|
||||
|
||||
public Command getAutonomousCommand() {
|
||||
return new SequentialCommandGroup(null);
|
||||
return new SequentialCommandGroup(new Avancer(drive), new Force7(lanceur, force7, accumulateur)
|
||||
, new Force1(lanceur, accumulateur, force1), new Reculer(drive));
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ public class Avancer extends CommandBase {
|
||||
private Drive drive;
|
||||
/** Creates a new Avancer. */
|
||||
public Avancer(Drive drive) {
|
||||
this.drive = drive;
|
||||
addRequirements(drive);
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
}
|
||||
|
||||
|
38
src/main/java/frc/robot/commands/Reculer.java
Normal file
38
src/main/java/frc/robot/commands/Reculer.java
Normal file
@ -0,0 +1,38 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.CommandBase;
|
||||
import frc.robot.subsystems.Drive;
|
||||
|
||||
public class Reculer extends CommandBase {
|
||||
private Drive drive;
|
||||
/** Creates a new Reculer. */
|
||||
public Reculer(Drive drive) {
|
||||
this.drive = drive;
|
||||
addRequirements(drive);
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
}
|
||||
|
||||
// Called when the command is initially scheduled.
|
||||
@Override
|
||||
public void initialize() {}
|
||||
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
drive.drive(-0.5, -0.2, 0);
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -30,8 +30,9 @@ public class Drive extends SubsystemBase {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
public void reset(){
|
||||
}
|
||||
/* public double distance(){
|
||||
return
|
||||
}*/
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
|
Loading…
x
Reference in New Issue
Block a user