Skip to content

codul de la regio + auto lui robert - #5

Merged
vladuzzul merged 1 commit into
mainfrom
new_auto
Aug 3, 2026
Merged

codul de la regio + auto lui robert#5
vladuzzul merged 1 commit into
mainfrom
new_auto

Conversation

@vladuzzul

@vladuzzul vladuzzul commented Aug 3, 2026

Copy link
Copy Markdown
Member

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

Summary by CodeRabbit

  • New Features
    • Added autonomous replay modes for recorded robot driving and mechanism actions.
    • Added teleoperated data-recording modes with telemetry, vision support, and CSV export for replayable sessions.
  • Improvements
    • Updated the default flap-open position for more precise mechanism operation.
  • Refactor
    • Removed obsolete comments and inactive turret-alignment code without changing existing driving behavior.

Copilot AI review requested due to automatic review settings August 3, 2026 10:44
@vladuzzul
vladuzzul merged commit e4558d1 into main Aug 3, 2026
1 check was pending
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 29e06ec8-b05d-4f53-bb2b-b376d0967683

📥 Commits

Reviewing files that changed from the base of the PR and between 1080b76 and 8b97a8a.

📒 Files selected for processing (8)
  • 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/OldReplayOp2.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/autonomous/ReplayAutoOp3.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/manual/DataRecordingOp2.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/manual/DataRecordingOp3.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/manual/MainDrivingOp.java
  • TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/utils/Constants.java

📝 Walkthrough

Walkthrough

Changes

Replay recording and playback

Layer / File(s) Summary
DataRecordingOp2 capture flow
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/manual/DataRecordingOp2.java
Adds a TeleOp recorder with robot controls, telemetry, periodic CSV capture, and shutdown handling.
DataRecordingOp3 capture flow
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/manual/DataRecordingOp3.java
Adds V3 CSV recording for drive powers, pose, voltage, mechanism velocities, and servo positions.
OldReplayOp2 playback flow
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/autonomous/OldReplayOp2.java
Adds CSV loading, interpolated pose playback, PD mecanum driving, mechanism replay, and voltage-based timing adjustment.
ReplayAutoOp3 playback flow
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/autonomous/ReplayAutoOp3.java
Adds V3 frame parsing, lookahead playback, filtered PD control, mechanism control, voltage scaling, telemetry, and cleanup.
Shared robot behavior cleanup
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/manual/MainDrivingOp.java, TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/utils/Constants.java
Removes obsolete comments and changes Constants.FLAP_OPEN from 1 to 0.9.

Estimated code review effort: 5 (Critical) | ~90+ minutes

Sequence Diagram(s)

sequenceDiagram
  participant DataRecordingOp3
  participant Robot
  participant CSVFile
  participant ReplayAutoOp3
  DataRecordingOp3->>Robot: control robot and read state
  DataRecordingOp3->>CSVFile: write recorded frame
  ReplayAutoOp3->>CSVFile: load recorded frames
  ReplayAutoOp3->>Robot: apply interpolated drive and mechanism outputs
Loading

Possibly related PRs

  • kronbot/decode#3: Shares changes in Robot.java and Auto_BackBlueOp.java related to turret and autonomous behavior.

Suggested reviewers: copilot

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

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the KronBot FTC codebase to support TeleOp recording and Autonomous replay (“Replay V3”), alongside minor cleanup and a flap calibration tweak.

Changes:

  • Adjust flap open servo constant for mechanism calibration.
  • Add TeleOp opmodes to record drive + mechanism data to CSV (V2 power-based, V3 velocity-based).
  • Add autonomous opmodes to replay recorded CSV data with improved control logic.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/utils/Constants.java Adjusts flap open position constant.
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/Robot.java Removes a large commented-out turret-alignment block.
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/manual/MainDrivingOp.java Removes dead/commented alignment code and extra whitespace.
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/manual/DataRecordingOp3.java Adds a TeleOp “Data Recorder V3” that records pose + mechanism velocities to CSV.
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/manual/DataRecordingOp2.java Adds a TeleOp “Data Recorder” that records pose + mechanism powers to CSV.
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/autonomous/ReplayAutoOp3.java Adds an autonomous replay opmode for the V3 CSV format with interpolation/PD improvements.
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/autonomous/OldReplayOp2.java Adds an older replay implementation for the V2 CSV format.
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/autonomous/Auto_BackBlueOp.java Removes an inline comment in an autonomous state machine.
Suppressed comments (2)

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/manual/DataRecordingOp3.java:245

  • If the FileWriter fails to initialize, dataRecorder remains null, but the loop still calls recordData(), which will throw a NullPointerException when writing. Guard recording when the recorder isn't initialized.
        // Record Data (Fix #5: uses same ElapsedTime as replay for consistent timestamps)
        if (now - lastRecordTime >= RECORD_INTERVAL_SEC) {
            try {
                recordData(now);
            } catch (IOException e) {

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/kronbot/manual/DataRecordingOp2.java:282

  • Telemetry label says "angle servo pos" but this prints the turret servo position, which is misleading during tuning/debugging.
        telemetry.addData("shooter motor vel:", robot.leftOuttake.getVelocity());
        telemetry.addData("angle servo pos:", robot.turretServo.getPosition());
        telemetry.addData("turret angle:", robot.turret.angle);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Autonomous(name = "Replay Auto V3", group = "Autonomous")
public class ReplayAutoOp3 extends LinearOpMode {

private static final String CSV_PATH = "/sdcard/robot_data.csv";
Comment on lines +246 to +254
// Record Data
if (now - lastRecordTime >= RECORD_INTERVAL_MS) {
try {
recordData();
} catch (IOException e) {
telemetry.addData("Recording Error", e.getMessage());
}
lastRecordTime = now;
}
telemetry.addData("Drive Powers", "LF:%.2f RF:%.2f LR:%.2f RR:%.2f",
leftFront.getPower(), rightFront.getPower(), leftRear.getPower(), rightRear.getPower());
telemetry.addData("shooter motor vel:", robot.leftOuttake.getVelocity());
telemetry.addData("angle servo pos:", robot.turretServo.getPosition());
* Records drive motor powers (for feedforward replay) and mechanism velocities
* (for faithful shooter reproduction).
*
* CSV columns (17 total):
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