Skip to content

Add Mechanism2d visualization and telemetry to shooter subsystems#2

Draft
Claude wants to merge 15 commits into
mainfrom
claude/add-shooter-subsystem
Draft

Add Mechanism2d visualization and telemetry to shooter subsystems#2
Claude wants to merge 15 commits into
mainfrom
claude/add-shooter-subsystem

Conversation

@Claude

@Claude Claude AI commented Mar 14, 2026

Copy link
Copy Markdown

Adds comprehensive Mechanism2d visualizations and SmartDashboard telemetry to FlywheelSubsystem and VariableHoodSubsystem, following the pattern established by TurretSubsystem.

FlywheelSubsystem

Mechanism2d (4x3 canvas):

  • Dual spinning arrows (orange/orange-red) for left/right motor speeds
  • Cyan target speed indicator
  • Arrow length scales with RPM (0-6000), rotation shows spinning effect

Telemetry:

  • Speed metrics: Left/Right/Average RPM, Target, Error
  • Current draw: Supply/Stator for both motors
  • Status booleans: At_Speed, At_Shoot_Speed

VariableHoodSubsystem

Mechanism2d (3x3 canvas):

  • Orange arm showing current hood angle
  • Cyan arm showing target angle
  • Grey reference line at horizontal

Telemetry:

  • Position: Current/Target Angle (degrees), Error, Rotations
  • Velocity: DegPerSec
  • Current draw: Supply/Stator
  • Control: ClosedLoop_Error
  • Status booleans: At_Target, At_Starting_Angle, At_Max_Angle

All telemetry organized under Flywheel/ and Hood/ namespaces. Visualization and metrics update at 50Hz in periodic().

// Example: Mechanism2d setup
flywheelMech = new Mechanism2d(4, 3);
leftFlywheelArrow = leftRoot.append(
    new MechanismLigament2d("LeftSpeed", 0.0, 0, 8, new Color8Bit(Color.kOrange))
);
SmartDashboard.putData("Flywheel/Mechanism2d", flywheelMech);
Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature]: Shooter subsystem / Hood subsystem</issue_title>
<issue_description># [Feature] Implement Shooter Subsystem (Flywheel & Variable Hood) using YAMS

🔍 Step 1: Analyze Project Structure

Before writing any code, analyze the project workspace.

  1. Locate the Constants.java file.
  2. Locate the existing subsystems folder to ensure FlywheelSubsystem.java and VariableHoodSubsystem.java are created in the correct package directory.

🔢 Step 2: Update Constants.java

CRITICAL: Do NOT hardcode any CAN IDs, gear ratios, speeds, or angles in the subsystem files. Add a ShooterConstants (or similar) inner class to Constants.java with the following values:

Hardware IDs:

  • kLeftFlywheelId = 41
  • kRightFlywheelId = 42
  • kHoodMotorId = 43

Gear Ratios & Kinematics:

  • kFlywheelGearRatio = 1.0 (1:1)
  • kHoodGearRatio = (20.0 / 48.0) * (15.0 / 30.0) * (10.0 / 187.0) // evaluates to approx 1/89.76

Speeds & Limits:

  • kStandardShootRPM = 5000.0
  • kWarmUpRPM = 3750.0 // (75% of 5000)
  • kHoodStartingAngleDeg = 18.2
  • kHoodMaxTravelDeg = 38.0

🎯 Step 3: Implement FlywheelSubsystem.java

Create the WPILib Command-based subsystem to control the shooter flywheels. Reference the constants defined in Step 2.

YAMS & Setup Requirements:

  • Strictly use YAMS (Yet Another Mechanism System). Do not use Phoenix Pro features.
  • Initialize the Kraken X60s using YAMS SmartMotorControllerConfig and TalonFXWrapper.
  • Configure the Left motor as Leader and Right motor as Follower (oppose leader direction if physically required).
  • Pass the leader motor into a YAMS FlyWheelConfig and use the FlyWheel mechanism class.

Behavioral Requirements:

  • Velocity Control: Use Motion Magic / PID via YAMS to control the speed.
  • Standard Set Speed: Create a method to set the shooter to kStandardShootRPM.
  • Warm-Up: Create a warmUp() method that sets the flywheels to kWarmUpRPM.
  • Telemetry & Simulation: Log the current flywheel speeds (from relative encoders) using YAMS built-in telemetry verbosity. Integrate a Mechanism2d representation showing the flywheels spinning.

