FRC2706 / FRC2706/2019-2706-Robot-Code
System for easy bindings to button combinations
- Dominant language
- Java
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Currently there are actually a number of cases where combinations of buttons on the operator and driver joysticks should be pressed to activate certain commands, yet we don't have an easy way of doing these each time.
As it is right now, one button activates a command and then the command itself handles the rest of the input. This isn't great because ideally commands should just perform actions and not deal with input/output.
I tried to do this sort of thing with `FluidTrigger` but for `FluidTrigger` to work, multiple of the same buttons would get checked each tick.
My proposed solution would be a modification of `FluidTrigger` such that you specify some fluid constant button bindings which may be involved in the combination and then you add commands with conditions. Something like:
```java
new FluidTrigger(fluidConstantBinding1, fluidConstantBinding2) {
@Override
protected Command getCommand() {
if (areAnyPressed(fluidConstantBinding1, fluidConstantBinding2) {
return someCommand;
} else if (areAllPressed(fluidConstantBinding1, fluidConstantBinding2) {
return anotherCommand;
}
}
```
(this wouldn't be the exact way it would work, just a demonstration of the ease with which I want this to be done).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the existing FluidTrigger implementation and the command/input handling described in the issue. Determine how button bindings are currently checked each tick and how commands are activated. Done means a clear, reusable way to express button combinations without requiring individual commands to handle input, with the proposed any/all behavior addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- robotics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100