SIM-06: The simulator runs code with MEASURE numbers (stand-ins in the robot file)
- 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.3 or newer.
- The docs it tests: The simulator: a pretend Control Hub and Driver Hub, Tunables.java: every number, part by part.
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
- Pick one number in your Tunables.java (for example a servo position). Write down its value, then change it to
MEASURE. - Run
./gradlew :sim:fromRobot. Opensimulator/robot.properties: find thetunable.Section.field = ...line for it. - 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.
- Run one of your tests (
./gradlew :sim:scenario): theinitline shows the same note, and the test runs past INIT. - Put your number back in Tunables.java and run
./gradlew :sim:fromRobotagain: thetunable.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 resultNo 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.