Documentation: YAMS Shooter/Flywheels Tutorial


🎯 Step 4: Implement VariableHoodSubsystem.java

Create the subsystem to control the shooter's variable angle hood. Reference the constants defined in Step 2.

YAMS & Setup Requirements:

  • Initialize the Kraken X44 using YAMS SmartMotorControllerConfig and TalonFXWrapper.
  • Pass the motor into a YAMS configuration for an angular mechanism (e.g., ArmConfig or TurretConfig) to handle positional logic.

Behavioral Requirements:

  • Kinematics: Ensure kHoodGearRatio is properly set in the YAMS MechanismGearing config so positional commands accurately reflect the hood's physical angle.
  • Angle Limits: Implement soft limits based on kHoodStartingAngleDeg and kHoodMaxTravelDeg.
  • Control: Use closed-loop PID positional control to set and actively hold the hood angle at all times.
  • Telemetry: Log the current hood angle in degrees, derived from the motor's relative encoder.

Documentation: YAMS Turrets/Wrists Tutorial


🛑 Acceptance Criteria

  1. The agent must first read the file tree and locate Constants.java.
  2. All magic numbers must be placed in Constants.java.
  3. Both new files must inherit from SubsystemBase and be placed in the correct subsystems package.
  4. YAMS wrapper classes must be utilized for all motor initializations and config chains.
  5. it should build</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

Co-authored-by: AdaTomruk <51528200+AdaTomruk@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] [Feature] Implement shooter subsystem with flywheel and variable hood Add shooter subsystems (Flywheel and VariableHood) with YAMS framework Mar 14, 2026
@Claude Claude AI requested a review from AdaTomruk March 14, 2026 17:41
@AdaTomruk

Copy link
Copy Markdown
Owner

it fails to build:

