Machine-Mavericks / Machine-Mavericks/FRC-2026
Tune Vision & Aiming (Limelight)
- Dominant language
- Java
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## 1. Vision & Aiming (Limelights)
The robot now uses two separate Limelights: one for the Drive (Odometry/Pose Estimation) and one for the Shooter (Hub Targeting). The `HubTargetingSubsystem` entirely relies on accurate physical constants to calculate the distance to the HUB. If these are wrong, your shooter RPM lookup table will be useless.
**Parameters to Tune (`RobotMap.Vision`):**
* `SHOOTER_LIMELIGHT_MOUNT_HEIGHT_M`: Measure the straight-line distance from the floor carpet to the exact center of the Shooter Limelight lens.
* `SHOOTER_LIMELIGHT_MOUNT_ANGLE_DEG`: Use a digital angle gauge/level to measure the upward tilt of the Shooter Limelight relative to a perfectly flat floor.
* *Tip:* If your distance calculations consistently read too short or too far across the board, this angle is likely off by a degree or two.
> [!NOTE]
> The position of the Drive Limelight on the robot has not yet been determined. Once it is physically mounted, you will need to add new mount height and angle constants for it in `RobotMap.Vision`, similar to the Shooter Limelight, and update `Odometry.java` (or any other pathing logic) to use those new measurements if required for accurate field pose projection.
**3D Pose Configuration (Java Code):**
In addition to the simple straight-line trigonometric distance values configured above, the Limelights require exact 3D positioning (X, Y, Z translation and Roll, Pitch, Yaw rotation) relative to the physical center of the robot. This allows the Limelights to accurately project the robot's pose on the field (`botpose`) for Odometry and MegaTag localization.
This 3D transform is pushed to the cameras **from the RoboRIO** over NetworkTables (`camerapose_robotspace_set`) on startup. It overrides any geometry configured in the Limelight Web UI.
* Locate the `SHOOTER_LIMELIGHT_3D_POSE` and `DRIVE_LIMELIGHT_3D_POSE` arrays in `RobotMap.Vision`.
* Measure the exact Forward, Side, and Up (Height) offsets in meters from the center of the robot to each camera lens.
* Note the Roll, Pitch, and Yaw in degrees. (*Note: the `SHOOTER_` array already uses the generic Height and Pitch constants from above.*)
* Enter these values into the arrays in `[Forward, Side, Up, Roll, Pitch, Yaw]` order.
**Tolerance (`HubTargetingSubsystem.java`):**
* `TARGET_TX_TOLERANCE_DEG`: This determines how perfectly the turrets need to be aligned before `isReadyToShoot()` allows the intake arm to fire. It is currently set to `2.0` degrees. If the turrets have structural backlash and struggle to hit the `2.0` mark perfectly, you may need to increase this slightly so the robot doesn't get "stuck" refusing to fire.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.