Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Akit docs #34

Merged
merged 137 commits into from
Dec 22, 2024
Merged

Akit docs #34

merged 137 commits into from
Dec 22, 2024

Conversation

SeanErn
Copy link
Member

@SeanErn SeanErn commented Dec 22, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new configuration file for object detection with detailed camera settings.
    • Added a new OI class for handling driver controller inputs.
    • Implemented a new DriveFacingBestObject command for improved gameplay interaction.
    • Added a PathfindToBestObject command for autonomous navigation to detected game objects.
    • Introduced a new Quickstart guide for configuring the swerve drive system.
  • Bug Fixes

    • Enhanced logging and error handling in the Robot class for better operational insights.
  • Documentation

    • Updated README.md with project overview and development setup instructions.
    • Restructured and clarified documentation for various subsystems and commands.
    • Removed outdated documentation files related to the Bling subsystem and joystick utilities.
  • Chores

    • Removed obsolete files related to the Bling subsystem and joystick utilities to streamline the codebase.

Copy link

coderabbitai bot commented Dec 22, 2024

Caution

Review failed

The pull request is closed.

📝 Walkthrough
📝 Walkthrough

Walkthrough

This pull request introduces a comprehensive restructuring of the FRC Team 5152 robot code repository. The changes span multiple aspects of the project, including subsystem management, documentation, build configuration, and input handling. The primary focus appears to be on modernizing the codebase, simplifying subsystem interactions, and improving overall code organization. Key modifications include removing legacy subsystems, updating build and documentation workflows, and introducing new input handling mechanisms.

Changes

