SIM-04: Record a test in the simulator, break it, update it
- Your robot needs: any robot.
- Starter bots that fit: goBILDA starter bot, REV DUO starter bot, AndyMark Robits starter bot, Studica starter bot.
- Library version: v0.17.1 or newer.
- The docs it tests: Lesson 10: Test your robot code (advanced), The simulator: a pretend Control Hub and Driver Hub.
Why
The simulator's recorder writes a test from what a driver does on the page. We need to know if students can record a test of their own robot, if the suggested checks make sense, and if a recorded test passes when it is run again (a test that fails for no reason is worse than none).
Setup
- Your robot project with the simulator running your code:
./gradlew :sim:run -PteamCode=../TeamCode. - Your robot drives in the simulator, and has an autonomous.
Steps
- Follow start lesson 10, section 2: record a test of your autonomous (INIT, choose the alliance, START, wait for its end, Stop recording).
- Read the suggested checks. Write down any check that looks wrong or missing. Save it.
- Press Run it now. Then run it 4 more times (Run it again).
- Record a TeleOp test: drive forward 2 seconds, turn, let go, Stop recording, Save, Run it now (5 times).
- Change one number on purpose (for example
Tunables.Drive.maxPowerto 0.6), restart the simulator, and run both tests. - For a test that fails: The change was on purpose: update the test, Save the update, Run it again.
- Run all tests with one command:
./gradlew :sim:scenario(from theftc-helper-libfolder). - Put the number back.
Pass rule
Each recorded test passes 5 runs out of 5 before the change, the change makes at least one fail, and after the update it passes again.
Record
Write these down while you test. The report form has them as a list to fill in.
- robot (drive kind, parts), OpMode names
- how many of the 5 runs passed, for each test, before the change
- each suggested check that looked wrong or was missing
- which test failed after the change, and the lines the update changed
- the result of
./gradlew :sim:scenario - anything in the window that was hard to understand
If your robot is different
Any robot that runs in the simulator works. No autonomous yet? Record two TeleOp tests (driving, and your intake or main mechanism). What matters: a recorded test passes again and again, and fails only when the robot really changed.
Report your result
Pass, fail, or could not run: every result helps. The form opens on GitHub with this test filled in (a free GitHub account is needed). No student names, please.
Report resultNo reports for this test yet: yours would be the first. Every test's reports.
All tests · Next: TUR-01 Turret home switch (touch or magnetic) - homes at START
Something wrong on this page? Tell us with a short GitHub form.