Shooting On The Move
Stopping the robot to aim is a 2-second penalty on your cycle time. In modern high-level play, the robot must be capable of calculating a solution and firing while traversing the field at 4+ m/s. MARSLib uses a high-fidelity Iterative Kinematic Solver to find these solutions in real-time.
1. The Moving Target Problem
Section titled “1. The Moving Target Problem”If you aim where the Hub is right now, by the time the ball leaves your shooter and travels 4 meters, the ball will hit the rim and bounce out. You must aim where the Hub will be relative to the ball’s flight path.
2. Iterative Convergence
Section titled “2. Iterative Convergence”There is no closed-form algebraic solution for shooting on the move because the ball’s travel time depends on the exit angle, and the exit angle depends on the robot’s future position. MARSLib solves this using a 3-pass Iterative Solver:
-
Pass 1: Calculate a “Naive” shot to the Hub’s current location.
-
Pass 2: Estimate where the robot will be after the Naive shot’s flight time.
-
Pass 3: Recalculate the shot to that future location.
This 3-pass convergence is computationally cheap and brings the shot error down to less than 1cm at 5 m/s.
3. Tuning Your Shot Map
Section titled “3. Tuning Your Shot Map”The solver relies on an InterpolatingTreeMap. You provide the shooter with physical “Known Goods” (e.g., at 2m, I need 4000 RPM and 30° pivot). The MARSShotSetup skill then uses cubic splines to smooth out the values between those points.
📖 Further Reading & External Resources
Section titled “📖 Further Reading & External Resources”-
Team 6328: Aiming on the Move - An elite-tier breakdown of the vector math required for dynamic shooting.
-
WPILib: Geometry & Kinematics - Underlying vector and transform math.
-
1690 Code Release - The definitive implementation of high-accuracy shooter interpolation.