Skip to content

Mubotics7157/2026-Splitstream

Repository files navigation

Mubotics 7157 - Splitstream (FRC 2026)

The 2026 competition robot code for Team 7157 (Mubotics) for WPILib 2026.

Built on the WPILib command-based framework with AdvantageKit for full logging/replay support.

Robot Overview

Splitstream features a swerve drivetrain with dual independently-aimed turret shooters, an articulating intake, a spindexer for game piece indexing, and a Limelight-based vision system for AprilTag localization.

Architecture

IO Abstraction Layer

Every subsystem follows a three-layer pattern enabling full simulation and log replay:

Layer Purpose Example
XxxIO Interface with @AutoLog inputs class IntakeIO
XxxIOReal Hardware implementation (Phoenix 6, CANcoders) IntakeIOReal
XxxIOSim Simulation implementation IntakeIOSim
Subsystem Control logic, reads inputs via Logger.processInputs() Intake

Subsystems

  • Drive (subsystems/drive/) - Phoenix 6 swerve drivetrain with PathPlanner + Choreo trajectory following. Tuner constants are selected by bot identity (comp vs practice bot, detected via MAC address).
  • Superstructure (subsystems/superstructure/) - Top-level state machine coordinating intake, spindexer, and shooter using a Goal enum: IDLE, DEPLOYED_IDLE, INTAKING, SHOOTING, CLIMBING.
  • Shooter (subsystems/shooter/) - Dual left/right shooting units, each composed of:
    • Turret - Rotating aiming mechanism with wrap optimization across +/-pi
    • Flywheel - Variable-speed launch wheel
    • Hood - Adjustable launch angle
  • TurretManager (subsystems/shooter/TurretManager) - Coordinates both turrets with field-relative angle solving, launch-on-the-move compensation, and heading corridor calculation for the drive command.
  • Intake (subsystems/intake/) - Arm + rollers with PID position control.
  • Spindexer (subsystems/spindexer/) - Game piece indexing with left/right feeders for directing balls to each shooter.
  • Vision (subsystems/vision/) - AprilTag pose estimation via Limelight cameras (MegaTag 2 multi-tag fusion) with PhotonVision simulation support.
  • LED (subsystems/led/) - Status indicator LEDs.

RobotState (Centralized State)

RobotState is a singleton tracking all shared robot state:

  • Robot pose with time-interpolatable buffer (1.0s lookback)
  • Chassis speeds (measured and desired, robot and field relative)
  • Mechanism positions (intake arm, turrets, hoods) for 3D AdvantageScope visualization
  • Vision measurements with inverse-variance weighting
  • Field zone tracking

Autonomous System

Located in frc.robot.auto:

  • AutoModeSelector - Dashboard choosers for mode, start side, intake locations, and shoot positions. Also includes SysId characterization modes.
  • ModularAutoBuilder - Builder-pattern 2-cycle autonomous routines. Each cycle: intake at location -> drive to shoot position -> shoot. Supports Choreo paths (Center, Depot, Preload) and PathPlanner pathfinding (Outpost).
  • AutoUtil - Choreo trajectory loading/caching, alliance flipping, PID-based trajectory following.
  • Choreo .traj files live in src/main/deploy/choreo/.

Control Board

Driver input is abstracted through interfaces:

  • IDriveControlBoard - Throttle, strafe, rotation, plus triggers for intake/shoot/manual-stow/reset gyro/auto-align
  • IButtonControlBoard - X-wheels, force stow intake, force lowest hood, flywheel/hood offset adjustments

Implementations (GamepadDriveControlBoard, GamepadButtonControlBoard) use Xbox controllers with sim controller support.

Build & Development

Requires Java 17+. Code formatting (Google Java Format, AOSP style) runs automatically via Spotless before compilation.

