This project is based on the official AdvantageKit 2026 TalonFX swerve template and uses B-Line for autonomous path following. It includes high-frequency odometry, TalonFX/CANcoder hardware IO, Pigeon 2 support, simulation, SysId commands, replay logging, and an AdvantageScope calibration layout.
- Set the team number with
WPILib: Set Team Numberin VS Code. - Generate
src/main/java/frc/robot/generated/TunerConstants.javafor the real chassis with CTRE Tuner X, following the AdvantageKit TalonFX template instructions. The checked-in CAN IDs, encoder offsets, geometry, ratios, gains, and CAN bus name are example values only. - Tune the drive and steer loops, then tune the B-Line constraints and PID controllers in
BLineAutos.java. Begin with the robot on blocks and conservative limits. - Import
AdvantageScope Swerve Calibration.jsoninto AdvantageScope for calibration and tuning.
BLineAutos connects B-Line to the drive pose, measured robot-relative chassis speeds, odometry
reset, and robot-relative velocity output. It also sends B-Line telemetry to AdvantageKit logs.
Create paths with the B-Line editor and export them to
src/main/deploy/autos/paths. Load one with new Path("FileName"), then add the command returned by
the shared FollowPath.Builder to the autonomous chooser. The included programmatic example is for
simulation and low-speed validation, not for competition use.
Build with:
./gradlew buildNo generic swerve constants are safe for a physical robot. Verify motor and encoder CAN IDs, inversions, absolute encoder offsets, Pigeon ID, CAN bus, module locations, wheel radius, gearing, current limits, and all feedback/feedforward gains before enabling.