Skip to content

Conversation

@PcPup
Copy link
Collaborator

@PcPup PcPup commented Jan 12, 2026

What did you change?

Have you..

  • Commented any added code? (If applicible)
  • Tested to make sure the code works?

Summary by CodeRabbit

Release Notes

  • New Features

    • Added intelligent auto-aiming system with trajectory calculations for launcher positioning
    • Integrated path following for improved autonomous navigation and consistency
    • Enhanced telemetry dashboard for better diagnostics and visualization
  • Bug Fixes

    • Calibrated targeting angles and speeds across autonomous routines
    • Refined servo and motor alignment parameters for improved accuracy
  • Refactor

    • Standardized hardware configuration naming and values across all operation modes

✏️ Tip: You can customize this high-level summary in your review settings.

PcPup and others added 30 commits January 9, 2026 12:33
Updated angle constants to use fractional values.
@PcPup PcPup requested review from a team as code owners January 12, 2026 16:55
@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This pull request centralizes hardware and autonomous configuration constants into OpmodeConstants, refactors autonomous routines to use these shared constants, introduces static pose tracking via StaticCommunism, adds auto-aiming functionality with projectile motion calculations, and integrates a Follower-based path following system into teleop operations.

Changes

Cohort / File(s) Summary
Constants & Configuration Centralization
OpmodeConstants.java, pedroPathing/Constants.java, PIDF_Tuning.java
Renames teleop/auto constants with proper casing (e.g., backlineSpeedTeleopBacklineSpeed); converts IntakeRampLaunchPos/IntakeRampIntakePos from int to double; adds new hardware mapping constants for drive motors, IMU, odometry, lights, floodgate, and webcam; replaces hardcoded hardware names with OpmodeConstants references in Pedro pathing; updates PIDF_Tuning to use OpmodeConstants.LauncherName and simplifies velocity control.
New Pose Tracking Utility
StaticCommunism.java
New public static utility class with a Pose field initialized to coordinates (72, 9.6) with 90-degree heading for pose persistence across opmodes.
Autonomous Path Variants – Angle Adjustments
autos/Back3Blue.java, autos/Back3Red.java, autos/pickup12blue.java
Minor angle refinements: backlineAngle adjusted (110→109 in Back3Blue and pickup12blue; 70→73 in Back3Red) to fine-tune targeting behavior.
Autonomous Path Variants – Configuration Migration
autos/Back3Main.java, autos/GoalMain.java, autos/pickup12main.java, autos/pickup18main.java, autos/pickup6main.java
Migrate hardcoded hardware names and PIDF constants to OpmodeConstants references; add StaticCommunism.pose tracking; introduce timing-based state transitions with 0.3-second pause states (case 200); restructure path state progression and feeder/intake initialization.
Autonomous Path Variants – Major Refactor (Goal Routes)
autos/GoalBlue.java, autos/GoalRed.java
Replace runtime movement logic with configuration-driven methods (set_starting_pose(), set_color()); introduce GoalAimAngle field; update @Autonomous annotation metadata with group parameter; define explicit path setup via method calls instead of procedural move() implementations.
Teleop & Solo Modes – Drive Motor & Constant Integration
soloOP/aimingTest.java, soloOP/solo_op_BLUE.java, soloOP/solo_op_RED.java
Add set_goal_position() methods returning goal Pose coordinates for blue (12.2, 136.7) and red (131.1, 136.7); in aimingTest, integrate OpmodeConstants for drive motor mappings; aimingTest adds extensive auto-aiming configuration (goal height, launcher parameters, servo angle bounds, velocity limits) and projectile motion calculations.
Teleop Main – Major Architecture Refactor
soloOP/solo_op_MAIN.java
Add abstract set_goal_position() method, public goalPosition and path fields; introduce Follower-based autonomous/teleop path following; integrate PanelsTelemetry; change angle field types from int to double (sourced from TeleopBacklineAngle, TeleopMidAngle, TeleopGoalAngle); refactor drive logic to use follower teleop commands during alignment; simplify calculateAlignmentCorrection() to PD-based clipping; update servo/light/hardware mappings to use OpmodeConstants.

Sequence Diagram(s)

sequenceDiagram
    participant Teleop as TeleOp Loop
    participant Follower as Follower
    participant Vision as Vision Portal
    participant Drive as Drive
    participant Launcher as Launcher

    Teleop->>Vision: Poll AprilTag detection
    Vision-->>Teleop: Tag detected (alignmentRequested)
    
    alt Alignment Active (Right Trigger >= 0.2)
        Teleop->>Follower: Set goal position from set_goal_position()
        Teleop->>Follower: Update follower state
        Follower-->>Teleop: Compute path & corrections
        Teleop->>Drive: Apply follower teleop drive commands
        Drive-->>Teleop: Motor outputs
    else Manual Drive
        Teleop->>Drive: Apply gamepad inputs directly
        Drive-->>Teleop: Motor outputs
    end
    
    alt Auto-Aiming (in aimingTest)
        Teleop->>Follower: Get current pose
        Follower-->>Teleop: Follower pose
        Teleop->>Teleop: Calculate distance & height
        Teleop->>Teleop: Compute optimal angle/velocity via projectile motion
        Teleop->>Launcher: Set velocity & servo angle
        Launcher-->>Teleop: Launch ready
    end
Loading
sequenceDiagram
    participant Init as Init Phase
    participant Autonomous as Path Execution
    participant Follower as Follower
    participant StaticComm as StaticCommunism

    Init->>Autonomous: Set starting pose (StaticCommunism.pose or set_starting_pose)
    Init->>Autonomous: Create Paths via set_color()
    
    Autonomous->>Follower: Begin path following (pathState = 1)
    Follower->>Follower: Follow preload path
    Follower-->>Autonomous: Path complete
    
    Autonomous->>Autonomous: Launch & shoot (pathState = 100/101)
    Autonomous->>StaticComm: Record pose after shooting
    
    Autonomous->>Autonomous: Enter wait state (pathState = 200)
    Autonomous->>Autonomous: Hold for 0.3-0.5 seconds
    Autonomous->>Autonomous: Advance to next path (pathState = 0)
    
    Autonomous->>Follower: Begin next path
    Follower->>Follower: Follow pickup/park path
    Follower-->>Autonomous: Path complete
    
    Autonomous->>Autonomous: End autonomous
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 Constants unified, angles align,
Pose-tracked paths and aiming so fine,
Followers dance through the field with grace,
Auto and teleop—each in their place! 🚀

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 10d6404 and 932bfbd.

📒 Files selected for processing (18)
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/OpmodeConstants.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PIDF_Tuning.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/StaticCommunism.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autos/Back3Blue.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autos/Back3Main.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autos/Back3Red.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autos/GoalBlue.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autos/GoalMain.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autos/GoalRed.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autos/pedroPathing/Constants.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autos/pickup12blue.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autos/pickup12main.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autos/pickup18main
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autos/pickup6main.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/soloOP/aimingTest.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/soloOP/solo_op_BLUE.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/soloOP/solo_op_MAIN.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/soloOP/solo_op_RED.java

Comment @coderabbitai help to get the list of available commands and usage tips.

@PcPup PcPup merged commit e70c2cc into master Jan 12, 2026
1 of 2 checks passed
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.

3 participants