./gradlew build                          # Compile and build
./gradlew deploy                         # Deploy to RoboRIO
./gradlew deploy -PprofileMode           # Deploy with JMX profiling
./gradlew simulateJava                   # Run simulation
./gradlew simulateJavaRelease -Preplay   # Replay mode (AdvantageKit log replay)
./gradlew test                           # Run tests (JUnit 5)
./gradlew spotlessApply                  # Apply code formatting manually

Project Structure

src/main/java/
├── frc/robot/
│   ├── auto/                     # Autonomous routines & path building
│   ├── commands/                 # Drive, intake, shooter, spindexer commands
│   ├── controlboard/             # Driver control interfaces & implementations
│   ├── dashboard/                # Elastic dashboard & tunable values
│   ├── factories/                # Auto, intake, shooter factory classes
│   ├── lib/
│   │   ├── commands/             # Custom command groups (ChezySequence, ChezyRepeat)
│   │   ├── drivers/              # CAN device ID utilities
│   │   ├── rebuilt/              # FieldLocation utilities
│   │   ├── subsystems/           # ServoMotor subsystem abstractions, TalonFX/CANCoder IO
│   │   ├── time/                 # RobotTime utilities
│   │   ├── util/                 # Math helpers, interpolating maps, latched booleans, etc.
│   │   └── zones/                # Field zone geometry (polygon, rectangle, circle, composite)
│   ├── simulation/               # Game piece & opponent robot simulation
│   ├── subsystems/
│   │   ├── drive/                # Swerve drive (comp/prac/sim tuner constants)
│   │   ├── intake/               # Intake arm + rollers
│   │   ├── led/                  # LED status indicators
│   │   ├── shooter/              # TurretManager, ShootingUnit, setpoints
│   │   │   ├── flywheel/         # Flywheel subsystem
│   │   │   ├── hood/             # Hood subsystem
│   │   │   └── turret/           # Turret subsystem
│   │   ├── spindexer/            # Game piece indexing & feeding
│   │   ├── superstructure/       # Top-level state machine
│   │   └── vision/               # AprilTag vision processing
│   └── util/                     # LoggedTunableNumber
│
└── com/team254/lib/pathplanner/  # PathPlanner library (from Team 254)

Dependencies

Library Version
WPILib 2026
Phoenix 6 26.1.1
AdvantageKit 2026
PathPlannerLib 2026
ChoreoLib 2026
PhotonLib 2026
MapleSim latest

Getting Started

  1. Clone this repository
  2. Install WPILib 2026 and Java 17+
  3. Open in VS Code with the WPILib extension
  4. Build with ./gradlew build
  5. Deploy with ./gradlew deploy

Simulation

Run full simulation (with MapleSim physics):

./gradlew simulateJava

Replay AdvantageKit logs:

./gradlew simulateJavaRelease -Preplay

AdvantageScope 3D Model

The robot model for AdvantageScope visualization is located in ascopeAssets/Robot_Splitstream/.

Component Mapping

Component Description Position (X, Y, Z)
model Main robot chassis (0, 0, 0)
model_0 Turret Left (0.11, 0.2, -0.364)
model_1 Turret Right (0.11, -0.2, -0.364)
model_2 Intake (-0.187, 0, -0.4)
model_3 Hood Left (-0.15, 0.10, -0.55)
model_4 Hood Right (-0.15, -0.10, -0.55)

Cameras

Camera Position (X, Y, Z) Pitch Yaw
limelight-bl (-0.329, -0.237, 0.201) -15 deg 135 deg
limelight-br (-0.329, 0.237, 0.201) -15 deg -135 deg

Robot Dimensions

  • Front-Left to Back-Left: 19.25 in
  • Front-Left to Front-Right: 25.5 in

Credits

Based on Team 254 (The Cheesy Poofs) 2024 Robot Code. and Team 6328 (Mechanical Advantage) 2026 Robot Code.

About

7157 season code for the 2026 season.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Generated from Mubotics7157/Sim-Skeleton