Skip to content
Work in progress. This library and its docs are new and still changing, and some parts are not yet tested on a real robot. Something wrong or unclear?Tell us with a short GitHub form.

SIM-05: A simulator test stands in for a number not measured yet (set tunable)

medium prioritySimulator only (no robot needed)about 15 minSimulator

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

  1. Pick one number in your Tunables.java (for example a servo position). Write down its value.
  2. Change it to MEASURE in Tunables.java. Run your test: ./gradlew :sim:scenario. INIT stops and names the number.
  3. Add set tunable Section.field VALUE before init in the test (your section and field, the value you wrote down). Run it again: it passes.
  4. 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).
  5. Make a typo in the name (for example one letter wrong). Run it: read the message.
  6. Put the number back in Tunables.java and delete the set tunable line.

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 result

No 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.