How bchrobotics/trojans2024 works
Main Components
• Robot Control Core: This central module is represented by classes like Main.java, Robot.java, and RobotContainer.java. They serve as the entry point and orchestrate the robot’s behavior.
• Subsystems: Located in src/main/java/frc/robot/subsystems, these include components like the Drivetrain, Elevator, Mechanism, and the specialized MAXSwerveModule. Each subsystem maps directly to a physical part of the robot.
• Commands: Found in src/main/java/frc/robot/commands (e.g., CombinedCommands.java). These encapsulate the actions that the subsystems perform.
• Utility Classes: Under src/main/java/frc/utils, these include helper classes for control algorithms (like BetterPIDController and BetterProfiledPIDController) and hardware device abstractions (e.g., Camera, LEDs, BeamBreak). They provide supportive functionality across the robot’s code.
• Deployment & Autonomous Paths: The directory src/main/deploy (with its nested pathplanner folder) contains files for autonomous routines and path planning. This represents configuration data that defines autonomous movement routines and navigation grids.
• Vendor Dependencies: Managed under vendordeps and referenced in the README (NavX, REVLib, PathplannerLib, photonlib). These represent the external libraries and hardware drivers integrated into the project.
• Build and Configuration Systems: Gradle scripts (build.gradle, settings.gradle, gradle wrapper files) configure project builds and deployments, while configuration files (.Glass, .SysId, .wpilib, etc.) support the development and deployment environments.
Relationships and Interactions
• The deployment folder’s autonomous routines and paths are used by the core code (or autonomous commands) to control navigation. Represent these as separate configuration input components which supply path definitions.
• Vendor libraries provide essential support for tasks like sensor fusion (NavX) and advanced drive functionality (PathplannerLib); show these as external modules that interface with both the core and the subsystems.
• External interactions: the connection to the Driver Station and the use of WPILib provides a bridge between the robot hardware and operator input.
Architectural Patterns and Principles
• Command-Based Design: Make it clear that the project follows the command-based pattern typical in FRC robot projects. The separation between subsystems and commands should be visually distinct.
• Modularization: The project is split into well-defined packages (robot code, commands, subsystems, utils) which promotes separation of concerns.
• Configuration-Driven Autonomous: The use of deploy folders with path and autonomous files (“.auto” files) indicates that autonomous behavior is configured externally, allowing for on-the-fly adjustments without modifying core code.