Core structure
MARSLib is built using a “Hardware Abstraction Layer” (like a universal remote control) that lets you swap out motors without rewriting your code. We built the framework to reuse memory instead of constantly creating new objects (called “zero-allocation”), which stops the robot from lagging. Because of this, whether you are running a real robot or a simulated one, the math behaves the exact same way.
structure Diagram
Section titled “structure Diagram”Package Reference
Section titled “Package Reference”Core framework packages and their responsibilities.
| Package | Description | Key Classes |
|---|---|---|
com.marslib.swerve | 250Hz odometry, swerve kinematics, traction control | SwerveDrive, SwerveModule, PhoenixOdometryThread |
com.marslib.vision | AprilTag localization with MegaTag 2.0 fusion | MARSVision, VisionIO |
com.marslib.mechanisms | Generic IO abstractions | RotaryMechanismIO, LinearMechanismIO |
com.marslib.faults | Thread-safe fault reporting | MARSFaultManager, Alert |
com.marslib.simulation | Dyn4j physics world, game piece spawning | MARSPhysicsWorld, GamePieceBody |
com.marslib.power | Voltage load-shedding and stator monitoring | MARSPowerManager |
com.marslib.util | State machines, tunable numbers, shot math | MARSStateMachine, EliteShooterMath |
com.marslib.auto | PathPlanner integration, alignment commands | MARSAutoBuilder |
frc.robot | Competition logic: RobotContainer, commands | RobotContainer, MARSSuperstructure |
📖 Further Reading & External Resources
Section titled “📖 Further Reading & External Resources”- Limelight MegaTag 2.0 Breakdown - Understanding how FRC 1690 style IMU yaw-seeding rejects rapid AprilTag noise variations.
- PhotonVision Hardware Guide - Best practices for illuminating targets globally.