Skip to content

Comments

5 drive to point#11

Open
JosephTLockwood wants to merge 2 commits into2-Loggingfrom
5-DriveToPoint
Open

5 drive to point#11
JosephTLockwood wants to merge 2 commits into2-Loggingfrom
5-DriveToPoint

Conversation

@JosephTLockwood
Copy link
Collaborator

@JosephTLockwood JosephTLockwood commented Nov 17, 2025

Summary by CodeRabbit

  • New Features
    • Added autonomous path planning support with PathPlanner integration
    • Added field-centric drive control with joystick and keyboard input bindings
    • Added drive-to-point command for autonomous point-to-point navigation
    • Added telemetry and data logging capabilities for diagnostics
    • Added configurable robot parameters including navigation grid and path definitions

@coderabbitai
Copy link

coderabbitai bot commented Nov 17, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR integrates PathPlanner autonomous path planning into an FRC robot codebase. It introduces a new CommandSwerveDrivetrain subsystem with AutoBuilder configuration, adds joystick control bindings for field-centric driving, includes a DriveToPoint command for point-to-point navigation, enables Epilogue data logging, and provides PathPlanner configuration files and vendor dependencies.

Changes

Cohort / File(s) Summary
PathPlanner Configuration Files
simgui-ds.json, src/main/deploy/pathplanner/navgrid.json, src/main/deploy/pathplanner/paths/Example Path.path, src/main/deploy/pathplanner/settings.json
New JSON and path files defining keyboard joystick mappings, navigational grid (17.548 × 8.052 m with 0.3 m nodes), example autonomous path with two waypoints and global constraints, and robot/pathplanner settings including drivetrain dimensions, kinematic mode, motor types, and wheel module positions.
Robot Logging & Initialization
src/main/java/frc/robot/Robot.java
Added imports for Epilogue and DataLogManager; annotated class with @Logged; initialized DataLogManager and bound Epilogue in constructor.
Container & Control Wiring
src/main/java/frc/robot/RobotContainer.java
Added @Logged annotation; implemented path following warmup scheduling, autonomous mode selection via autoChooser (populated from AutoBuilder), joystick bindings for field-centric drive with deadbands, DriveToPoint button mappings (A/B buttons), and idle behavior disable during disabled mode.
Point-to-Point Navigation Command
src/main/java/frc/robot/commands/DriveToPoint.java
New command class driving swerve drivetrain to target Pose2d using separate PID controllers for X, Y, and rotation; applies field-centric SwerveRequest each cycle; continuous-input rotation controller; idles drivetrain on end; never finishes on its own.
Swerve Drivetrain Subsystem
src/main/java/frc/robot/subsystems/CommandSwerveDrivetrain.java
New subsystem extending TunerSwerveDrivetrain; provides three overloaded constructors with optional odometry frequency and vision standard deviations; configures PathPlanner AutoBuilder with PPHolonomicDriveController and hardcoded PID constants; manages simulation thread (kSimLoopPeriod-based updates); integrates vision measurements with Kalman filter timestamp handling; applies operator perspective once per enable cycle; exposes applyRequest(Supplier) and pose/module state accessors.
PathPlanner Vendor Dependency
vendordeps/PathplannerLib-2025.2.7.json
New manifest file declaring PathplannerLib 2025.2.7 Java and C++ dependencies with multi-platform support (windows/linux/macos/athena/arm architectures).

Sequence Diagram(s)

sequenceDiagram
    participant RobotInit as Robot Constructor
    participant DLM as DataLogManager
    participant Epilogue as Epilogue
    participant Container as RobotContainer
    participant AutoBuilder as PathPlanner<br/>AutoBuilder
    participant Drivetrain as CommandSwerveDrivetrain
    
    RobotInit->>DLM: start()
    RobotInit->>Epilogue: bind(this)
    RobotInit->>Container: create RobotContainer
    
    Container->>AutoBuilder: load RobotConfig from settings
    Container->>AutoBuilder: configure PPHolonomicDriveController<br/>with PID constants
    Container->>AutoBuilder: configure path-flipping logic
    Container->>Drivetrain: applyRequest(field-centric supplier)
    
    Note over Container: Schedule PathPlanner warmup
    Note over Container: Populate autoChooser from<br/>AutoBuilder paths
Loading
sequenceDiagram
    participant Scheduler as Command Scheduler
    participant RobotContainer as RobotContainer
    participant Drivetrain as CommandSwerveDrivetrain
    participant SwerveRequest as SwerveRequest<br/>FieldCentric
    
    Scheduler->>RobotContainer: Poll joystick axes
    RobotContainer->>Drivetrain: apply field-centric<br/>velocities (with deadband)
    
    Scheduler->>Drivetrain: execute()
    Drivetrain->>SwerveRequest: update with<br/>joystick speeds
    SwerveRequest->>Drivetrain: apply to modules
    
    alt Autonomous
        Scheduler->>Drivetrain: execute auto command<br/>from autoChooser
        Drivetrain->>Drivetrain: apply operator<br/>perspective (once)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~70 minutes

  • CommandSwerveDrivetrain.java requires careful review of AutoBuilder configuration logic, simulation thread initialization (delta-time handling, battery voltage usage), vision measurement integration with Kalman filter timestamp conversion, and operator perspective application state management.
  • RobotContainer.java wiring is moderately complex; verify that autoChooser population from AutoBuilder paths and path following warmup scheduling are correct, and that joystick deadband values are appropriate.
  • DriveToPoint.java PID controller setup and continuous-input rotation handling should be verified for correctness, particularly the isFinished() returning false (command must be externally stopped).
  • PathPlanner configuration files (settings.json, navgrid.json, Example Path.path) should be validated for geometric accuracy and constraint values matching robot capabilities.
  • Robot.java and vendor dependency are trivial and low-risk.

Poem

🐰 A swerve of speed, a path so true,
With PathPlanner's wisdom through and through,
Field-centric hops on joystick's call,
DriveToPoint commands conquer all!
Epilogue logs each joyful bound—
Autonomous glory, swift and sound! 🎯

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 64.71% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '5 drive to point' accurately reflects the main change: adding a new DriveToPoint command class and integrating it into the robot control system.

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.

@JosephTLockwood JosephTLockwood changed the base branch from main to 2-Logging November 17, 2025 06:30
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.

1 participant