File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/main/java/frc/team2767/deepspace/control Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 2020import frc .team2767 .deepspace .command .states .SetFieldDirectionCommand ;
2121import frc .team2767 .deepspace .command .states .SetLevelCommand ;
2222import frc .team2767 .deepspace .command .vacuum .ActivateValveCommand ;
23- import frc .team2767 .deepspace .control .trigger .*;
2423import frc .team2767 .deepspace .subsystem .ElevatorLevel ;
2524import frc .team2767 .deepspace .subsystem .FieldDirection ;
2625import frc .team2767 .deepspace .subsystem .VacuumSubsystem ;
3029public class XboxControls {
3130
3231 private final Joystick xbox ;
32+ private static final double DEADBAND = 0.5 ;
3333
3434 private final Logger logger = LoggerFactory .getLogger (this .getClass ());
3535
@@ -48,31 +48,31 @@ public boolean get() {
4848 new Trigger () {
4949 @ Override
5050 public boolean get () {
51- return xbox .getRawAxis (Axis .RIGHT_Y .id ) < -0.1 ;
51+ return xbox .getRawAxis (Axis .RIGHT_Y .id ) < -DEADBAND ;
5252 }
5353 };
5454
5555 Trigger RightStickDown =
5656 new Trigger () {
5757 @ Override
5858 public boolean get () {
59- return xbox .getRawAxis (Axis .RIGHT_Y .id ) > 0.1 ;
59+ return xbox .getRawAxis (Axis .RIGHT_Y .id ) > DEADBAND ;
6060 }
6161 };
6262
6363 Trigger LeftStickRight =
6464 new Trigger () {
6565 @ Override
6666 public boolean get () {
67- return xbox .getRawAxis (Axis .LEFT_X .id ) > 0.1 ;
67+ return xbox .getRawAxis (Axis .LEFT_X .id ) > DEADBAND ;
6868 }
6969 };
7070
7171 Trigger LeftStickLeft =
7272 new Trigger () {
7373 @ Override
7474 public boolean get () {
75- return xbox .getRawAxis (Axis .LEFT_X .id ) < -0.1 ;
75+ return xbox .getRawAxis (Axis .LEFT_X .id ) < -DEADBAND ;
7676 }
7777 };
7878
You can’t perform that action at this time.
0 commit comments