diff --git a/.clang-format b/.clang-format index 14ff7a4a8..15a3ce2db 100644 --- a/.clang-format +++ b/.clang-format @@ -68,19 +68,26 @@ ForEachMacros: - BOOST_FOREACH IncludeBlocks: Regroup IncludeCategories: - - Regex: '^' - Priority: 2 - SortPriority: 0 - - Regex: '^<.*\.h>' - Priority: 1 - SortPriority: 0 - - Regex: '^<.*' - Priority: 2 - SortPriority: 0 - - Regex: '.*' - Priority: 3 - SortPriority: 0 -IncludeIsMainRegex: '([-_](test|unittest))?$' + # C standard library headers + # + # https://en.cppreference.com/w/cpp/header: + # * C compatibility headers + # * Special C compatibility headers + # * Empty C headers + # * Meaningless C headers + # * Unsupported C headers + - Regex: '^<(assert\.h|ctype\.h|errno\.h|fenv\.h|float\.h|inttypes\.h|limits\.h|locale\.h|math\.h|setjmp\.h|signal\.h|stdarg\.h|stddef\.h|stdint\.h|stdio\.h|stdlib\.h|string\.h|time\.h|uchar\.h|wchar\.h|wctype\.h|stdatomic\.h|ccomplex|complex\.h|ctgmath|tgmath\.h|ciso646|cstdalign|cstdbool|iso646\.h|stdalign\.h|stdbool\.h|stdatomic\.h|stdnoreturn\.h|threads\.h)>' + Priority: 1 + # C++ standard library headers (lowercase and underscores with no .h suffix) + - Regex: '^<[a-z_]+>' + Priority: 2 + # Other library headers (angle brackets) + - Regex: '^<.*' + Priority: 3 + # Project headers (double quotes) + - Regex: '^".*' + Priority: 4 +IncludeIsMainRegex: '(Test|_test)?$' IncludeIsMainSourceRegex: '' IndentCaseLabels: true IndentGotoLabels: true @@ -136,7 +143,7 @@ RawStringFormats: CanonicalDelimiter: '' BasedOnStyle: google ReflowComments: true -SortIncludes: false +SortIncludes: true SortUsingDeclarations: true SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 704a41b1a..0d5211e4a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -11,6 +11,7 @@ Merge checklist: - [ ] Pull Request title is [short, imperative summary](https://cbea.ms/git-commit/) of proposed changes - [ ] The description documents the _what_ and _why_ +- [ ] This PR has been [linted](https://docs.photonvision.org/en/latest/docs/contributing/linting.html). - [ ] If this PR changes behavior or adds a feature, user documentation is updated - [ ] If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly - [ ] If this PR touches configuration, this is backwards compatible with settings back to v2025.3.2 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 497bac00b..07179431a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,10 +88,8 @@ jobs: run: sudo apt-get update && sudo apt-get install -y libcholmod3 liblapack3 libsuitesparseconfig5 - name: Gradle Build run: ./gradlew photon-targeting:build photon-core:build photon-server:build -x check - - name: Gradle Tests - run: ./gradlew testHeadless --stacktrace - - name: Gradle Coverage - run: ./gradlew jacocoTestReport + - name: Gradle Tests and Coverage + run: ./gradlew test jacocoTestReport --stacktrace build-offline-docs: name: "Build Offline Docs" runs-on: ubuntu-22.04 diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index 350bf3886..9333d9132 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -31,7 +31,7 @@ jobs: with: python-version: 3.11 - name: Install wpiformat - run: pip3 install wpiformat==2025.34 + run: pip3 install wpiformat==2025.75 - name: Run run: wpiformat - name: Check output diff --git a/.styleguide b/.wpiformat similarity index 68% rename from .styleguide rename to .wpiformat index 7259f0408..6a5c65933 100644 --- a/.styleguide +++ b/.wpiformat @@ -1,41 +1,25 @@ cppHeaderFileInclude { \.h$ - \.hpp$ - \.inc$ - \.inl$ -} - -cppSrcFileInclude { - \.cpp$ } modifiableFileExclude { - \.jpg$ - \.jpeg$ - \.png$ - \.gif$ - \.so$ \.dll$ - \.webp$ + \.gif$ \.ico$ - \.rknn$ - \.tflite$ + \.jpeg$ + \.jpg$ \.mp4$ + \.pdf$ + \.png$ + \.rknn$ + \.so$ + \.svg$ + \.tflite$ \.ttf$ + \.webp$ \.woff2$ gradlew photon-lib/py/photonlibpy/generated/ - photon-targeting/src/main/native/cpp/photon/constrained_solvepnp/generate/ photon-targeting/src/generated/ -} - -includeProject { - ^photonLib/ -} - -includeOtherLibs { - ^frc/ - ^networktables/ - ^units/ - ^wpi/ + photon-targeting/src/main/native/cpp/photon/constrained_solvepnp/generate/ } diff --git a/.styleguide-license b/.wpiformat-license similarity index 100% rename from .styleguide-license rename to .wpiformat-license diff --git a/build.gradle b/build.gradle index 1f0d90b7d..fcbbe71c3 100644 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,7 @@ ext { javalinVersion = "6.7.0" libcameraDriverVersion = "v2025.0.4" rknnVersion = "dev-v2025.0.0-5-g666c0c6" - rubikVersion = "dev-v2025.1.0-8-g067a316" + rubikVersion = "dev-v2025.1.0-6-g4a5e508" frcYear = "2025" mrcalVersion = "v2025.0.0"; @@ -92,7 +92,7 @@ spotless { format 'misc', { target fileTree('.') { include '**/*.md', '**/.gitignore' - exclude '**/build/**', '**/build-*/**' + exclude '**/build/**', '**/build-*/**', '**/node_modules/**' } trimTrailingWhitespace() indentWithSpaces(2) diff --git a/docs/.styleguide b/docs/.styleguide deleted file mode 100644 index a3bf6f6ac..000000000 --- a/docs/.styleguide +++ /dev/null @@ -1,18 +0,0 @@ - -modifiableFileExclude { - \.jpg$ - \.jpeg$ - \.png$ - \.gif$ - \.so$ - \.pdf$ - \.mp4$ - \.dll$ - \.webp$ - \.ico$ - \.rknn$ - \.tflite$ - \.svg$ - \.woff2$ - gradlew -} diff --git a/docs/source/conf.py b/docs/source/conf.py index 8d4b6b6db..3414fc7db 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -21,6 +21,29 @@ project = "PhotonVision" copyright = "2024, PhotonVision" author = "Banks Troutman, Matt Morley" +# -- Git configuration ----------------------------------------------------- +import subprocess + +try: + # Use closest tag + git_tag_ref = ( + subprocess.check_output( + [ + "git", + "describe", + "--tags", + ], + stderr=subprocess.DEVNULL, + ) + .strip() + .decode() + ) +except subprocess.CalledProcessError: + # Couldn't find closest tag, fallback to main + git_tag_ref = "main" + +myst_substitutions = {"git_tag_ref": git_tag_ref} + # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be @@ -158,4 +181,4 @@ if token: linkcheck_auth = [(R"https://github.com/.+", token)] # MyST configuration (https://myst-parser.readthedocs.io/en/latest/configuration.html) -myst_enable_extensions = ["colon_fence"] +myst_enable_extensions = ["colon_fence", "substitution"] diff --git a/docs/source/docs/apriltag-pipelines/2D-tracking-tuning.md b/docs/source/docs/apriltag-pipelines/2D-tracking-tuning.md index eb3672acd..dd3ec93c8 100644 --- a/docs/source/docs/apriltag-pipelines/2D-tracking-tuning.md +++ b/docs/source/docs/apriltag-pipelines/2D-tracking-tuning.md @@ -2,7 +2,7 @@ ## Tracking AprilTags -Before you get started tracking AprilTags, ensure that you have followed the previous sections on installation, wiring and networking. Next, open the Web UI, go to the top right card, and switch to the "AprilTag" or "Aruco" type. You should see a screen similar to the one below. +Before you get started tracking AprilTags, ensure that you have followed the previous sections on installation, wiring and networking. Next, open the Web UI, go to the top right card, and switch to the "AprilTag" or "ArUco" type. You should see a screen similar to the one below. ```{image} images/apriltag.png :align: center @@ -12,7 +12,7 @@ You are now able to detect and track AprilTags in 2D (yaw, pitch, roll, etc.). I ## Tuning AprilTags -AprilTag pipelines come with reasonable defaults to get you up and running with tracking. However, in order to optimize your performance and accuracy, you must tune your AprilTag pipeline using the settings below. Note that the settings below are different between the AprilTag and Aruco detectors but the concepts are the same. +AprilTag pipelines come with reasonable defaults to get you up and running with tracking. However, in order to optimize your performance and accuracy, you must tune your AprilTag pipeline using the settings below. Note that the settings below are different between the AprilTag and ArUco detectors but the concepts are the same. ```{image} images/apriltag-tune.png :align: center diff --git a/docs/source/docs/apriltag-pipelines/detector-types.md b/docs/source/docs/apriltag-pipelines/detector-types.md index 0bd43f2ad..1e62a1394 100644 --- a/docs/source/docs/apriltag-pipelines/detector-types.md +++ b/docs/source/docs/apriltag-pipelines/detector-types.md @@ -8,8 +8,8 @@ Note that both of these pipeline types detect AprilTag markers and are just two ## AprilTag -The AprilTag pipeline type is based on the [AprilTag](https://april.eecs.umich.edu/software/apriltag.html) library from the University of Michigan and we recommend it for most use cases. It is (to our understanding) most accurate pipeline type, but is also ~2x slower than AruCo. This was the pipeline type used by teams in the 2023 season and is well tested. +The AprilTag pipeline type is based on the [AprilTag](https://april.eecs.umich.edu/software/apriltag.html) library from the University of Michigan and we recommend it for most use cases. It is (to our understanding) most accurate pipeline type, but is also ~2x slower than ArUco. This was the pipeline type used by teams in the 2023 season and is well tested. -## AruCo +## ArUco -The AruCo pipeline is based on the [AruCo](https://docs.opencv.org/4.8.0/d9/d6a/group__aruco.html) library implementation from OpenCV. It is ~2x higher fps and ~2x lower latency than the AprilTag pipeline type, but is less accurate. We recommend this pipeline type for teams that need to run at a higher framerate or have a lower powered device. This pipeline type was new for the 2024 season. +The ArUco pipeline is based on the [ArUco](https://docs.opencv.org/4.8.0/d9/d6a/group__aruco.html) library implementation from OpenCV. It is ~2x higher fps and ~2x lower latency than the AprilTag pipeline type, but is less accurate. We recommend this pipeline type for teams that need to run at a higher framerate or have a lower powered device. This pipeline type was new for the 2024 season. diff --git a/docs/source/docs/calibration/calibration.md b/docs/source/docs/calibration/calibration.md index 874e701d9..64b5181e8 100644 --- a/docs/source/docs/calibration/calibration.md +++ b/docs/source/docs/calibration/calibration.md @@ -4,7 +4,7 @@ In order to detect AprilTags and use 3D mode, your camera must be calibrated at the desired resolution! Inaccurate calibration will lead to poor performance. ::: -To calibrate a camera, images of a Charuco board (or chessboard) are taken. By comparing where the grid corners should be in object space (for example, a corner once every inch in an 8x6 grid) with where they appear in the camera image, we can find a least-squares estimate for intrinsic camera properties like focal lengths, center point, and distortion coefficients. For more on camera calibration, please review the [OpenCV documentation](https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html). +To calibrate a camera, images of a ChArUco board (or chessboard) are taken. By comparing where the grid corners should be in object space (for example, a corner once every inch in an 8x6 grid) with where they appear in the camera image, we can find a least-squares estimate for intrinsic camera properties like focal lengths, center point, and distortion coefficients. For more on camera calibration, please review the [OpenCV documentation](https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html). :::{warning} While any resolution can be calibrated, higher resolutions may be too performance-intensive for some coprocessors to handle. Therefore, we recommend experimenting to see what works best for your coprocessor. @@ -16,6 +16,10 @@ The calibration data collected during calibration is specific to each physical c ## Calibration Tips +:::{warning} +The usage of chessboards can result in bad calibration results if multiple similar images are taken. We strongly recommend that teams use ChArUco boards instead! +::: + Accurate camera calibration is required in order to get accurate pose measurements when using AprilTags and 3D mode. The tips below should help ensure success: 01. Ensure the images you take have the target in different positions and angles, with as big of a difference between angles as possible. It is important to make sure the target overlay still lines up with the board while doing this. Tilt no more than 45 degrees. @@ -34,11 +38,11 @@ Following the ideas above should help in getting an accurate calibration. ### 1. Navigate to the calibration section in the UI. -The Cameras tab of the UI houses PhotonVision's camera calibration tooling. It assists users with calibrating their cameras, as well as allows them to view previously calibrated resolutions. We support both charuco and chessboard calibrations. +The Cameras tab of the UI houses PhotonVision's camera calibration tooling. It assists users with calibrating their cameras, as well as allows them to view previously calibrated resolutions. We support both ChArUco and chessboard calibrations. ### 2. Print out the calibration target. -In the Camera Calibration tab, we'll print out the calibration target using the "Download" button. This should be printed on 8.5x11 printer paper. This page shows using an 8x8 charuco board (or chessboard depending on the selected calibration type). +In the Camera Calibration tab, we'll print out the calibration target using the "Download" button. This should be printed on 8.5x11 printer paper. This page shows using an 8x8 ChArUco board (or chessboard depending on the selected calibration type). :::{warning} Ensure that there is no scaling applied during printing (it should be at 100%) and that the PDF is printed as is on regular printer paper. Check the square size with calipers or an accurate measuring device after printing to ensure squares are sized properly, and enter the true size of the square in the UI text box. For optimal results, various resources are available online to calibrate your specific printer if needed. @@ -46,13 +50,13 @@ Ensure that there is no scaling applied during printing (it should be at 100%) a ### 3. Select calibration resolution and fill in appropriate target data. -We'll next select a resolution to calibrate and populate our pattern spacing, marker size, and board size. The provided chessboard and charuco board are an 8x8 grid of 1 inch square. The provided charuco board uses the 4x4 dictionary with a marker size of 0.75 inches (this board does not need the old OpenCV pattern selector selected). Printers are not perfect, and you need to measure your calibration target and enter the correct marker size (size of the aruco marker) and pattern spacing (aka size of the black square) using calipers or similar. Finally, once our entered data is correct, we'll click "start calibration." +We'll next select a resolution to calibrate and populate our pattern spacing, marker size, and board size. The provided chessboard and ChArUco board are an 8x8 grid of 1 inch square. The provided ChArUco board uses the 4x4 dictionary with a marker size of 0.75 inches (this board does not need the old OpenCV pattern selector selected). Printers are not perfect, and you need to measure your calibration target and enter the correct marker size (size of the ArUco marker) and pattern spacing (aka size of the black square) using calipers or similar. Finally, once our entered data is correct, we'll click "start calibration." :::{warning} Old OpenCV Pattern selector. This should be used in the case that the calibration image is generated from a version of OpenCV before version 4.6.0. This would include targets created by calib.io. If this selector is not set correctly the calibration will be completely invalid. For more info view [this GitHub issue](https://github.com/opencv/opencv_contrib/issues/3291). ::: :::{note} -If you have a [calib.io](https://calib.io/) CharuCo Target you will have to enter the paramaters of your target. For example if your target says "9x12 | Checker Size: 30 mm | Marker Size: 22 mm | Dictionary: AruCo DICT 5x5", you would have to set the board type to Dict_5x5_1000, the pattern spacing to 1.1811 in (30 mm converted to inches), the marker size 0.866142 in (22 mm converted to inches), the board width to 12 and the board height to 9. If you chose the wrong tag family the board wont be detected during calibration. If you swap the width and height your calibration will have a very high error. +If you have a [calib.io](https://calib.io/) ChArUco Target you will have to enter the paramaters of your target. For example if your target says "9x12 | Checker Size: 30 mm | Marker Size: 22 mm | Dictionary: ArUco DICT 5x5", you would have to set the board type to Dict_5x5_1000, the pattern spacing to 1.1811 in (30 mm converted to inches), the marker size 0.866142 in (22 mm converted to inches), the board width to 12 and the board height to 9. If you chose the wrong tag family the board wont be detected during calibration. If you swap the width and height your calibration will have a very high error. ::: ### 4. Take at calibration images from various angles. diff --git a/docs/source/docs/camera-specific-configuration/arducam-cameras.md b/docs/source/docs/camera-specific-configuration/arducam-cameras.md index 96178f672..e24685742 100644 --- a/docs/source/docs/camera-specific-configuration/arducam-cameras.md +++ b/docs/source/docs/camera-specific-configuration/arducam-cameras.md @@ -1,5 +1,9 @@ # Arducam Cameras +:::{warning} +Arducam Pivariety cameras are **incompatible** with PhotonVision as they require a custom camera library not compatible with PhotonVision. +::: + Arducam cameras are supported for setups with multiple devices. This is possible because Arducam provides software that allows you to assign truly different device names to each camera. This feature is particularly useful in complex setups where multiple cameras are used simultaneously. ## Setting Up Arducam Cameras diff --git a/docs/source/docs/contributing/building-photon.md b/docs/source/docs/contributing/building-photon.md index b9a296ef8..2c0a65c3d 100644 --- a/docs/source/docs/contributing/building-photon.md +++ b/docs/source/docs/contributing/building-photon.md @@ -18,6 +18,10 @@ This section contains the build instructions from the source code available at [ [pnpm](https://pnpm.io/) is the package manager used to download dependencies for the UI. To install pnpm, follow [the instructions on the official pnpm website](https://pnpm.io/installation). +**Cross-Compilation Toolchains (Optional):** + + If you plan to deploy PhotonVision to a coprocessor like a Raspberry Pi, you will need to install the appropriate cross-compilation toolchain for your platform. For `linuxarm64` devices, this can be accomplished by running `./gradlew installArm64Toolchain` in the root folder of the project. + ## Compiling Instructions ### Getting the Source Code @@ -173,6 +177,29 @@ With the VSCode [Extension Pack for Java](https://marketplace.visualstudio.com/i To correctly run PhotonVision tests this way, you must [delegate the tests to Gradle](https://code.visualstudio.com/docs/java/java-build#_delegate-tests-to-gradle). Debugging tests like this will [**not** currently](https://github.com/microsoft/build-server-for-gradle/issues/119) collect outputs. +### Running Tests With UI + +By default, tests are run with UI disabled so they are not obtrusive during a build. All tests should be useful when the UI is disabled. However, if a particular test would benefit from having UI access (i.e. for debugging info), the UI can be enabled by passing the `enableTestUi` project property to Gradle. This will run all tests by default, but the Gradle `--tests` option can be used to [filter for specific tests](https://docs.gradle.org/current/userguide/java_testing.html#test_filtering). + +```{eval-rst} +.. tab-set:: + + .. tab-item:: Linux + :sync: linux + + ``./gradlew test -PenableTestUi`` + + .. tab-item:: macOS + :sync: macos + + ``./gradlew test -PenableTestUi`` + + .. tab-item:: Windows (cmd) + :sync: windows + + ``gradlew test -PenableTestUi`` +``` + ### Debugging PhotonVision Running Locally Unit tests can instead be debugged through the ``test`` Gradle task for a specific subproject in VSCode, found in the Gradle tab: diff --git a/docs/source/docs/contributing/index.md b/docs/source/docs/contributing/index.md index 4de6c437a..80b8487ef 100644 --- a/docs/source/docs/contributing/index.md +++ b/docs/source/docs/contributing/index.md @@ -3,6 +3,7 @@ ```{toctree} building-photon building-docs +linting developer-docs/index design-descriptions/index ``` diff --git a/docs/source/docs/contributing/linting.md b/docs/source/docs/contributing/linting.md new file mode 100644 index 000000000..690113c68 --- /dev/null +++ b/docs/source/docs/contributing/linting.md @@ -0,0 +1,43 @@ +# Linting the PhotonVision Codebase + +## Versions + +:::{note} +If you work on other projects that use different versions of the same linters as PhotonVision, you may find it beneficial to use a [venv](https://docs.python.org/3/library/venv.html) instead of installing the linters globally. This will allow you to have different versions of the same linter installed for different projects. +::: + +The correct versions for each linter can be found under the linting workflow located [here](https://github.com/PhotonVision/photonvision/tree/main/.github/workflows). For *doc8*, the version can be found in `docs/requirements.txt`. If you've linted, and are still unable to pass CI, please check the versions of your linters. + +## Frontend + +### Linting the frontend + +In order to lint the frontend, run `pnpm -C photon-client lint && pnpm -C photon-client format`. This should be done from the base level of the repo. + +## Backend + +### wpiformat installation + +To lint the backend, PhotonVision uses *wpiformat* and *spotless*. Spotless is included with gradle, which means installation is not needed. To install wpiformat, run `pipx install wpiformat`. To install a specific version, run `pipx install wpiformat==`. + +### Linting the backend + +To lint, run `./gradlew spotlessApply` and `wpiformat`. + +## Documentation + +### doc8 installation + +To install *doc8*, the python tool we use to lint our documentation, run `pipx install doc8`. To install a specific version, run `pipx install doc8==`. + +### Linting the documentation + +To lint the documentation, run `doc8 docs` from the root level of the docs. + +## Alias + +The following [alias](https://www.computerworld.com/article/1373210/how-to-use-aliases-in-linux-shell-commands.html) can be added to your shell config, which will allow you to lint the entirety of the PhotonVision project by running `pvLint`. The alias will work on Linux, macOS, Git Bash on Windows, and WSL. + +```sh +alias pvLint='wpiformat -v && ./gradlew spotlessApply && pnpm -C photon-client lint && pnpm -C photon-client format && doc8 docs' +``` diff --git a/docs/source/docs/examples/aimingatatarget.md b/docs/source/docs/examples/aimingatatarget.md index d00719bda..a4482e4af 100644 --- a/docs/source/docs/examples/aimingatatarget.md +++ b/docs/source/docs/examples/aimingatatarget.md @@ -6,7 +6,7 @@ The following example is from the PhotonLib example repository ([Java](https://g - A Robot - A camera mounted rigidly to the robot's frame, centered and pointed forward. -- A coprocessor running PhotonVision with an AprilTag or Aruco 2D Pipeline. +- A coprocessor running PhotonVision with an AprilTag or ArUco 2D Pipeline. - [A printout of AprilTag 7](https://firstfrc.blob.core.windows.net/frc2025/FieldAssets/Apriltag_Images_and_User_Guide.pdf), mounted on a rigid and flat surface. ## Code diff --git a/docs/source/docs/objectDetection/opi.md b/docs/source/docs/objectDetection/opi.md index 210a9a7f2..c724dc598 100644 --- a/docs/source/docs/objectDetection/opi.md +++ b/docs/source/docs/objectDetection/opi.md @@ -14,6 +14,6 @@ PhotonVision currently ONLY supports 640x640 Ultralytics YOLOv5, YOLOv8, and YOL Only quantized models are supported, so take care when exporting to select the option for quantization. ::: -PhotonVision now ships with a [Python Notebook](https://github.com/PhotonVision/photonvision/blob/main/scripts/rknn-convert-tool/rknn_conversion.ipynb) that you can use in [Google Colab](https://colab.research.google.com) or in a local environment. In Google Colab, you can simply paste the PhotonVision GitHub URL into the "GitHub" tab and select the `rknn_conversion.ipynb` notebook without needing to manually download anything. +PhotonVision now ships with a {{ '[Python Notebook](https://github.com/PhotonVision/photonvision/blob/{}/scripts/rknn_conversion.ipynb)'.format(git_tag_ref) }} that you can use in [Google Colab](https://colab.research.google.com) or in a local **Linux** environment (since `rknn-toolkit2` only supports Linux). In Google Colab, you can simply paste the PhotonVision GitHub URL into the "GitHub" tab and select the `rknn_conversion.ipynb` notebook without needing to manually download anything. Please ensure that the model you are attempting to convert is among the {ref}`supported models ` and using the PyTorch format. diff --git a/docs/source/docs/objectDetection/rubik.md b/docs/source/docs/objectDetection/rubik.md index 6f458e876..0ab786630 100644 --- a/docs/source/docs/objectDetection/rubik.md +++ b/docs/source/docs/objectDetection/rubik.md @@ -14,7 +14,7 @@ PhotonVision currently ONLY supports 640x640 Ultralytics YOLOv8 and YOLOv11 mode Only quantized models are supported, so take care when exporting to select the option for quantization. ::: -PhotonVision now ships with a [Python Notebook](https://github.com/PhotonVision/photonvision/blob/main/scripts/rubik_conversion.ipynb) that you can use in [Google Colab](https://colab.research.google.com) or in a local environment. In Google Colab, you can simply paste the PhotonVision GitHub URL into the "GitHub" tab and select the `rubik_conversion.ipynb` notebook without needing to manually download anything. +PhotonVision now ships with a {{ '[Python Notebook](https://github.com/PhotonVision/photonvision/blob/{}/scripts/rubik_conversion.ipynb)'.format(git_tag_ref) }} that you can use in [Google Colab](https://colab.research.google.com), [Kaggle](https://kaggle.com/code), or in a local environment. In Google Colab, you can simply paste the PhotonVision GitHub URL into the "GitHub" tab and select the `rubik_conversion.ipynb` notebook without needing to manually download anything. Please ensure that the model you are attempting to convert is among the {ref}`supported models ` and using the PyTorch format. diff --git a/docs/source/docs/pipelines/about-pipelines.md b/docs/source/docs/pipelines/about-pipelines.md index fbb4d3ca1..f269bb393 100644 --- a/docs/source/docs/pipelines/about-pipelines.md +++ b/docs/source/docs/pipelines/about-pipelines.md @@ -10,7 +10,7 @@ A vision pipeline represents a series of steps that are used to acquire an image ## Types of Pipelines -### AprilTag / AruCo +### AprilTag / ArUco This pipeline type is based on detecting AprilTag fiducial markers. More information about AprilTags can be found in the [WPILib documentation](https://docs.wpilib.org/en/stable/docs/software/vision-processing/apriltag/apriltag-intro.html). This pipeline provides easy to use 3D pose information which allows localization. @@ -56,7 +56,7 @@ Each pipeline has a set of tabs that are used to configure the pipeline. All pip Pipielines also have additional tabs that are specific to the pipeline type. Listed below are the tabs for each pipeline type. -### AprilTag / AruCo Pipelines +### AprilTag / ArUco Pipelines - AprilTag: This tab includes AprilTag specific tuning parameters, such as decimate, blur, threads, pose iterations, and more. diff --git a/docs/source/docs/quick-start/camera-calibration.md b/docs/source/docs/quick-start/camera-calibration.md index 8d902b9a9..c23089d1f 100644 --- a/docs/source/docs/quick-start/camera-calibration.md +++ b/docs/source/docs/quick-start/camera-calibration.md @@ -9,8 +9,8 @@ If you’re not using cameras in 3D mode, calibration is optional, but it can st ## Print the Calibration Target - Downloaded from our [demo site](http://photonvision.global/#/cameras), or directly from your coprocessors cameras tab. -- Use the Charuco calibration board: - - Board Type: Charuco +- Use the ChArUco calibration board: + - Board Type: ChAruCo - Tag Family: 4x4 - Pattern Spacing: 1.00in - Marker Size: 0.75in diff --git a/docs/source/docs/quick-start/camera-focusing.md b/docs/source/docs/quick-start/camera-focusing.md new file mode 100644 index 000000000..f9498bd57 --- /dev/null +++ b/docs/source/docs/quick-start/camera-focusing.md @@ -0,0 +1,19 @@ +# Camera Focusing + +## Prepare Camera +:::{warning} +Refocusing your camera **will** make your calibration inaccurate, make sure to recalibrate after focusing. +::: +To ensure that your camera is focused properly, mount it to a secure surface and ensure it does not move drastically. Point your camera at a detailed surface like a calibration board, and make sure that it not too close to the camera. + +## Using Focus Mode +:::{important} +When you enable Focus Mode, it will assign a *Score* to the current focus, this score depends on your environment and the lighting. This score cannot be compared to a focus score collected from other environments. +::: +- In the Cameras tab, turn on Focus Mode. +- Rotate the lens on your camera to try and get the focus score as high as possible. +- Once you cannot get a higher score, this indicates that your camera is fully focused and can be set in place using glue if desired. + +```{image} images/focusModeExample.png +:scale: 50% +``` diff --git a/docs/source/docs/quick-start/images/focusModeExample.png b/docs/source/docs/quick-start/images/focusModeExample.png new file mode 100644 index 000000000..2ba492c2e Binary files /dev/null and b/docs/source/docs/quick-start/images/focusModeExample.png differ diff --git a/docs/source/docs/quick-start/index.md b/docs/source/docs/quick-start/index.md index 4b9a97e3d..7302ff93c 100644 --- a/docs/source/docs/quick-start/index.md +++ b/docs/source/docs/quick-start/index.md @@ -9,5 +9,6 @@ wiring networking camera-matching camera-calibration +camera-focusing quick-configure ``` diff --git a/photon-client/package.json b/photon-client/package.json index d701ef9bf..cf2485b2d 100644 --- a/photon-client/package.json +++ b/photon-client/package.json @@ -10,7 +10,7 @@ "build-demo": "vite build --mode demo", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix", "format": "prettier --write src/", - "lint-ci": "eslint . --max-warnings 0 --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix", + "lint-ci": "eslint . --max-warnings 0 --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts", "format-ci": "prettier --check src/" }, "dependencies": { diff --git a/photon-client/src/components/app/photon-error-snackbar.vue b/photon-client/src/components/app/photon-error-snackbar.vue index d654d5343..19f2d064a 100644 --- a/photon-client/src/components/app/photon-error-snackbar.vue +++ b/photon-client/src/components/app/photon-error-snackbar.vue @@ -13,5 +13,15 @@ import { useStateStore } from "@/stores/StateStore";

{{ useStateStore().snackbarData.message }}

+ + + diff --git a/photon-client/src/components/cameras/CameraCalibrationCard.vue b/photon-client/src/components/cameras/CameraCalibrationCard.vue index 0458e6bc7..c0ca6f8fb 100644 --- a/photon-client/src/components/cameras/CameraCalibrationCard.vue +++ b/photon-client/src/components/cameras/CameraCalibrationCard.vue @@ -1,5 +1,5 @@