File/Directory Change Summary
.github/workflows/docs.yml Added ./gradlew build step before Javadoc generation
.gitignore Added BuildConstants.java to ignored files; removed 2025CTREexample
.photonvision/.gitignore Deleted file that ignored .zip files and main directory
.photonvision/README.md Deleted file providing context for Photonvision data
.photonvision/config/camera/FM_ObjectDetection/config.json Added new configuration file for object detection with camera settings
.run/ReplayWatch.run.xml Updated Gradle run configuration with new task names and environment options
.vscode/extensions.json Adjusted indentation of recommendations array
.vscode/launch.json Deleted file containing debugging configurations for WPILib
.vscode/settings.json Modified Java test configuration and added new debug setting
.wpilib/wpilib_preferences.json Reformatted JSON for improved readability
README.md Added sections for project overview, development setup, and licensing
build.gradle Restructured build process with new dependencies and tasks
docs/mkdocs/docs/game/subsystems/controls.md Deleted file detailing controls subsystem
docs/mkdocs/docs/index.md Removed extensive documentation on robot systems and features
docs/mkdocs/docs/library/commands/defaultsettoalliancecolor.md Deleted command documentation
docs/mkdocs/docs/library/commands/drivefacingbestobject.md Deleted command documentation
docs/mkdocs/docs/library/commands/drivefacingpose.md Deleted command documentation
docs/mkdocs/docs/library/commands/pathfindtobestobject.md Deleted command documentation
docs/mkdocs/docs/library/commands/pathfindtopose.md Deleted command documentation
docs/mkdocs/docs/library/commands/swerve/characterization.md Added documentation for swerve drive characterization commands
docs/mkdocs/docs/library/commands/swerve/defaultdrive.md Added documentation for default drive command
docs/mkdocs/docs/library/commands/swerve/drivefacingangle.md Added documentation for drive facing angle command
docs/mkdocs/docs/library/commands/swerve/drivefacingpose.md Added documentation for drive facing pose command
docs/mkdocs/docs/library/commands/vision/objectdetection/drivefacingbestobject.md Added documentation for drive facing best object command
docs/mkdocs/docs/library/commands/vision/objectdetection/pathfindtobestobject.md Added documentation for pathfinding to best object command
docs/mkdocs/docs/library/subsystems/bling.md Deleted file documenting the Bling subsystem
docs/mkdocs/docs/library/subsystems/pneumatics.md Deleted file documenting the pneumatics subsystem
docs/mkdocs/docs/library/subsystems/swerve.md Updated documentation for SwerveDrive subsystem
docs/mkdocs/docs/library/subsystems/vision/apriltag.md Updated documentation for AprilTag subsystem
docs/mkdocs/docs/library/subsystems/vision/objectdetection.md Updated documentation for Object Detection subsystem
docs/mkdocs/docs/quickstart.md Added comprehensive guide for configuring and tuning the swerve drive system
docs/mkdocs/mkdocs.yml Restructured navigation and added new sections for documentation
docs/mkdocs/site/404.html Deleted custom 404 error page
docs/mkdocs/site/assets/javascripts/lunr/tinyseg.js Deleted Japanese tokenizer script
docs/mkdocs/site/assets/stylesheets/palette.06af60db.min.css Deleted CSS styles for dark color scheme
docs/mkdocs/site/game/subsystems/controls/index.html Deleted HTML documentation for controls subsystem
docs/mkdocs/site/index.html Deleted main HTML structure for documentation site
docs/mkdocs/site/library/commands/defaultsettoalliancecolor/index.html Deleted command documentation
docs/mkdocs/site/library/commands/drivefacingbestobject/index.html Deleted command documentation
docs/mkdocs/site/library/commands/pathfindtobestobject/index.html Deleted command documentation
docs/mkdocs/site/library/subsystems/bling/index.html Deleted subsystem documentation
docs/mkdocs/site/library/subsystems/pneumatics/index.html Deleted subsystem documentation
docs/mkdocs/site/library/subsystems/swerve/index.html Deleted subsystem documentation
docs/mkdocs/site/library/subsystems/vision/apriltag/index.html Deleted subsystem documentation
docs/mkdocs/site/library/subsystems/vision/objectdetection/index.html Deleted subsystem documentation
docs/mkdocs/site/search/search_index.json Deleted search index for documentation
docs/mkdocs/site/sitemap.xml Deleted empty sitemap file
settings.gradle Restructured plugin management block
src/main/deploy/pathplanner/navgrid.json Reformatted JSON for improved readability
src/main/deploy/pathplanner/settings.json Added newline at end of JSON file
src/main/deploy/swerve/mi41talonsl3/controllerproperties.json Reformatted JSON structure
src/main/deploy/swerve/mi41talonsl3/modules/backleft.json Reformatted JSON structure
src/main/deploy/swerve/mi41talonsl3/modules/backright.json Reformatted JSON structure
src/main/deploy/swerve/mi41talonsl3/modules/frontleft.json Reformatted JSON structure
src/main/deploy/swerve/mi41talonsl3/modules/frontright.json Reformatted JSON structure
src/main/deploy/swerve/mi41talonsl3/modules/physicalproperties.json Reformatted JSON structure
src/main/deploy/swerve/mi41talonsl3/modules/pidfproperties.json Reformatted JSON structure
src/main/deploy/swerve/mi41talonsl3/swervedrive.json Reformatted JSON structure
src/main/deploy/swerve/mk4italonsl2/controllerproperties.json Reformatted JSON structure
src/main/deploy/swerve/mk4italonsl2/modules/backleft.json Reformatted JSON structure
src/main/deploy/swerve/mk4italonsl2/modules/backright.json Reformatted JSON structure
src/main/deploy/swerve/mk4italonsl2/modules/frontleft.json Reformatted JSON structure
src/main/deploy/swerve/mk4italonsl2/modules/frontright.json Reformatted JSON structure
src/main/deploy/swerve/mk4italonsl2/modules/physicalproperties.json Reformatted JSON structure
src/main/deploy/swerve/mk4italonsl2/modules/pidfproperties.json Reformatted JSON structure
src/main/deploy/swerve/mk4italonsl2/swervedrive.json Reformatted JSON structure
src/main/java/frc/alotobots/Constants.java Added runtime mode enumeration and simplified constants
src/main/java/frc/alotobots/Main.java Updated file header comments with new project details
src/main/java/frc/alotobots/OI.java New input handling class for driver controller
src/main/java/frc/alotobots/Robot.java Updated to use LoggedRobot, enhanced logging capabilities
src/main/java/frc/alotobots/RobotContainer.java Removed legacy subsystems, added new subsystem configurations
src/main/java/frc/alotobots/game/HMIStation.java Deleted class managing controller input
src/main/java/frc/alotobots/game/constants/HMIDeadbands.java Deleted file containing deadband constants
src/main/java/frc/alotobots/library/bling/BlingSubsystem.java Deleted class managing LED lighting
src/main/java/frc/alotobots/library/bling/BlingSubsystemConstants.java Deleted file containing constants for Bling subsystem
src/main/java/frc/alotobots/library/bling/BlingTelemetry.java Deleted class handling telemetry for Bling subsystem
src/main/java/frc/alotobots/library/bling/README.md Deleted overview of the Bling subsystem
src/main/java/frc/alotobots/library/bling/commands/DefaultSetToAllianceColor.java Deleted command for setting LEDs to alliance color
src/main/java/frc/alotobots/library/driverstation/JoystickUtilities.java Deleted utility class for joystick input processing
src/main/java/frc/alotobots/library/drivetrains/README.md Deleted documentation for SwerveDrive subsystem
src/main/java/frc/alotobots/library/drivetrains/swerve/ctre/SwerveDrivePathPlanner.java Deleted class managing autonomous path planning
src/main/java/frc/alotobots/library/drivetrains/swerve/ctre/SwerveDriveSubsystem.java Deleted class controlling swerve drive system