[{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "268435846",
"severity": 8,
"message": "The import yams.mechanisms.config.FlywheelConfig cannot be resolved",
"source": "Java",
"startLineNumber": 13,
"startColumn": 8,
"endLineNumber": 13,
"endColumn": 45,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "268435846",
"severity": 8,
"message": "The import yams.mechanisms.rotational cannot be resolved",
"source": "Java",
"startLineNumber": 14,
"startColumn": 8,
"endLineNumber": 14,
"endColumn": 34,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "268435846",
"severity": 8,
"message": "The import yams.motorcontrollers.ctre cannot be resolved",
"source": "Java",
"startLineNumber": 20,
"startColumn": 8,
"endLineNumber": 20,
"endColumn": 34,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "67108979",
"severity": 8,
"message": "The method withClosedLoopController(double, double, double, AngularVelocity, AngularAcceleration) in the type SmartMotorControllerConfig is not applicable for the arguments (double, double, double, AngularVelocity, AngularVelocity)",
"source": "Java",
"startLineNumber": 38,
"startColumn": 14,
"endLineNumber": 38,
"endColumn": 38,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "67108964",
"severity": 8,
"message": "The method fromRatio(double) is undefined for the type GearBox",
"source": "Java",
"startLineNumber": 44,
"startColumn": 55,
"endLineNumber": 44,
"endColumn": 64,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "16777218",
"severity": 8,
"message": "TalonFXWrapper cannot be resolved to a type",
"source": "Java",
"startLineNumber": 51,
"startColumn": 13,
"endLineNumber": 51,
"endColumn": 27,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "67108979",
"severity": 8,
"message": "The method withClosedLoopController(double, double, double, AngularVelocity, AngularAcceleration) in the type SmartMotorControllerConfig is not applicable for the arguments (double, double, double, AngularVelocity, AngularVelocity)",
"source": "Java",
"startLineNumber": 56,
"startColumn": 14,
"endLineNumber": 56,
"endColumn": 38,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "67108964",
"severity": 8,
"message": "The method fromRatio(double) is undefined for the type GearBox",
"source": "Java",
"startLineNumber": 62,
"startColumn": 55,
"endLineNumber": 62,
"endColumn": 64,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "16777218",
"severity": 8,
"message": "TalonFXWrapper cannot be resolved to a type",
"source": "Java",
"startLineNumber": 69,
"startColumn": 13,
"endLineNumber": 69,
"endColumn": 27,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "16777218",
"severity": 8,
"message": "FlywheelConfig cannot be resolved to a type",
"source": "Java",
"startLineNumber": 71,
"startColumn": 19,
"endLineNumber": 71,
"endColumn": 33,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "16777218",
"severity": 8,
"message": "FlywheelConfig cannot be resolved to a type",
"source": "Java",
"startLineNumber": 72,
"startColumn": 13,
"endLineNumber": 72,
"endColumn": 27,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "16777218",
"severity": 8,
"message": "Flywheel cannot be resolved to a type",
"source": "Java",
"startLineNumber": 76,
"startColumn": 19,
"endLineNumber": 76,
"endColumn": 27,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "16777218",
"severity": 8,
"message": "Flywheel cannot be resolved to a type",
"source": "Java",
"startLineNumber": 76,
"startColumn": 43,
"endLineNumber": 76,
"endColumn": 51,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "16777218",
"severity": 8,
"message": "FlywheelConfig cannot be resolved to a type",
"source": "Java",
"startLineNumber": 76,
"startColumn": 52,
"endLineNumber": 76,
"endColumn": 66,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "16777218",
"severity": 8,
"message": "Flywheel cannot be resolved to a type",
"source": "Java",
"startLineNumber": 86,
"startColumn": 9,
"endLineNumber": 86,
"endColumn": 17,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "16777218",
"severity": 8,
"message": "Flywheel cannot be resolved to a type",
"source": "Java",
"startLineNumber": 91,
"startColumn": 9,
"endLineNumber": 91,
"endColumn": 17,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/FlywheelSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "16777218",
"severity": 8,
"message": "Flywheel cannot be resolved to a type",
"source": "Java",
"startLineNumber": 108,
"startColumn": 9,
"endLineNumber": 108,
"endColumn": 17,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/VariableHoodSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "268435846",
"severity": 8,
"message": "The import yams.motorcontrollers.ctre cannot be resolved",
"source": "Java",
"startLineNumber": 25,
"startColumn": 8,
"endLineNumber": 25,
"endColumn": 34,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/VariableHoodSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "67108964",
"severity": 8,
"message": "The method fromRatio(double) is undefined for the type GearBox",
"source": "Java",
"startLineNumber": 58,
"startColumn": 55,
"endLineNumber": 58,
"endColumn": 64,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/VariableHoodSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "16777218",
"severity": 8,
"message": "TalonFXWrapper cannot be resolved to a type",
"source": "Java",
"startLineNumber": 65,
"startColumn": 13,
"endLineNumber": 65,
"endColumn": 27,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/VariableHoodSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "67108964",
"severity": 8,
"message": "The method getKrakenX60FOC(int) is undefined for the type DCMotor",
"source": "Java",
"startLineNumber": 65,
"startColumn": 47,
"endLineNumber": 65,
"endColumn": 62,
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/LimelightHelpers.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "268435844",
"severity": 4,
"message": "The import frc.robot.LimelightHelpers.LimelightResults is never used",
"source": "Java",
"startLineNumber": 10,
"startColumn": 8,
"endLineNumber": 10,
"endColumn": 51,
"tags": [
1
],
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/LimelightHelpers.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "268435844",
"severity": 4,
"message": "The import frc.robot.LimelightHelpers.PoseEstimate is never used",
"source": "Java",
"startLineNumber": 11,
"startColumn": 8,
"endLineNumber": 11,
"endColumn": 47,
"tags": [
1
],
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/RobotContainer.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "570425421",
"severity": 4,
"message": "The value of the field RobotContainer.flywheel is not used",
"source": "Java",
"startLineNumber": 58,
"startColumn": 37,
"endLineNumber": 58,
"endColumn": 45,
"tags": [
1
],
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/RobotContainer.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "570425421",
"severity": 4,
"message": "The value of the field RobotContainer.hood is not used",
"source": "Java",
"startLineNumber": 59,
"startColumn": 41,
"endLineNumber": 59,
"endColumn": 45,
"tags": [
1
],
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/CommandSwerveDrivetrain.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "570425421",
"severity": 4,
"message": "The value of the field CommandSwerveDrivetrain.m_sysIdRoutineSteer is not used",
"source": "Java",
"startLineNumber": 79,
"startColumn": 32,
"endLineNumber": 79,
"endColumn": 51,
"tags": [
1
],
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/CommandSwerveDrivetrain.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "570425421",
"severity": 4,
"message": "The value of the field CommandSwerveDrivetrain.m_sysIdRoutineRotation is not used",
"source": "Java",
"startLineNumber": 99,
"startColumn": 32,
"endLineNumber": 99,
"endColumn": 54,
"tags": [
1
],
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/IntakeSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "33555835",
"severity": 4,
"message": "The field SparkBase.ResetMode.kResetSafeParameters has been deprecated and marked for removal",
"source": "Java",
"startLineNumber": 42,
"startColumn": 43,
"endLineNumber": 42,
"endColumn": 63,
"tags": [
2
],
"origin": "extHost1"
},{
"resource": "/Users/adatomruk/Code/FRC/2026-Compbot/src/main/java/frc/robot/subsystems/IntakeSubsystem.java",
"owner": "generated_diagnostic_collection_name#2",
"code": "33555835",
"severity": 4,
"message": "The field SparkBase.PersistMode.kPersistParameters has been deprecated and marked for removal",
"source": "Java",
"startLineNumber": 42,
"startColumn": 77,
"endLineNumber": 42,
"endColumn": 95,
"tags": [
2
],
"origin": "extHost1"
}]

