33import edu .wpi .first .wpilibj .Compressor ;
44import edu .wpi .first .wpilibj .PowerDistributionPanel ;
55import edu .wpi .first .wpilibj .TimedRobot ;
6+ import edu .wpi .first .wpilibj .buttons .POVButton ;
67import edu .wpi .first .wpilibj .command .Scheduler ;
8+ import edu .wpi .first .wpilibj .smartdashboard .SmartDashboard ;
79import frc .team4909 .robot .operator .controllers .BionicF310 ;
10+ import frc .team4909 .robot .operator .controllers .FlightStick ;
811import frc .team4909 .robot .sensors .LidarLitePWM ;
912import frc .team4909 .robot .sensors .Stream ;
13+ import frc .team4909 .robot .setpoints .HatchLow ;
14+ import frc .team4909 .robot .setpoints .HatchMiddle ;
1015import frc .team4909 .robot .subsystems .climber .ClimberSubsystem ;
1116import frc .team4909 .robot .subsystems .climber .commands .DriveStiltsBack ;
1217import frc .team4909 .robot .subsystems .climber .commands .DriveStiltsForward ;
13- import frc .team4909 .robot .subsystems .climber .commands .ExtendStilts ;
14- import frc .team4909 .robot .subsystems .climber .commands .RetractStilts ;
18+ import frc .team4909 .robot .subsystems .climber .commands .StiltsDownOnly ;
19+ import frc .team4909 .robot .subsystems .climber .commands .StiltsUpOnly ;
1520import frc .team4909 .robot .subsystems .drivetrain .DriveTrainSubsystem ;
1621import frc .team4909 .robot .subsystems .drivetrain .Linefollow ;
1722import frc .team4909 .robot .subsystems .drivetrain .commands .InvertDriveDirection ;
2328import frc .team4909 .robot .subsystems .intake .commands .CargoIntakeOut ;
2429import frc .team4909 .robot .subsystems .intake .commands .HatchPanelIntakeOpen ;
2530
31+ import frc .team4909 .robot .subsystems .climber .commands .ZeroStilts ;
32+ import frc .team4909 .robot .subsystems .elevator .commands .ZeroElevator ;
33+
2634// Controls:
2735//
2836// Driver Gamepad (Port 0):
4149// RT: Cargo Intake In
4250// RB: Cargo Intake Out
4351// LT: Hatch Panel Intake In
52+ //
53+ // Flight Stick (Port 2):
54+ // Y: Stilt/Elevator Climb Speed
55+ // Joystick: Stilt Up/Down
4456
4557public class Robot extends TimedRobot {
4658
@@ -50,7 +62,8 @@ public class Robot extends TimedRobot {
5062 // Operator Input
5163 public static BionicF310 driverGamepad ;
5264 public static BionicF310 manipulatorGamepad ;
53- public boolean StiltsStop ;
65+ public static BionicF310 climberGamepad ;
66+ public static FlightStick climbStick ;
5467
5568 // Subsystems
5669 public static PowerDistributionPanel powerDistributionPanel ;
@@ -77,9 +90,9 @@ public class Robot extends TimedRobot {
7790 public void robotInit () {
7891
7992 // Cameras (subsystem)
80- stream = new Stream ();
81- // CameraServer.getInstance().startAutomaticCapture();
82- stream .streamCamera ();
93+ // stream = new Stream();
94+ // // CameraServer.getInstance().startAutomaticCapture();
95+ // stream.streamCamera();
8396 // grip = new GripPipeline();
8497
8598 // Compressor
@@ -107,6 +120,15 @@ public void robotInit() {
107120 RobotConstants .manipulatorGamepadDeadzone , // Deadzone
108121 RobotConstants .manipulatorGamepadSensitivity // Gamepad sensitivity
109122 );
123+
124+ climberGamepad = new BionicF310 (3 , // Port
125+ RobotConstants .manipulatorGamepadDeadzone , // Deadzone
126+ RobotConstants .manipulatorGamepadSensitivity // Gamepad sensitivity
127+ );
128+
129+
130+ climbStick = new FlightStick (2 );
131+
110132 /* Drivetrain */
111133
112134 /* Intake */
@@ -115,18 +137,23 @@ public void robotInit() {
115137 manipulatorGamepad .buttonHeld (BionicF310 .LT , 0.2 , new HatchPanelIntakeOpen ());
116138
117139 /* Climber */
118- driverGamepad .buttonHeld (BionicF310 .RT , 0.2 , new ExtendStilts ());
119- driverGamepad .buttonHeld (BionicF310 .LT , 0.2 , new RetractStilts ());
120140 driverGamepad .buttonHeld (BionicF310 .LB , new DriveStiltsBack ());
121141 driverGamepad .buttonHeld (BionicF310 .RB , new DriveStiltsForward ());
142+ climberGamepad .buttonHeld (BionicF310 .RB , new StiltsUpOnly ());
143+ climberGamepad .buttonHeld (BionicF310 .LB , new StiltsDownOnly ());
144+
122145
123- /* Elevator */
124- manipulatorGamepad .buttonPressed (BionicF310 .A , new SetElevatorPosition (-13000 , 1 ));
146+ /* Elevator Setpoints */
147+ manipulatorGamepad .buttonPressed (BionicF310 .A , new HatchMiddle ());
148+ manipulatorGamepad .buttonPressed (BionicF310 .B , new HatchLow ());
125149
126150 /* Sensors/Misc. */
127151 driverGamepad .buttonPressed (BionicF310 .A , new InvertDriveDirection ());
128152 driverGamepad .buttonPressed (BionicF310 .B , new Linefollow ());
129- }
153+
154+ SmartDashboard .putData (new ZeroElevator ());
155+ SmartDashboard .putData (new ZeroStilts ());
156+ }
130157
131158 /**
132159 * '' This function is called every robot packet, no matter the mode. Use this
@@ -158,9 +185,21 @@ public void autonomousPeriodic() {
158185 /**
159186 * This function is called periodically during operator control.
160187 */
188+
161189 @ Override
162- public void teleopPeriodic () {
190+ public void teleopInit () {
191+ // Reset elevator encoder
192+
193+ }
194+ @ Override
195+ public void disabledPeriodic () {
196+ Scheduler .getInstance ().run ();
197+ elevatorSubsystem .reset ();
198+ climberSubsystem .reset ();
199+ }
163200
201+ @ Override
202+ public void teleopPeriodic () {
164203 }
165204
166205 /**
0 commit comments