SIM-05: A simulator test stands in for a number not measured yet (set tunable)
- 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.18.2 or newer.
- The docs it tests: Lesson 10: Test your robot code (advanced), The simulator: a pretend Control Hub and Driver Hub.
Why
A number written as MEASURE in Tunables.java stops INIT until it is measured on the robot. The scenario line set tunable Section.field VALUE lets a simulator test run before that. We need to know that it works on your robot's code, that it changes nothing for the next test file, and that a typo gives a message a student understands.
Setup
- Your robot project with the simulator running your code, and one test of yours in
simulator/scenarios/(record one first: start lesson 10).
Steps
- Pick one number in your Tunables.java (for example a servo position). Write down its value.
- Change it to
MEASUREin Tunables.java. Run your test:./gradlew :sim:scenario. INIT stops and names the number. - Add
set tunable Section.field VALUEbeforeinitin the test (your section and field, the value you wrote down). Run it again: it passes. - Make a second test file without that line (copy the first, delete the line). Run both with one command: the second one stops at INIT again (the number did not carry over).
- Make a typo in the name (for example one letter wrong). Run it: read the message.
- Put the number back in Tunables.java and delete the
set tunableline.
Pass rule
3 runs out of 3: with the line the test passes, the next file without it stops at INIT, and the typo message names the right field ("did you mean ...").
Record
Write these down while you test. The report form has them as a list to fill in.
- the section and field you used, and its type (a number, or true/false)
- the result of each run (passed, or the message)
- the typo message, and whether it was clear
If your robot is different
Any robot with a Tunables.java works. No MEASURE lines? Step 2 makes one.
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: SIM-06 The simulator runs code with MEASURE numbers (stand-ins in the robot file)
Something wrong on this page? Tell us with a short GitHub form.