Class FlywheelIOTalonFX

java.lang.Object
com.marslib.mechanisms.FlywheelIOTalonFX
All Implemented Interfaces:
FlywheelIO

public class FlywheelIOTalonFX extends Object implements FlywheelIO
Real hardware implementation of FlywheelIO using a CTRE TalonFX motor controller.

Supports open-loop voltage control and closed-loop velocity control via Phoenix 6 onboard PID. Used for shooter and intake flywheels on the physical robot.

  • Constructor Details

    • FlywheelIOTalonFX

      public FlywheelIOTalonFX(int motorId, String canBus, boolean invert)
      Constructs a single Flywheel mechanism using a direct CTRE TalonFX.
      Parameters:
      motorId - The physical CAN ID of the primary TalonFX.
      canBus - The CANBus string (e.g. "rio" or "canivore").
      invert - Whether to invert the motor output.
    • FlywheelIOTalonFX

      public FlywheelIOTalonFX(int leaderId, int[] followerIds, boolean[] opposeLeader, String canBus, boolean invert)
      Constructs a master-follower Flywheel configuration (e.g., dual-motor shooter).
      Parameters:
      leaderId - The physical CAN ID of the master TalonFX.
      followerIds - Array of CAN IDs for the follower motors.
      opposeLeader - Array of booleans denoting if the follower should spin opposite to the leader.
      canBus - The CANBus string.
      invert - Whether the leader is inverted.
  • Method Details