This commit is contained in:
samuel desharnais
2022-11-21 17:55:47 -05:00
6 changed files with 378 additions and 0 deletions

View File

@ -15,6 +15,15 @@ package frc.robot;
* constants are needed, to reduce verbosity.
*/
public final class Constants {
public static final int MoteurAvantGauche = (0);
public static final int MoteurAvantDroit = (0);
public static final int MoteurArriereGauche = (0);
public static final int MoteurArriereDroit = (0);
public static final int PistonPousserR = 0;
public static final int PistonPousserF = 1;
public static final int pistonQuiShakef = 0;
public static final int pistonQuiShakeb = 1;
public static final int pistonBloqueurR = 2;
public static final int pistonBloqueurF = 3;
}

View File

@ -0,0 +1,34 @@
// 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.Poussoir;
public class Activer_poussoir extends CommandBase {
private Poussoir poussoir;
public Activer_poussoir(Poussoir poussoir) {
this.poussoir = poussoir;
addRequirements(poussoir);
}
// Called when the command is initially scheduled.
@Override
public void initialize() {}
// 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;
}
}

View File

@ -0,0 +1,39 @@
// 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.subsystems;
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
import edu.wpi.first.wpilibj.drive.MecanumDrive;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;
public class BasePilotable extends SubsystemBase {
private WPI_TalonSRX avantGauche = new WPI_TalonSRX(Constants.MoteurAvantGauche);
private WPI_TalonSRX avantDroit = new WPI_TalonSRX(Constants.MoteurAvantDroit);
private WPI_TalonSRX arriereGauche = new WPI_TalonSRX(Constants.MoteurArriereGauche);
private WPI_TalonSRX arriereDroit = new WPI_TalonSRX(Constants.MoteurArriereDroit);
private MecanumDrive mecanum = new MecanumDrive(avantGauche, arriereGauche, avantDroit, arriereDroit);
private void drive(double y, double x, double rot){
mecanum.driveCartesian(y, x, rot, 0);
}
/** Creates a new BasePilotable. */
public BasePilotable() {
avantDroit.setInverted(true);
arriereDroit.setInverted(true);
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}

View File

@ -0,0 +1,39 @@
// 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.subsystems;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.PneumaticsModuleType;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;
public class Poussoir extends SubsystemBase {
private DoubleSolenoid pousser = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.PistonPousserR,Constants.PistonPousserF );
private DoubleSolenoid bloqueur = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.pistonBloqueurR,Constants.pistonBloqueurF);
/** Creates a new Poussoir. */
public Poussoir() {
}
public void pousser(){
}
public void bloquer(){
}
public void debloque(){
}
public void tirer(){
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}