11package frc .robot .subsystems .carriage ;
22
3- import java .util .function .Supplier ;
4-
53import edu .wpi .first .math .controller .PIDController ;
64import edu .wpi .first .math .controller .SimpleMotorFeedforward ;
75import edu .wpi .first .math .trajectory .TrapezoidProfile ;
8- import edu .wpi .first .util .sendable .Sendable ;
9- import edu .wpi .first .util .sendable .SendableBuilder ;
10- import edu .wpi .first .wpilibj .shuffleboard .BuiltInWidgets ;
11- import edu .wpi .first .wpilibj .smartdashboard .SmartDashboard ;
126import frc .robot .DroidRageConstants .Control ;
137import frc .utility .motor .CANMotorEx ;
148import frc .utility .motor .TalonEx ;
159import frc .utility .motor .CANMotorEx .Direction ;
1610import frc .utility .motor .CANMotorEx .ZeroPowerMode ;
1711import frc .utility .template .IntakeTemplate ;
18- import lombok .Getter ;
19- import lombok .Setter ;
2012
2113public class Intake extends IntakeTemplate {
2214 private static class Constants {
2315 public static final double MAX_SPEED = 800 ;
2416 public static final double MIN_SPEED = -800 ;
2517 }
26- // private final ShuffleboardValue<Boolean> isElementInWriter =
27- // ShuffleboardValue.create(false, "IsElement", Carriage.class.getSimpleName())
28- // .withWidget(BuiltInWidgets.kBooleanBox)
29- // .build();
30- // private final ComplexWidgetBuilder builder = ComplexWidgetBuilder
31- // .create("f", "test", Carriage.class.getSimpleName())
32- // .withWidget(BuiltInWidgets.kTextView)
33- // .withSize(2, 1)
34- // .withPosition(0, 0)
35- // .withIsEnabled(true)
36- // .withDefaultValue("Intake");
37-
38- // private final Supplier<Boolean> isElementIn = () -> (getTargetPosition() - getEncoderPosition() > 40);
3918
4019 private static TalonEx motor = TalonEx .create (31 )
4120 .withDirection (Direction .Reversed )
@@ -53,25 +32,10 @@ public Intake(boolean isEnabled) {
5332 new SimpleMotorFeedforward (.0 , .6 , 0.3 ),
5433 new TrapezoidProfile .Constraints (0 , 0 ),
5534 Constants .MAX_SPEED , Constants .MIN_SPEED ,
56- Control .FEEDFORWARD , Carriage .class .getSimpleName (), "Intake" , 0 );
57- motor .setIsEnabled (isEnabled );
58- //Change
59- SmartDashboard .putData ("iintakemotor" , motor .getMotor ());
60- SmartDashboard .putData ("Is Element In" , isElementIn );
61- // isElementIn = this::(getTargetPosition() - getEncoderPosition() > 40);
35+ Control .FEEDFORWARD , Carriage .class .getSimpleName (), "Intake" , 0 , isEnabled );
36+
6237 }
6338
64-
65-
66- private final Sendable isElementIn = new Sendable () {
67- @ Override
68- public void initSendable (SendableBuilder builder ) {
69- builder .setSmartDashboardType ("Boolean Box" );
70-
71- builder .addBooleanProperty ("Is Element In" , () -> (getTargetPosition () - getEncoderPosition () > 40 ), null );
72- }
73- };
74-
7539 // public Command setPowerCommand(double power){
7640 // return new InstantCommand(()->motor.setPower(power));
7741 // }
0 commit comments