This repository has been archived by the owner on Apr 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
control-schema.yml
138 lines (114 loc) · 3.99 KB
/
control-schema.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# package frc.robot;
# import edu.wpi.first.wpilibj.XboxController;
# import edu.wpi.first.wpilibj.buttons.Button;
# import frc.robot.autonomous.commandgroups.Climb;
# import edu.wpi.first.wpilibj.GenericHID;
# /**
# * This class is the glue that binds the controls on the physical operator
# * interface to the commands and command groups that allow control of the robot.
# */
# public class OI {
# //// CREATING BUTTONS
# // One type of button is a joystick button which is any button on a
# //// joystick.
# // You create one by telling it which joystick it's on and which button
# // number it is.
# // Joystick stick = new Joystick(port);
# // Button button = new JoystickButton(stick, buttonNumber);
# // There are a few additional built in buttons you can use. Additionally,
# // by subclassing Button you can create custom triggers and bind those to
# // commands the same as any other Button.
# //// TRIGGERING COMMANDS WITH BUTTONS
# // Once you have a button, it's trivial to bind it to a button in one of
# // three ways:
# // Start the command when the button is pressed and let it run the command
# // until it is finished as determined by it's isFinished method.
# // button.whenPressed(new ExampleCommand());
# // Run the command while the button is being held down and interrupt it once
# // the button is released.
# // button.whileHeld(new ExampleCommand());
# // Start the command when the button is released and let it run the command
# // until it is finished as determined by it's isFinished method.
# // button.whenReleased(new ExampleCommand());
# // Constrollers
# public XboxController driverController = new XboxController(0);
# public XboxController operatorController = new XboxController(1);
# /**
# * Limits a trigger to positive values only. This allows the use of a steam
# * controller for driving
# */
# private double limitTrigger(double value) {
# if (value <= 0.0) {
# return 0.0;
# }
# return value;
# }
# /**
# * Get the DriveTrain throttle value from driverstation
# *
# * @return Throttle (from -1.0 to 1.0)
# */
# public double getThrottle() {
# double speed = 0.0;
# speed += limitTrigger(driverController.getTriggerAxis(GenericHID.Hand.kRight));
# speed -= limitTrigger(driverController.getTriggerAxis(GenericHID.Hand.kLeft));
# return speed;
# }
# /**
# * Get the DriveTrain turn rate value from driverstation
# *
# * @return Turn rate (from -1.0 to 1.0)
# */
# public double getTurn() {
# return driverController.getX(GenericHID.Hand.kLeft);
# }
# /**
# * @return Has the operator requested an intake action?
# */
# public boolean getIntake() {
# return operatorController.getYButtonPressed();
# }
# /**
# * @return Has the operator requested an outtake action?
# */
# public boolean getOuttake() {
# return operatorController.getBButtonPressed();
# }
# /**
# * @return Has the operator requested an outtake action for cargo?
# */
# public boolean getCargo() {
# return operatorController.getXButtonPressed();
# }
# /**
# *
# * @return Overriden slider input from operator
# */
# public double getSliderOverride() {
# return operatorController.getX(GenericHID.Hand.kLeft);
# }
# public boolean getCompressorEnable() {
# return operatorController.getStartButton() || driverController.getStartButton();
# }
# public boolean getCompressorDisable() {
# return operatorController.getBackButton() || driverController.getBackButton();
# }
# public boolean getClimb2FA() {
# return operatorController.getBumperPressed(GenericHID.Hand.kRight) && operatorController.getPOV() == 0;
# }
# public boolean getManualArmToggle(){
# return operatorController.getBumperPressed(GenericHID.Hand.kRight) && operatorController.getPOV() == 180;
# }
- control:
- input:
- type: range
- min: -1
- max: 1
- default: 0
- sources:
- operator:
- joystick:
- axis: 'y'
- hand: right
- modifier: -1
- method_name: getArmMovementOverrideSpeed