diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index ddc791a04..b04999f64 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -30,7 +30,7 @@ jobs: with: python-version: 3.11 - name: Install wpiformat - run: pip3 install wpiformat==2025.32 + run: pip3 install wpiformat==2025.33 - name: Run run: wpiformat - name: Check output diff --git a/.gitignore b/.gitignore index 1ac8577cd..41ab237bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,14 @@ -Python/__pycache__/WebSiteHandler\.cpython-37\.pyc - \.idea/ *.pyc - -Python/app/__pycache__/ - -Python/app/handlers/__pycache__/ - -\.vscode/ +__pycache__/ /.vs - backend/settings/ -/.vscode/ +.vscode/ +# Docs +source/_build +source/docs/_build # Compiled class file *.class @@ -109,7 +104,6 @@ fabric.properties # Temporary build files **/.gradle -**/target **/src/main/java/META-INF **/.settings **/.classpath @@ -125,8 +119,6 @@ compile_commands.json .clangd/ .cache/ -New client/photon-client/* - *.prefs *.jfr .DS_Store @@ -146,14 +138,17 @@ photonlib-cpp-examples/*/vendordeps/* photonlib-cpp-examples/*/networktables.json.bck photonlib-java-examples/*/networktables.json.bck *.sqlite -photon-server/src/main/resources/web/* venv .venv/* .venv networktables.json -website/node_modules -website/dist +# Web stuff +photon-server/src/main/resources/web/* +node_modules +dist +components.d.ts +# Py docs stuff photon-lib/py/site photon-lib/py/docs/reference diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index b7a9f77ac..000000000 --- a/docs/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -build/* -.DS_Store -.vscode/* -.idea/* -source/_build -source/docs/_build - -venv/* -.venv/* diff --git a/docs/source/docs/additional-resources/best-practices.md b/docs/source/docs/additional-resources/best-practices.md index ca8e5d327..066ae5e05 100644 --- a/docs/source/docs/additional-resources/best-practices.md +++ b/docs/source/docs/additional-resources/best-practices.md @@ -7,10 +7,14 @@ - Some time before the competition, lock down the version you are using and do not upgrade unless you encounter a critical bug. - Have a copy of the installation image for the version you are using on your programming laptop, in case re-imaging (without internet) is needed. - Extensively test at your home setup. Practice tuning from scratch under different lighting conditions. -- Use SmartDashboard / Shuffleboard to view your camera streams during practice. -- Confirm you have followed all the recommendations under the Networking section in installation (network switch and static IP). +- Confirm you have followed all the recommendations under the {ref}`Networking` documentation (network switch and static IP). - Only use high quality ethernet cables that have been rigorously tested. -- Set up RIO USB port forwarding using the guide in the Networking section in installation. + +## Camera Streaming +- All camera streams are published under the NetworkTables table `CameraPublisher`. +- The only subtable under `CameraPublisher` that will work for viewing a driver mode camera stream is the one that contains `Output` in the name. +- To view a camera stream in a dashboard, drag the correct subtable from the NetworkTables tree into your dashboard. +- Use the latest driver dashboard recommended by [WPILib](https://docs.wpilib.org/en/stable/docs/software/dashboards/dashboard-intro.html) on your driver station laptop. ## During the Competition @@ -19,7 +23,7 @@ - Make sure the field has match-accurate lighting conditions active. - Turn on your robot and pull up the dashboard on your driver station. - Point your robot at the targets and ensure you get a consistent tracking (you hold one targets consistently, the ceiling lights aren't detected, etc.). - - If you have problems with your pipeline, go to the pipeline tuning section and retune the pipeline using the guide there. + - If you have problems with your pipeline, retune the pipeline following the {ref}`camera tuning ` documentation. - Move the robot close, far, angled, and around the field to ensure no extra targets are found. - Monitor camera feeds during a practice match to ensure everything is working correctly. - After field calibration, use the "Export Settings" button in the "Settings" page to create a backup. diff --git a/docs/source/docs/driver-mode/images/crosshair-switch.png b/docs/source/docs/driver-mode/images/crosshair-switch.png new file mode 100644 index 000000000..c86bc0e0f Binary files /dev/null and b/docs/source/docs/driver-mode/images/crosshair-switch.png differ diff --git a/docs/source/docs/driver-mode/images/driver-mode-camera-settings.png b/docs/source/docs/driver-mode/images/driver-mode-camera-settings.png new file mode 100644 index 000000000..d8fb509f6 Binary files /dev/null and b/docs/source/docs/driver-mode/images/driver-mode-camera-settings.png differ diff --git a/docs/source/docs/driver-mode/images/driver-mode-dashboard.png b/docs/source/docs/driver-mode/images/driver-mode-dashboard.png new file mode 100644 index 000000000..b6c0fe841 Binary files /dev/null and b/docs/source/docs/driver-mode/images/driver-mode-dashboard.png differ diff --git a/docs/source/docs/driver-mode/index.md b/docs/source/docs/driver-mode/index.md new file mode 100644 index 000000000..5d9a0c4c5 --- /dev/null +++ b/docs/source/docs/driver-mode/index.md @@ -0,0 +1,27 @@ +# Driver Mode + +Driver Mode is a type of pipeline that doesn't run any vision processing, intended for viewing from a human. + +## Enabling Driver Mode + +To enable Driver Mode, toggle the switch at the top of the Dashboard page for a selected camera. + +```{image} images/driver-mode-dashboard.png +:align: center +:alt: Driver Mode Toggle in the Dashboard Page +``` + +Alternatively, visit the camera settings page and toggle the "Driver Mode" switch for a selected camera. + +```{image} images/driver-mode-camera-settings.png +:align: center +:alt: Driver Mode Toggle in the Camera Settings Page +``` + +## Hiding the Crosshair +When Driver Mode is enabled, a green crosshair will be shown at the center of the camera stream. If you do not want to show the green crosshair at the center of the camera stream, toggle the "Crosshair" switch under the Input tab, as shown in the image below. + +```{image} images/crosshair-switch.png +:align: center +:alt: Crosshair Switch +``` diff --git a/docs/source/docs/pipelines/about-pipelines.md b/docs/source/docs/pipelines/about-pipelines.md index d4a37516d..fbb4d3ca1 100644 --- a/docs/source/docs/pipelines/about-pipelines.md +++ b/docs/source/docs/pipelines/about-pipelines.md @@ -26,6 +26,10 @@ This pipeline type is based on detecting objects using a neural network. The obj This pipeline type is only supported on the Orange Pi 5/5+ coprocessors due to its Neural Processing Unit used by PhotonVision to support running ML-based object detection. ::: +### Driver Mode + +Driver Mode is a type of pipeline that doesn't run any vision processing, intended for human viewing. For more information about Driver Mode, see the {ref}`Driver Mode documentation`. + ### Colored Shape This pipeline type is based on detecting different shapes like circles, triangles, quadrilaterals, or a polygon. An example usage would be detecting yellow PowerCells from the 2020 FRC game. You can read more about the specific settings available in the contours page. diff --git a/docs/source/index.md b/docs/source/index.md index 09e16472d..2fb3195d5 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -102,6 +102,7 @@ docs/pipelines/index docs/apriltag-pipelines/index docs/reflectiveAndShape/index docs/objectDetection/index +docs/driver-mode/index docs/calibration/calibration ``` diff --git a/photon-client/.gitignore b/photon-client/.gitignore index fe2c4f9b8..0f57d3477 100644 --- a/photon-client/.gitignore +++ b/photon-client/.gitignore @@ -1,28 +1,8 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* - node_modules .DS_Store dist dist-ssr -*.local - -/cypress/videos/ -/cypress/screenshots/ # Editor directories and files -.vscode -!.vscode/extensions.json .idea -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? components.d.ts diff --git a/photon-core/.gitignore b/photon-core/.gitignore deleted file mode 100644 index ad3d67bb8..000000000 --- a/photon-core/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -bin/* -.settings/* -.project -.classpath -*.prefs -.gradle -.gradle/* -build -build/* -photonvision/* -photonvision_config/* -photon-server/lib/* -photon-server/package-lock.json diff --git a/photon-core/src/main/java/org/photonvision/vision/target/PotentialTarget.java b/photon-core/src/main/java/org/photonvision/vision/target/PotentialTarget.java index 01f8dddfc..520f1d454 100644 --- a/photon-core/src/main/java/org/photonvision/vision/target/PotentialTarget.java +++ b/photon-core/src/main/java/org/photonvision/vision/target/PotentialTarget.java @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + package org.photonvision.vision.target; import java.util.ArrayList; @@ -26,7 +27,6 @@ import org.photonvision.vision.opencv.Releasable; import org.photonvision.vision.pipe.impl.NeuralNetworkPipeResult; public class PotentialTarget implements Releasable { - public final Contour m_mainContour; public final List m_subContours; public final CVShape shape; diff --git a/photon-core/src/main/java/org/photonvision/vision/target/RobotOffsetPointMode.java b/photon-core/src/main/java/org/photonvision/vision/target/RobotOffsetPointMode.java index 434e2de6f..caa5bf331 100644 --- a/photon-core/src/main/java/org/photonvision/vision/target/RobotOffsetPointMode.java +++ b/photon-core/src/main/java/org/photonvision/vision/target/RobotOffsetPointMode.java @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + package org.photonvision.vision.target; public enum RobotOffsetPointMode { diff --git a/photon-core/src/main/java/org/photonvision/vision/target/RobotOffsetPointOperation.java b/photon-core/src/main/java/org/photonvision/vision/target/RobotOffsetPointOperation.java index d5aefd432..b925bd767 100644 --- a/photon-core/src/main/java/org/photonvision/vision/target/RobotOffsetPointOperation.java +++ b/photon-core/src/main/java/org/photonvision/vision/target/RobotOffsetPointOperation.java @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + package org.photonvision.vision.target; public enum RobotOffsetPointOperation { diff --git a/photon-core/src/main/java/org/photonvision/vision/target/TargetCalculations.java b/photon-core/src/main/java/org/photonvision/vision/target/TargetCalculations.java index 0ed64b82c..22c92ae2c 100644 --- a/photon-core/src/main/java/org/photonvision/vision/target/TargetCalculations.java +++ b/photon-core/src/main/java/org/photonvision/vision/target/TargetCalculations.java @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + package org.photonvision.vision.target; import org.opencv.calib3d.Calib3d; @@ -27,7 +28,6 @@ import org.photonvision.vision.calibration.CameraCalibrationCoefficients; import org.photonvision.vision.opencv.DualOffsetValues; public class TargetCalculations { - /** * Calculates the yaw and pitch of a point in the image. Yaw and pitch must be calculated together * to account for perspective distortion. Yaw is positive right, and pitch is positive up. @@ -49,7 +49,6 @@ public class TargetCalculations { double targetCenterY, double verticalFocalLength, CameraCalibrationCoefficients cameraCal) { - if (cameraCal != null) { // undistort MatOfPoint2f temp = new MatOfPoint2f(new Point(targetCenterX, targetCenterY)); diff --git a/photon-core/src/main/java/org/photonvision/vision/target/TargetModel.java b/photon-core/src/main/java/org/photonvision/vision/target/TargetModel.java index 04cc9bcd3..65b7ec22c 100644 --- a/photon-core/src/main/java/org/photonvision/vision/target/TargetModel.java +++ b/photon-core/src/main/java/org/photonvision/vision/target/TargetModel.java @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + package org.photonvision.vision.target; import com.fasterxml.jackson.annotation.JsonAlias; diff --git a/photon-core/src/main/java/org/photonvision/vision/target/TargetOffsetPointEdge.java b/photon-core/src/main/java/org/photonvision/vision/target/TargetOffsetPointEdge.java index eccf287ec..add407ea3 100644 --- a/photon-core/src/main/java/org/photonvision/vision/target/TargetOffsetPointEdge.java +++ b/photon-core/src/main/java/org/photonvision/vision/target/TargetOffsetPointEdge.java @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + package org.photonvision.vision.target; public enum TargetOffsetPointEdge { diff --git a/photon-core/src/main/java/org/photonvision/vision/target/TargetOrientation.java b/photon-core/src/main/java/org/photonvision/vision/target/TargetOrientation.java index 61b19c7f8..0820f0304 100644 --- a/photon-core/src/main/java/org/photonvision/vision/target/TargetOrientation.java +++ b/photon-core/src/main/java/org/photonvision/vision/target/TargetOrientation.java @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + package org.photonvision.vision.target; public enum TargetOrientation { diff --git a/photon-core/src/main/java/org/photonvision/vision/target/TrackedTarget.java b/photon-core/src/main/java/org/photonvision/vision/target/TrackedTarget.java index 6d55bb09a..ee31696cf 100644 --- a/photon-core/src/main/java/org/photonvision/vision/target/TrackedTarget.java +++ b/photon-core/src/main/java/org/photonvision/vision/target/TrackedTarget.java @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + package org.photonvision.vision.target; import edu.wpi.first.apriltag.AprilTagDetection; @@ -502,7 +503,6 @@ public class TrackedTarget implements Releasable { double verticalFocalLength, double imageArea, CameraCalibrationCoefficients cal) { - this.isLandscape = isLandscape; this.targetOffsetPointEdge = targetOffsetPointEdge; this.robotOffsetPointMode = robotOffsetPointMode; @@ -522,7 +522,6 @@ public class TrackedTarget implements Releasable { Point robotOffsetSinglePoint, DualOffsetValues dualOffsetValues, FrameStaticProperties frameStaticProperties) { - this.isLandscape = isLandscape; this.targetOffsetPointEdge = targetOffsetPointEdge; this.robotOffsetPointMode = robotOffsetPointMode; diff --git a/photon-core/src/test/java/org/photonvision/vision/target/TargetCalculationsTest.java b/photon-core/src/test/java/org/photonvision/vision/target/TargetCalculationsTest.java index b87ee4e14..340b8c993 100644 --- a/photon-core/src/test/java/org/photonvision/vision/target/TargetCalculationsTest.java +++ b/photon-core/src/test/java/org/photonvision/vision/target/TargetCalculationsTest.java @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + package org.photonvision.vision.target; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -41,7 +42,6 @@ import org.photonvision.vision.frame.FrameStaticProperties; import org.photonvision.vision.opencv.DualOffsetValues; public class TargetCalculationsTest { - private static Size imageSize = new Size(1280, 720); private static Point imageCenterPoint = new Point(imageSize.width / 2.0 - 0.5, imageSize.height / 2.0 - 0.5); diff --git a/photon-core/src/test/java/org/photonvision/vision/target/TrackedTargetTest.java b/photon-core/src/test/java/org/photonvision/vision/target/TrackedTargetTest.java index d0e17215e..0311d309f 100644 --- a/photon-core/src/test/java/org/photonvision/vision/target/TrackedTargetTest.java +++ b/photon-core/src/test/java/org/photonvision/vision/target/TrackedTargetTest.java @@ -14,6 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + package org.photonvision.vision.target; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/photon-lib/py/photonlibpy/py.typed b/photon-lib/py/photonlibpy/py.typed index 8b1378917..e69de29bb 100644 --- a/photon-lib/py/photonlibpy/py.typed +++ b/photon-lib/py/photonlibpy/py.typed @@ -1 +0,0 @@ - diff --git a/photon-server/.gitignore b/photon-server/.gitignore deleted file mode 100644 index b55df9197..000000000 --- a/photon-server/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -bin/* -.settings/* -.project -.classpath -*.prefs -.gradle -.gradle/* -build -build/* -photonvision/* -photonvision_config/* -lib/* -photon-sever/lib/* diff --git a/photon-targeting/.gitignore b/photon-targeting/.gitignore deleted file mode 100644 index 4faca75e2..000000000 --- a/photon-targeting/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -bin/* -.settings/* -.project -.classpath -*.prefs -.gradle -.gradle/* -build -build/* -photonvision/* -photonvision_config/* diff --git a/website/src/main.ts b/website/src/main.ts index a1ea13e27..e69de29bb 100644 --- a/website/src/main.ts +++ b/website/src/main.ts @@ -1 +0,0 @@ -// We don't use javascript, so this is empty