Commands have to explicitly keep running after the move is complete, otherwise the elevator backdrives. This makes coding command compositions and autos MUCH harder. Make holding the elevator position the default command.
Related PRs:
Checklist
[x] Code is complete, and naming of variables, methods and classes are readable by non-coder humans.
[ ] This code change has been tested and validated working as expected.
[ ] This code change has been reflected in robot documentation in the docs folder.
[x] The questions below have all been answered.
[x] The title of this PR has been updated to describe the change made, for example, [Subsystem or Command Name] Short description of change.
[x] Assignees (usually yourself) have been assigned in the "Assignees" section to the right.
[x] Relevant reviewers have been assigned under the "Reviewers" section at the right.
What is changing and why?
Creates new HoldElevator command including new method in subystem it uses. Elevator subsystem adds a state variable as to whether a "holdposition" has been recorded and the actual position. Every method which moves elevator has to reset that state to false -- and when holdPosition() first called it gets recorded from encoder.
How was this tested?
Not yet tested. Based on 2019 Starlord similar function.
Is there anything the reviewer of this PR needs to know to validate that this code is correct?
You can still Stop the elevator by calling MoveElevator with a speed of 0. That command won't end unless interrupted and doesn't prevent backdrive.
If putting Elevator moves to target inside a Command Group -- you likely want to use .asProxy() decorator to keep the overall command group from requiring the Elevator. This solution requires the default command on Elevator to kick in to function.
What do your team members need to know about this?
You can still Stop the elevator by calling MoveElevator with a speed of 0. That command won't end unless interrupted and doesn't prevent backdrive.
If putting Elevator moves to target inside a Command Group -- you likely want to use .asProxy() decorator to keep the overall command group from requiring the Elevator. This solution requires the default command on Elevator to kick in to function.
Related Issues and PRs
n/a
Issue:
Commands have to explicitly keep running after the move is complete, otherwise the elevator backdrives. This makes coding command compositions and autos MUCH harder. Make holding the elevator position the default command.
Related PRs:
Checklist
docs
folder.[Subsystem or Command Name] Short description of change
.What is changing and why?
Creates new HoldElevator command including new method in subystem it uses. Elevator subsystem adds a state variable as to whether a "holdposition" has been recorded and the actual position. Every method which moves elevator has to reset that state to false -- and when holdPosition() first called it gets recorded from encoder.
How was this tested?
Not yet tested. Based on 2019 Starlord similar function.
Is there anything the reviewer of this PR needs to know to validate that this code is correct?
What do your team members need to know about this?