Possibly related PRs


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments.

Actionable comments posted: 15

🔭 Outside diff range comments (2)
docs/mkdocs/docs/library/subsystems/vision/apriltag.md (2)

Line range hint 846-853: Add validation checks to camera offset configuration.

The camera offset configuration should include bounds checking and validation.

 private static final Transform3d[] CAMERA_OFFSETS =
   new Transform3d[] {
     // Front Middle
     new Transform3d(
+        validateTranslation(
         new Translation3d(0.275, 0.0, 0.23),
+        ),
+        validateRotation(
         new Rotation3d(0, Math.toRadians(0), Math.toRadians(0)))
+        )
   };

+private static Translation3d validateTranslation(Translation3d t) {
+    if (Math.abs(t.getX()) > 1.0 || Math.abs(t.getY()) > 1.0 || Math.abs(t.getZ()) > 1.0) {
+        throw new IllegalArgumentException("Camera offset exceeds reasonable bounds");
+    }
+    return t;
+}

+private static Rotation3d validateRotation(Rotation3d r) {
+    if (Math.abs(r.getAngle()) > Math.PI) {
+        throw new IllegalArgumentException("Camera rotation exceeds π radians");
+    }
+    return r;
+}
🧰 Tools
🪛 LanguageTool

[uncategorized] ~16-~16: Loose punctuation mark.
Context: ...ameters: 1. AprilTagConsumer consumer: A functional interface that receives pr...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~21-~21: Loose punctuation mark.
Context: ...ndard deviations) 2. AprilTagIO... io: Variable number of AprilTagIO interface...

(UNLIKELY_OPENING_PUNCTUATION)


Line range hint 858-864: Add null checks and validation to camera configuration.

The camera configuration should include proper null checks and validation.

 public static final CameraConfig[] CAMERA_CONFIGS = {
+    Objects.requireNonNull(
     new CameraConfig(
-        "FM_ObjectDetection",
+        validateCameraName("FM_ObjectDetection"),
         CAMERA_OFFSETS[0],
         new SimCameraProperties())
+    )
    };

+private static String validateCameraName(String name) {
+    if (name == null || name.trim().isEmpty()) {
+        throw new IllegalArgumentException("Camera name cannot be null or empty");
+    }
+    if (!name.matches("[A-Z]{2}_ObjectDetection")) {
+        throw new IllegalArgumentException("Camera name must follow format: XX_ObjectDetection");
+    }
+    return name;
+}
🧰 Tools
🪛 LanguageTool

[uncategorized] ~16-~16: Loose punctuation mark.
Context: ...ameters: 1. AprilTagConsumer consumer: A functional interface that receives pr...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~21-~21: Loose punctuation mark.
Context: ...ndard deviations) 2. AprilTagIO... io: Variable number of AprilTagIO interface...

(UNLIKELY_OPENING_PUNCTUATION)

🧹 Nitpick comments (28)
docs/mkdocs/mkdocs.yml (2)

34-39: Consider additional useful markdown extensions

The current extensions are well-chosen for technical documentation. Consider adding these additional extensions to enhance the documentation further:

  • pymdownx.arithmatex: For mathematical equations (useful for robotics calculations)
  • pymdownx.tasklist: For checkboxes in configuration steps
  • toc: For table of contents with customizable depth
markdown_extensions:
  - tables
  - admonition
  - pymdownx.details
  - pymdownx.superfences
  - attr_list
+ - pymdownx.arithmatex
+ - pymdownx.tasklist
+ - toc:
+     permalink: true

41-42: Add newline at end of file

Add a newline character at the end of the file to comply with POSIX standards and fix the yamllint warning.