Claude AI and others added 2 commits March 14, 2026 17:47
Co-authored-by: AdaTomruk <51528200+AdaTomruk@users.noreply.github.com>
Co-authored-by: AdaTomruk <51528200+AdaTomruk@users.noreply.github.com>
@Claude Claude AI changed the title Add shooter subsystems (Flywheel and VariableHood) with YAMS framework Fix shooter subsystems to use Phoenix 6 API instead of non-existent YAMS classes Mar 14, 2026
Co-authored-by: AdaTomruk <51528200+AdaTomruk@users.noreply.github.com>
@Claude Claude AI changed the title Fix shooter subsystems to use Phoenix 6 API instead of non-existent YAMS classes Add shooter subsystem keybindings to RobotContainer Mar 14, 2026
Co-authored-by: AdaTomruk <51528200+AdaTomruk@users.noreply.github.com>
@Claude Claude AI changed the title Add shooter subsystem keybindings to RobotContainer Add Mechanism2d visualization and telemetry to shooter subsystems Mar 14, 2026
- Updated pivot angle setpoints in Constants.java to reflect new hardware configurations.
- Removed PivotSubsystem and VariableHoodSubsystem as they are no longer needed.
- Integrated IntakeArmSubsystem to manage the intake arm's position with trapezoidal motion profiling.
- Adjusted FlywheelSubsystem to use a follower configuration for the right motor.
- Simplified the IntakeSubsystem by removing visualization code and updating motor configuration.
- Enhanced RobotContainer to remove pivot bindings and streamline shooter controls.
… simulation support

- Updated Constants.java to include new HoodConstants and reorganized existing constants for clarity.
- Modified RobotContainer.java to integrate new IntakeArmSubsystem and HoodSubsystem, enhancing control over the intake and hood mechanisms.
- Added simulation capabilities to IntakeArmSubsystem and HoodSubsystem, allowing for better testing and tuning in a simulated environment.
- Cleaned up unused imports and improved code readability across various files.
- Adjusted CAN bus configuration in TunerConstants.java for consistency with hardware setup.
- Introduced FeederSubsystem to control the funnel motor for game piece handling.
- Updated RobotContainer to include FeederSubsystem and configure joystick bindings for feeder control.
- Implemented AutoAimAndShootCommand to automate shooting process, integrating feeder operation based on turret, hood, and flywheel readiness.
- Enhanced TurretSubsystem to provide robot pose for accurate targeting.
- Added ShootingCalculator for dynamic shooting parameters based on robot state and target position.
- Created documentation for new subsystems and commands.
- Addressed deprecated API usage in existing subsystems and ensured proper configuration for new components.
…nt AutoAimTurretCommand for simplified turret aiming
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Shooter subsystem / Hood subsystem

2 participants