Code for Team 1678's 2024 robot, Nik.
See also:
-
Drivetrain
The swerve drivetrain features a custom Phoenix 6 enabled odometry class and pure pursuit path following for consistent autonomous driving.
-
Vision Pose Correction
The robot continously records and stores the most recent vision and odometry updates in a robot state class, and feeds the information into an extended kalman filter. The localization factors in number of tags seen, average distance to tags, and closest tag when calculating trust factor.
-
Auto Aim
Using the relative transform to either the speaker or ferry target, swerve drivetrain overrides driver and path heading control when instructed to auto-align. The superstructure uses the pose from localization and multiple regression maps to calculate the target drivetrain angle, shooter angle, and shooter RPM for either shooting or ferrying.
-
Superstructure Control
The elevator, intake, three indexer rollers are controlled using a request queue. Desired actions are added to the queue by calling the appropiate state or transition method, which adds a chain of requests to be sequentially run.
-
Contains structure code for defining and running autonomous modes.
-
com.team1678.frc2024.auto.actions
Contains all actions used during the autonomous, which all inherit the
Action
interface. Examples include driving paths, waiting for a superstructure command, and waiting for a target track within error. -
com.team1678.frc2024.auto.modes
Contains all autonomous modes. Notable modes are the customizable six note modes, the note detection three note modes, and the mandatory do nothing mode.
-
com.team1678.frc2024.controlboard
Contains code for handling driver input. Nik is controlled by two Xbox Controllers.
-
Contains code for loops, which run sections of code periodically on the robot. All loops implement the
Loop
interface, and are handled by theLooper
class. We run our loops at 50 Hz, or every 0.02 seconds. -
Contains the
TrajectoryGenerator
class which contains the trajectories that the robot drives during autonomous mode. Each Trajectory is composed of a list of Pose2d objects and headings. -
Contains the
ElevatorMotionPlanner
class that contains request chains for extending and retracting the elevator to ensure it does not collide with the intake. -
Contains util classes related to solving for shooting parameters for ferrying and speaker shooting, and tuned regression maps referenced to find hood angle, shooter rpm, and yaw offset.
-
com.team1678.frc2024.subsystems
Contains classes for each subsystem on the robot, all of which extend the
Subsystem
abstract class. Each subsystem uses state machines for control. Subsystems also contain an enabled loop, a read periodic inputs method, and a write periodic outputs method, which are controlled by the SubystemManager class.