Merge branch 'main' into py-docs

This commit is contained in:
Sam Freund
2025-04-14 21:41:09 -05:00
committed by GitHub
26 changed files with 62 additions and 95 deletions

View File

@@ -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

27
.gitignore vendored
View File

@@ -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

9
docs/.gitignore vendored
View File

@@ -1,9 +0,0 @@
build/*
.DS_Store
.vscode/*
.idea/*
source/_build
source/docs/_build
venv/*
.venv/*

View File

@@ -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<docs/quick-start/networking: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 <docs/pipelines/input:Camera Tuning / Input>` 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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

View File

@@ -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
```

View File

@@ -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<docs/driver-mode/index:Driver Mode>`.
### 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.

View File

@@ -102,6 +102,7 @@ docs/pipelines/index
docs/apriltag-pipelines/index
docs/reflectiveAndShape/index
docs/objectDetection/index
docs/driver-mode/index
docs/calibration/calibration
```

View File

@@ -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

View File

@@ -1,13 +0,0 @@
bin/*
.settings/*
.project
.classpath
*.prefs
.gradle
.gradle/*
build
build/*
photonvision/*
photonvision_config/*
photon-server/lib/*
photon-server/package-lock.json

View File

@@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
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<Contour> m_subContours;
public final CVShape shape;

View File

@@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.photonvision.vision.target;
public enum RobotOffsetPointMode {

View File

@@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.photonvision.vision.target;
public enum RobotOffsetPointOperation {

View File

@@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
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));

View File

@@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.photonvision.vision.target;
import com.fasterxml.jackson.annotation.JsonAlias;

View File

@@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.photonvision.vision.target;
public enum TargetOffsetPointEdge {

View File

@@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.photonvision.vision.target;
public enum TargetOrientation {

View File

@@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
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;

View File

@@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
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);

View File

@@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.photonvision.vision.target;
import static org.junit.jupiter.api.Assertions.assertEquals;

View File

@@ -1 +0,0 @@

View File

@@ -1,13 +0,0 @@
bin/*
.settings/*
.project
.classpath
*.prefs
.gradle
.gradle/*
build
build/*
photonvision/*
photonvision_config/*
lib/*
photon-sever/lib/*

View File

@@ -1,11 +0,0 @@
bin/*
.settings/*
.project
.classpath
*.prefs
.gradle
.gradle/*
build
build/*
photonvision/*
photonvision_config/*

View File

@@ -1 +0,0 @@
// We don't use javascript, so this is empty