SOM-03: Shooting on the move in the simulator - strafe and compare
- 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.0 or newer.
- The docs it tests: Lesson 9: A shooter, a camera and a turret (for robots that shoot), The simulator: a pretend Control Hub and Driver Hub.
Why
Before anyone tunes shooting on the move on a real robot (SOM-01, SOM-02), the simulator can show whether the lead goes the right way and how much it helps. Its shots fly with real air and its verdicts (clean, rim, miss) come from the same judge as the turret shot simulator.
Setup
- SIM-01 works on this laptop.
- The V2 example robot (a turret that follows the goal, odometry, a shot table, shooting on the move off). In the
ftc-helper-libfolder:./gradlew :sim:fromRobot -PteamCode=none -ProbotClass=com.crossbotics.ftchelper.examples.v2bot.Robot -Pout=build/v2bot.properties, then./gradlew :sim:run -PteamCode=none -Probot=build/v2bot.properties. Open http://localhost:8780. - Or your own turret robot with odometry and a shot table (
:sim:fromRobot -PteamCode=../TeamCode).
Steps
- Choose "V2 Bot TeleOp", pick the alliance (gamepad 1 X = BLUE, B = RED), START. Open the Match panel (Control Hub, "Match"): it shows each shot's verdict.
- Drive to a spot about 4 ft from your goal where the turret follows it (
following: camera; lesson 9's Try it in the simulator says where the tags can be seen). Write the spot (the line under the field map). - Shooting on the move is off. Standing still, fire 4 (hold gamepad 2 RB). Count clean shots.
- Load 4 pieces again (drive the intake over pieces on the field, or restart the simulator) and go back to the spot. Strafe slowly past the goal (keyboard A or D, or the left stick) and fire 4 while moving. Count clean shots.
- Stop the simulator. In
examples/src/main/java/com/crossbotics/ftchelper/examples/v2bot/Tunables.java, classAim, changeshootOnMove = falsetotrueand addpublic static double flightSec = 0.8;(your own robot: the same two lines in itsTunables.Aim). Start the simulator again (the Setup commands). - Repeat step 3 (standing still: no
Aim: moving shotline) and step 4 at the same speed. While moving, readAim: moving shot: lead ... deg, ... in. Count clean shots. - Misses on the side the robot drives toward: raise
flightSec; on the other side: lower it (it changes at once in the tuning menu, GUIDE held 1 s). Repeat the strafe. - Put the example's
Tunables.javaback as it was.
Pass rule
Standing still, the clean shots with it on are within 1 of what they were before (out of 4), and while strafing it gives at least 2 more clean shots out of 4 than with it off, or 3 of 4 with it on.
Record
Write these down while you test. The report form has them as a list to fill in.
- the robot (V2 example or your own) and the alliance
- clean shots out of 4: still, strafing off, strafing on (and after changing
flightSec) - the lead the Driver Station showed while strafing (degrees, inches)
- the
flightSecthat worked best in the simulator
If your robot is different
A robot with no turret aims the whole robot instead (g1.rb.toggle(robot.aimMode())): the same steps work, say so. The simulator's flightSec is a starting point only: measure the real one on the robot (SOM-01 step 2).
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: TEST-01 Test kit - JUnit tests of your Robot.java on the laptop
Something wrong on this page? Tell us with a short GitHub form.