Skip to content

working auto aim + autonomous after regio - #3

Merged
ChiriacIoana merged 15 commits into
mainfrom
new_auto
Mar 2, 2026
Merged

working auto aim + autonomous after regio#3
ChiriacIoana merged 15 commits into
mainfrom
new_auto

Conversation

@ChiriacIoana

@ChiriacIoana ChiriacIoana commented Mar 2, 2026

Copy link
Copy Markdown
Collaborator

Before issuing a pull request, please see the contributing page.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced range-based shooter configuration system for improved accuracy across varying distances
    • Added multi-segment autonomous routines with coordinated intake and multi-ball shooting sequences
    • Implemented enhanced turret aiming controls with dynamic range targeting
  • Bug Fixes

    • Adjusted follower initialization for more reliable path execution
  • Refactoring

    • Restructured autonomous state machines for better multi-shot coordination and timing
    • Improved velocity and servo control consistency across shooter systems

@ChiriacIoana
ChiriacIoana merged commit 37243ea into main Mar 2, 2026
1 check was pending
@coderabbitai

coderabbitai Bot commented Mar 2, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec3c27f and d7cbea2.

📒 Files selected for processing (13)
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/KronBot.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/Robot.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/autonomous/Auto_BackBlueOp.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/autonomous/Auto_BackRedOp.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/autonomous/Auto_CloseBlueOp.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/autonomous/Auto_CloseRedOp.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/autonomous/AutonomousConstants.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/manual/MainDrivingOp.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/manual/OuttakeShootingTesting.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/utils/Constants.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/utils/PoseStorage.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/utils/tests/TestAuto.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/pedroPathing/Constants.java

📝 Walkthrough

Walkthrough

This PR introduces a range-based shooter targeting system with configurable RangeConfig data holders, substantially overhauls autonomous routines for multi-ball shooting sequences with staged intake/launch cycles, updates hardware calibration constants (flap, range velocities, angles), and removes automatic IMU reset and follower initialization during hardware setup.

Changes

Cohort / File(s) Summary
Range-based Shooter Configuration
Robot.java
Introduces public RangeConfig inner class (angle, velocity, kS); replaces direct velocity/angle/kS fields with activeConfig. Adds interpolateRange() for distance-based interpolation between TreeMap-stored range configs. Updates Shoot.activateRange() to accept range index and assign resulting config. Extends telemetry to reflect activeConfig values. Adds Blue_Target flag for target calculations.
Autonomous Multi-Segment Pathing
Auto_BackBlueOp.java, Auto_BackRedOp.java, Auto_CloseBlueOp.java, Auto_CloseRedOp.java
Restructures autonomous sequences from simple two-path routines into multi-stage flows with 6-12 path states and separate launch states (0-5). Introduces new poses (start, launch1/11/2, intake1/11, etc.) and path chains for staged shooting, intake cycles, and parking. Refactors autonomousPathUpdate() to handle sequential ball launching, motor/servo controls during transitions, and timing-based state progression with braking on segments.
Autonomous Coordinate System
AutonomousConstants.java
Replaces compact field layout with expanded coordinate set for CLOSE and FAR (BACK) pathways (RED/BLUE). Updates launch speed constants (1150→1230, 1400→1600) and angle servo positions (0.6→0.3, 0.65→0.2). Introduces multiple intermediate zone coordinates (LaunchZoneClose1/11, IntakeZoneClose1/11, etc.) supporting staged autonomous flows.
Hardware Configuration & Constants
Constants.java
Updates flap servo positions (FLAP_CLOSED: 0.29→0.55; FLAP_OPEN: 0.55→1). Adds range distance thresholds (RANGE_1=20, RANGE_2=40, RANGE_3=90, RANGE_4=120) with velocity/angle tuning per range. Adds basket coordinates (BASKET_X=130, BASKET_Y/BASKET_BLUE_Y for targeting). Updates pedroPathing velocity constants (xVelocity, yVelocity increased ~200 units).
Manual Control & Telemetry
MainDrivingOp.java, OuttakeShootingTesting.java
Refactors turret aiming logic with dpad-based incremental steps and auto-aim toggles; adds Blue_Target toggle via right stick. Removes gamepad parameter from activateRange() calls. Updates velocity threshold comparison to use activeConfig.velocity. Changes direct outtake field assignments to activeConfig references in testing utilities.
Initialization & Cleanup
KronBot.java, PoseStorage.java, TestAuto.java
Disables automatic IMU reset and follower init in initHardware(). Replaces string-based file path construction with File objects in savePose()/loadPose() and alters default return poses (missing→(67,67,0), error→(69,69,0)). Comments out entire TestAuto class, effectively disabling it.

Sequence Diagram(s)

sequenceDiagram
    participant Sensor as Robot Sensor/Measurement
    participant Range as Outtake (Range Interpolation)
    participant Shooter as Shoot (Activation)
    participant Config as RangeConfig
    participant Hardware as Hardware Output

    Sensor->>Range: measured distance (0 or value)
    activate Range
    alt distance == 0 (auto-range)
        Range->>Range: interpolateRange()
        Note over Range: TreeMap lookup + linear interpolation
    else distance > 0 (fixed range)
        Range->>Range: select fixed RangeConfig
    end
    Range-->>Config: RangeConfig (velocity, angle, kS)
    deactivate Range
    
    Shooter->>Shooter: activateRange(int range)
    Shooter->>Config: assign to outtake.activeConfig
    
    Hardware->>Hardware: apply velocity from activeConfig
    Hardware->>Hardware: apply angle from activeConfig
    Hardware->>Hardware: apply kS (friction compensation)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • new changes  #2: Overlapping changes to KronBot/Robot initialization patterns, initFollower usage, and follower state management during hardware setup.

Poem

🐰 Ranges interpolate, launchers calculate,
Multi-stage paths now navigate the gate,
From intake to basket, the sequence flows,
Each servo and motor precisely knows! 🎯

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch new_auto

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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