plugins:
  - search
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 42-42: no new line character at the end of file

(new-line-at-end-of-file)

docs/mkdocs/docs/library/commands/swerve/drivefacingangle.md (4)

14-17: Enhance configuration requirements with specific details

The configuration requirements section could be more helpful by including:

  • Example values or recommended ranges for PID parameters
  • Units for angular velocity and acceleration (e.g., rad/s, rad/s²)
  • A link to the TunerConstants documentation

Consider expanding the section like this:

 The following must be configured in TunerConstants:
-PID values for angle control
-Maximum angular velocity and acceleration constraints
-Profile constraints for smooth angle transitions
+PID values for angle control:
+  - Recommended ranges: kP (0.1-1.0), kI (0-0.1), kD (0-0.1)
+Maximum constraints:
+  - Angular velocity: 0-π rad/s
+  - Angular acceleration: 0-2π rad/s²
+Profile constraints for smooth angle transitions
+
+See [TunerConstants](/path/to/tunerconstants) for more details.

10-11: Clarify parameter types and units

The constructor parameters section should specify:

  • The exact type of the targetRotation supplier
  • The expected angle units and valid ranges

Consider updating the parameters section like this:

-`swerveDriveSubsystem`: The SwerveDrive subsystem instance this command will control
-`targetRotation`: A supplier that provides the target rotation angle
+`swerveDriveSubsystem`: The SwerveDrive subsystem instance this command will control
+`targetRotation`: A DoubleSupplier that provides the target rotation angle in radians (-π to π)

3-4: Add usage example and coordinate system details

The overview would be more helpful with:

  • A simple example use case (e.g., maintaining field-relative orientation while driving)
  • Clarification about the coordinate system conventions used

Consider expanding the overview like this:

 ## Overview
 The DriveFacingAngle command implements sophisticated angle-controlled driving capabilities, allowing the robot to maintain a specific heading while moving. This command utilizes a ProfiledPIDController for precise angle management.
+
+For example, you can use this command to keep the robot facing a specific field element while driving in any direction. The command uses a counter-clockwise positive coordinate system, where 0 radians points along the positive X-axis.

1-20: Consider adding more comprehensive documentation sections

The documentation would benefit from additional sections:

  • Code examples showing common usage patterns
  • Common pitfalls or gotchas to watch out for
  • Related commands (e.g., other swerve drive commands)

Consider adding these sections at the end of the file:

 ## API Reference
 For detailed API documentation, see the [DriveFacingAngle Javadoc](/5152_Template/javadoc/frc/alotobots/library/commands/swervedrive/DriveFacingAngle.html)
+
+## Usage Examples
+```java
+// Example 1: Face forward while driving
+new DriveFacingAngle(
+    swerveDrive,
+    () -> 0.0  // Always face forward (0 radians)
+);
+
+// Example 2: Face game piece while driving
+new DriveFacingAngle(
+    swerveDrive,
+    () -> vision.getGamePieceAngle()
+);
+```
+
+## Common Pitfalls
+- Ensure angle wrapping is handled correctly when crossing the ±π boundary
+- Be mindful of acceleration limits when making large angle changes
+
+## Related Commands
+- [DefaultDrive](/5152_Template/library/commands/swerve/defaultdrive)
+- [DriveFacingPose](/5152_Template/library/commands/swerve/drivefacingpose)
src/main/java/frc/alotobots/Constants.java (2)

26-27: Clarify naming or usage strategy for simMode and currentMode.
Both of these variables tie to the new enum, but “simMode” is set to REPLAY by default, which might be confusing. Consider updating the name “simMode” to reflect its broader usage (e.g., "defaultMode") or adding comments clarifying that it’s the fallback mode.


29-38: Add Javadoc or more descriptive usage hints for Mode enum.
While the comments are present for each enum constant, an overall Javadoc block clarifying typical usage scenarios for each mode would aid readability and maintainability.

src/main/java/frc/alotobots/Robot.java (3)

54-74: Validate logging configuration for each mode.
You have distinct data receivers or replay setups for each mode. Confirm this logic remains consistent with your operators’ expectations (e.g., minimal logging overhead in SIM, correct file writing on REAL, etc.).


76-77: Great usage of Logger.start()
This is a straightforward call, but remember to stop or flush logs appropriately on shutdown or transitions to avoid partial logs.


155-157: Leverage simulationPeriodic more extensively.
SimulationPeriodic is empty. You could replicate or inject sensor feedback logic here if needed, especially with physics-based simulation model expansions.

