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-06: The simulator runs code with MEASURE numbers (stand-ins in the robot file)

medium prioritySimulator only (no robot needed)about 15 minSimulator

Why

A number written as MEASURE in Tunables.java stops INIT on the robot until it is measured. In the simulator, :sim:fromRobot writes a stand-in for it in the robot file, so the code runs before the robot is built. We need to know that the simulator uses the stand-in and says so, that the real number wins once it is written, and that the robot file stays right after each :sim:fromRobot.

Setup

  • Your robot project with the simulator running your code (./gradlew :sim:run), written in five files.

Steps

  1. Pick one number in your Tunables.java (for example a servo position). Write down its value, then change it to MEASURE.
  2. Run ./gradlew :sim:fromRobot. Open simulator/robot.properties: find the tunable.Section.field = ... line for it.
  3. Start the simulator, choose your TeleOp, INIT. Read the note under the Driver Hub ("... = MEASURE: the simulator uses the stand-in ..."). START: the part goes to the stand-in.
  4. Run one of your tests (./gradlew :sim:scenario): the init line shows the same note, and the test runs past INIT.
  5. Put your number back in Tunables.java and run ./gradlew :sim:fromRobot again: the tunable. line is gone.

Pass rule

3 runs out of 3: INIT goes on with the note, the part goes to the stand-in, and the line is gone after the number is written.

Record

Write these down while you test. The report form has them as a list to fill in.

  • the section and field, the stand-in value written, and whether it was a sensible value for your part
  • the note text you saw, and whether it was clear
  • anything the stand-in made the robot do that looked wrong

If your robot is different

Any robot with a Tunables.java works. No MEASURE lines? Step 1 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: CTL-03 Switch the alliance during TeleOp (turned on by you)

Something wrong on this page? Tell us with a short GitHub form.