This commit is contained in:
Olivier Dubois 2023-03-08 18:13:47 -05:00
parent a50cbc2cf5
commit cea457445c
3 changed files with 3 additions and 17 deletions

View File

@ -12,9 +12,7 @@ import edu.wpi.first.wpilibj.PneumaticsModuleType;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
import edu.wpi.first.wpilibj.motorcontrol.MotorControllerGroup;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;
@ -33,9 +31,6 @@ public class BasePilotable extends SubsystemBase {
private DoubleSolenoid brakegauche = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.brakegauche, Constants.brakegauche);
//gyro
ShuffleboardTab teb = Shuffleboard.getTab("teb");
ShuffleboardLayout layout = Shuffleboard.getTab("teb")
.getLayout ("distance", BuiltInLayouts.kList)
.withSize(2, 2);
private AHRS gyroscope = new AHRS();public double getangle() {return gyroscope.getAngle();}
public double getpitch() {
return gyroscope.getPitch();
@ -70,7 +65,7 @@ public void resetGyro(){
/** Creates a new BasePilotable. */
public BasePilotable() {
droit.setInverted(true);
layout .addDouble("distance", this::distance);
teb .addDouble("distance", this::distance);
}
@Override

View File

@ -12,27 +12,18 @@ import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.PneumaticsModuleType;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;
public class BrasTelescopique extends SubsystemBase {
ShuffleboardTab teb = Shuffleboard.getTab("teb");
ShuffleboardLayout layout = Shuffleboard.getTab("teb")
.getLayout("layout", BuiltInLayouts.kList)
.withSize(2, 2);
ShuffleboardLayout bras = Shuffleboard.getTab("teb")
.getLayout("bras", BuiltInLayouts.kList)
.withSize(2, 2);
/** Creates a new BrasTelescopique. */
public BrasTelescopique() {
teb .add("photocell",0.1);
teb .add("winch",0.1);
bras.add ("encodeur",0.1);}
teb .add ("encodeur",0.1);}
final CANSparkMax Winch = new CANSparkMax(Constants.BrasTelescopique,MotorType.kBrushless);
private DigitalInput photocell = new DigitalInput(Constants.photocell);
private DoubleSolenoid brakewinch = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.brakewinchf, Constants.brakewinchb);