src/main/java/frc/alotobots/RobotContainer.java (1)

79-98: No-op usage in SIM.
Sim references are properly set for no real hardware calls. If you expand your simulator or need partial simulation for vision, keep the placeholders well-advertised or documented.

build.gradle (2)

179-217: Assess the eventDeploy task scope
Auto-committing changes on “event” branches can be useful but might also lead to unintended commits. Be sure to test your branching workflow thoroughly.


223-275: Spotless usage
Applying Spotless automatically before compilation ensures consistent formatting. Keep an eye on performance if your codebase grows significantly.

.github/workflows/docs.yml (2)

31-31: Consider separating build and documentation tasks

While running build before generating documentation ensures all dependencies are compiled, it might be more efficient to run only the necessary compilation tasks for documentation generation.

- ./gradlew build
+ ./gradlew classes

Line range hint 1-47: Add caching to improve workflow performance

The workflow could benefit from caching Gradle dependencies and Python packages to reduce build times and network usage.

Add these steps after the setup steps:

- uses: actions/cache@v3
  with:
    path: |
      ~/.gradle/caches
      ~/.gradle/wrapper
    key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
    restore-keys: |
      ${{ runner.os }}-gradle-

- uses: actions/cache@v3
  with:
    path: ~/.local/pip
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
    restore-keys: |
      ${{ runner.os }}-pip-
docs/mkdocs/docs/library/commands/swerve/characterization.md (1)

36-39: Add specific requirements and safety warnings

The configuration requirements section could be more specific:

  • Define the minimum clear operating space dimensions needed
  • Specify what constitutes a "level surface" (maximum allowable slope)
  • Add safety warnings about robot movement during characterization
src/main/java/frc/alotobots/OI.java (2)

23-33: Add input validation and document coordinate system

The translation and rotation methods should:

  • Document the coordinate system conventions (which direction is positive/negative)
  • Apply deadband filtering
  • Validate input ranges
   public static double getTranslateForwardAxis() {
-    return driverController.getLeftY();
+    double value = driverController.getLeftY();
+    return Math.abs(value) < DEADBAND ? 0.0 : value;
   }

44-47: Document button mappings and their purposes

Add Javadoc comments explaining:

  • What each button does
  • The expected behavior when pressed
  • Any preconditions or requirements
docs/mkdocs/docs/library/commands/vision/objectdetection/drivefacingbestobject.md (1)

23-29: Enhance behavior details with code examples

Consider adding code examples to demonstrate the usage of this command, particularly:

  1. How to initialize the command with different game elements
  2. How to integrate it with existing commands
docs/mkdocs/docs/library/commands/vision/objectdetection/pathfindtobestobject.md (2)

37-41: Fix list indentation

The list items under "Calculates optimal approach position based on:" are indented with 4 spaces. According to markdown standards, they should be indented with 2 spaces.

- Calculates optimal approach position based on:
-     - Robot bumper dimensions
-     - Approach angle to target
-     - Game element position and orientation
+ Calculates optimal approach position based on:
+   - Robot bumper dimensions
+   - Approach angle to target
+   - Game element position and orientation
🧰 Tools
🪛 Markdownlint (0.37.0)

38-38: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


39-39: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


40-40: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


25-32: Enhance configuration requirements with specific constant names

The configuration section mentions Constants.tunerConstants but could be more specific about which constants need to be set. Consider adding the actual constant names and their expected values.

docs/mkdocs/docs/library/subsystems/swerve.md (2)

21-31: Enhance configuration section with code examples

The TunerConstants section lists various configuration options but doesn't show how to set them. Consider adding code examples showing the proper way to configure these values.


34-39: Consider adding links to related documentation

The additional notes section mentions several important features (vision integration, PathPlanner, system identification) but doesn't link to their respective documentation. Consider adding links to these related topics.

docs/mkdocs/docs/library/subsystems/vision/objectdetection.md (2)

7-9: Add language specification to code block and enhance constructor documentation.

The code block should specify the language and include more details about parameter types.

-```
+```java
 public ObjectDetectionSubsystem(Supplier<Pose2d> robotPose, ObjectDetectionIO... io)

+Additional details to add:
+- robotPose: Returns the current robot pose as a Pose2d object
+- io: Array of ObjectDetectionIO interfaces for camera input/output operations


---

`21-30`: **Add error handling examples to configuration requirements.**

