2 Command-based programming¶
2.1 Lecture¶
Further reading¶
2.2 Activity¶
Specifications¶
You are given:
A
Robot.javawith theCommandSchedulerrunningSkeleton for subsystems/commands
You will:
Populate
IntakeSubsystem.javaAdd motor control (
runIn,runOut,stop)Add a proximity sensor and Debouncer to detect a game piece
Populate commands that:
Run the intake until a game piece is detected (
IntakeUntilPiece)Allow manual reverse (
IntakeOut)
Test using Gradle
./gradlew cleanTest test --rerun-tasks
Instructions¶
In your terminal, run
git clone https://github.com/titan2022/command_based_project && cd command_based_project
Then run
./gradlew cleanTest test --rerun-tasks
This should throw a number of errors. You should complete the skeleton code according to the project specifications in the previous slide and rerun the test. It will result in passing (green) on all four tests once you have properly implemented everything.
Step 1 - Implement Motor Step 2 - Add proximity sensor + Debouncer Step 3 - Implement IntakeOut.java Step 4 - Implement IntakeUntilPiece command Step 5 - Add a manual reverse command (IntakeOut)
Solution¶
The solution can be found in the solution branch of @titan2022/command_based_project.