The configuration section should include examples of error handling for common failure scenarios.

Consider adding:
- Exception handling for camera initialization failures
- Recovery procedures for camera disconnections
- Validation of configuration parameters
- Logging recommendations for debugging

</blockquote></details>
<details>
<summary>docs/mkdocs/docs/quickstart.md (2)</summary><blockquote>

`394-402`: **Add language specification and enhance MOI calculation example.**

The code block for MOI calculation should specify the language and include validation.

```diff
-```
+```java
 MOI = mass * (trackwidth/2) * (kA_angular/kA_linear)
+
+// Example validation:
+if (mass <= 0 || trackwidth <= 0 || kA_angular <= 0 || kA_linear <= 0) {
+    throw new IllegalArgumentException("Invalid parameters for MOI calculation");
+}
+if (MOI <= 0) {
+    throw new IllegalStateException("Calculated MOI is invalid");
+}
🧰 Tools
🪛 Markdownlint (0.37.0)

394-394: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


912-929: Enhance camera verification section with automated testing.

The camera verification section should include automated testing procedures.

Consider adding:

  • Automated camera connection testing
  • Performance benchmarking scripts
  • Latency measurement tools
  • Network bandwidth monitoring
  • System resource utilization checks
🛑 Comments failed to post (15)
.gitignore (1)

190-190: 💡 Codebase verification

Remove the temporary directory entry from .gitignore

The "2025CTREexample" entry appears to be a local temporary directory that:

  • Is not referenced anywhere in the codebase
  • Has no related CTRE files or example directories in the project
  • Is placed under a "# Temp" comment section

Since this is clearly a local development artifact and not a common pattern in the project, it should not be committed to the shared .gitignore file. Consider adding it to your personal .git/info/exclude file instead.

🔗 Analysis chain

Verify if the example directory should be permanently ignored.

The "2025CTREexample" entry appears to be a temporary directory. Consider if this should be a permanent ignore rule or if it's specific to your local development environment.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if this directory is referenced or used in the project
rg -l "2025CTREexample" 

Length of output: 23


Script:

#!/bin/bash
# Let's check the context around this entry in .gitignore
rg -B 5 -A 5 "2025CTREexample" .gitignore

# Also check if there are any CTRE-related files or directories
fd -I "ctre|CTRE"

# Check if there are any example directories
fd -t d -I "example"

Length of output: 164

docs/mkdocs/mkdocs.yml (1)

14-22: 💡 Codebase verification

Missing documentation files referenced in navigation

The verification revealed that all referenced markdown files are missing from the repository:

  • docs/library/commands/swerve/defaultdrive.md
  • docs/library/commands/swerve/drivefacingangle.md
  • docs/library/commands/swerve/drivefacingpose.md
  • docs/library/commands/swerve/characterization.md
  • docs/library/commands/vision/objectdetection/drivefacingbestobject.md
  • docs/library/commands/vision/objectdetection/pathfindtobestobject.md
  • docs/library/subsystems/vision/objectdetection.md

Please ensure these documentation files are created and added to the repository to prevent broken links in the navigation.

🔗 Analysis chain

Verify all referenced documentation files exist

The navigation structure references multiple markdown files. Let's ensure they all exist to prevent broken links.

Also applies to: 26-26

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if all referenced markdown files exist
files=(
    "docs/library/commands/swerve/defaultdrive.md"
    "docs/library/commands/swerve/drivefacingangle.md"
    "docs/library/commands/swerve/drivefacingpose.md"
    "docs/library/commands/swerve/characterization.md"
    "docs/library/commands/vision/objectdetection/drivefacingbestobject.md"
    "docs/library/commands/vision/objectdetection/pathfindtobestobject.md"
    "docs/library/subsystems/vision/objectdetection.md"
)

for file in "${files[@]}"; do
    if [ ! -f "$file" ]; then
        echo "Missing: $file"
    fi
done

Length of output: 2047

docs/mkdocs/docs/library/commands/swerve/drivefacingangle.md (1)

7-7: 💡 Codebase verification

Broken documentation link needs to be updated

The link to the SwerveDriveSubsystem documentation should be updated to point to the correct location:

  • Change /5152_Template/library/subsystems/swerve/ to /library/subsystems/swerve as the documentation exists at docs/mkdocs/docs/library/subsystems/swerve.md
🔗 Analysis chain

Verify documentation links

Let's ensure the referenced documentation pages and Javadoc exist at the specified locations.

Also applies to: 20-20


Let me verify the correct documentation structure first.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of referenced documentation files and Javadoc

# Check if the swerve subsystem documentation exists
echo "Checking swerve subsystem documentation..."
fd -t f -e md -e html "index.md|README.md" docs/mkdocs/docs/library/subsystems/swerve/

# Check if the Javadoc exists
echo "Checking Javadoc..."
fd -t f "DriveFacingAngle.html" docs/

Length of output: 401


Script:

#!/bin/bash
# Check the actual documentation structure
echo "Checking documentation structure..."
fd -t d "subsystems|commands" docs/mkdocs/docs/library/

# List all markdown files in the library section
echo -e "\nListing all markdown files in library..."
fd -t f -e md . docs/mkdocs/docs/library/

Length of output: 916

.vscode/settings.json (1)

29-29: ⚠️ Potential issue

Remove the null entry from test configuration array

The null entry in the test configuration array is suspicious and could potentially cause issues with test execution. If this is intentional, please document the reason; otherwise, it should be removed.

- null
.run/ReplayWatch.run.xml (1)

4-8: ⚠️ Potential issue

Remove hardcoded absolute path from run configuration

The environment variable AKIT_LOG_PATH contains a hardcoded absolute path that:

  • References a specific user's media device
  • Contains a specific date
  • Won't work for other developers

Consider using a relative path or making this configurable per developer environment.

       <option name="env">
         <map>
-          <entry key="AKIT_LOG_PATH" value="/run/media/sernstes/E419-3D6A/logs/akit_24-12-13_15-13-21.wpilog" />
+          <entry key="AKIT_LOG_PATH" value="${project.basedir}/logs/latest.wpilog" />
         </map>
       </option>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

      <option name="env">
        <map>
          <entry key="AKIT_LOG_PATH" value="${project.basedir}/logs/latest.wpilog" />
        </map>
      </option>
docs/mkdocs/docs/library/commands/swerve/characterization.md (2)

7-7: ⚠️ Potential issue

Fix broken documentation link

The link to SwerveDriveSubsystem documentation appears to use an old path format /5152_Template/library/subsystems/swerve/. Update it to match the new documentation structure.


41-42: ⚠️ Potential issue

Fix broken Javadoc link

The API reference link uses an old path format /5152_Template/javadoc/. Update it to match the new documentation structure.

src/main/java/frc/alotobots/OI.java (1)

19-20: 🛠️ Refactor suggestion

Consider making OI instance-based instead of static

Static state can make testing difficult and limit flexibility. Consider:

  • Making OI instance-based
  • Injecting controller dependencies
  • Adding constructor parameter for controller port instead of hardcoding 0
 public class OI {
-  public static final double DEADBAND = 0.1;
-  private static final CommandXboxController driverController = new CommandXboxController(0);
+  public static final double DEADBAND = 0.1;
+  private final CommandXboxController driverController;
+
+  public OI(int controllerPort) {
+    this.driverController = new CommandXboxController(controllerPort);
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

  public static final double DEADBAND = 0.1;
  private final CommandXboxController driverController;

  public OI(int controllerPort) {
    this.driverController = new CommandXboxController(controllerPort);
  }
docs/mkdocs/docs/library/commands/vision/objectdetection/drivefacingbestobject.md (2)

6-7: 🛠️ Refactor suggestion

Update subsystem links to use relative paths

The subsystem links use absolute paths starting with /5152_Template. Consider using relative paths for better maintainability.

-- [Object Detection Subsystem](/5152_Template/library/subsystems/vision/objectdetection)
-- [Swerve Drive Subsystem](/5152_Template/library/subsystems/swerve)
++ [Object Detection Subsystem](../../../../subsystems/vision/objectdetection)
++ [Swerve Drive Subsystem](../../../../subsystems/swerve)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

- [Object Detection Subsystem](../../../../subsystems/vision/objectdetection)
- [Swerve Drive Subsystem](../../../../subsystems/swerve)

31-31: ⚠️ Potential issue

Fix the JavaDoc reference link

The JavaDoc reference link uses PROJECT_ROOT which appears to be a placeholder. Consider using a relative path instead.

-For detailed method documentation, refer to the [JavaDoc reference](PROJECT_ROOT/javadoc/frc/alotobots/library/subsystems/vision/photonvision/objectdetection/commands/package-summary.html).
+For detailed method documentation, refer to the [JavaDoc reference](../../../../../javadoc/frc/alotobots/library/subsystems/vision/photonvision/objectdetection/commands/package-summary.html).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

For detailed method documentation, refer to the [JavaDoc reference](../../../../../javadoc/frc/alotobots/library/subsystems/vision/photonvision/objectdetection/commands/package-summary.html).
docs/mkdocs/docs/library/commands/vision/objectdetection/pathfindtobestobject.md (2)

44-44: ⚠️ Potential issue

Fix the JavaDoc reference link

The JavaDoc reference link uses PROJECT_ROOT which appears to be a placeholder. Consider using a relative path instead.

-For detailed method documentation, refer to the [JavaDoc reference](PROJECT_ROOT/javadoc/frc/alotobots/library/subsystems/vision/photonvision/objectdetection/commands/package-summary.html).
+For detailed method documentation, refer to the [JavaDoc reference](../../../../../javadoc/frc/alotobots/library/subsystems/vision/photonvision/objectdetection/commands/package-summary.html).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

For detailed method documentation, refer to the [JavaDoc reference](../../../../../javadoc/frc/alotobots/library/subsystems/vision/photonvision/objectdetection/commands/package-summary.html).

6-7: 🛠️ Refactor suggestion

Update subsystem links to use relative paths

The subsystem links use absolute paths starting with /5152_Template. Consider using relative paths for better maintainability.

-- [Object Detection Subsystem](/5152_Template/library/subsystems/vision/objectdetection)
-- [Swerve Drive Subsystem](/5152_Template/library/subsystems/swerve)
++ [Object Detection Subsystem](../../../../subsystems/vision/objectdetection)
++ [Swerve Drive Subsystem](../../../../subsystems/swerve)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

- [Object Detection Subsystem](../../../../subsystems/vision/objectdetection)
- [Swerve Drive Subsystem](../../../../subsystems/swerve)
docs/mkdocs/docs/library/subsystems/swerve.md (2)

32-32: ⚠️ Potential issue

Fix JavaDoc reference link

The JavaDoc reference link uses an absolute path. Consider using a relative path instead.

-See the [JavaDoc Reference](/5152_Template/javadoc/frc/alotobots/library/subsystems/swervedrive/package-summary.html) for detailed configuration options.
+See the [JavaDoc Reference](../../../javadoc/frc/alotobots/library/subsystems/swervedrive/package-summary.html) for detailed configuration options.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

See the [JavaDoc Reference](../../../javadoc/frc/alotobots/library/subsystems/swervedrive/package-summary.html) for detailed configuration options.

7-10: 🛠️ Refactor suggestion

Update command links to use relative paths

The command links use absolute paths starting with /5152_Template. Consider using relative paths for better maintainability.

-- [DefaultDrive Command](/5152_Template/library/commands/swerve/defaultdrive)
-- [DriveFacingAngle Command](/5152_Template/library/commands/swerve/drivefacingangle)
-- [DriveFacingPose Command](/5152_Template/library/commands/swerve/drivefacingpose)
-- [Characterization Commands](/5152_Template/library/commands/swerve/characterization)
++ [DefaultDrive Command](../../commands/swerve/defaultdrive)
++ [DriveFacingAngle Command](../../commands/swerve/drivefacingangle)
++ [DriveFacingPose Command](../../commands/swerve/drivefacingpose)
++ [Characterization Commands](../../commands/swerve/characterization)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

- [DefaultDrive Command](../../commands/swerve/defaultdrive): Provides standard teleoperated control
- [DriveFacingAngle Command](../../commands/swerve/drivefacingangle): Maintains a specific robot heading while driving
- [DriveFacingPose Command](../../commands/swerve/drivefacingpose): Orients the robot to face a target position while driving
- [Characterization Commands](../../commands/swerve/characterization): Used for system identification and calibration
docs/mkdocs/docs/quickstart.md (1)

571-650: 🛠️ Refactor suggestion

Add network security considerations to vision coprocessor setup.

The vision coprocessor setup section should include network security best practices.

Consider adding:

  • Network isolation recommendations
  • Firewall configuration
  • Access control setup
  • SSL/TLS configuration for PhotonVision
  • Regular security updates procedure

@SeanErn SeanErn merged commit 327600c into master Dec 22, 2024
2 checks passed
@SeanErn SeanErn deleted the AkitDocs branch December 22, 2024 02:03
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