Compare commits

..

606 Commits

Author SHA1 Message Date
samfreund
f022130bfa do stuff 2025-11-26 21:10:02 -06:00
Sam Freund
5457db947e Merge branch 'main' into py-docs 2025-11-26 20:01:24 -06:00
Jade
8c7ca1697e Fix OV9281 resolution options when libcamera (#2100)
Resolves https://github.com/PhotonVision/photonvision/issues/2087

Values are taken from the
[datasheet](https://www.ovt.com/wp-content/uploads/2022/01/OV9281-OV9282-PB-v1.3-WEB.pdf)
and have been tested on the LL4

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2025-11-27 01:00:46 +08:00
samfreund
a7329c48a3 lint 2025-11-25 15:31:11 -06:00
Sam Freund
ce0b00ee03 Merge branch 'main' into py-docs 2025-11-25 15:25:17 -06:00
Gold856
a8d825919e Fix PipelineType index mismatch (#2204)
## Description

#2180 added an additional value to PipelineType.java. Enums are
serialized with `ordinal()`, and the frontend wasn't updated to account
for this, causing an off-by-one error where the UI thought the pipeline
was actually the next pipeline over. This resyncs the enum on the
frontend to the backend and adjusts the mapping from PipelineType to
WebsocketPipelineType to make everything match.

Fixes #2201.

closes #2202 

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] 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
- [x] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-11-24 02:12:22 -05:00
Michael Jansen
63593b873a Catch other boards in isRK3588 check (#2199) 2025-11-22 23:50:51 +00:00
Tyler Veness
aa64bfe82e [ci] Upgrade to wpiformat 2025.75 (#2198) 2025-11-22 07:39:30 -08:00
Sam Freund
d27b3d0775 Modal template for deletion confirmation (#2190)
## Description

<!-- What changed? Why? (the code + comments should speak for itself on
the "how") -->

<!-- Fun screenshots or a cool video or something are super helpful as
well. If this touches platform-specific behavior, this is where test
evidence should be collected. -->

<!-- Any issues this pull request closes or pull requests this
supersedes should be linked with `Closes #issuenumber`. -->

This adds a template modal that can be used for confirming that the user
wants to delete something. The main goal is to reduce complication and
duplicated code, and standardize the way we handle deletion.

closes #2175

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added

---------

Co-authored-by: Devolian <devondoyle@outlook.com>
2025-11-18 03:41:20 -05:00
Tyler Veness
77e5545eef [ci] Upgrade to wpiformat 2025.69 (#2193) 2025-11-17 06:48:36 +00:00
ElectricTurtle32
618072c3dd Add Camera Focus Mode (#2180)
## Description
 
Camera focus tool pipeline using a Laplacian and finding the variance.
Similar to Limelight.


closes #1597 

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] This PR has been
[linted](https://docs.photonvision.org/en/latest/docs/contributing/linting.html).
- [x] 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
- [x] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-11-17 00:15:42 +00:00
Dan Katzuv
7d2c69dbdb Fix "ArUco" and "ChAruCo" spellings (#2184)
## Description
Looks like this is the convention from a quick Google search.
## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-11-13 16:07:33 -05:00
Tyler Veness
a2b19c080e Upgrade to wpiformat 2025.48 (#2186) 2025-11-11 05:28:28 +00:00
Alan Everett
def3b9faa8 Only show images during tests when requested via project property (#2177)
## Description

Revision of #2164. Instead of only running headless tests during a
build, now only the images are disabled. To reenable showing images, the
`enableTestUi` project property needs to be passed to gradle.

```bash
./gradlew test -PenableTestUi
```

## Meta

Merge checklist:
- [X] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [X] The description documents the _what_ and _why_
- [X] This PR has been
[linted](https://docs.photonvision.org/en/latest/docs/contributing/linting.html).
- [x] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-11-06 19:38:07 +00:00
Charlotte
25c355ebc2 Add warning about arducam-pivariety incompatibility (#2178) 2025-11-06 11:04:02 -06:00
Sam Freund
dad7f0a82d Add support for removing calib coefficients (#2150)
## Description

Adds the ability to remove old calibrations. This might be helpful if
you have a bad calibration.

closes #1262

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added

---------

Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
2025-11-02 21:17:22 +00:00
Sam Freund
6f2603f0cb Fix bug with import nickname (#2176)
## Description

`.` is a special regex character, which means we weren't actually
matching the `.` in the string, but rather the character before it. This
resulted in the last letter in a model nickname getting cut off on
import. This fix resolves that issue.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-11-02 20:14:57 +00:00
Jade
f499e4fb50 [NFC] Invert AprilTag family default (#2124)
## Description

Switch default tag family used in AprilTag pipeline. We already
functionally changed the default in
https://github.com/PhotonVision/photonvision/pull/1333 but since 2024
FIRST appears to have been using 36h11 so switching here seems to make
sense as well.

## Meta

Merge checklist:
- [ ] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added

---------

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2025-11-02 13:32:39 -05:00
Rikhil Chilka
e5c8859c57 Add notice to notebook about running on linux (#2163) 2025-11-02 18:29:08 +00:00
Sam Freund
2cde701cff Add documentation for linting (#2166)
## Description

This adds documentation for how to lint PhotonVision, as it is not
available elsewhere and people have historically needed to figure it out
for themselves. It also adds an alias for linting PV.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-11-02 03:38:51 +00:00
Sam Freund
d649a9cb9e Use progress bar for file uploads (#2148)
## Description
<img width="3840" height="2160" alt="image"
src="https://github.com/user-attachments/assets/c0289923-a6c8-48b9-84c1-ce92c7acbc9d"
/>
<img width="3840" height="2160" alt="image"
src="https://github.com/user-attachments/assets/3b58c7d0-e12e-45d6-b328-c3061949349a"
/>


closes #871

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [ ] The description documents the _what_ and _why_
- [ ] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-11-02 01:56:12 +00:00
Sam Freund
695742bfcf Add axios post util (#2153)
## Description

This replaces boilerplate that checks whether we've successfully sent
the request, whether there was an error, etc.

closes #2151

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-11-01 17:48:28 -04:00
Alan Everett
5df9137256 Gradle build task improvements (#2164)
## Description

This fixes a few problems with the Gradle `build` task and subtasks.
1. Spotless was being run on `node_modules`, resulting in errors for
out-of-source files. This is now disabled.
2. All tests were running from the `build` task, resulting in unexpected
windows popping up. Now only headless tests are run.
3. Headless tests were updated to run from the same root directory as
the other tests.

## Meta

Merge checklist:
- [X] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [X] The description documents the _what_ and _why_
- [ ] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-11-01 17:42:30 -04:00
Sam Freund
36b437323f Add cross-compilation toolchain to docs (#2172) 2025-10-31 21:23:33 -05:00
Sam Freund
5d39ef5b62 Fix client linting in CI (#2167) 2025-10-30 18:52:14 -05:00
Gold856
2bb59f8437 Add Merch link to header on desktop (#2165) 2025-10-30 15:49:01 -05:00
Charlotte
cd502a22c7 Add message discouraging chessboard usage (#2160) 2025-10-30 16:49:57 +00:00
Sam Freund
f16ffe3cd2 Add progress indicator for single model OD upload (#2154) 2025-10-30 01:11:25 -05:00
Chris Gerth
45236b872a Add Merch link to header (#2161)
## Description

added a merch store link


## Meta

Merge checklist:
- [x ] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [ ] The description documents the _what_ and _why_
- [ ] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-10-29 21:32:02 -05:00
Sam Freund
6b20dc3c1b Fix rubik_jni bounding box bug (#2162) 2025-10-28 21:48:44 -07:00
Sam Freund
9f6d8caf48 Fix calibration resolution default bug (#2156) 2025-10-23 23:42:04 -05:00
Rikhil Chilka
3cbac8117e Merge rknn conversion scripts into notebook (#2157) 2025-10-23 23:41:49 -05:00
Rikhil Chilka
8e88a9a780 Update notebook links in docs to point to docs version (#2155)
Co-authored-by: Sam Freund <samf.236@proton.me>
2025-10-23 16:35:40 -05:00
Sam Freund
99ca8228a1 Merge branch 'main' into py-docs 2025-10-23 16:14:46 -05:00
Rikhil Chilka
7cb3b7a37b Add downgrade fix for ONNX error during RKNN conversion (#2136) 2025-10-23 17:17:31 +00:00
Alan
054ed8b6a1 Add camera mismatch banner to dashboard (#1921)
## Description

Detects if a camera mismatch is present in any camera and displays a
banner in the dashboard for better visibility to the user. All detection
occurs in the backend, and is sent to the frontend via use of a mismatch
boolean included in each vision module.

<img width="1235" alt="image"
src="https://github.com/user-attachments/assets/19219a56-c366-4c56-8c4b-cb5a36fe4a04"
/>

Closes #1920

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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
- [x] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [x] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added

---------

Co-authored-by: Sam Freund <techguy763@gmail.com>
Co-authored-by: samfreund <samf.236@proton.me>
Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
2025-10-21 20:53:22 -04:00
Riley Brewer
d44480ddad Fix typo: s/Specifc/Specific (#2143)
## Description

Simple typo fix:
s/Specifc/Specific

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] If this PR changes behavior or adds a feature, user documentation
is updated
- [x] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [x] If this PR touches configuration, this is backwards compatible
with settings back to v2025.3.2
- [x] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [x] If this PR addresses a bug, a regression test for it is added
2025-10-22 00:18:01 +00:00
Sam Freund
c71921c41e Add documentation for forcing OD UI (#2018) 2025-10-21 19:09:42 -05:00
Michael Jansen
ee4501f1d6 Add Luma P1 support (#2135)
## Description

Adds support for building images for the Luma P1. This bumps the image
modifier pin to v2025.0.4. This pulls in:

* Allow users to install any release via install.sh by @crschardt in
https://github.com/PhotonVision/photon-image-modifier/pull/49
* Exit install script if run on systemcore by @crschardt in
https://github.com/PhotonVision/photon-image-modifier/pull/58
* Fix --list-versions in install.sh by @crschardt in
https://github.com/PhotonVision/photon-image-modifier/pull/59
* Remove large folders of firmware that (probably) isn't needed by
@crschardt in
https://github.com/PhotonVision/photon-image-modifier/pull/41
* Cancel in progress runs by @spacey-sooty in
https://github.com/PhotonVision/photon-image-modifier/pull/65
* Add limelight 4 support by @spacey-sooty in
https://github.com/PhotonVision/photon-image-modifier/pull/52

**Full Changelog**:
https://github.com/PhotonVision/photon-image-modifier/compare/v2025.0.3...v2025.0.4


## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-10-21 10:20:42 -07:00
Gold856
d9b86a718e Revert "Make HardwareConfig a record" (#2142) 2025-10-21 10:56:17 -05:00
Sam Freund
1ac185c247 Fix versioning helper (#2141)
## Description

When we tagged `v2026.0.0-alpha-1`, we broke the versioning-helper
logic. It doesn't expect `alpha` in the version string. This PR adds
matching for lowercase alphanumeric to the versioning helper, which
resolves that issue.

Also turns out `getProviders()` is now broken as a gradle method. Sad.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-10-21 01:14:57 -04:00
Sam Freund
7170c29efe Version rubik pi image (#2129) 2025-10-21 04:43:33 +00:00
Gold856
4f549ba579 Use the tool plugin to include photon-targeting into photon-core (#2137)
## Description

This allows photon-targeting to be loaded using the same mechanism as
the rest of the WPILib libraries, fixing issues with libraries not being
able to find and load their dependent libraries.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-10-20 07:45:54 -07:00
ElectricTurtle32
b531fe6b81 Made steam overlay buttons primary color (#2139) 2025-10-19 00:59:16 +00:00
Jade
373ed2ff05 Fix most gradle deprecation warnings (#2093) 2025-10-15 22:22:55 -04:00
Jade
115bc09f2e Update LimeLight installation documentation (#2133) 2025-10-15 17:51:43 +00:00
Gold856
7497566f56 [ci] Fix releaser (#2127) 2025-10-14 00:55:14 -05:00
Henry Martin
85f155c77b chore: Bump Javalin (#2126) 2025-10-13 20:58:14 -05:00
Sam Freund
797936865f Add support for building rubik image (#2110) 2025-10-13 17:56:23 -05:00
Sam Freund
831df409f7 Disable 3d mode for OD (#2121)
## Description

There isn't anything that 3D mode adds for OD, and the results are
typically messed up. Thus, we disable 3D mode when we're using an OD
pipeline.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-10-13 21:56:16 +00:00
Drew Williams
b89ab49d34 Add Constrained PNP Pose Strategies to C++ photonlib (#1908)
This adds the two missing pose strategies from the java version of
photonlib (Constrained PNP and the Trig solve), to C++ photonlib

---------

Co-authored-by: Matthew Morley <matthew.morley.ca@gmail.com>
2025-10-12 12:26:12 -07:00
Sam Freund
099c88e0b7 Remove gh-action-releaser (#2119)
## Description

See https://github.com/photonvision/photon-image-modifier/pull/77

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-10-11 09:48:20 -07:00
Sam Freund
1ee2ecb608 Make NT client name the same as hostname (#2107) 2025-10-10 22:07:27 -07:00
Gold856
82d6b6b845 Make exported journalctl logs less verbose and always display everything (#2101)
## Description

There was a recent occurance of journalctl logs saying something like
`[66B blob data]`. We don't log anything binary, so journalctl might be
hiding some lines, thinking they're actually binary data when they're
actually plain text. Use `-a` to always log everything. If it's binary
data anyways, we'll want to know what it is anyways. Use `--output cat`
because we output our own timestamps and we don't want journalctl's own
timestamping. Filter the output through `sed` to remove ANSI color codes
to make reading logs easier.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-10-11 00:25:54 -04:00
Sam Freund
8ec041493a Conglomerate release artifacts (#2115) 2025-10-10 23:10:40 -05:00
Gold856
da608a5070 Fix file uploads not overwriting existing files (#2116)
## Description

#2023 changed how file uploads were handled to use `Files.copy`, but
incorrectly didn't specify the `REPLACE_EXISTING` copy option, causing
file uploads to fail if the file already existed.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-10-10 04:44:43 +00:00
Alan Everett
17c23b0390 Fix documentation tab set syncing (#2109) 2025-10-09 16:27:58 -05:00
Gold856
e486ff5a50 Modify build-image to use global variable for image version (#2113) 2025-10-09 17:22:23 +00:00
Gold856
e84e3e7c7c Refactor LibCameraJNILoader to use PhotonJNICommon (#2048) 2025-09-16 08:04:25 -07:00
Jade
a1d06a9920 [ci] Set versions for image builds to 24.04 (#2092)
This should fix the [LL4 CI](https://github.com/PhotonVision/photonvision/actions/runs/17751849602/job/50450131089).
From [here](https://github.com/pguyot/arm-runner-action?tab=readme-ov-file#cpu)
we can see that 24.04 is required for the cortex-a76 used by the pi5,
> cortex-a76 equivalent to max:cortex-a76. Note that this requires a
newer version of qemu, for example with runner ubuntu 24.

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2025-09-16 12:56:41 +08:00
Gold856
04e9bffeb7 Properly declare inputs and output for buildClient (#2086)
Co-authored-by: samfreund <samf.236@proton.me>
2025-09-16 04:35:33 +00:00
Jade
4b01b66ab7 Add limelight 4 support (#1807)
Resolves #1804

---------

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2025-09-16 09:48:02 +08:00
Craig Schardt
ee56bf7597 Update libcameraDriverVersion to v2025.0.4 (#1769)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: Jade <spacey-sooty@proton.me>
2025-09-15 03:05:53 -04:00
Jade
058ca19262 Publish FPS with camera (#2083) 2025-09-12 09:10:37 -05:00
Devon Doyle
b43d0dde20 Add custom theming (#2081)
Adds support for user-created custom themes. Custom theme interface is
tucked into the global settings in a non-invasive manner to avoid major
design changes. Builds on the theme structure established by the dark
theme update.

<img width="1486" height="953" alt="image"
src="https://github.com/user-attachments/assets/716bcfc7-af74-41dc-b14a-cfc2f2d2caa9"
/>

<img width="1486" height="956" alt="image"
src="https://github.com/user-attachments/assets/a00f9620-0b1d-4f67-b010-e94dda5dc212"
/>



Here's a few examples of what teams could do, using a few color schemes
from local teams. Imagine the possibilities!

<img width="1485" height="951" alt="image"
src="https://github.com/user-attachments/assets/c3da37b8-f6be-4152-81e0-533297f517fc"
/>

<img width="1483" height="951" alt="image"
src="https://github.com/user-attachments/assets/0d453f7a-cf6f-4c27-97db-603b54c1f73e"
/>

<img width="1485" height="952" alt="image"
src="https://github.com/user-attachments/assets/bf8c7770-e60d-4875-9580-ed7e54e089f4"
/>

<img width="1484" height="952" alt="image"
src="https://github.com/user-attachments/assets/326d89e6-dd6e-4e05-a9fa-c9fc6f880847"
/>

<img width="1482" height="951" alt="image"
src="https://github.com/user-attachments/assets/eb5a2a5d-c103-482c-a62a-5ccd5ba21cc5"
/>

<img width="1482" height="950" alt="image"
src="https://github.com/user-attachments/assets/4831ca56-f322-4345-97af-8963ae8539b1"
/>



Looking for high contrast? Just moments away:
<img width="1484" height="949" alt="image"
src="https://github.com/user-attachments/assets/7ffc65c6-7000-4566-b4f0-c8247f75fb3d"
/>
2025-09-07 00:33:37 -04:00
Kevin Cooney
3300b90823 Set the initial capacity of ArrayLists in getAllUnreadResults() (#2079)
If there are more than 10 queued results,
PhotonCamera.getAllUnreadResults() would resize two arrays at least once
each.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-09-01 23:36:02 -04:00
Sam Freund
f58416fe16 Update compatible version to 2025 (#2068)
## Description

The version of settings that needs to be compatible is last years, in
this case 2025.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-09-01 23:34:58 -04:00
Graham
62eb66a493 Set canonical root URL for documentation (#2078) 2025-08-29 02:19:50 +00:00
Gold856
fcbc392d83 Use deploy-utils instead of an external ssh plugin (#2077) 2025-08-22 06:10:13 +00:00
Kevin Cooney
7d927aca3b Fix 'Resource leak: <variable> is never closed' warnings (#2023)
Fix numerous places where using AutoCloseable objects without closing
them.

Changes:
- Upgrade JUnit from 5.10.0 to 5.11.4 (so `@AutoClose` can be used)
- Use `Files.copy()` to copy files
- Use try-with-resources when calling `Files.list()` or `Files.walk()`
- Use try-with-resources or `@AutoClose` to close `PhotonCamera` and
  `PhotonCameraSim` objects created by tests
- Update `SQLConfigTest` to use `@TempDir`

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-08-18 23:37:00 -04:00
Sam Freund
bd2c5062f9 Bump website and docs dependencies (#2075) 2025-08-19 01:30:47 +00:00
Sam Freund
354f4e945e Remove codecov from workflow (#2070)
## Description

It's unused and fails when run, so I'm removing it.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-08-17 01:54:01 +00:00
Rikhil Chilka
2eb224a55f Preload OD models before import to check quantization (#2056)
Co-authored-by: samfreund <samf.236@proton.me>
Co-authored-by: Sam Freund <techguy763@gmail.com>
2025-08-16 00:59:22 -05:00
Sam Freund
2ab7a2e389 Bump Gradle to 8.14.3 (#2064) 2025-08-15 22:07:12 -04:00
Sam Freund
27a1cfcb12 Bump wpiformat to 2025.34 (#2066) 2025-08-15 22:05:54 -04:00
Sam Freund
c7f5edc262 Exclude license from being loaded as a model (#2063) 2025-08-15 15:17:21 -05:00
Gold856
6fe96316a4 Fix calibrationUtils.py (#2055) 2025-08-13 06:16:49 -07:00
Gold856
b32d9c6ee3 Only update UI when there's been a change in conflict detection (#2054)
## Description

After #1991, the program state was always resent in an attempt to
simplify logic, but this had the side effect of causing the settings UI
to reset periodically when the hostname check was performed. This
restores the original logic in #1791 to check for differences in the
conflict state, and to only send the program state if it's changed.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-08-11 18:21:19 -04:00
Gold856
7766d99ca6 Only make vendor-json-repo PR if the repo is ours (#2053)
## Description

This prevents jobs from failing on forks of the repo.
Closes #1975.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-08-10 19:26:50 -04:00
Gold856
81a5a48ac4 Use new vendor JSON repo action (#2049) 2025-08-10 13:59:20 -07:00
Craig Schardt
29e183660f Remove log spam from periodic network and IP address queries (#2051) 2025-08-10 07:22:21 -07:00
cuttestkittensrule
8676649ebc Add PNP_DISTANCE_TRIG_SOLVE strategy to C++ (#2021) 2025-08-10 06:55:04 -07:00
Matt Morley
35dcc3ce5a Verify that nmcli installed (#1929)
## Description

Previously, NetworkManager would happily go asking for networkmanager to
do things even if it wasn't installed. This should never be the case,
but we should bail out early if it is regardless IMO. This prevents logs
and the UI from looking suspiciously "working", if you ignore the exit
code. Up for debate if we actually need this feature.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added

---------

Co-authored-by: Craig Schardt <crschardt@fastem.com>
2025-08-09 22:40:55 -04:00
Sam Freund
9277960018 Add support for object detection on Rubik Pi 3 (#2005) 2025-08-09 10:02:55 -05:00
Gold856
e23df8c9a4 Make dashboard theme transition smooth and fix link color (#2046) 2025-08-08 13:06:26 -07:00
Gold856
22490b8c38 Add an error when the connection for the end calibration request fails (#1840) 2025-08-08 13:06:08 -07:00
Sam Freund
3ac509b40d Expose and document NMS slider (#2028) 2025-08-08 13:05:54 -07:00
Sam Freund
0ea108e17f Run metrics with debug false to reduce log spam (#2027) 2025-08-08 08:14:20 -05:00
Sam Freund
da715244cb Add COCO trained model for RKNN (#2035)
## Description

See #2026 for the previous iteration of this PR.

This adds the RKNN model trained on the COCO dataset as one of the
models shipped with PV. This model is fairly general, and has been
trained to identify a number of objects, including people, animals,
cars, and more. This model is meant for teams to test object detection,
particularly for teams who might not have access to the game elements
that our other models are trained on.

It additionally acknowledges Ultralytics for the model, and includes the
AGPL copyleft license.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] If this PR changes behavior or adds a feature, user documentation
is updated
- [x] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [x] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [x] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [x] If this PR addresses a bug, a regression test for it is added
2025-08-08 05:55:14 +00:00
Kevin Cooney
ab854e91e5 [photon-lib] Invalidate pose cache when setting referencePose (#2040) 2025-08-08 00:14:44 -05:00
Rikhil Chilka
a930852bee Add yes pipe for rubik conversion cmd (#2043) 2025-08-07 19:11:43 -05:00
Sam Freund
65c214ac2d Add notebook for Rubik Model conversion (#2006) 2025-08-07 11:11:35 -05:00
Rikhil Chilka
bf8073ab26 Update RKNN Conversion notebook permalinks (#2042) 2025-08-06 22:09:58 +00:00
Rikhil Chilka
2bf166bc3f Update notebook links (#2037) 2025-08-06 16:33:03 -05:00
Gold856
2c98d10a92 Fix labeler labelling everything as backend (#2041) 2025-08-06 16:31:36 -05:00
Gold856
923f9564dc Fix buildAndCopyUI and update build instructions (#2036) 2025-08-05 17:19:37 -05:00
Gold856
ad64bfeaa9 Switch to pnpm (and update some dependencies) (#2032) 2025-08-04 13:59:45 -07:00
Gold856
ffd4d1f80e Add PR labeler (#2031)
## Description

It's nice to be able to filter PRs by what components they've modified.
The 5 labels that have been selected are `frontend`, `backend`,
`documentation`, `photonlib`, and `website`, since those are the primary
components in the monorepo.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-08-04 12:18:52 -07:00
Gold856
1310640e10 Revert "Add COCO model for RKNN (#2026)" (#2033)
This reverts commit 753123844b.

## Description

The COCO dataset contains images that use the NC and/or ND variants of
the CC license, and distributing a model based on that dataset is most
likely a violation of licenses. Additionally, the model is licensed under AGPL,
which might be a concern for PhotonVision, and at a minimum, there's no
license file bundled with the model right now.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-08-04 13:51:24 -04:00
Sam Freund
753123844b Add COCO model for RKNN (#2026)
## Description

This adds the RKNN model trained on the COCO dataset as one of the
models shipped with PV. This model is fairly general, and has been
trained to identify a number of objects, including people, animals,
cars, and more. This model is meant for teams to test object detection,
particularly for teams who might not have access to the game elements
that our other models are trained on.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-08-04 05:20:51 +00:00
Rikhil Chilka
ba1c0db7e1 RKNN conversion tool (#2024) 2025-08-04 05:15:54 +00:00
Devon Doyle
fce54d12c1 Dark mode and minor interface tweaks (#2016)
Co-authored-by: Sam Freund <samf.236@proton.me>
2025-08-04 05:15:33 +00:00
Gold856
3e19cd45cc Disable linkcheck for www.gnu.org (#2030) 2025-08-03 22:54:08 -05:00
Rikhil Chilka
6b49e92d00 Add model benchmark data (#2025) 2025-08-03 23:37:16 +00:00
Kevin Cooney
29e24bbac2 [photon-lib] Python support for PNP_DISTANCE_TRIG_SOLVE (#2015)
This adds support for PNP_DISTANCE_TRIG_SOLVE in the the python
PhotonPoseEstimator, mirroring the implementation in the Java
PhotonPoseEstimator.

Changes:
- Add PoseStrategy.PNP_DISTANCE_TRIG_SOLVE
- Add addHeadingData() and resetHeadingData() to PhotonPoseEstimator
- Fix PhotonCameraSim.process() to set ntReceiveTimestampMicros in the
result
- Minor readability improvements to PhotonPipelineResult
- Minor test improvements to PhotonPoseEstimatorTest
- Add .vscode/settings.json (to make running python tests in VSCode
easier)

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added

---------

Co-authored-by: Sam948-byte <samf.236@proton.me>
2025-08-01 11:04:01 -07:00
Kevin Cooney
cefaa313df Add an overload of resetHeadingData() which takes in a Rotation3d (#2013) 2025-07-27 19:28:16 -05:00
Sam Freund
4b5bc6ae84 Update logic for metric publisher topic name (#2011) 2025-07-23 23:23:10 -05:00
Sam Freund
758fbb9110 Update metrics publisher hostname when hostname is changed (#2008) 2025-07-22 23:56:32 +00:00
Sam Freund
02e6b6d3e2 Move metrics subtable to root PV table (#2007) 2025-07-22 18:28:48 -05:00
Sam Freund
af689b61d5 Add Gradle wrapper validation (#2004)
Check Gradle wrapper with gradle/actions/wrapper-validation to avoid supply chain attacks
2025-07-19 18:59:26 -04:00
Gold856
8215cafbae Fix camera calibration card contents completely vanishing during calibration (#1998)
## Description

Per
https://github.com/PhotonVision/photonvision/pull/1972#issuecomment-3066574742,
camera calibration got broken because I accidently hid the entire
contents of the camera calibration card in #1972. Now, v-show is only
applied to the calibration table so that only the calibration table is
hidden during calibration.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-07-13 21:56:19 -04:00
Gold856
ed58f69275 Dynamically import dependencies that are not critical to viewing the UI (#2001) 2025-07-13 14:28:45 -07:00
Gold856
a62d5e0eee Make testHeadless output the same stuff as test from photon-lib (#2000) 2025-07-13 06:24:09 -07:00
Gold856
2e97c95be1 Restore original video mode index order (#1999) 2025-07-13 06:23:35 -07:00
Gold856
6610b21b6e Refactor MAC address detection (#1991)
Co-authored-by: Sam Freund <techguy763@gmail.com>
2025-07-13 04:59:16 +00:00
Jade
ef5e6463cb Clarify and fix OpenCV/WPILib version checking error (#1963)
## Description

Fixed the error in the OpenCV/WPILib version checking crash and
clarified it, since it's not PhotonVision that needs updating, but
rather WPILib.

Reported on chief
https://www.chiefdelphi.com/t/opencv-is-version-4-6-0-and-needs-to-be-4-10-0/501751/7

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added

---------

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
2025-07-12 05:44:55 -04:00
Sam Freund
7f6edcd567 feat: add metrics publisher for NT (#1791)
Publishes metrics to NT using a protobuf under
`photonvision/coprocessors/metrics` using the device host name as the
key.

Refactors metrics to use numbers where possible, instead of strings.

Removes GPU mem display from metrics card when it can't be determined.

Updates UI metrics periodically.

Resolves #1988

Closes #830

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
2025-07-12 09:40:58 +00:00
Gold856
d7e536dda9 Clean up spacing and other things in various parts of the UI (#1972)
## Description

After the Vue 3 upgrade, the spacing for various UI elements was left
inconsistent in many places. Dialogs were hit especially hard and had
some very inconsistent spacing. Additionally, the 24 pixels of padding
around all cards was noted as a waste of space and unnecessary, so it
has been shrunk down to 20 pixels to make the UI a tiny bit more compact
and to make it visually closer to some parts of the UI that have 16
pixels of padding (the camera views are the most notable example).
Padding between input elements has also been reduced to 20 pixels (this
required some hackery to get consistent sizes on input elements, since
switches and sliders have different heights.)

Some other minor UI tweaks were made, such as removing the divider
between dialog contents and dialog buttons because it visually looks
better, shrinking the banner padding so it doesn't displace as much
content, making the banner background one uniform color instead of a
highlight around the icon, fixing the targets tab so that the columns
stop shifting around when the values change, preserving newlines in the
log view, cleaning up the object detection UI, and making the import
dialogs have consistently inset input elements.

Old dashboard:

![image](https://github.com/user-attachments/assets/409c7ddd-4b7d-4535-9f3f-3970d9dd85f8)

New dashboard:

![image](https://github.com/user-attachments/assets/587ac540-1d6d-40e5-9c6b-00697bab6cbc)

Old Camera tab:

![image](https://github.com/user-attachments/assets/2f1d50a1-131f-4fb7-8617-e1cb4dc5504c)

New Camera tab:

![image](https://github.com/user-attachments/assets/6d5581b7-faff-400a-8e34-e3abf00e0af6)

Old Calibration Info:

![image](https://github.com/user-attachments/assets/81133cc1-c861-4746-9b1e-8320312037de)

New Calibration Info:

![image](https://github.com/user-attachments/assets/0de5935c-84a7-4606-bbc1-8e6d227b7b60)

Old Log Viewer:

![image](https://github.com/user-attachments/assets/f2c32a10-3353-4781-93d7-8e0ffa8ca7fe)

New Log Viewer:

![image](https://github.com/user-attachments/assets/0aeee866-c182-4e80-9025-56bf383d714f)

Old Pipeline Creation Dialog:

![image](https://github.com/user-attachments/assets/a0eb368d-d9af-4cb3-8d9c-fcd12a5caf36)

New Pipeline Creation Dialog:

![image](https://github.com/user-attachments/assets/f05f34a3-f42e-4e8f-9ccd-171a48980b8f)

Old Factory Reset:

![image](https://github.com/user-attachments/assets/9c16a7f7-a454-4ee4-8574-98abf9b94e2d)

New Factory Reset:

![image](https://github.com/user-attachments/assets/fb67888c-c4f1-4e8e-9d02-6943e7a918eb)

Old Pipeline Change:

![image](https://github.com/user-attachments/assets/3acb215a-6639-4d50-a4e6-18b50c3ec1bd)

New Pipeline Change:

![image](https://github.com/user-attachments/assets/a2b18582-cdbd-407c-9690-f11aecf78c76)

Old Import Dialog:

![image](https://github.com/user-attachments/assets/ff43b0bd-3f99-44e5-97fa-c250cd331790)

New Import Dialog:

![image](https://github.com/user-attachments/assets/7ec46023-d47a-45d7-80b8-6881b812300e)

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-07-12 00:02:23 -04:00
Gold856
dbbb00f955 Reenable and fix flaky tests (#1837) 2025-07-09 21:16:44 -07:00
Gold856
78f57600cc Set a more sane timeout for WS connections and log WS errors (#1992) 2025-07-08 21:40:21 -07:00
Sam Freund
d341ebbadf Initial hardware support for Rubik pi (#1989) 2025-07-06 19:39:29 +00:00
Sam Freund
d88ea4a75d De-conflict camera names and hostnames by use of a banner (#1982) 2025-07-04 21:43:17 +00:00
Sam Freund
46ac1baa69 Delete photon-server/photonvision_config_from_2024.3.1 (#1985)
Seems to be unused, since the settings import test we use pulls from test-resources.
2025-07-01 01:34:53 -04:00
Sam Freund
f802e8c10c Update server index wording (#1984) 2025-07-01 00:23:07 -04:00
Jade
647c238987 Fix usage reporting. (#1964)
## Description

Fixes the amount of cameras and pose estimators reported by usage reporting.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added

---------

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2025-06-30 23:08:23 -04:00
Sam Freund
4a648b302a Migrate NNM Settings to SQLITE (#1894)
Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
Co-authored-by: Chris Gerth <gerth2@users.noreply.github.com>
2025-06-30 22:02:44 -05:00
Gold856
cc7923eeb4 Fix camera setup modal not closing and navigation not working (#1979) 2025-06-28 23:18:54 -05:00
Sam Freund
a9c26202a0 Fix logic for no cameras detected modal (#1978)
fixes #1977 

Previously, the logic was checking for the camera object to be the same
as the placeholder camera object. Logic has been changed to check only
the name of the camera object.
2025-06-28 16:09:35 -05:00
Matthew Liang
783d9d73be Update list of coprocessors on quick-install.md (#1976) 2025-06-25 21:07:35 -05:00
Jade
efc997dfbd [ci] Run on push or PR (#1974)
## Description

CI will now run whenever a branch is pushed or a PR is opened. Fixes
2027 behaviour and allows running CI on forks

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2025-06-23 23:50:13 -04:00
Gold856
3df58485c2 Disable linkcheck for gnu.org 2025-06-22 03:26:31 -07:00
Sam Freund
25851525ce Fix Broken Docs (#1971)
Some dummy updated the
[Caddyfile](https://github.com/PhotonVision/ansible-playbooks/blob/main/files/caddy/Caddyfile)
on the server but never updated the playbook repo or the CI on main to
reflect that. 🤷 Anyways, we're keeping the new Caddyfile because
it makes pydocs work, and it more accurately reflects our CI process.
2025-06-18 17:26:20 -04:00
samfreund
46e71703ef trigger docs run 2025-06-18 16:06:54 -05:00
Gold856
4b740a5485 Disable Alerts test in PhotonCameraTest (#1969)
## Description

Disable the Alerts test in PhotonCameraTest because it's consistently
failing on Linux.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-06-18 03:26:52 +00:00
Matthew Morley
413cf8c4af Fuse off mypy 2025-06-16 15:37:15 -07:00
Matthew Morley
d2193037f9 Nix merch because we can't have nice things 2025-06-16 15:37:03 -07:00
samfreund
6fbb41fb76 this should fix importing? 2025-05-09 13:06:42 -05:00
samfreund
05fcf876cd debugggggging 2025-05-09 13:03:05 -05:00
samfreund
1637be6044 change path 2025-05-09 12:57:42 -05:00
samfreund
6f2fd19351 add files to index 2025-05-09 12:47:58 -05:00
samfreund
892e240b18 change theme 2025-05-09 12:44:31 -05:00
samfreund
326c77fa38 dammit, it was a typo 2025-05-09 12:41:57 -05:00
samfreund
8cf48bee57 update requirements.txt 2025-05-09 12:35:33 -05:00
samfreund
26f08a6fdf switch to sphinx 2025-05-09 12:29:47 -05:00
Sam Freund
abb8ccf4e9 add conditionals for publishing 2025-05-09 11:06:18 -05:00
Sam Freund
50adef1672 publish release docs 2025-05-09 11:04:26 -05:00
samfreund
cf68403182 Merge branch 'py-docs' of github.com:photonvision/photonvision into py-docs 2025-05-09 11:01:09 -05:00
samfreund
dc0985dfb5 fix docstrings style 2025-05-09 11:01:05 -05:00
Sam Freund
8fb29ff5c4 Update photon-api-docs.yml 2025-05-09 10:17:45 -05:00
Sam Freund
476cd6df8b Update photon-api-docs.yml 2025-05-09 10:17:00 -05:00
samfreund
783ed82d50 Merge branch 'py-docs' of github.com:photonvision/photonvision into py-docs 2025-05-08 23:36:29 -05:00
samfreund
416e2f7607 update versions 2025-05-08 23:36:23 -05:00
Sam Freund
ebd1071553 Merge branch 'main' into py-docs 2025-05-08 23:33:50 -05:00
samfreund
fa8b60fe27 convert to requirements.txt 2025-05-08 23:33:00 -05:00
Sam Freund
52125067ac Remove unused template from docs (#1960) 2025-05-08 20:53:48 -07:00
Sam Freund
db591f720c Remove manual links from README (#1959) 2025-05-08 20:51:35 -07:00
Sam Freund
c81d4addb9 [docs] upgrade dependencies (#1958)
Upgrade dependencies for docs page
2025-05-08 20:47:47 -07:00
Sam Freund
c2581f3e99 limit publishing 2025-05-08 18:34:20 -05:00
samfreund
96b0938dc0 Merge branch 'py-docs' of github.com:photonvision/photonvision into py-docs 2025-05-08 18:31:35 -05:00
samfreund
697e52f886 lint 2025-05-08 18:30:42 -05:00
Sam Freund
87b219d9be Merge branch 'main' into py-docs 2025-05-08 18:29:37 -05:00
samfreund
abcd6b8f50 add docs to readme 2025-05-08 17:30:16 -05:00
Sam Freund
aa0760e97a Add basic linux troubleshooting tips (#1885) 2025-05-07 16:09:11 -05:00
Graham
74322affde Clean up client dependencies (#1954)
Co-authored-by: samfreund <techguy763@gmail.com>
Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
2025-05-07 11:06:07 -05:00
Graham
bec8092660 Vue 3 Upgrade (#1900)
## Description

Upgrades to Vue 3 and necessary associated dependencies. Also fixes some
issues with the layout and adds validation for object detection models.

Closes #885, closes #1943, closes #1449.
## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added

---------

Co-authored-by: Matt M <matthew.morley.ca@gmail.com>
Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
Co-authored-by: samfreund <techguy763@gmail.com>
2025-05-06 18:21:41 -04:00
Sam Freund
29f76bc1c3 Add question about method of powering to bug issue template (#1947)
## Description

A common question is the way that people are powering their coprocs when
we're trying to help debug. Therefore, it would be useful to know when
people open a bug report.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] If this PR changes behavior or adds a feature, user documentation
is updated
- [x] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [x] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [x] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [x] If this PR addresses a bug, a regression test for it is added

---------

Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
2025-05-05 18:43:25 -05:00
Sam Freund
35c79b138c Remove MacOS builds from releases (#1948)
## Description

We don't support MacOS, so why have it in releases? Note: we still
continue to build for MacOS, we just don't publish releases for it.
2025-05-04 05:26:15 +00:00
Sam Freund
73cd2ab62c Standardize API (#1942)
## Description

closes #1941

Rewrite the API to use the payload method , and use records in the
``RequestHandler``. There's a couple places where this isn't the place,
that's where the front end is making a get request, and so a payload
doesn't make sense.

This is meant to encourage more static typing. 

Additionally, fix some typos in params in ``CameraSettingsStore``

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] If this PR changes behavior or adds a feature, user documentation
is updated
- [x] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [x] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [x] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [x] If this PR addresses a bug, a regression test for it is added
- [x] Everything changed got tested

---------

Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
2025-05-03 22:15:32 -07:00
Nolan Brown
ae9f73130f [photon-lib] Fix incorrect tag visualization transforms (#1899)
## Description

Fixes #1239

Tag image corners used in `VideoSimUtil` did not match the expected
corner order returned by the detection pipeline of [BL, BR, TR, TL],
causing the tag image to appear flipped.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] If this PR changes behavior or adds a feature, user documentation
is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-04-29 15:06:59 -07:00
Bryce Roethel
c1b0c8a831 [photon-lib] Add PhotonPoseEstimator.resetHeadingData() (#1933) 2025-04-25 23:57:27 -05:00
Maximilian McDiarmid
99b4dc8725 Updates to object detection documentation (#1930)
## Description

Added a warning about non-quantized custom models not being supported,
and a note about not being able to delete models from the GUI once
they're uploaded to the coprocessor.

---------

Co-authored-by: Sam Freund <techguy763@gmail.com>
2025-04-22 20:27:53 +00:00
Matt Morley
0c9502d8b9 Add leading zero to log file date/time (#1925)
## Description

WAS: Logs did not have a leading zero, meaning that alphabetical and
temporal sort were not the same

IS: Logs now have leading zeros added. This means that alphabetical sort
works properly.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added

---------

Co-authored-by: Craig Schardt <crschardt@fastem.com>
2025-04-22 07:53:24 -07:00
Gold856
c15c62698a Revert "Use Timer object to calculate FPS" (#1928)
This reverts commit a4295275ed.

## Description

This commit broke the FPS counter because I forgot to start the timer. I
could just use `restart`, and then it would only be wrong for the very
first pipeline run, but that's a hack, and frankly, the old way was
fine.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-04-22 00:04:26 +00:00
Gold856
7bbfe6f05b Clean up build (#1926) 2025-04-20 05:35:27 -07:00
Alan
5349cae965 [docs] Minor documentation changes (#1922) 2025-04-19 23:24:22 -05:00
Matt Morley
3ea9100845 Add docs about robot modes (#1924)
## Description

Adds docs about the new logging added in 1923

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] 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 v2024.3.1
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
2025-04-20 00:37:31 +00:00
Gold856
ad1f51ba06 Miscellanous clean up 2025-04-19 17:17:34 -07:00
Gold856
1b1f8029c8 Refactor QuirkyCamera
QuirkyCamera was refactored to use EnumMap, since that seems to be more efficient. This also enables more concise copying of QuirkyCamera in getQuirkyCamera by just passing in the Map of the QuirkyCamera. Also, putAll was used instead of manually copying quirks in updateQuirks for conciseness.
2025-04-19 17:17:34 -07:00
Gold856
1bb861545b Use CameraServer directly instead of duplicating its functionality 2025-04-19 17:17:34 -07:00
Gold856
a4295275ed Use Timer object to calculate FPS 2025-04-19 17:17:34 -07:00
Gold856
0dfca8c04f Always statically import JUnit Assertions 2025-04-19 17:17:34 -07:00
Gold856
3ed8d3a4f3 Refactor instanceof 2025-04-19 17:17:34 -07:00
Gold856
7f7d80bc3b Refactor switch case 2025-04-19 17:17:34 -07:00
Gold856
89c0cc3a01 Remove unnecessary assignment
In places like pipelines or DataSocketHandler, objects were being instantiated and assigned to a variable, but were then passed into a method, never to be used again. For pipelines especially, that style of code wasn't always consistently used, and other pipelines skipped assignment and instantiated objects in the method call. Make everything consistent by always instantiating in the method call. GenericUSBCameraSettables also had an unnecessary assignment, and that was cleaned up too for readability.
2025-04-19 17:17:34 -07:00
Gold856
e514071094 Use Math.hypot instead of Math.sqrt(a^2 + b^2) 2025-04-19 17:17:34 -07:00
Gold856
38ee450117 Use toList instead of collect(Collectors.toList()) when the list is definitely never modified 2025-04-19 17:17:34 -07:00
Gold856
23d5e5b34f Remove blacklistedResIndices from HardwareConfig
Matt says this was for mmal, and we use libcamera now, so this is unnecessary now. Also, the filtering logic that used blacklistedResIndices was completely broken.
2025-04-19 17:17:34 -07:00
Gold856
75dee20d77 Move various printTestResults methods to TestUtils
printTestResults was duplicated a lot, so it has been moved to TestUtils for maintainability.
2025-04-19 17:17:34 -07:00
Gold856
ed7fc6bbcc Use WPILib Pair and drop dependency on Apache Commons Pair
This allowed us to drop a few Apache Commons dependencies, which is good for reducing JAR size and the number of things we need to pull in.
2025-04-19 17:17:34 -07:00
Gold856
8a2c9f2ae0 Refactor FileSaveFrameConsumer to close objects and let Java handle paths 2025-04-19 17:17:34 -07:00
Gold856
c45c2a0a1f Refactor how AprilTag images are made in sim 2025-04-19 17:17:34 -07:00
Gold856
b86217a59a Use text blocks 2025-04-19 17:17:34 -07:00
Gold856
4ffd1fc600 Use nicer array syntax 2025-04-19 17:17:34 -07:00
Gold856
a42aed1e7f Make pipe params into records 2025-04-19 17:17:34 -07:00
Gold856
20e2fe46ba Make NMDeviceInfo a record 2025-04-19 17:17:34 -07:00
Gold856
1fb02a477d Make HardwareConfig a record 2025-04-19 17:17:34 -07:00
Gold856
09f8d1c2a5 Delete unused classes and remove unused code 2025-04-19 17:17:34 -07:00
Alan
e754f5944e [docs] Reorganize camera configuration pages and add camera matching documentation (#1917) 2025-04-19 19:11:32 -05:00
Matt Morley
089233f4be Log message on robot mode changes (#1923) 2025-04-19 23:35:24 +00:00
Alan
b1f8598a03 [docs] Update PhotonLib vendor dependency guide (#1915) 2025-04-18 18:48:42 +00:00
Sam Freund
b8d74522bd remove core and server from javadocs (#1911) 2025-04-17 16:45:08 +00:00
Sam Freund
5ff025fdbf Add documentation issue template (#1907) 2025-04-15 14:46:12 +00:00
Alan
537cd7c564 Update PhotonPoseEstimator examples (#1903)
## Description

Updates the PhotonPoseEstimator programming documentation page to
reflect the new PhotonPoseEstimator. and add a more comprehensive
step-by-step tutorial using code from the PV Pose Estimation examples.

Updates various code examples to ensure they are matching the latest
documentation or example code on GitHub.

This PR is a successor of, and therefore closes #1765.

This PR is blocked by #1706, as the linked PR updates examples.
Closes #1757 and closes #1800 and closes #1632 and closes #1773 and
closes #1465.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] If this PR changes behavior or adds a feature, user documentation
is updated
- [x] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [x] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [x] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [x] If this PR addresses a bug, a regression test for it is added

---------

Co-authored-by: Kevin Reas <76408202+PaarkG@users.noreply.github.com>
Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
2025-04-15 06:42:25 +00:00
Jade
1c42755451 Make Vision pose estimation examples use all vision measurements (#1706)
Resolves https://github.com/PhotonVision/photonvision/issues/1634

---------

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: Sam Freund <techguy763@gmail.com>
2025-04-15 03:33:42 +00:00
Sam Freund
b22371d7c0 Merge branch 'main' into py-docs 2025-04-14 21:41:09 -05:00
Gold856
63b1ff242c Clean up .gitignore (#1897) 2025-04-14 19:37:08 -07:00
Alan
be490a7dea [docs] Update best practices (#1896)
## Description

Updates best practices in the documentation. Include more information on
how to get a camera stream into a driver dashboard.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] If this PR changes behavior or adds a feature, user documentation
is updated
- [x] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [x] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [x] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [x] If this PR addresses a bug, a regression test for it is added
2025-04-14 22:05:54 +00:00
Sam Freund
44893b14b0 Bump Wpiformat (#1892) 2025-04-14 22:00:18 +00:00
Alan
d22abdfd76 [docs] Document driver mode (#1890)
## Description

Adds documentation for driver mode because it currently isn't
documented.

Closes #1824

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] If this PR changes behavior or adds a feature, user documentation
is updated
- [x] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [x] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [x] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [x] If this PR addresses a bug, a regression test for it is added

---------

Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
Co-authored-by: Sam Freund <techguy763@gmail.com>
2025-04-14 19:50:04 +00:00
samfreund
3eea79f0d4 Merge branch 'py-docs' of github.com:photonvision/photonvision into py-docs 2025-04-14 00:36:07 -05:00
samfreund
0147a44100 remove source 2025-04-14 00:36:02 -05:00
Sam Freund
0bec1f239c Update photon-api-docs.yml 2025-04-13 23:31:09 -05:00
samfreund
44b46cf117 yeah that's good enough 2025-04-13 23:29:32 -05:00
Sam Freund
ffdda9ddfa Update photon-api-docs.yml 2025-04-13 14:57:00 -05:00
Sam Freund
a5bc63878d Merge branch 'main' into py-docs 2025-04-13 14:50:54 -05:00
Sam Freund
a5b1cc0ded Update photon-api-docs.yml 2025-04-13 14:48:39 -05:00
Alan
cbdea5d0f1 [docs] Update "About Pipelines" list (#1889) 2025-04-13 19:09:49 +00:00
Gold856
9a88e565fb Fix calibration array length (#1879)
## Description

Fixed a bug where rotated camera distortion coefficient arrays and
rotated camera intrensic arrays were 8x bigger than they were supposed
to be. The root cause was because of how the data from JsonMatOfDouble
was being handled. A Mat was pulled out, then modified, then a new
JsonMatOfDouble was made from the Mat. This required a conversion from a
Mat to a Java array. The array was incorrectly sized as `elements *
bytes`, when it should've just been `elements`. Due to some uncertainty
as to the types of Mats passed into JsonMatOfDouble.fromMat, the
expected Mat type has been explicitly documented. The added regression
test rotates the calibration data 4 times, equivalent to not rotating at
all. This should mean the arrays are equal, and that is what we check.

Additionally fixes a bug when rotating 180 degrees that flipped width
and height

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [x] If this PR addresses a bug, a regression test for it is added

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2025-04-13 17:57:05 +00:00
Sam Freund
aacbdf5010 Update index.md 2025-04-13 10:53:34 -05:00
samfreund
3547d0584b exclude generated files 2025-04-13 10:51:39 -05:00
Sam Freund
40815020de Update photon-api-docs.yml 2025-04-13 10:47:52 -05:00
samfreund
e522642a48 linting 2025-04-13 10:43:40 -05:00
Sam Freund
3cdda8a84e Add instructions for excluding a file 2025-04-13 10:38:44 -05:00
Sam Freund
228caf47f2 Update photon-api-docs.yml 2025-04-13 10:30:34 -05:00
samfreund
d1761d07e9 update to exclude packet.py 2025-04-13 10:22:10 -05:00
samfreund
331f4f0218 Merge branch 'py-docs' of github.com:photonvision/photonvision into py-docs 2025-04-13 08:09:23 -05:00
samfreund
eb85834180 add brand color 2025-04-13 08:09:17 -05:00
Sam Freund
871ca61c8d Merge branch 'main' into py-docs 2025-04-13 07:56:26 -05:00
Gold856
925defc868 Add data exchange update to merge checklist (#1888)
## Description

https://github.com/PhotonVision/photonvision/pull/884 says that PRs that
update pipeline settings or anything related to data exchange should
update the typing in the frontend as well, but that's not on the
checklist. Add it to ensure we don't miss it.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR addresses a bug, a regression test for it is added
2025-04-13 04:29:25 +00:00
samfreund
358f5747ab man I hate linting 2025-04-12 22:54:50 -05:00
Sam Freund
e334d26459 Update python.yml 2025-04-12 22:53:16 -05:00
Sam Freund
77d5388a35 Update photon-api-docs.yml 2025-04-12 22:46:27 -05:00
samfreund
88a1e789ad actually add the logo 2025-04-12 22:41:36 -05:00
samfreund
abc67bdd95 add logo 2025-04-12 22:37:18 -05:00
Sam Freund
05309b1e25 Update mkdocs.yml 2025-04-12 22:35:20 -05:00
Sam Freund
ddacff7079 Update photon-api-docs.yml 2025-04-12 22:32:18 -05:00
samfreund
32e4f0029b Merge branch 'py-docs' of github.com:photonvision/photonvision into py-docs 2025-04-12 22:30:08 -05:00
samfreund
34057f223d autogen files 2025-04-12 22:29:41 -05:00
Sam Freund
55303ccd9c Update index.md 2025-04-12 17:33:57 -05:00
Sam Freund
3c73b68ba3 Update index.md 2025-04-12 17:33:37 -05:00
Sam Freund
6d816b5053 Update photon-api-docs.yml 2025-04-12 17:19:46 -05:00
Sam Freund
7c6bab1dfa Update photon-api-docs.yml 2025-04-12 17:17:21 -05:00
Sam Freund
462a2aa629 Update photon-api-docs.yml 2025-04-12 17:16:07 -05:00
samfreund
47b799a0ce add docs for python 2025-04-12 17:12:13 -05:00
Sam Freund
35c72e8446 Update photon-api-docs.yml 2025-04-12 16:49:42 -05:00
Sam Freund
c440ce57ce Update photon-api-docs.yml 2025-04-12 16:49:06 -05:00
Sam Freund
8452527589 Update photon-api-docs.yml 2025-04-12 16:44:25 -05:00
Astrin
843c1fed17 fixed a spelling mistake (#1883)
There was a minor spelling mistake in the calibration documentation
"Ensure your the images" changed to be "ensure the images"

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] If this PR changes behavior or adds a feature, user documentation
is updated
- [x] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [x] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [x] If this PR addresses a bug, a regression test for it is added
2025-04-11 21:52:09 +00:00
Sam Freund
781126719a Rename Workflows (#1881)
## Description

Rename some of the workflows and the steps within the workflows to
provide further clarity as to what they affect. Additionally, rename the
RtD workflow file to differentiate it from the javadocs/doxygen
workflow.

closes #1880

## Meta

Merge checklist:
- [X] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [X] The description documents the _what_ and _why_
- [X] If this PR changes behavior or adds a feature, user documentation
is updated
- [X] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [X] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [X] If this PR addresses a bug, a regression test for it is added
2025-04-11 13:33:27 -07:00
Sam Freund
a93be9c816 chore[docs]: Recommend ethernet tether over port forwarding for VH-109 (#1847)
closes #1825

The new radio has four ethernet ports, and one dedicated port for the
DS. There's no reason for teams to tether to the roborio via USB-B, and
tethering via radio will provide more realistic match conditions.
Therefore, recommend tethering via radio.

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] If this PR changes behavior or adds a feature, user documentation
is updated
- [x] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [x] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [x] If this PR addresses a bug, a regression test for it is added
2025-04-11 05:16:57 +00:00
Sam Freund
1af3dab37a Fix CI for website (#1877)
## Description

We forgot to go to the correct directory prior to running ``npm ci``, so
now I'm adding it.

PROOF: see the passing website test

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] If this PR changes behavior or adds a feature, user documentation
is updated
- [x] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [x] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [x] If this PR addresses a bug, a regression test for it is added

---------

Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
2025-04-11 04:38:23 +00:00
Sam Freund
163dbe58e4 feat!: monorepo landing page (#1868)
## Description

Monorepos the [landing website](https://photonvision.org)

## Meta

Merge checklist:
- [x] @mcm001 migrates all the secrets over to this repo
- [x] Add label for website stuff
- [ ] Archive the old website repo
- [x] Website gets cleaned up
2025-04-10 23:03:37 -04:00
Sam Freund
c26a7cc5ac feat: release and development docs versions (#1872) 2025-04-10 13:29:24 -05:00
Sam Freund
6170958be9 chore: bump wpiformat (#1869) 2025-04-09 21:38:36 +00:00
Sam Freund
ea9bd4ac93 feat: link methods in javadocs to source code (#1866) 2025-04-09 18:48:06 +00:00
Gold856
aa15eedc7a Update docs dependencies and do some house cleaning (#1863) 2025-04-09 11:26:16 -04:00
Gold856
1798b67dd3 Recommend Raspberry Pi Imager over Balena Etcher (#1858)
## Description

Balena Etcher has historically had issues like bootlooping. Recommend
Raspberry Pi Imager instead and warn about using Balena Etcher.
Closes #1856.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR addresses a bug, a regression test for it is added
2025-04-08 12:48:18 -07:00
Gold856
f92cf62a54 Remove tag cutting workflow (#1854) 2025-04-01 09:55:06 -04:00
Sam Freund
3c332db4bf chore[docs]: add arducam ESD problem to troubleshooting (#1848)
closes #1720

Many teams have issues with their Arducams randomly disconnecting, so
we're adding some documentation on how to try and resolve that.

## Meta

Merge checklist:
- [X] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [X] The description documents the _what_ and _why_
- [X] If this PR changes behavior or adds a feature, user documentation
is updated
- [X] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [X] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [X] If this PR addresses a bug, a regression test for it is added
2025-03-29 23:57:07 -04:00
Matt Morley
4e1d7bbb3d Dont sanitize unique name in calibration JSON HTTP URL (#1846) 2025-03-25 22:34:18 +08:00
Matt Morley
97dbcdd252 Paranoia test TSP client (#1844)
## Description

Added paranoia checks to satisfy @Gold872 

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [x] If this PR addresses a bug, a regression test for it is added
2025-03-24 22:32:29 -04:00
Gold856
0ef7c803f9 Fix dead link on Networking page in Quick Start (#1843)
## Description

Switches a dead link to VividHosting's page about passive PoE to one
that actually works.

Fixes #1842.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [ ] 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 v2024.3.1
- [ ] If this PR addresses a bug, a regression test for it is added
2025-03-22 22:29:39 -04:00
Gold856
410a4c75b7 Document UI hot reload option in dev docs (#1834) 2025-03-20 22:08:17 +00:00
Gold856
edf42f5102 Increase precision on displayed target distance (#1833) 2025-03-20 21:39:29 +00:00
Sam Freund
3e879cc30f feat: crosshair toggle for driver mode (#1822)
closes #1818 

![image of added
toggle](https://github.com/user-attachments/assets/9a8a4f88-3ce2-4fcd-b0ac-61f5b96d26e4)
Here's what the added toggle looks like, I just put in the input
settings. It'll also hide itself when drivermode is off.
2025-03-19 14:29:59 -07:00
JA-01
c2127ac820 [Docs] Fix broken hyperlink (Fixes #1802) (#1821) 2025-03-19 12:47:29 -07:00
Sam Freund
002373e395 fix: remove debugging printout for snapshot methods (#1823) 2025-03-19 12:46:35 -07:00
Gold856
de98f5f02d Fix snapshot methods not working (#1815) 2025-03-19 06:02:18 +00:00
Sam Freund
30645803e6 chore: bump wpilib to 2025.3.2 and fix mypy errors (#1819) 2025-03-19 01:31:59 -04:00
Matt Morley
abbf3f2820 Use normalized pixels in cPNP problem formulation (#1816)
## Description

instead of using camera calibration, the CasADi problem formulation now
expect the caller to provide "normalized pixel coordinates". This
reduces the number of floating point operations we need to perform (and
reduces total LOC by 6%). `casadi_wrapper.cpp` now converts from (u, v)
coordinates to normalized (x'', y'') coordinates with:

x'' = (u - c_x) / f_x
y'' = (u - c_y) / f_y

Which is the inverse of this (from [opencv
docs](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html), and
assuming no distortion):

![image](https://github.com/user-attachments/assets/41ca657d-af42-4cdf-9c25-6a4f04d20940)

In my testing, this is ~16% faster on my x86 laptop. Would love some rio
benchmarks.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [~] 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 v2024.3.1
- [~] If this PR addresses a bug, a regression test for it is added
2025-03-19 00:34:56 -04:00
Gold87
8d4024b8c8 Add alerts for timesync and disconnection (#1799) 2025-03-13 23:13:51 -07:00
Gold87
f6736fc730 Force load opencv before using OpenCV functions (#1808)
Force loads OpenCV before any OpenCV functions are used. `OpenCVLoader`
has all of its loading done in a static initializer field, so it's only
loaded once.

Also deprecates `OpenCVHelp.forceLoadOpenCV()`, since it's functionality
is the exact same.

Resolves #1803
2025-03-14 07:50:41 +08:00
Jade
889c73ec91 [docs] Add a warning about streams on different ports (#1810) 2025-03-12 16:24:31 -07:00
person4268
8fe53f3b84 Check MSVC Runtime before loading natives (#1809) 2025-03-11 20:10:15 -07:00
Sam Freund
a3304818d2 fix: docs for YOLOv11 naming (#1806) 2025-03-09 15:11:56 -07:00
Julius
4057205583 Cleanup Docs for PhotonPoseEstimator (#1795) 2025-03-04 21:41:04 +08:00
Jade
7f1936d609 Make macOS arm wording generic (#1796) 2025-03-02 14:45:20 -08:00
Vasista Vovveti
f41a472308 Fix rknn detection for non opi platforms (#1797) 2025-03-02 14:44:38 -08:00
Sam Freund
9589967808 fix: docs updates for the different apriltag field layouts (#1787) 2025-02-19 08:54:07 -08:00
Owen Busler
311846dc26 Update camera calibration docs to add calib.io targets note (#1732) 2025-02-19 07:19:54 -08:00
Matt Morley
533f8c97fd Add constrained solvePNP strategy (#1682)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: Jade Turner <spacey-sooty@proton.me>
2025-02-19 14:15:27 +08:00
Cameron (3539)
75c289f526 Stop unknown coprocessor stats / no output from shell commands. (#1786)
Join the threads and wait for them to finish reading the input/error
streams before returning.
2025-02-17 15:58:16 -08:00
Sam Freund
e97865166d [build] Bump WPILib to 2025.3.1 (#1785) 2025-02-17 14:04:25 +08:00
Joseph Eng
53144bfcf1 Clean up pnp distance trig solve (#1781) 2025-02-14 21:20:05 -08:00
Joseph Eng
ee97a1b62e Add back pr template (#1782)
This has the contents of
https://github.com/PhotonVision/photonvision/pull/1561 at
04f63bdd6e,
which got force-pushed away before it got merged.

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
Co-authored-by: Jade <spacey-sooty@proton.me>
2025-02-14 18:37:11 -08:00
Julius
01a3d31734 Add 6328's implementation of PNP distance for Trig Solving to PhotonPoseEstimator (#1767)
https://discord.com/channels/725836368059826228/725846784131203222/1334309604946874460


https://www.chiefdelphi.com/t/frc-6328-mechanical-advantage-2025-build-thread/477314/85

Helps with ambiguous single tag estimates and produces more stability.
2025-02-13 11:45:18 -08:00
Jade
a546ff0819 Add version checking to C++ (#1774)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2025-02-12 23:23:11 -05:00
Sam Freund
67bc032d26 remove unnecessary readme badges (#1768)
closes #1766
2025-02-11 13:54:49 +08:00
Matt Morley
8f816cf1af Verify WPILib/OpenCV versions at runtime (#1772) 2025-02-10 17:52:48 -08:00
Craig Schardt
e2b028abdc Update install command for Romi (#1746)
Pending https://github.com/PhotonVision/photon-image-modifier/pull/49
2025-02-09 21:27:59 -06:00
Sam Freund
00fb4bdf07 Update Allowed Naming Conventions For Object Detection Models (#1749) 2025-02-09 07:12:47 -08:00
Sam Freund
7067c75525 Add YOLO11 Support (#1736) 2025-02-08 17:11:01 -08:00
Sam Freund
ef82328d74 Upload new algae RKNN model (#1758) 2025-02-03 15:52:20 -08:00
Sam Liu
be59e3a958 Add 3D tracking of the 2025 Algae in Colored Shape pipelines (#1756) 2025-02-01 14:11:01 -08:00
Joseph Eng
99427d888a Fix fallback for the multitag on rio pose strategy (#1755) 2025-02-01 14:09:43 -08:00
Sam Freund
8ec2da952f Yolo docs minimalist (#1723) 2025-01-28 10:05:23 -08:00
Anon Ymous
a5d007e258 Change SimCameraProperties to enable chaining of setters (#1731) 2025-01-28 10:03:03 -08:00
Gold856
78b82e3a96 Add FontAwesome assets (#1734)
Fixes #1472. TTF fonts were included as part of the FontAwesome kit, but
I opted to not add them because basically every browser won't use them
and it just pollutes the repo.
2025-01-19 23:58:47 -05:00
Gold856
1303a0eaae Fix typos and incorrect param order in Javadoc (#1740) 2025-01-19 22:56:47 -05:00
David Vo
ab41d2d1ed photonlibpy: Explicitly re-export (#1737) 2025-01-17 18:28:16 -08:00
Jade
d78f2b8650 Add LL3g to release (#1727) 2025-01-14 06:38:42 -08:00
Devon Doyle
5e5df483e2 Camera disconnected + stream normalization improvements (#1701) 2025-01-13 23:30:25 -08:00
Matt Morley
009ec9e1d4 Bump images to v2025.0.3 (#1724) 2025-01-13 15:17:47 -08:00
David Vo
a08dc374c8 photonlibpy: License under MIT (#1700)
Everything under the `photon-lib` directory is intended to all be
licensed under MIT:


e40c8fbca0/photon-lib/.styleguide-license (L2)

Presumably we don't want to force teams to release their robot code
under GPL.
2025-01-13 12:00:09 -05:00
Liam Stow
5b0ec742c4 add [[maybe_unused]] to EstimateCamPosePNP() (#1721)
Fixes #1716
2025-01-13 11:36:06 -05:00
Craig Schardt
04e28bc2d8 Bump images to v2025.0.2 (#1717) 2025-01-12 20:52:45 -07:00
Sam Freund
966b9e8c61 Yolo duplication fix (#1713)
Somebody wanted a description, so here I am.

This PR fixes an error which caused the discoverModels function to be
rerun after each upload of a new model, but without clearing the list of
available models. This causes any models that were on the list prior to
the import to be duplicated. This PR also makes it so that uploading a
model automatically updates the list of available models.

---------

Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
Co-authored-by: Chris Gerth <gerth2@users.noreply.github.com>
2025-01-12 19:48:39 -06:00
Jade
5f75619063 Bump python projects to 2025.2.1 (#1705)
Blocked on robotpy release

---------

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
2025-01-12 16:24:36 -05:00
person4268
03ff9357d7 Remove nonfunctional ignore-cameras CLI arg (#1708)
The underlying logic appears to have been removed. I don't think anyone
really used this option, and the new camera matching stuff makes it
redundant.
2025-01-12 16:23:59 -05:00
Matt Morley
d05032963d Create new tag workflow (#1645) 2025-01-12 11:34:36 -07:00
Matt Morley
7d9f9a627c Document v4l latency (#1676) 2025-01-12 11:30:36 -07:00
Jade
2d19908119 fix docs ci not running (#1707)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2025-01-11 23:50:39 -05:00
DeltaDizzy
d487e1c466 Fix deprecation warnings in PhotonLib examples (#1699)
The following deprecation warnings have been fixed:
- `SwerveModuleState.optimize(desiredState, currentRotation);`, which is
now an instance method
- `AprilTagFields.kDefaultField.loadAprilTagLayoutField();`, which is
now `AprilTagFieldLayout.loadField(AprilTagFields.kDefaultField);`

WIP:
- [x] C++
- [x] Python
2025-01-11 23:30:24 -05:00
mythgarr
159b848234 [python] Fix PhotonPipelineMetadata constructor arg order (#1698)
Relates to https://github.com/PhotonVision/photonvision/pull/1578
2025-01-11 23:29:19 -05:00
David Vo
53e6890f20 photon-serde: Relicense generated files under MIT (#1709) 2025-01-11 16:55:55 -07:00
Matt Morley
83c124f7fc Ingest wpilib!7609 and add turbo button (#1662)
Now that https://github.com/wpilibsuite/allwpilib/pull/7572 and
https://github.com/wpilibsuite/allwpilib/pull/7609 have been merged:
- Adds a magic hidden button to enable the new frame grabber behavior by
adding a boolean topic at `/photonvision/use_new_cscore_frametime`.
Toggle this to true to maybe increase FPS at the cost of latency
variability
- Bumps WPILib to ingest
https://github.com/wpilibsuite/allwpilib/pull/7609 , but doesn't
currently provide any user feedback about the time source. I don't think
that reporting this super matters?

---------

Co-authored-by: Jade <spacey-sooty@proton.me>
2025-01-11 07:37:09 -07:00
Jade
05348f3981 [build] Bump to WPILib 2025.2.1 (#1703)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2025-01-11 22:09:45 +08:00
Devon Doyle
e40c8fbca0 Calibration card and PV input styling (#1695)
Images are before and after comparison.
Does the following:
- Fixes several styling issues with pv-* input elements, including top
padding, vertical alignment, and allocated input width

![image](https://github.com/user-attachments/assets/70d37e65-e0cd-4c71-8ea1-941ec2175850)

![image](https://github.com/user-attachments/assets/031d008d-3cce-4ed2-bc88-5fbecf20c94f)

- Conforms the calibration details modal to overall styling and spacing
standards

![image](https://github.com/user-attachments/assets/18281551-f924-4e12-9ad4-d2ec470dbc70)

![image](https://github.com/user-attachments/assets/db772325-7650-467d-8521-252c7d38601f)
(left the blank table there on empty calibrations to give the user a
sense of what they might see if they don't have any)
2025-01-08 16:46:31 -05:00
Sam Freund
27684eef60 Add custom models (#1687) 2025-01-08 11:44:06 -07:00
Jochem
cc740c92c9 Added constructor overload to PhotonCameraSim for AprilTagFieldLayout (#1692) 2025-01-08 11:43:46 -07:00
Jade
e673304221 Use pragma once (#1693)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2025-01-09 00:49:53 +08:00
Matt Morley
974fcec21e Cancel previous GH commit jobs (#1690) 2025-01-08 09:24:49 -07:00
Sam Freund
36e3a1f72e Update references in docs to 2025 (#1685)
Fixes #1651
2025-01-07 15:38:20 -07:00
Craig Schardt
5993e79e00 Update images to v2025.0.0 (#1680)
Use the shiny new images for 2025.
2025-01-07 13:00:52 -05:00
Devon Doyle
484e8d4298 General UI Refinements (#1678)
Does the following:
- Adjusts the shade of red buttons and banners to increase readability
and reduce eye strain

![image](https://github.com/user-attachments/assets/7f741a9e-dc1e-4394-b87d-580e189245b1)

![image](https://github.com/user-attachments/assets/b23202f1-4cf6-46c1-aca5-2455a09259cd)

- Cleans up factory reset and camera deletion modals

![image](https://github.com/user-attachments/assets/e6564732-d578-43da-bc83-729ec6fdbc5e)

![image](https://github.com/user-attachments/assets/9c5a1cba-f4fd-47ea-811c-abbabe5fa3a4)

- Removes matchCamerasOnlyByPath as it is no longer used and throws
errors in the console

![image](https://github.com/user-attachments/assets/77043993-26a2-4de4-8e98-702e7f285dc6)

- Limits the criteria to flag a camera mismatch in Camera Matching to
only what is necessary based on camera type and highlights differences
in table properties (testing on this is appreciated)

![image](https://github.com/user-attachments/assets/cfbd96c1-09dd-414a-8177-693fc054b26f)

- Only displays both saved vs. current info in camera matching if there
is a difference between the two

![image](https://github.com/user-attachments/assets/6223ffc8-4cff-464f-8b54-720c3222a5d5)

- Some general code cleanup (reduced unnecessary padding/margin/row-col
statements, style="display:flex;" -> class="d-flex", etc.
- Moves Compact Mode button to the bottom away from all the menu items
(cleaner imo, open to thoughts)
- Establishes a general spacing format for cards and pages and applies
this to existing cards and pages to create a consistent look and feel to
the UI (e.g. keeping things in line and less erratic spacing/placement
of UI elements)

![image](https://github.com/user-attachments/assets/1ab0ca4b-303e-436d-97b3-da72d46c4fcb)

![image](https://github.com/user-attachments/assets/82ba9e53-f854-4309-bc00-7b5d0bad58b7)

![image](https://github.com/user-attachments/assets/18aa6ca4-e6fa-4125-8a0a-e6a007a0337d)

![image](https://github.com/user-attachments/assets/77043993-26a2-4de4-8e98-702e7f285dc6)


- Delete protection for camera matching modules
- Anti-backend-spam for activate/deactivate/delete modules to hopefully
prevent any odd behavior from button spamming
- Enforces a common camera stream size on camera matching view (NEEDS
MORE TESTING)

![image](https://github.com/user-attachments/assets/9032783d-1edf-4c6e-ba7b-00e5f20280df)

https://private-user-images.githubusercontent.com/29715865/400783758-dc99c151-b8a7-4367-a173-74c2fc5b2666.mp4?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzYyNTc3NzEsIm5iZiI6MTczNjI1NzQ3MSwicGF0aCI6Ii8yOTcxNTg2NS80MDA3ODM3NTgtZGM5OWMxNTEtYjhhNy00MzY3LWExNzMtNzRjMmZjNWIyNjY2Lm1wND9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAxMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMTA3VDEzNDQzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMwOWM1MDc2ZTVlOWZhM2MxYjAwZjAyZTc2MTYyZTk1ZTVmOGFhZmVkMzlmODRlZTk1ODVlOTk2ZGQzZmM0Y2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ovtRnObwbkEfljr9d5fqaory0nH91LWJSSkmrUUe_4Y
2025-01-07 08:45:39 -05:00
Cameron (3539)
fa2034d30b Unique path is not constant (#1681) 2025-01-06 00:00:55 -05:00
Craig Schardt
a84d681782 Fix exception thrown when isUp() is called on an unavailable network interface (#1679) 2025-01-04 00:45:57 -05:00
Cameron (3539)
ab844a77b8 Remove camera index in ui (#1677)
With the new camera matching, this is SUPER BAD! Convert to using camera
uuid.

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2025-01-03 15:50:25 -08:00
Chris Gerth
6c7a174424 Adding timeSyncServer for Python (#1675) 2025-01-03 12:23:27 -06:00
Craig Schardt
474e4f07f8 Refined network management (#1672)
This PR implements several refinements to the way that NetworkManager
controls the network interface.

- The monitor detects and logs changes to the network address
- The monitor detects and logs changes to the connection and will
reinitialize the connection if needed
- Remove NetworkInterface.java class, which wasn't used anywhere
- Use java.net.NetworkInterface to get IP addresses for any interface
(device)
- Adds a metric for the current IP address (address on the currently
selected interface)
2025-01-03 08:29:18 -06:00
Jade
7c254ec5dc Change from k2024Crescendo to kDefaultField for AprilTagFieldLayout (#1667)
This reduces the things we need to update each year

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2025-01-03 22:03:00 +08:00
Chris Gerth
09a741f540 2025 Doc Cleanup (#1650) 2025-01-02 22:44:50 -05:00
Jade
a540d2dd3f [build] Update to stable WPILib (#1674) 2025-01-02 12:13:38 -05:00
Jade
3f8c406898 [github] Request review from docs team for docs PRs (#1668)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2025-01-02 03:47:40 +08:00
Cameron (3539)
6065a3d70c Fix CSI camera exposure setting (#1665)
Adjusts the exposure setting of csi cameras to match that of USB
cameras. If you set a manual exposure it will drop out of auto exposure.
2025-01-01 14:21:54 -05:00
Cameron (3539)
34e9d5084c Add arducam model warning (#1669)
![image](https://github.com/user-attachments/assets/3cae0985-45f0-467e-867e-c000e87a6f55)
2025-01-01 14:18:44 -05:00
Cameron (3539)
a56101197a Add tooltip to calibration data table (#1670)
Help make it clearer for people to click on the table.

![image](https://github.com/user-attachments/assets/4d8fb2a1-a3c8-4391-8021-a0d9356aaeea)
2025-01-01 14:18:25 -05:00
Jade
2a82393c8e Fix googletest dependency (#1666)
This was rendered useless when googletest was added to the allwpilib
monorepo https://github.com/wpilibsuite/allwpilib/pull/6820

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2025-01-02 02:01:01 +08:00
oh-yes-0-fps
418eada0b5 Convert to user selected camera matching (#1556) 2025-01-01 03:04:20 -05:00
Jade
b2e70a7257 Remove photonvision docs repo (#1649) 2024-12-29 17:44:16 -05:00
Nolan Brown
b7a2636e97 [photon-lib] Fix sim tag ambiguity (#1653) 2024-12-29 17:43:55 -05:00
Matt
d0e5e169cc Fix Aruco leak + remove old tag families (#1661)
- Remove 16h5
- Fix leak in ArucoPoseEstimatorPipe
2024-12-27 20:14:30 -05:00
Matt
7e18424d11 Fix NPE changing camera quirks then calibrating (#1660)
Closes https://github.com/PhotonVision/photonvision/issues/1659
2024-12-27 19:44:40 -05:00
Jade
00d307439c Remove duplicated dependencies blocks (#1648) 2024-12-25 12:25:12 -05:00
Craig Schardt
5df189d306 Improve slider text input fields (#1654)
This PR changes the text input fields to allow a user to type in a value and press enter (or click away) before the UI registers the updated value. It makes text input behave in a more expected manner.  The spin buttons are no longer shown for the text box. Instead, there are up and down buttons on either side of the slider.

The only thing that I can't figure out is a way to make the up and down buttons continuously increment (decrement) the value if you click and hold. I'm not sure that this is required, but if someone wants to propose a solution, please add it to this PR.
2024-12-22 23:25:29 -06:00
Chris Gerth
bd1c5c0330 Fix bloaty gif (#1647)
change to mp4
2024-12-20 23:56:13 -06:00
Nolan Brown
77e75b9975 Cpp-examples gradle settings organization (#1646)
Not familiar with gradle but it keeps yelling at me for this
2024-12-20 23:55:02 -05:00
Craig Schardt
e506ac6b28 Fix release action glob exclusion (#1644)
In softprops/action-gh-release, when using an glob pattern to exclude files, all of the files to exclude must be specified on one line. Splitting them to multiple lines causes all files to match one of the two lines. 

To combine on one line, use `|` between the patterns.
2024-12-20 17:11:13 -06:00
Matt
88bc63cf82 Bump Athena image to 2025 (#1643) 2024-12-20 13:12:01 -08:00
Nolan Brown
a05542c06c [docs] Document VSCode tests and gradle tasks (#1641) 2024-12-20 09:27:29 -08:00
Jade
ffc4e06ac6 Move to main over master (#1642)
Resolves https://github.com/PhotonVision/photonvision/issues/251

---------

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2024-12-20 09:24:52 -08:00
Jade
81076375b8 Bump to WPILib beta 3 and OpenCV 4.10 (#1638)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2024-12-19 20:54:48 -05:00
Matt
66f369f3a9 Remove selective builds (#1639)
Selective builds breaks my ability to require that checks pass before
merging. It's not worth the bite for very few docs-only PRs, given
github limitations on needing to skip INDIVIDUAL JOB STEPS on required
CI jobs.

Maybe we should move to gitlab 💀
2024-12-19 05:32:22 +00:00
Matt
7cba7b432d Add camera sim smoketest (#1637)
Paranoia test inspired by
https://github.com/PhotonVision/photonvision/issues/1635 .
2024-12-19 04:51:02 +00:00
Jade
dd98d96d7e Actually remove all RuntimeDetector usage (#1636)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2024-12-19 04:47:29 +00:00
Jade
8ede892c14 Remove usage of RuntimeDetector (#1536)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2024-12-17 17:11:05 +00:00
Christopher Mahoney
08c62ab8cd Java 17 (#1440)
![image](https://github.com/user-attachments/assets/d4e4226f-74b0-4ded-87b4-ac4bf2f1ac34)

JDK 11 References
https://github.com/search?q=org%3APhotonVision+jdk-11&type=code

JDK 17 References
https://github.com/search?q=org%3APhotonVision+jdk-17&type=code

TODO List (things we might need to update in other repos):
- []
ab5fa98d72/photonvision/src/modules/photonvision/start_chroot_script (L29)
- []
7f8d225445/stage2/01-sys-tweaks/00-packages (L34)
- []
ab5fa98d72/photonvision/src/modules/photonvision/install.sh (L11)
- []
a4e7ecb6e3/Makefile (L14)

Closes https://github.com/PhotonVision/photonvision/pull/1069

---------

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: Jade <spacey-sooty@proton.me>
2024-12-17 17:01:19 +00:00
Matt
e8efef476b We have followers around the whole globe (#1622)
Co-authored-by: Vasista Vovveti <vasistavovveti@gmail.com>
2024-12-11 23:47:18 -05:00
Griffin Della Grotte
c6403a65d2 Add Rock 5C Release (#1617) 2024-12-11 06:47:16 +00:00
Craig Schardt
6a8d638853 Fix typehint problem with ndarrays (#1631)
mypy was inferring the wrong type for ndarrays in photonCameraSim.py.
This fixes the problem by adding typehints using numpy.typing.NDArray.
2024-12-09 05:21:37 +00:00
Craig Schardt
782929b006 Fix "Manage Device Networking" toggle being disabled incorrectly (#1620)
This fixes a bug introduced in #1592 that caused the Manage Device
Networking toggle to be disabled for systems where PhotonVision is
managing the network.

There is still a problem with the toggle defaulting to "off" and not
staying in the "on" position after settings are saved. I need help from
someone who understands the frontend to figure out why it keeps getting
set back to "off".

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
Co-authored-by: Cameron (3539) <theforgelover@gmail.com>
2024-12-07 04:30:41 +00:00
Craig Schardt
4997ad9115 Fix formating errors that are in master (#1627)
A few files with format mistakes were merged into master and they cause
spotless and wpiformat to fail. This PR fixes those files.
2024-12-06 22:21:05 +00:00
Matt
857a30d980 Pull image version from metadata file (#1599)
Closes #1554


![image](https://github.com/user-attachments/assets/fa51c0a3-a25e-4112-8ef2-990404c746d6)
2024-12-05 02:01:48 +00:00
Julius
a40e69cca0 Update docs to suggest JDK 17 (#1611)
#1609 
#1604
2024-12-04 03:27:10 +00:00
William Toth
e069a79a32 Check for exposure setting validity before accessing. (#1618)
If the exposure property for the generic USB camera settable was not
valid for one camera in the list, then the thread would crash/hang and
no cameras would show up in the list
2024-12-01 23:59:00 +00:00
Joseph Farkas
d9dfe15bfe Set loaded to false when JNI loading fails (#1614)
#1613
2024-12-01 16:19:31 +00:00
James Ward
1dbd2e5990 [python] Correct time units (#1605) 2024-11-28 16:12:52 +00:00
Matt
7e9da4133d (Mostly) allow reloading during calibration (#1593) 2024-11-26 03:25:50 +00:00
Gold856
163b5c9c81 Remove unused JNI artifacts (#1603)
Also removes unnecessary `_M_` prefix from artifacts.
2024-11-23 16:54:00 +00:00
Max Midgley
c6a3638a2f More obvious industrial SD card recommendation (#1601)
It wasn't hard to not notice or skip over the recommendation, or just
not take it seriously. So I added some banners to direct people to read
the quick start guide, and a banner to heavily suggest using an
industrial SD card, since they're just the best thing available right
now.
2024-11-23 07:39:42 +00:00
Jordan McMichael
44f78cb03e [Examples] Limit minimum battery voltage in sim to 0.1V (#1600)
Occasionally, the sim projects are capable of simulating current draw of
over 600A, which triggers a condition in
`BatterySim::calculateDefaultBatteryLoadedVoltage` that limits the
minimum measured battery voltage to 0V (to prevent it from going
negative).

When battery voltage measures 0, this causes NaN values to propagate
through the drivetrain model, making sim inoperable. Specifically, [this
is the
line](https://github.com/PhotonVision/photonvision/blob/master/photonlib-java-examples/aimandrange/src/main/java/frc/robot/subsystems/drivetrain/SwerveDriveSim.java#L452)
that causes the initial NaN values in simulation.

This PR is posed as a patch to ensure that simulation doesn't break.
2024-11-22 00:21:27 +00:00
Lucien Morey
61552ad6ca Tidy up of python autogenerated messages (#1594)
This fixes mostly formatting issues so there is no longer any diff with
things after rerunning the generation script. Yes, most of this can be
fixed by running wpiformat but that doesn't exist as a pre-commit hook
atm, so I think this is nicer.

It also removes any reference to the java encode/decode within the
python message gen
2024-11-21 04:43:33 +00:00
Lucien Morey
fa66ed866c add file marker for type checking (#1598)
I think this is the correct way to do this based on my understanding of
the guide to making a [pep561 compliant
package](https://mypy.readthedocs.io/en/stable/installed_packages.html#creating-pep-561-compatible-packages)
and this example in
[black](https://github.com/psf/black/pull/1395/files). Given that I get
all the type-checking info from a local installation, I don't know if
this is testable until it's published on Pypi.

resolves #1210
2024-11-21 04:43:05 +00:00
Gold856
08b4bd1f03 Update to WPILib beta 2 (#1588)
Resolves #1547.
2024-11-21 04:42:30 +00:00
Lucien Morey
c536a1c312 add missing log and use logger over print (#1596)
This is closer to a port of the Java/C++ stuff and will mean we get a
more standard print output with the rest of the logging in the lib
2024-11-21 03:01:08 +00:00
Matt
adb18fe711 Refactor program configuration broadcast hashmap spaghetti (#1592)
WAS: we used raw hash-maps to encode program state
S/B: we use Jackson to do this encoding for us for free. We have
Objects, and we should use them to represent structured data.

---------

Co-authored-by: Craig Schardt <crschardt@fastem.com>
2024-11-19 05:22:33 +00:00
Matt Morley
7d1e748b0e Enable merge groups 2024-11-18 21:15:40 -08:00
James Ward
3a9d22c76b Handle remote UUID mismatch properly (#1590)
Check for no response
Only throw if incorrect version, and not when missing

Resolves #1569
2024-11-18 21:28:07 -05:00
Dualfuel671
417e1a65b6 Simple proof reading (#1591)
Just correcting some keystroke errors.

---------

Co-authored-by: Craig Schardt <crschardt@fastem.com>
2024-11-18 17:54:24 -06:00
Cameron (3539)
5762167186 Test way too many calibration points (#1585)
![image](https://github.com/user-attachments/assets/508674fe-1d5e-41bf-a115-23bcf1638da0)

Limit seems to be at -least- 700,000 corners in my testing. That's
enough for anyone, surely.

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2024-11-18 02:10:40 -05:00
Matt
faa9eb0093 Disable VisionSystemSimTest entirely (#1584)
This test is still failing on main, see
https://github.com/PhotonVision/photonvision/actions/runs/11875827435/job/33093483193
2024-11-18 01:55:00 -05:00
Gold856
005363c5cd Add web resource folder back to gitignore (#1583) 2024-11-17 00:24:21 -05:00
Matt
478723ca2c Skip Vision System Sim Tests on Windows (#1581) 2024-11-16 20:09:41 -08:00
Matt
05dcfa2a13 Remove time source override (#1582) 2024-11-16 20:09:33 -08:00
Gold856
eff95c09f1 Clean up build (#1572)
Fixes #1564. Also copies vendordep JSONs to the examples as advised by
Thad. Removes unused shared/javacpp/setupBuild.gradle. Also removes
unnecessary `chmod +x gradlew` from CI workflows.
2024-11-16 21:30:34 -05:00
Lucien Morey
097e641789 [Python] remove opencv dependency for robot installations (#1580) 2024-11-16 18:26:07 -08:00
James Ward
f107c94d05 [python] Fix population of metadata (#1578) 2024-11-16 18:25:43 -08:00
Craig Schardt
93242edc86 Fix rate limiting in sphinx link checker (#1579)
Fixes rate-limit errors in the sphinx linkchecker on GitHub links caused
by a missing token.

```
-rate limited-   https://github.com/PhotonVision/photonvision/commits/master/ | sleeping...
-rate limited-   https://github.com/PhotonVision/photonvision/commits/master/ | sleeping...
(docs/advanced-installation/prerelease-software: line    9) broken    https://github.com/PhotonVision/photonvision/commits/master/ - 429 Client Error: Too Many Requests for url: https://github.com/PhotonVision/photonvision/commits/master/
```
2024-11-16 20:24:27 -06:00
Craig Schardt
eb395414ab Explain how to install older version of PhotonVision on Romi (#1577)
Provide instructions for installing the PhotonVision version that is
compatible with WPILibPi 2023.4.2, which is the newest version available
for the Romi.

The older text is hidden in a comment so that it can be restored when
there is a newer version of WPILibPi that is compatible with newer
versions of PhotonVision.
2024-11-16 17:16:10 -06:00
Lucien Morey
04191efc51 sphinxify java docs for python code (#1575) 2024-11-15 18:01:33 -08:00
Cameron (3539)
9bbf49bc6b [docs] Create quick-start guide (#1528)
Add a quick-start guide to help answer more questions with fewer words.
---------

Co-authored-by: Matt M <matthew.morley.ca@gmail.com>
2024-11-14 22:56:02 -05:00
Lucien Morey
dfed7e3621 Break up masssive python overload hacks (#1573)
What it says on the tin. This is all stuff from our initial effort to
port the sim things. Right now it is coupled to #1557 because this fixes
things up in that. Lets merge that one before dealing with this one
2024-11-14 14:59:55 -08:00
Cameron (3539)
4dc4ae88de Update libcamera version (#1566)
This uses the version of libcamera-gl-driver that was built using our
image. This assumes
the correct update path of the pi image version to libcamera to
photonvision.
2024-11-14 11:26:28 -05:00
Lucien Morey
c50c657193 Add Python test harness for openCVHelp class (#1557) 2024-11-14 11:10:08 -05:00
Matt
c04e13ef93 Fix roborio duplicate .so's on deploy (#1571) 2024-11-14 01:52:23 -05:00
Jade
5f3dc152c3 [photon-targeting] Remove dependency on wpilibc (#1544)
Closes https://github.com/PhotonVision/photonvision/pull/1543/files

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2024-11-14 00:25:32 -05:00
Lucien Morey
a64491a59e [photonlibpy] add mypy to ci (#1570)
Co-authored-by: James Ward <james@thedropbears.org.au>
2024-11-13 10:39:02 -05:00
Lucien Morey
a7319ce1d6 [photonlibpy] bump python dependencies for 2025 (#1567)
I tasked my team with updating our upcoming Reefscape codebase to target
2025 packages, only to realise we have created an unsolvable dependency
nightmare with these things being neglected...
2024-11-13 10:38:44 -05:00
Lucien Morey
02c94ea7ed [photonlibpy] stop getting full stack trace on test failure (#1568)
Signal/noise ratio is too low with this enabled. When dealing with #1567
I got ~46000 lines of errors going around in a circle rather than just
an import failure at the scope of each failed test
2024-11-13 10:38:17 -05:00
Gold856
c7ed37789e [photon-targeting] Fix JNI loading (#1563) 2024-11-13 10:37:51 -05:00
James Ward
744e522aea Correct yet more python type hinting (#1555) 2024-11-12 11:17:27 -05:00
David Vo
af03ae0a8b photonlibpy: Fix some type check failures (#1548)
This fixes a variety of type check failures raised by both mypy and pyright. See #1548
2024-11-12 00:53:43 -05:00
Craig Schardt
31ec9baa95 Include kernel logs when downloading logs (#1551)
Instead of writing the kernel logs to the photonvision logs, this will
download them in the same zip file as the photonvision logs. Only includes dmesg logs from the current boot, which is fine since we should capture most of them in our logs now.
2024-11-12 00:41:22 -05:00
Drew Williams
1fc93bd05d [photonli?b C++] Fix rotation3d constructor (#1553)
Fixes #1552 -- mixed up rpy and a rotation vector 

After changes:


![image](https://github.com/user-attachments/assets/0f58c2be-fc00-494c-af76-408c1ec438f9)
2024-11-11 11:06:00 -05:00
Matt
5bee683661 Add gh cli note (#1549) 2024-11-10 16:02:26 -08:00
Lucien Morey
b3d74e56a0 Add python simulation (#1532) 2024-11-10 14:16:02 -08:00
Stephen Just
b5d48a6503 Automatically detect and report hardware model for most SBCs (#1540)
ARM-based machines populate the device model into Device Tree. We can
use this information to automatically detect and report the hardware
model for most Single Board Computers (SBCs). Vendors who want to
override this can still do so via the value in the configuration
database.
2024-11-10 15:49:29 -06:00
Matt
2ea4da0f1e Publish vendor JSON as released artifact (#1525) 2024-11-10 09:56:47 -08:00
Gold856
152b4391b8 Remove unnecessary symbol exclusions (#1542) 2024-11-09 22:09:14 -08:00
Jade
4b2787a8b2 [ci] Update actions (#1546) 2024-11-09 22:08:34 -08:00
Jade
d8de4a7863 [build] Update wpiformat to 2024.45 (#1545)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2024-11-10 13:42:16 +08:00
Matt
14f7155a23 [TSP] Move Bind() to Start (#1538)
Fixes UB with static init. Turns out starting threads in static init doesn't work on windows.
2024-11-09 17:35:38 -05:00
Lucien Morey
d188c37466 Fix missing vars and catch bad shim (#1541)
I made a mistake when cherry-picking things into #1534. Fixing it also
prompted me to regenerate message things without thinking even though it
wasn't needed here but it helped me catch an issue with a bad shim. I
must not have saved it properly on my computer and missed it before
review.
2024-11-09 17:32:35 -05:00
Lucien Morey
14fcc5d485 generate packing for python messages (#1535)
Generate packet serialization in Python, too.
2024-11-09 13:08:45 -05:00
Lucien Morey
1d8d934a8a Enable Python tests, standardise variable spelling and fix arg checking (#1533)
I found these with a quick find-and-replace and checked against the inbuilt Python type checking. I am away from my robot and can't really
confirm there are no flow-on effects. There are no other active usages of the bad casing in the Python code, so we should be good. The generated serde messages already use this casing, so we don't need to update there.
2024-11-09 08:08:57 +08:00
Lucien Morey
bdb2949b4b Stop type hinting members as optional in PhotonTrackedTarget (#1539)
List types should never be optional if sent to NT because an empty list conveys the same
thing.

The equivalent C++ struct takes the same approach with empty vectors rather than an optional vector.
2024-11-09 07:58:56 +08:00
Jade
4cf1c7eee4 [ci] Fix unamed action steps (#1537) 2024-11-08 10:39:34 -05:00
Gold856
04ec99f17a Add license to jars (#1530)
Fixes GPL violation, the license has been missing since 2024.
This also puts licenses in as many JARs and native library archives as possible (for good measure.)
2024-11-08 09:10:14 +08:00
Lucien Morey
150561abf2 Add missing var to dataclass (#1534) 2024-11-07 18:31:21 -05:00
Craig Schardt
58a0597c86 Make install.sh run the version from photon-image-modifier. (#1531)
We've moved the install script to photon-image-modifier. This updates
the install script in photonvision to just download and run the
install.sh from photon-image-modifier.
2024-11-06 23:00:11 -06:00
Matt
a842581785 Fix windows NPEs around exposure+klogs (#1529) 2024-11-06 21:51:31 -05:00
Matt
8dcf0b31a2 Create FileLogger JNI (#1517) 2024-11-06 20:16:36 -05:00
Kouyang07
a99a8e750b Fixed Python code block being in C++ block (#1527) 2024-11-06 12:41:13 -05:00
William Toth
a0b22cd8a3 Update docs to specify that WPILib JDK is required on Windows (#1522) 2024-11-04 23:27:49 -05:00
Cameron (3539)
5d55d215ec Another config matching bug (#1518)
This is quite an odd issue/fix. 

So this is what happened... Photonvision booted with the camera
connected and the camera was working...
After a short time the camera stopped working (for some reason maybe
static, maybe temp, maybe wiring, idk).
During this time pv showed

Jul 04 06:25:18 BackLeft java[643]: [2024-07-04 06:25:18] [CSCore -
PvCSCoreLogger] [ERROR] CS: ERROR 40: ioctl VIDIOC_QBUF failed at
UsbCameraImpl.cpp:723: Invalid argument (UsbUtil.cpp:156)
Jul 04 06:25:18 BackLeft java[643]: [2024-07-04 06:25:18] [CSCore -
PvCSCoreLogger] [WARN] CS: WARNING 30: BackLeft: could not queue buffer
0 (UsbCameraImpl.cpp:724)

I went over and played with the wire. The camera fully disconnected but
it ended up "reconnecting"
When the camera was "reconnected" photonvision detected a "new camera"
except this time with no otherpaths (aka no usb path, or by id path).
That resulted in pv creating a new camera configuration for a camera
with no otherpaths
Cscore then started to report errors that look like it attempted to
connect to the same camera twice

This fixes it by filtering out USB cameras that have no otherpath on
linux.
2024-11-04 21:50:18 -05:00
Craig Schardt
625dacb020 Add QuadThresholdParameters to AprilTag config (#1519)
This works around a change made to the default QuadThresholdParameters in the WPILib AprilTagDetector for 2025.
https://github.com/wpilibsuite/allwpilib/pull/6847
2024-11-03 21:53:53 -06:00
Matt
fc8ecac376 Create TSP Server in C++ photonlib (#1516)
Automatically starts a TCP server in C++. Also adds warnings to Python.
2024-11-01 23:32:38 -07:00
Jade
75e2498f53 Fix typos (#1508)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2024-11-01 23:51:16 -04:00
Matt
7a4ea3dd56 Assert that version checking won't throw on startup (#1512)
# Overview

Previously if the coproc came up later, getProperty would return the
string literal "null", which made us print the BFW. Add tests to make
sure that we don't do that anymore by rebooting a sim coproc +
robot in a combination of different orders.
2024-11-01 23:50:21 -04:00
Jade
5e1a93950e Fix photon-targetting being a seperate project (#1504) 2024-10-31 22:23:52 -07:00
Jade
380546cee0 Remove nonsensical settings.gradles (#1506) 2024-10-31 22:23:12 -07:00
Cameron (3539)
d7a7610917 Fix videomode is null (#1513)
There is a weird edge case at least with arducam/broken arducams/used
arducams where cscore will see it when pv starts but not be able to
connect to it. If we always read out the "current" video mode instead of
null when it is disconnected things will work. If the camera is
disconnected while we try to change the video mode when we get the
current video mode it will tell us what we wanted to set it to. Then
when the camera reconnects it will be in that video mode.
2024-10-31 23:13:36 -04:00
Matt
37aaa49b32 Create timesync JNI for testing client (#1433) 2024-10-31 08:27:19 -07:00
Cameron (3539)
937bafa8e2 Bump to WPILib 2025 Beta 1 & remove C++ protobuf (#1484)
Remove C++ protobuf support until
https://github.com/wpilibsuite/allwpilib/issues/7250 is addressed.
Developers should upgrade to wpilib vscode 2025 beta 1.

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2024-10-31 02:59:39 -04:00
Matt
3d18ded3f6 Link to wpilib javadocs in ours (#1509)
![image](https://github.com/user-attachments/assets/d197b637-bf52-4a03-bf55-32a45fff8b06)
2024-10-29 17:11:53 -07:00
Jade
daa5842fb5 Remove explicit NativeUtils specification (#1495) 2024-10-28 09:18:12 -07:00
Emmy Chow
6f52267c26 Install script improvements (#1456) 2024-10-27 15:07:28 -07:00
Craig Schardt
acbae88d34 Reduce log spam if network monitor fails (#1494)
This prevents spamming of the logs by the network interface device
monitor by:

- checking to make sure the device file exists before starting the
monitoring task
- only logging once if it throws an exception, but keep trying in case
the exception is transient
2024-10-27 16:33:14 -05:00
42
986c7020c3 docs: update link to PhotonVision running examples (#1493) 2024-10-26 15:15:34 -07:00
42
eb7a56abaf docs: fix incorrect link to PhotonVision compiling instructions (#1492) 2024-10-26 14:37:02 -07:00
Matt
d04c4b8231 Re-set config save default state to true (#1489)
Previously, no config updates were ever saved out. At all. Oops.
2024-10-25 23:41:48 -04:00
Matt
f8e25ced89 Add aliases, allow v2024.3.1 setting import (#1487)
Was easy enough to add annotations. Ongoing work to remove these hacks post 2025 is tracked in https://github.com/PhotonVision/photonvision/pull/1487
2024-10-25 23:04:08 -04:00
Matt
f906295c39 Create "Hide calibration corners" switch, default to mrcal on if possible (#1462) 2024-10-25 10:05:03 -07:00
Matt
aee432127a Add AWB slider/toggle (#1477)
Also reworks OV9782 defaults. Probably doesn't work on windows. We should hide these sliders probably. 

Co-authored-by: Cameron (3539) <theforgelover@gmail.com>
2024-10-25 00:27:40 -07:00
Matt
385059c233 Big scary buttons (#1471) 2024-10-24 20:48:02 -07:00
Cameron (3539)
9b61ed156c Fix VisionSourceManagerTest typo (#1486) 2024-10-22 22:23:29 -04:00
Cameron (3539)
8eaa6904dd Equal only by usb paths (#1481)
This bug would only appear when there are cameras with the same naming.
Old config matching would also match using the by-id this was
problematic. When one camera is disconnected it would assign the by-id
path to the other camera with the
same name. When the camera is replugged in it would not be reassigned
the by-id path and would fail the camerainfo equals check.
2024-10-21 10:37:00 -04:00
Matt
7da2ec1948 Fix PhotonCamera typestring checks (#1480)
Previously NT would quietly drop readQueue changes.
2024-10-20 22:21:24 -07:00
Cameron (3539)
7224561b76 Add slider debounce (#1479)
Sliders for exposure and brightness would spam messages on the backend.
This used to cause crashes and can cause it to get quite laggy /
delayed. This will add a 20ms debounce which won't send the value to the
backend until the value hasn't changed for 20ms.

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2024-10-21 00:48:01 -04:00
Craig Schardt
4c84c87cf4 Bump Raspberry Pi images to v2025.0.0-beta-6 (#1483)
Fixes #1482
2024-10-20 22:59:25 -05:00
Craig Schardt
8ff0d93c1f Improve network management (#1478)
This PR changes the way that photonvision interacts with nmcli to control networking on the coprocessor. Instead of modifying an existing connection, Photonvision adds new connections for DHCP and Static IP configurations. It then activiates the proper one at startup and any time that the network configuration is changed.


It also now uses the interface name and not the connection name and checks that the interface is available before making any changes. If the saved interface is not found, it updates the stored interface name and applies the network settings to the current interface. This should minimize the failure to control the network if the network interface wasn't available when PhotonVision first booted.

One other benefit of not altering the default configuration is that, if PhotonVision fails to run for any reason, the device can be accessed using the original networking configuration.

The code has been tested on an OrangePi5 and and a Raspberry Pi 4.

Addresses: #1261
2024-10-20 22:23:50 -05:00
Cameron (3539)
b38de6b506 Calibration Rotation! (#1464)
Rotate camera calibration coefficients based on camera rotation. Probably. Seems to work. Maybe.

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2024-10-19 01:23:23 -04:00
Cameron (3539)
388b3fa2ef Default 36h11 (#1470) 2024-10-14 22:33:03 -04:00
Cameron (3539)
028b6ea62f Fix reflective null points (#1469) 2024-10-14 20:31:19 -04:00
Cameron (3539)
c961f1e22e Fix apriltag detection draw bug (#1467)
We accidentally copied more settings then we wanted. This adds an
annotation that we can mark variables with that will prevent them from
being copied when we switch pipeline types.
2024-10-14 20:30:27 -04:00
Cameron (3539)
189da52a77 Fix aruco draw (#1468)
Someone hard-coded the 16h5 model. Additionally, the April tag pipeline
redistorts the points before drawing them, so let's do that as well.
2024-10-14 20:15:08 -04:00
Cameron (3539)
48fc88c5e9 ChArUco: adjust detector params, hide unused (#1463) 2024-10-13 16:42:53 -04:00
Matt
30ee91379e Copy common fields when changing pipeline type (#1461)
Preserve common AdvancedPipelineSettings fields when switching pipeline types. This includes camera resolution, exposure settings, and stuff
2024-10-13 14:52:13 -04:00
Matt
353a8eaaec Add FMS info to snapshot names (#1460)
Supersedes #464

Co-authored-by: Ofir Siboni <050ofir@gmail.com>
2024-10-13 12:47:57 -04:00
Cameron (3539)
09b1bb9e22 Fix client log view (#1459)
Someone forgot to add the timestamp.
2024-10-13 02:13:21 -04:00
Matt
26f3a9977b Create AprilTag pipeline by default (#1458) 2024-10-13 01:38:25 -04:00
Cameron (3539)
0766d0e802 Fix large calibration datasets crashes (#1453)
The target list in networktables is limited to 127 items. When you
capture more than 127 calibration images it breaks this limit and errors
out and dies. Do not publish calibration targets to nt. And also move cal images into their own folder
2024-10-13 01:29:17 -04:00
Cameron (3539)
d9b6199cf0 Dont send SolvePNPEnabled in drivermode. (#1454)
There are no settings for solvePNPEnabled while in driver mode but the
UI tries to set it. Let us not do that.
Fixes #1377

Co-authored-by: Chris Gerth <gerth2@users.noreply.github.com>
2024-10-10 23:27:16 -05:00
Chris Gerth
91da7af171 latest is correct is not correct (#1455)
Ubuntu 24 borked for most of our CI. something to do with glibc


https://discord.com/channels/725836368059826228/725846784131203222/1294138369177157832

it always should have been at a fixed version. Now it is.
2024-10-10 23:13:58 -05:00
Cameron (3539)
471c90e8fa UI Message Passing (#1448)
Bring the UI setting changes in thread with the camera.
2024-10-08 23:06:43 -04:00
Cameron (3539)
142e22ff24 Object detection OOM crash (#1451)
Don't return before we release the object.
2024-10-08 22:01:51 -04:00
Cameron (3539)
c4b273e737 Reduce pipeline use-after-free errors (#1447) 2024-10-07 11:35:18 -04:00
Stephen Just
cd9dd07282 Camera view updated to better respond to state (#1437) 2024-10-05 22:26:14 -07:00
George Horsey
3225c079d3 Update calibration.md OpenCV Docs Link (#1445)
Link had ">" at the end of the URL causing a 404 error.
2024-09-30 23:40:41 -04:00
Craig Schardt
95d55dc977 Add-OrangePi5max-image (#1444)
Completes #1420
2024-09-30 22:21:44 -05:00
Jade
95236e5045 [docs] Fix usage of getTagPose (#1442) 2024-09-29 11:43:02 -04:00
Jade
30e930f051 [docs] Fix invalid max error bits recommendation (#1443) 2024-09-29 11:42:19 -04:00
Jade
68adfe6034 [docs] Remove gerth2 links (#1441)
Resolves https://github.com/PhotonVision/photonvision/issues/1418
2024-09-29 09:55:36 -04:00
Christopher Mahoney
abe95dfaa0 Update poseest.md (#1439)
This space is the root cause of failures in #1437.

RE: #1430
2024-09-29 06:55:46 -05:00
Chris Gerth
354f11a6d6 Fix broken links (#1430) 2024-09-24 18:19:49 -05:00
Banks T
b7cab0431d See3Cam_24CUG Quirks (#1302)
Co-authored-by: Matt <matthew.morley.ca@gmail.com>
Co-authored-by: Chris Gerth <chrisgerth010592@gmail.com>
2024-09-24 18:18:59 -05:00
Chris Gerth
a8daff3ed4 Revised 9782 defaults (#1431)
revised order to prevent some randomness around init
2024-09-24 00:02:16 -05:00
Matt
a0c85fc95f Create photon-targeting-JNI framework (#1428)
Initial framework for adding JNI libraries. Auto generated JNI headers and sticks native libraries into the JAR (and adds to class path for testing)
2024-09-23 22:44:09 -04:00
Matt
f33218c49c Add message UUID and type names to hash and message defintion (#1409) 2024-09-22 22:27:13 -04:00
Stephen Just
360298cc24 Fix error being printed to console on Chrome when navigating UI (#1429)
Chrome prints an error to the console when you have `<img src="null" />`

The path `//:0` can be used for an empty image and Chrome will not raise
an error.
2024-09-21 16:11:58 -04:00
Christopher Mahoney
27cb69c094 Support selecting Object Detection models (#1359)
This PR is for part 1 of #1354. It focuses on adding a model selection
interface for models that exist in `photonvision_config/models/`. Upon
completion we can ship more than 1 model and users could upload their
own through `ssh` without deleting the shipped model. This PR also adds
the abstractions need to support more DNN backends (say OpenCV, or RPI
AI Kit)

Up next is adding a CRUD interface for managing models through the UI.
2024-09-21 16:08:00 -04:00
Craig Schardt
24fb6af5f4 Fix setting gain to max on cameras that don't have a gain quirk (#1424) 2024-09-15 23:40:27 -04:00
Cameron (3539)
546058593e Roll Back to 2024.3.2 (#1423)
Roll back to 2024.3.2 to get some good testing on actual robots.
2024-09-15 20:01:11 -04:00
Chris Gerth
9e6a066561 Examples Clean-Up (#1408) 2024-09-15 00:10:02 -04:00
Christopher Mahoney
596c87519c fix: reflection bug in onDataChangeEvent (#1416) 2024-09-12 14:08:57 -04:00
Drew Williams
06f0f7d66f Fixes windows not allowing auto exposure prop for the ov2311 (#1407) 2024-09-03 22:17:10 -04:00
Devon Doyle
c38b50911d [photon-client] Log Viewer Improvements (#1385)
Fixes the following issues with the client log viewer:
- Inconsistent and excessive spacing between log entries
- Lack of responsiveness to window size or scaling

Adds the following features to the log viewer:
- Auto-scroll if scrolled to the bottom
- Ability to clear logs on button click
- Search function to filter logs
- Displays the time the frontend captured a log and displays that timestamp in hh::mm::ss in the log viewer
- Allows logs to be filtered to be after a certain time
- General styling refinements to increase usability

---------

Co-authored-by: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com>
2024-08-31 18:22:07 -04:00
Matt
169595e56e Auto-generate packet dataclasses with Jinja (#1374) 2024-08-31 13:44:19 -04:00
Mohammad Durrani
c19d54c633 Removed CalibDB (#1396) 2024-08-31 12:31:49 -04:00
Matt
738e3646f7 Photonlibpy - Best Target Function #1223 (#1406)
Supercedes https://github.com/PhotonVision/photonvision/pull/1223

---------

Co-authored-by: vladb <vlad.bondar@frc5113.com>
2024-08-31 12:30:09 -04:00
Jade
50ea32c82d Fix getTarget docs (#1404) 2024-08-29 01:20:03 -04:00
Stephen Just
8c09cd2cb3 Populate CameraSettingsStore with placeholder value if no cameras are present (#1401) 2024-08-25 08:10:45 -04:00
Stephen Just
c33fd8362d [photon-client] Bump node to V18 (#1402)
* Bumps minimum NodeJS requirement to v18 (already used as part of
official builds)
* Prerequisite for latest VueJS
2024-08-24 22:58:33 -04:00
Cameron (3539)
2e4be684be Update RPI Image 7/4/24 (#1373)
Bump libcamera version to support new pi image.
2024-08-22 21:10:03 -04:00
Cameron (3539)
ed6cf0f5dc Document Charuco (#1398)
You know... I made those charuco changes now I need to document how it
works... basic stuff.

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2024-08-19 20:35:02 -04:00
Mohammad Durrani
4643f86438 Switch from RST to MyST Markdown (#1395) 2024-08-18 14:05:23 -04:00
vic123
0493ef9133 Document how to install PhotonLib of specific version (#1392) 2024-08-18 00:37:45 -04:00
Craig Schardt
c5c2a7a6f9 Add OrangePi5b image to generated images (#1394) 2024-08-17 14:20:19 -04:00
Chris Gerth
f1d1d325e0 Move to using Absolute Exposure Range (#1352)
Uses logic in
https://github.com/PhotonVision/photon-libcamera-gl-driver/pull/16 to
push the ov9281 down to its true minimum exposure.

Updates UI to list the exposure settings in ~~microseconds.~~ Native
units - not everyone works in microseconds.

Does its darndest to actually try to set the exposure in
~~microseconds.~~ Native Units. To do this...

Lifecam is funky when doing this - [cscore limits the exposure settings
to certain quantized
values](https://github.com/wpilibsuite/allwpilib/blob/main/cscore/src/main/native/linux/UsbCameraImpl.cpp#L129).
Add a new camera quirk to allow that.

~~Updated camera quirks to re-evaluate every camera load (rather than
recalling from settings - this shouldn't be necessary)~~ This should be
rolled back, needed for arducam type selection.

Updated camera quirk matching logic to make PID/VID optional, and
basename optional (and only match trailing characters). This enables
mirroring CSCore's logic for identifying lifecams by name.

Updated the USBCamera to primarily use cscore's exposed property names.

Since camera manufacturers use a potpourri of names for the same
thing....

For nice-to-have settings: new soft-set logic to try all possible names,
but gracefully pass if the property isn't there.
For required settings: Search a list for the first setting that's
supported, fail if none are supported.

More logging of camera properties to help debug.

Note: most of this work is because cscore doesn't directly expose a
massaged exposure-setting-absolute API (and, given what we've seen,
probably _shouldn't_, this struggle is not for the faint of heart).

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2024-08-17 10:02:59 -05:00
Craig Schardt
dbe566cb55 Update install.sh for OPi5 Ubuntu 24.04 (#1390)
This updates the install script to work correctly on Ubuntu 24.04
versions of the Orange Pi 5 images.

Changes include:
- installing libatomic1
- disabling networkd-wait-online if using Network Manager
- using systemctl instead of service to detect if photonvision is
running
- detecting if this is a RK3588 cpu and enabling all cores
2024-08-13 10:54:26 -04:00
Matt
c3302045d9 Add rsync & sphinx-autobuild docs (#1391) 2024-08-12 11:01:04 -04:00
Jade
ac1fc2a46b Add API docs to sidebar (#1383) 2024-08-04 21:58:54 -04:00
Matt
67463a020a Use ReadQueue for PhotonCamera timestamps (#1316)
This removes the extra GetLastChange call to keep everything properly
atomic.

Closes #1303
2024-08-04 14:23:46 -04:00
Craig Schardt
37e9d40762 Use new OrangePi5 images and add OrangePi5 Pro (#1388) 2024-08-03 21:57:35 -04:00
Matt
974a926e75 Run wpiformat (#1379) 2024-08-02 11:57:34 -04:00
Cameron (3539)
d1e7fd4db9 Revert "Use pnpm instead of npm" (#1382)
Reverts PhotonVision/photonvision#1375

Causes white screen UI Bug, "the way we currently strap everything with
vue2 and vuetify has a lot of footguns in it, and using a newer package
manager where each subdependency gets its own version of node is causing
incorrect dependency resolution which also means we can't fix this
without either updating node or patching those dependencies id say just
revert the PR for now until I or someone else can do the vue3 update"
2024-07-31 12:45:10 -04:00
MADMAN-Modding
10f74bb623 Fixed spelling error (#1376) 2024-07-24 16:38:49 -04:00
Sriman Achanta
3c58b05af7 Use pnpm instead of npm (#1375)
Pnpm is like npm except instead of keeping multiple copies of
dependencies, it shares a single copy for multiple dependencies
significantly reducing build time and the space needed to hold all the
dependencies. Read [here](https://pnpm.io/motivation) for more info.

This changes our CI to use pnpm and allows developers to choose to use
pnpm instead of npm. Also, pnpm has a built-in node version manager so
devs no longer need to use nvm to work on photonvision. All npm
functionality (including photon-server gradle tasks) still functions
using npm so this isn't breaking. We should make a docs change to
suggest to use pnpm.
2024-07-24 00:45:19 -04:00
Matt
9ad9b8288a Update docs on docs about docs (#1360) 2024-07-04 17:15:51 -04:00
Cameron (3539)
fab75918da Fix OV9782 typos (#1358)
There were a couple of typos in the last OV9782 fix, this addresses
those. Additionally, remove Matt's comment that he forgot.
2024-07-01 22:14:22 -04:00
Gautam
173b6d9ca8 Adds support for OV9782's quirks (#1284)
The OV9782 camera has a specific exposure range, so a camera quirk for
it needs to exist. The default white balance is also pretty bad, so it
must be adjusted.

Closes #1204

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
Co-authored-by: Cameron (3539) <theforgelover@gmail.com>
2024-07-01 18:54:20 -04:00
Matt
e7e59ed2d4 Rename .readthedocs to match RTD 2024-06-30 20:47:13 -07:00
Matt
dcc7ddc19b Move docs in-source (#1357) 2024-06-30 16:10:12 -04:00
Matt
0cdd9a74d0 Bump wpilib to 2025.0.0-alpha-1 and break non-FRC JDKs (#1356)
Windows users will have to add
`"-Dorg.gradle.java.home=C:\Users\Public\wpilib\2024\jdk"` to gradle
invocations, ie `./gradlew run
"-Dorg.gradle.java.home=C:\Users\Public\wpilib\2024\jdk"`, due to MSVC
ABI breakages and other stupidity
2024-06-30 02:08:58 -04:00
Cameron (3539)
8c45fef62a Support more charuco boards (#1348)
Add support for the old opencv charuco board like calibio. 

Add support for other tag families while calibrating.

Fix calibration issue index out of range with charuco missing points.
2024-06-20 21:29:00 -04:00
Cameron (3539)
1d9810505a fix CSI camera null quirks error (#1349)
temp fix for this issue with csi cameras
2024-06-19 19:09:52 -04:00
Matt
8f0cc0ab8b Revert "Warn when getBestCameraToTarget returns 0, 0, 0 (#1334)" (#1351)
This reverts commit 6ff7b3e143. See #1351 for context
2024-06-17 22:38:16 -04:00
Cameron (3539)
0105df9ad4 Bump libcamera driver version (#1346)
* Update build.gradle
2024-06-12 18:06:25 -04:00
Matt
292c7a10d4 Only publish to maven on main fork (#1345) 2024-06-11 16:31:05 -04:00
Matt
230e73749f Only download necessary files in release step (#1344) 2024-06-11 09:36:34 -05:00
Matt
655909cc84 Create combine job and offline vendordep ZIP (#1343)
* Create combine job

* Update build.yml

* Bump max workers in photonlib

* Oops

* actually kill entirely

* Maybe fix test

* Don't run tests

* Update OpenCVTest.java

* Update build.yml

* Use upload-artifact@v4

* Update build.yml

* Update build.yml
2024-06-10 20:37:01 -05:00
Matt
5289948b83 Add photon.pb.h/PhotonVersion to cpp headers zip & create combined sources zip (#1335)
Combined sources zip is useful for robotpy to build both targeting & lib in the same build
2024-06-09 17:18:57 -04:00
Cameron (3539)
7b19a951ca Camera Lost Stream (#1341)
* Fix no stream on camera unplug.

* Spotless remove datarate

* Make Static Frames Class

* lint and format
2024-06-06 20:46:46 -05:00
Cameron (3539)
db531f1b6a Fix libcamera not found bug (#1326)
* Update build.yml
2024-06-02 16:16:43 -04:00
Jade
6ff7b3e143 Warn when getBestCameraToTarget returns 0, 0, 0 (#1334)
Resolves https://github.com/PhotonVision/photonvision/issues/915
2024-06-01 13:28:00 -04:00
Jade
e34b114669 Change default AprilTag family to 36h11 (#1333)
Change default AprilTag family to 36h11

Resolves https://github.com/PhotonVision/photonvision/issues/1226
2024-05-30 20:30:40 -04:00
Matt
f792b46eb7 Fix mac released jar naming (#1332) 2024-05-29 20:13:24 -04:00
Matt
19b4802094 Allow opencv8 distortion model in PhotonCamera (#1317)
We previously assumed only OpenCV5 but mrcal uses opencv8
2024-05-29 17:28:35 -04:00
Matt
fcca858a37 Update maven URL to reposilite (#1330)
Also bumps to new builds of artifacts (NFC)
2024-05-29 12:29:08 -05:00
Matt
9eae7a4431 Disable transitive deps for rknn-jni (#1329) 2024-05-26 18:43:06 -05:00
Matt
0eeedf49fc Publish generated proto sources (#1328) 2024-05-26 14:02:37 -05:00
Matt
98633e9150 Bump wpilib to latest dev (#1327) 2024-05-26 14:02:07 -05:00
Matt
ed08e2a78f Move PhotonVersion to C++ file (#949)
This was supposed to speed up incremental compilation, but not sure it actually does. It's better form tm tho and fixes a robotpy-wrapper weirdness
2024-05-24 23:22:31 -04:00
amquake
12cb082f1b Update README.md (#1321) 2024-05-19 20:37:13 -04:00
Drew Williams
74a051d721 [PhotonLib C++] Fix SetVersionCheckEnabled to actually disable version checking (#1323)
* change verifyversion to use member variable

* Revert "change verifyversion to use member variable"

This reverts commit 4439839c8f.

* Removed inline specifier for versioncheck variable

---------

Co-authored-by: Drew Williams <DrewW@iARx.com>
2024-05-19 20:36:44 -04:00
Craftzman7
9e58f5ed02 Disable Arm32 Builds (#1325)
Disables Arm32 builds and removes mention of the build option in the README.
2024-05-19 20:35:40 -04:00
Matt
713fad6f6b Allow file uploads of any size and better report active cameras in PhotonCamera error print (#1298)
Previously reported itself which was confusing. New print:

```
Error at org.photonvision.PhotonCamera.verifyVersion(PhotonCamera.java:378): Found the following PhotonVision cameras active on NetworkTables:
 ==> HD_Pro_Webcam_C920
 ==> Arducam_OV9281_USB_Camera
```
2024-05-10 14:58:18 -04:00
Matt
1708376df8 Expose object detection class id/conf in photonlib (#1266)
* Implement class id/conf in photonlib

* Maybe fix things

* run lint

* Update Packet.java comments

* Update Packet.java comments again

* Update comments

* oops

* Update packet.py

---------

Co-authored-by: Chris Gerth <gerth2@users.noreply.github.com>
2024-05-10 14:52:16 -04:00
Matt
113951100e Add sequence ID, capture, publish and recieve timestamp to PhotonPipelineResult (#1305)
Closes #1304
2024-05-10 14:04:34 -04:00
Programmers3539
70c2cdebe0 Charuco Support (#1312)
Add charuco calibration to photonvision. Currently does not support generating custom charuco boards. This does not support https://calib.io/pages/camera-calibration-pattern-generator. Currently only supports the 4X4_50 family. Also removes all dotboard calibration. Fixes using the lowest possible fps while doing calibration (now uses the highest fps available for each resolution).
2024-05-10 13:12:13 -04:00
Matt
560f379109 Bump libcamera to fix picam v1, remove duplicate opencv (#1263) 2024-05-10 11:09:01 -05:00
Matt
00c2a25730 Undistort corner pitch/yaw using opencv (#1250)
* Undistort pitch/yaw

* Actually implement lol

* Update TargetCalculations.java

* fix yawpitch test units

* format

---------

Co-authored-by: amquake <noleetarrr@gmail.com>
2024-05-02 21:17:28 -04:00
Drew Williams
6535710fc4 Change sim to use 36h11 tags when doing multitag (#1314) 2024-04-29 16:19:03 -04:00
Matt
c9a696225d Kill deprecated things (#1311) 2024-04-27 11:32:36 -05:00
Devon Doyle
010688006a [Client] Fix issue with clearing multitag buffer (#1299)
* fix improper state reference

* add parentheses for clarity

* fix buffer array reactivity + loop optimization
2024-03-22 20:19:51 -04:00
Matt
2d8b1ec66d Properly handle empty frames from cscore (#1296) 2024-03-21 23:23:56 -04:00
Devon Doyle
15da06b24c Sticky calibration camera display card (#1294)
* Stick camera card in calibration view to top

* Spacing
2024-03-21 15:39:07 -04:00
Devon Doyle
97d2050a99 Fix mjpg stream accumulation (#1293)
Fixes bug where switching tabs/etc causes buildup of connected mjpg streams in network, eventually slowing down streams and causing stream failure until refresh. Accomplishes this by directly setting the source of stream elements to null before unmount, allowing chrome/edge to close the connection.

Fixes #1106
2024-03-20 22:53:15 -04:00
Matt
c89acea5a6 Run updated wpiformat (#1291) 2024-03-18 20:54:06 -04:00
Matt
fa5d58147a Recreate user pipeline on type change (#1290)
* Recreate user pipeline on type change

* Fix typo

---------

Co-authored-by: shueja <32416547+shueja@users.noreply.github.com>
2024-03-18 20:50:32 -04:00
Matt
e74afb9688 Release letterboxed frame (#1289) 2024-03-18 17:20:14 -07:00
Matt
5dc70e4d3f Run resize in CPU and more aggressively release rknn resources (#1287)
With the latest dev opi image, i saw this stack trace when object detection stopped working (threads hanging forever on detect(). The stack pointed me to somewhere inside the RGA. Based on this i moved resize into CPU (as our [native code already is lazy](6934abb26c/src/main/native/cpp/yolo_common.cpp (L227))), and was not able to see more crashes

[message.txt](https://github.com/PhotonVision/photonvision/files/14630158/message.txt)

Includes also a quick hack to add a shutdown hook that releases pipelines at exit.
2024-03-18 16:36:14 -04:00
Matt
5597f5acd9 Set default pipeline idx in PipelineManager constructor (#1286)
Addresses #1285
2024-03-18 13:21:41 -04:00
Matt
fae3116951 Bump to 2024.3.2 (#1283) 2024-03-17 23:00:22 -05:00
Gautam
def37b92ba Add proper exposure range for OV2311 (#1282) 2024-03-16 20:28:52 -04:00
Phill Tran
5b878fe3a3 Disable camera orientation option when camera is calibrated (#1277)
* Disable camera orientation option when camera is calibrated.

* Flip logic on if camera is calibrated when disabling camera orientation rotation

* Add comment on why orientation is disabled when camera is calibrated

* Add v banner warning regarding rotating calibrated camera bug

* Run lint

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2024-03-15 10:39:04 -04:00
Matt
d9c2a382f1 Update build.yml (#1276) 2024-03-14 00:32:08 -05:00
Matt
e125632960 Free native resources in apriltag pipelines (#1272)
Addresses memory leak when switching between apriltag/aruco pipelines
2024-03-14 01:22:32 -04:00
Matt
d8f82bf9ee Opencv cal: CALIB_USE_LU and use camera focal length guess (#1268) 2024-03-09 08:31:54 -05:00
Matt
587ac478f4 Bump mrcal to include solver fixes (#1265) 2024-03-06 10:51:49 -05:00
Matt
bad676f67c Pipe cscore logs through photonvision (#1260)
This means we can see even more logs about mjpeg server status as well
2024-03-04 23:27:39 -05:00
Matt
71128d1569 Create smoketest mode (#1264)
Create test mode that exists after confirming libraries load OK
2024-03-04 23:24:23 -05:00
Matt
7cec141341 Fix CSI camera matching (#1258)
* previously CSI cameras would always have a new config made and would never match
2024-02-27 09:07:42 -05:00
Matt
ec66645667 Update build.yml (#1249) 2024-02-20 16:28:50 -05:00
Vasista Vovveti
39aaa34520 update wpilib to 2024.3.1 (#1246) 2024-02-20 15:08:52 -05:00
Vasista Vovveti
4a3200d0c0 Run apt update and install sqlite3 (#1247) 2024-02-19 21:37:55 -05:00
Matt
01dc7ea5ce Properly check camera info equality and handle zero cameras (#1245)
- Fix CameraInfo equality check (which prevents the same camera on a new usb port from being enumerated by us)
- Fix warning prints
- Make matchCamerasOnlyByPath apply to Windows
- Add unit tests
2024-02-19 12:34:57 -05:00
Matt
2a9502be3d Add matching by base-name only (fused off by only by path) (#1238) 2024-02-18 21:00:14 -05:00
amquake
39216db143 [photonlib] Invert simulated target yaw (#1243) 2024-02-18 20:59:54 -05:00
Matt
428f926ac2 Actually properly match cameras by name fr this time (#1237)
Our current code matches cameras in this order (which I think is objectively wrong and stupid)

- by-id (/dev/v4l/by-id/product-string)
- by path (/dev/videoN)
- product string/name, but ascii only
- asks cscore to reconnect to cameras using `path`, which on linux is actually /dev/videoN. This isn't guaranteed to stick to a camera if you replug them weirdly at runtime.

This is silly and does not consider the actual physical usb port. I propose instead, in this order:

- By physical usb port path and base name
- by physical usb port path and USB VID/PID
- By base name only (with a toggle switch to disable this, and create a new VisionModule instead)
- Give cscore /dev/video/by-path on Linux systems, pinning Photon USBCameras to a particular usb port once created.

This changes lots of things so stay paranoid!
2024-02-16 16:05:47 -05:00
Matt
4efeb3d412 Load libwinpthread-1.dll before libgcc_s_seh-1 (#1228) 2024-02-16 16:05:16 -05:00
Matt
6a2d83e19b Upload docs to VPS via SFTP (#1235)
Still in testing, might break our docs for now
2024-02-12 19:57:23 -05:00
Matt
1c0d92641f Check empty mean errors in calibration card (#1229)
Fixes calibration card disappearing if calibdb calibration was used
2024-02-12 15:55:31 -05:00
DeltaDizzy
9653c46bdb fix cpp and java photoncamera names (#1230) 2024-02-11 04:27:25 -05:00
Chris Gerth
3738e7821b fix latency calculation (#1227) 2024-02-09 18:45:38 -06:00
Tim Winters
0eb0a4e3c5 Store the last pose on update (#1207)
* Store the last pose on update

* Don't clear lastPose if pose isn't calculated

---------

Co-authored-by: Mohammad Durrani <46766905+mdurrani808@users.noreply.github.com>
2024-02-05 09:50:36 -05:00
Chris Gerth
7666f152bb Fix chessboard gen for unique square sizes (#1217) 2024-02-05 09:48:39 -05:00
Craig Schardt
45a39f6609 Remove duplicate video modes (#1221)
(Fixes #1219)
2024-02-04 22:42:01 -05:00
Matt
bc55218739 Add NPU usage to metrics on supported platforms (#1215) 2024-02-03 12:31:31 -05:00
Matt
e616d93d59 Update CameraCalibrationInfoCard.vue (#1214) 2024-02-02 21:53:47 -05:00
Chris Gerth
5851509a9e Python tweaks (#1211)
* Increasing api parity with java/cpp by adding hasTargets

* type hints fixed up

* wpiFormat
2024-02-02 14:17:53 -06:00
james20902
ea1b701ba7 Add support for different RKNN YOLO models in the backend (#1205) 2024-02-01 23:48:02 -05:00
Matt
62112cd2fd Reduce initial connection bandwidth (#1200)
Reduces bandwidth requirements by being much lazier about how much calibration data is sent to the UI.
2024-02-01 21:42:54 -05:00
Gautam
c7508fea46 Add v4l-utils to install script (#1201)
adds about 2kb to our image
2024-01-27 09:46:50 -05:00
Matt
eca3cea82d Sort object detection results and reduce code duplication (#1173)
* Sort object detection results and reduce code dup.

* Filter objdet results by ratio and area

* Address code review

---------

Co-authored-by: Mohammad Durrani <46766905+mdurrani808@users.noreply.github.com>
2024-01-23 14:10:31 -05:00
Craig Schardt
cbbfbda59d clean up debugging println (#1193) 2024-01-22 22:59:42 -05:00
Drew Williams
a3e1dda3aa Fixed cpp sim apriltag layout and cleaned up cpp sim example (#1190)
* Fixed cpp sim apriltag layout and cleaned up cpp sim example

* changed layout for photoncamerasim

---------

Co-authored-by: Drew Williams <DrewW@iARx.com>
2024-01-22 15:38:25 -05:00
Aiden Lambert
939283df0e Fix positioning of multitarget struct in pipelineresult unpack (#1181)
fixed the unpacking order to match the current pipelineresult data layout.

* fix positioning of multitarget struct in pipelineresult unpack

* fix encode order in PhotonPipelineResult.cpp
2024-01-22 13:05:30 -05:00
Craig Schardt
43338a4e96 Temperature monitoring for RK3588 (#1186) 2024-01-22 07:59:40 -05:00
Craig Schardt
bcea6fcc8d Bump WPILib to 2024.2.1 (#1188) 2024-01-21 20:06:47 -05:00
Ethan Wall
90773e0e4a [photonlib-py] Begin implementing PhotonPoseEstimator in Python (#1178)
* [photonlib-py] Initial impl of PhotonPoseEstimator

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2024-01-21 06:57:32 -06:00
Matt
57f02f31a5 Dont flush settings on exit after import (#1179)
Fixes bug when importing settings zip that would have the new settings be over written, and would not actually update
2024-01-20 20:49:51 -05:00
Matt
580bbb4a4d Draw calibration rainbow and scale thickness based on image size (#1174) 2024-01-20 20:04:15 -05:00
Craig Schardt
4a0c15b61b Disable the network controls when networkingIsDisabled is true (#1118)
* commented controls that should depend on networkingIsDisabled

* add the thing

* fix Manage Device Networking showing disabled

* commented controls that should depend on networkingIsDisabled

* add the thing

* fix Manage Device Networking showing disabled

* Hide the settings that aren't available when networking is disabled

* Update NetworkingCard.vue

* Update NetworkingCard.vue

---------

Co-authored-by: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com>
2024-01-20 19:46:47 -05:00
Programmers3539
a1df37e20f Add Orange Pi 5 Plus image (#1170)
And bumps both opi images to kill snapd
2024-01-20 19:45:58 -05:00
DeltaDizzy
644c162834 Make java examples independent by adding GradleRIO version (#1158) 2024-01-20 19:45:29 -05:00
Max Worrall
5f591a51c4 [photonlib-py] Remove print statement (#1171) 2024-01-18 11:21:42 -05:00
Sriman Achanta
d59be893ae Fix UI bugs from RKNN PR (#1169)
* fix interactiveCols

* fix deferred store bug

* Fix bug where ObjectDetection pipeline could be made on invalid platforms

* Update vite.config.ts
2024-01-16 22:23:05 -05:00
Ryan Blue
f13a507a71 Fix total ram reporting (#1161) 2024-01-15 23:03:52 -05:00
Programmers3539
628cead2dc Add LL3 image from photon-image-modifier (#1166)
* LL3

* Update build.yml
2024-01-15 22:50:44 -05:00
Mohammad Durrani
7b67f6bebf Add RKNN / Object Detection Pipeline (#1144)
Tested on Orange Pi 5 and Cool Pi 4B. Merge with parts of the OpenCV DNN PR. 

Adds support for YOLOv5s models for Rockchip CPUs with a NPU. Right now hard coded to a note model from alex_idk. Very much still incubating and largely untested.
2024-01-15 22:28:34 -05:00
Matt
e1f550a751 Load libquadmath on Windows (#1163)
Nobody reads these, right? This probably won't make things worse. Surely.
2024-01-15 18:44:58 -05:00
Ryan Blue
a40e4049d4 Update spotless to fix exception spam (#1162) 2024-01-15 15:44:43 -05:00
Matt
152888f216 Bind-mount repo in image builder (#1157)
Reduces built image size by not accidentally copying source in
2024-01-14 13:31:12 -05:00
ArchB1W
b729d9e917 [photon-lib java] Implement ProtobufSerializable (#1156)
* [photon-lib java] Fix classes with protobuf support not "announcing it"

Since they didn't implement `ProtobufSerializable` this meant that most other software didn't even know protobufs were even implemented.
In AdvantageKit for example this would cause it to not work it all and crash.

* Run `spotlessJavaApply`
2024-01-13 22:35:57 -05:00
Thad House
6917ec8401 Fix vendordep including all wpilib libraries (#1155)
* Fix vendordep including all wpilib libraries. Without this fix, users were consuming a massively oversized .jar
2024-01-13 18:57:56 -06:00
1199 changed files with 398994 additions and 25432 deletions

View File

@@ -68,19 +68,26 @@ ForEachMacros:
- BOOST_FOREACH
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<ext/.*\.h>'
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

3
.gitattributes vendored
View File

@@ -35,3 +35,6 @@
*.so binary
*.dll binary
*.webp binary
# autogenerated constrained solve pnp code
photon-targeting/src/main/native/cpp/photon/constrained_solvepnp/generate/**/* linguist-generated

4
.github/CODEOWNERS vendored
View File

@@ -1,2 +1,6 @@
# These owners will be the default owners for everything in the repo.
* @PhotonVision/program-devs
docs/* @PhotonVision/doc-maintainers
photonlib-java-examples/* @PhotonVision/doc-maintainers
photonlib-cpp-examples/* @PhotonVision/doc-maintainers
photonlib-python-examples/* @PhotonVision/doc-maintainers

View File

@@ -22,6 +22,7 @@ If applicable, add screenshots to help explain your problem. Additionally, provi
**Platform:**
- Hardware Platform (ex. Raspberry Pi 4, Windows x64):
- How is it powered? (ex. Zinc-V, Pololu Buck Converter, Battery Bank):
- Network Configuration (Connection between the Radio and any devices in between, such as a Network Switch):
- PhotonVision Version:
- Browser (with Version) (Chrome, Edge, Firefox, etc.):

17
.github/ISSUE_TEMPLATE/docs_issue.md vendored Normal file
View File

@@ -0,0 +1,17 @@
---
name: Documentation Request
about: Something needs to be documented/updated in the documentation
title: ''
labels: documentation
assignees: ''
---
**Are you requesting documentation for a new feature, or updated documentation for an old feature?**
Put the feature you are requesting documentation for here, along with whether the documentation is stale and needs to be updated, or whether the documentation does not exist, and needs to be created.
**Where is it?**
Put the location of the documentation that needs to be updated here. If you're requesting documenation for a new feature, put where you think it should go.
**Additional context**
Add any other context or screenshots about the feature request here.

15
.github/labeler.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
"backend":
- changed-files:
- any-glob-to-any-file: [photon-core/**, photon-server/**]
"documentation":
- changed-files:
- any-glob-to-any-file: [docs/**, photon-docs/**]
"frontend":
- changed-files:
- any-glob-to-any-file: photon-client/**
"photonlib":
- changed-files:
- any-glob-to-any-file: photon-lib*/**
"website":
- changed-files:
- any-glob-to-any-file: website/**

19
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,19 @@
## Description
<!-- What changed? Why? (the code + comments should speak for itself on the "how") -->
<!-- Fun screenshots or a cool video or something are super helpful as well. If this touches platform-specific behavior, this is where test evidence should be collected. -->
<!-- Any issues this pull request closes or pull requests this supersedes should be linked with `Closes #issuenumber`. -->
## Meta
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
- [ ] If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added

View File

@@ -1,37 +1,41 @@
name: Build
on:
# Run on pushes to main and pushed tags, and on pull requests against main, but ignore the docs folder
push:
branches: [ master ]
tags:
- 'v*'
pull_request:
branches: [ master ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
IMAGE_VERSION: v2026.0.4
jobs:
build-client:
name: "PhotonClient Build"
defaults:
run:
working-directory: photon-client
runs-on: ubuntu-22.04
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Dependencies
run: npm ci
- name: Build Production Client
run: npm run build
- uses: actions/upload-artifact@v4
with:
name: built-client
path: photon-client/dist/
- uses: gradle/actions/wrapper-validation@v4
build-examples:
name: "Build Examples"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
architecture: x64
- os: macos-14
architecture: aarch64
- os: ubuntu-22.04
name: "Photonlib - Build Examples - ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
needs: [validation]
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -44,27 +48,21 @@ jobs:
with:
java-version: 17
distribution: temurin
- name: Install RoboRIO Toolchain
run: ./gradlew installRoboRioToolchain
# Need to publish to maven local first, so that C++ sim can pick it up
# Still haven't figured out how to make the vendordep file be copied before trying to build examples
- name: Publish photonlib to maven local
run: |
chmod +x gradlew
./gradlew publishtomavenlocal -x check
run: ./gradlew photon-targeting:publishtomavenlocal photon-lib:publishtomavenlocal -x check
- name: Build Java examples
working-directory: photonlib-java-examples
run: |
chmod +x gradlew
./gradlew copyPhotonlib -x check
./gradlew build -x check --max-workers 2
run: ./gradlew build
- name: Build C++ examples
working-directory: photonlib-cpp-examples
run: |
chmod +x gradlew
./gradlew copyPhotonlib -x check
./gradlew build -x check --max-workers 2
run: ./gradlew build
build-gradle:
name: "Gradle Build"
runs-on: ubuntu-22.04
needs: [validation]
steps:
# Checkout code.
- name: Checkout code
@@ -74,54 +72,84 @@ jobs:
- name: Fetch tags
run: git fetch --tags --force
- name: Install Java 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install mrcal deps
run: sudo apt-get update && sudo apt-get install -y libcholmod3 liblapack3 libsuitesparseconfig5
- name: Gradle Build
run: |
chmod +x gradlew
./gradlew build -x check --max-workers 2
- name: Gradle Tests
run: ./gradlew testHeadless -i --max-workers 1 --stacktrace
- name: Gradle Coverage
run: ./gradlew jacocoTestReport --max-workers 1
- name: Publish Coverage Report
uses: codecov/codecov-action@v3
with:
file: ./photon-server/build/reports/jacoco/test/jacocoTestReport.xml
- name: Publish Core Coverage Report
uses: codecov/codecov-action@v3
with:
file: ./photon-core/build/reports/jacoco/test/jacocoTestReport.xml
run: ./gradlew photon-targeting:build photon-core:build photon-server:build -x check
- name: Gradle Tests and Coverage
run: ./gradlew test jacocoTestReport --stacktrace
build-offline-docs:
name: "Build Offline Docs"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
repository: 'PhotonVision/photonvision-docs.git'
ref: master
- uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.11'
- name: Install graphviz
run: |
sudo apt-get update
sudo apt-get -y install graphviz
- name: Install dependencies
working-directory: docs
run: |
python -m pip install --upgrade pip
pip install sphinx sphinx_rtd_theme sphinx-tabs sphinxext-opengraph doc8
pip install -r requirements.txt
- name: Build the docs
working-directory: docs
run: |
make html
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: built-docs
path: build/html
path: docs/build/html
build-photonlib-vendorjson:
name: "Build Vendor JSON"
runs-on: ubuntu-22.04
needs: [validation]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Java 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
# grab all tags
- run: git fetch --tags --force
# Generate the JSON and give it the ""standard""" name maven gives it
- run: |
./gradlew photon-lib:generateVendorJson
export VERSION=$(git describe --tags --match=v*)
mv photon-lib/build/generated/vendordeps/photonlib.json photon-lib/build/generated/vendordeps/photonlib-$(git describe --tags --match=v*).json
# Upload it here so it shows up in releases
- uses: actions/upload-artifact@v4
with:
name: photonlib-vendor-json
path: photon-lib/build/generated/vendordeps/photonlib-*.json
build-photonlib-host:
env:
MACOSX_DEPLOYMENT_TARGET: 12
MACOSX_DEPLOYMENT_TARGET: 13
strategy:
fail-fast: false
matrix:
@@ -129,14 +157,15 @@ jobs:
- os: windows-2022
artifact-name: Win64
architecture: x64
- os: macos-12
- os: macos-14
artifact-name: macOS
architecture: x64
architecture: aarch64
- os: ubuntu-22.04
artifact-name: Linux
name: "Photonlib - Build Host - ${{ matrix.artifact-name }}"
runs-on: ${{ matrix.os }}
needs: [validation]
steps:
- uses: actions/checkout@v4
with:
@@ -146,30 +175,41 @@ jobs:
with:
java-version: 17
distribution: temurin
architecture: ${{ matrix.architecture }}
- run: git fetch --tags --force
- run: |
chmod +x gradlew
./gradlew photon-lib:build --max-workers 1
- run: ./gradlew photon-targeting:build photon-lib:build
name: Build with Gradle
- run: ./gradlew photon-lib:publish photon-targeting:publish
name: Publish
env:
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }}
if: github.event_name == 'push'
if: github.event_name == 'push' && github.repository_owner == 'photonvision'
# Copy artifacts to build/outputs/maven
- run: ./gradlew photon-lib:publish photon-targeting:publish -PcopyOfflineArtifacts
- uses: actions/upload-artifact@v4
with:
name: maven-${{ matrix.artifact-name }}
path: build/outputs
build-photonlib-docker:
strategy:
fail-fast: false
matrix:
include:
- container: wpilib/roborio-cross-ubuntu:2024-22.04
- container: wpilib/roborio-cross-ubuntu:2025-24.04
artifact-name: Athena
build-options: "-Ponlylinuxathena"
- container: wpilib/raspbian-cross-ubuntu:bullseye-22.04
artifact-name: Raspbian
build-options: "-Ponlylinuxarm32"
- container: wpilib/aarch64-cross-ubuntu:bullseye-22.04
artifact-name: Aarch64
build-options: "-Ponlylinuxarm64"
runs-on: ubuntu-22.04
container: ${{ matrix.container }}
name: "Photonlib - Build Docker - ${{ matrix.artifact-name }}"
needs: [validation]
steps:
- uses: actions/checkout@v4
with:
@@ -178,18 +218,47 @@ jobs:
run: |
git config --global --add safe.directory /__w/photonvision/photonvision
- name: Build PhotonLib
run: |
chmod +x gradlew
./gradlew photon-lib:build --max-workers 1
# We don't need to run tests, since we specify only non-native platforms
run: ./gradlew photon-targeting:build photon-lib:build ${{ matrix.build-options }} -x test
- name: Publish
run: |
chmod +x gradlew
./gradlew photon-lib:publish photon-targeting:publish
run: ./gradlew photon-lib:publish photon-targeting:publish ${{ matrix.build-options }}
env:
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }}
if: github.event_name == 'push'
if: github.event_name == 'push' && github.repository_owner == 'photonvision'
# Copy artifacts to build/outputs/maven
- run: ./gradlew photon-lib:publish photon-targeting:publish -PcopyOfflineArtifacts ${{ matrix.build-options }}
- uses: actions/upload-artifact@v4
with:
name: maven-${{ matrix.artifact-name }}
path: build/outputs
combine:
name: Combine
needs: [build-photonlib-docker, build-photonlib-host]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --tags --force
# download all maven-* artifacts to outputs/
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: output
pattern: maven-*
- run: find .
- run: zip -r photonlib-$(git describe --tags --match=v*).zip .
name: ZIP stuff up
working-directory: output
- run: ls output
- uses: actions/upload-artifact@v4
with:
name: photonlib-offline
path: output/*.zip
build-package:
needs: [build-client, build-gradle, build-offline-docs]
needs: [build-gradle, build-offline-docs]
strategy:
fail-fast: false
@@ -198,24 +267,20 @@ jobs:
- os: windows-latest
artifact-name: Win64
architecture: x64
arch-override: none
arch-override: winx64
- os: macos-latest
artifact-name: macOS
architecture: x64
arch-override: none
- os: ubuntu-latest
artifact-name: Linux
architecture: x64
arch-override: none
arch-override: macx64
- os: macos-latest
artifact-name: macOSArm
architecture: x64
arch-override: macarm64
- os: ubuntu-latest
artifact-name: LinuxArm32
- os: ubuntu-22.04
artifact-name: Linux
architecture: x64
arch-override: linuxarm32
- os: ubuntu-latest
arch-override: linuxx64
- os: ubuntu-22.04
artifact-name: LinuxArm64
architecture: x64
arch-override: linuxarm64
@@ -232,34 +297,113 @@ jobs:
with:
java-version: 17
distribution: temurin
- run: |
rm -rf photon-server/src/main/resources/web/*
mkdir -p photon-server/src/main/resources/web/docs
if: ${{ (matrix.os) != 'windows-latest' }}
- run: |
del photon-server\src\main\resources\web\*.*
mkdir photon-server\src\main\resources\web\docs
if: ${{ (matrix.os) == 'windows-latest' }}
- uses: actions/download-artifact@v4
architecture: ${{ matrix.architecture }}
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
name: built-client
path: photon-server/src/main/resources/web/
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: photon-client/pnpm-lock.yaml
- name: Install Arm64 Toolchain
run: ./gradlew installArm64Toolchain
if: ${{ (matrix.artifact-name) == 'LinuxArm64' }}
- uses: actions/download-artifact@v4
with:
name: built-docs
path: photon-server/src/main/resources/web/docs
- run: |
chmod +x gradlew
./gradlew photon-server:shadowJar --max-workers 2 -PArchOverride=${{ matrix.arch-override }}
- run: ./gradlew photon-targeting:jar photon-server:shadowJar -PArchOverride=${{ matrix.arch-override }}
if: ${{ (matrix.arch-override != 'none') }}
- run: |
chmod +x gradlew
./gradlew photon-server:shadowJar --max-workers 2
- run: ./gradlew photon-server:shadowJar
if: ${{ (matrix.arch-override == 'none') }}
- uses: actions/upload-artifact@v4
with:
name: jar-${{ matrix.artifact-name }}
path: photon-server/build/libs
- uses: actions/upload-artifact@v4
with:
name: photon-targeting_jar-${{ matrix.artifact-name }}
path: photon-targeting/build/libs
run-smoketest-native:
needs: [build-package]
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
artifact-name: jar-Linux
extraOpts: -Djdk.lang.Process.launchMechanism=vfork
- os: windows-latest
artifact-name: jar-Win64
extraOpts: ""
- os: macos-latest
artifact-name: jar-macOS
architecture: x64
runs-on: ${{ matrix.os }}
steps:
- name: Install Java 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- uses: actions/download-artifact@v4
with:
name: ${{ matrix.artifact-name }}
# On linux, install mrcal packages
- run: |
sudo apt-get update
sudo apt-get install --yes libcholmod3 liblapack3 libsuitesparseconfig5
if: ${{ (matrix.os) == 'ubuntu-24.04' }}
# and actually run the jar
- run: java -jar ${{ matrix.extraOpts }} *.jar --smoketest
if: ${{ (matrix.os) != 'windows-latest' }}
- run: ls *.jar | %{ Write-Host "Running $($_.Name)"; Start-Process "java" -ArgumentList "-jar `"$($_.FullName)`" --smoketest" -NoNewWindow -Wait; break }
if: ${{ (matrix.os) == 'windows-latest' }}
run-smoketest-chroot:
needs: [build-package]
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
artifact-name: LinuxArm64
image_suffix: RaspberryPi
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_raspi.img.xz
cpu: cortex-a7
image_additional_mb: 0
extraOpts: -Djdk.lang.Process.launchMechanism=vfork
runs-on: ${{ matrix.os }}
name: smoketest-${{ matrix.image_suffix }}
steps:
- uses: actions/download-artifact@v4
with:
name: jar-${{ matrix.artifact-name }}
- uses: pguyot/arm-runner-action@v2
name: Run photon smoketest
id: generate_image
with:
base_image: ${{ matrix.image_url }}
image_additional_mb: ${{ matrix.image_additional_mb }}
optimize_image: yes
cpu: ${{ matrix.cpu }}
# We do _not_ wanna copy photon into the image. Bind mount instead
bind_mount_repository: true
# our image better have java installed already
commands: |
java -jar ${{ matrix.extraOpts }} *.jar --smoketest
build-image:
needs: [build-package]
@@ -269,27 +413,81 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: ubuntu-24.04
artifact-name: LinuxArm64
image_suffix: RaspberryPi
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/v2024.0.4/photonvision_raspi.img.xz
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_raspi.img.xz
cpu: cortex-a7
image_additional_mb: 0
- os: ubuntu-latest
- os: ubuntu-24.04
artifact-name: LinuxArm64
image_suffix: limelight2
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/v2024.0.4/photonvision_limelight.img.xz
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_limelight.img.xz
cpu: cortex-a7
image_additional_mb: 0
- os: ubuntu-latest
- os: ubuntu-24.04
artifact-name: LinuxArm64
image_suffix: limelight3
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_limelight3.img.xz
cpu: cortex-a7
image_additional_mb: 0
- os: ubuntu-24.04
artifact-name: LinuxArm64
image_suffix: limelight3G
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_limelight3g.img.xz
cpu: cortex-a7
image_additional_mb: 0
- os: ubuntu-24.04
artifact-name: LinuxArm64
image_suffix: limelight4
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_limelight4.img.xz
cpu: cortex-a76
image_additional_mb: 0
- os: ubuntu-24.04
artifact-name: LinuxArm64
image_suffix: luma_p1
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_luma_p1.img.xz
cpu: cortex-a76
image_additional_mb: 0
- os: ubuntu-24.04
artifact-name: LinuxArm64
image_suffix: orangepi5
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/v2024.0.4/photonvision_opi5.img.xz
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_opi5.img.xz
cpu: cortex-a8
image_additional_mb: 4096
image_additional_mb: 1024
- os: ubuntu-24.04
artifact-name: LinuxArm64
image_suffix: orangepi5b
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_opi5b.img.xz
cpu: cortex-a8
image_additional_mb: 1024
- os: ubuntu-24.04
artifact-name: LinuxArm64
image_suffix: orangepi5plus
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_opi5plus.img.xz
cpu: cortex-a8
image_additional_mb: 1024
- os: ubuntu-24.04
artifact-name: LinuxArm64
image_suffix: orangepi5pro
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_opi5pro.img.xz
cpu: cortex-a8
image_additional_mb: 1024
- os: ubuntu-24.04
artifact-name: LinuxArm64
image_suffix: orangepi5max
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_opi5max.img.xz
cpu: cortex-a8
image_additional_mb: 1024
- os: ubuntu-24.04
artifact-name: LinuxArm64
image_suffix: rock5c
image_url: https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_rock5c.img.xz
cpu: cortex-a8
image_additional_mb: 1024
runs-on: ${{ matrix.os }}
name: "Build image - ${{ matrix.image_url }}"
name: "Build image - ${{ matrix.image_suffix }}"
steps:
- name: Checkout code
@@ -299,7 +497,7 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: jar-${{ matrix.artifact-name }}
- uses: pguyot/arm-runner-action@v2
- uses: pguyot/arm-runner-action@HEAD
name: Generate image
id: generate_image
with:
@@ -307,6 +505,8 @@ jobs:
image_additional_mb: ${{ matrix.image_additional_mb }}
optimize_image: yes
cpu: ${{ matrix.cpu }}
# We do _not_ wanna copy photon into the image. Bind mount instead
bind_mount_repository: true
commands: |
chmod +x scripts/armrunner.sh
./scripts/armrunner.sh
@@ -321,32 +521,84 @@ jobs:
with:
name: image-${{ matrix.image_suffix }}
path: photonvision*.xz
build-rubik-image:
needs: [build-package]
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-24.04
name: "Build image - Rubik Pi 3"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: jar-LinuxArm64
- name: Generate image
run: |
wget https://raw.githubusercontent.com/PhotonVision/photon-image-modifier/refs/tags/$IMAGE_VERSION/mount_rubikpi3.sh
chmod +x mount_rubikpi3.sh
./mount_rubikpi3.sh https://github.com/PhotonVision/photon-image-modifier/releases/download/$IMAGE_VERSION/photonvision_rubikpi3.tar.xz /tmp/build/scripts/armrunner.sh
- name: Compress image
run: |
new_jar=$(realpath $(find . -name photonvision\*-linuxarm64.jar))
new_image_name=$(basename "${new_jar/.jar/_rubikpi3.img}")
mv photonvision_rubikpi3 $new_image_name
tar -I 'xz -T0' -cf ${new_image_name}.tar.xz $new_image_name --checkpoint=10000 --checkpoint-action=echo='%T'
- uses: actions/upload-artifact@v4
name: Upload image
with:
name: image-rubikpi3
path: photonvision*.xz
release:
needs: [build-package, build-image]
needs: [build-photonlib-vendorjson, build-package, build-image, build-rubik-image, combine]
runs-on: ubuntu-22.04
steps:
# Download literally every single artifact. This also downloads client and docs,
# but the filtering below won't pick these up (I hope)
# Download all fat JARs
- uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: jar-*
# Download offline photonlib
- uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: photonlib-offline
# Download vendor json
- uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: photonlib-vendor-json
# Download all images
- uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: image-*
- run: find
# Push to dev release
- uses: pyTooling/Actions/releaser@r0
- uses: pyTooling/Actions/releaser@r6
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: 'Dev'
rm: true
snapshots: false
files: |
**/*.xz
**/*.jar
**/*linux*.jar
**/*win*.jar
**/photonlib*.json
**/photonlib*.zip
if: github.event_name == 'push'
# Upload all jars and xz archives
- uses: softprops/action-gh-release@v1
- name: Create Vendor JSON Repo PR
uses: wpilibsuite/vendor-json-repo/.github/actions/add_vendordep@main
with:
files: |
**/*.xz
**/*.jar
**/photonlib*.json
if: startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
repo: PhotonVision/vendor-json-repo
token: ${{ secrets.VENDOR_JSON_REPO_PUSH_TOKEN }}
vendordep_file: ${{ github.workspace }}/photonlib-${{ github.ref_name }}.json
pr_title: Update photonlib to ${{ github.ref_name }}
pr_branch: photonlib-${{ github.ref_name }}
if: github.repository == 'PhotonVision/photonvision' && startsWith(github.ref, 'refs/tags/v')

View File

@@ -1,92 +0,0 @@
name: Documentation
on:
push:
# For now, run on all commits to master
branches: [ master ]
# and also all tags starting with v
tags:
- 'v*'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-client:
name: "PhotonClient Build"
defaults:
run:
working-directory: photon-client
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Dependencies
run: npm ci
- name: Build Production Client
run: npm run build-demo
- uses: actions/upload-artifact@v4
with:
name: built-client
path: photon-client/dist/
run_docs:
runs-on: "ubuntu-22.04"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --tags --force
- name: Install Java 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- name: Build javadocs/doxygen
run: |
chmod +x gradlew
./gradlew docs:generateJavaDocs docs:doxygen
- uses: actions/upload-artifact@v4
with:
name: built-docs
path: docs/build/docs
release:
needs: [build-client, run_docs]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
steps:
# Download literally every single artifact.
- uses: actions/download-artifact@v4
- run: find .
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

14
.github/workflows/labeler.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
name: "Pull Request Labeler"
on:
- pull_request_target
jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
sync-labels: true

View File

@@ -1,34 +1,37 @@
name: Lint and Format
on:
# Run on pushes to main and pushed tags, and on pull requests against main, but ignore the docs folder
push:
branches: [ master ]
tags:
- 'v*'
pull_request:
branches: [ master ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
wpiformat:
name: "wpiformat"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Fetch all history and metadata
run: |
git fetch --prune --unshallow
git checkout -b pr
git branch -f master origin/master
git branch -f main origin/main
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.11
- name: Install wpiformat
run: pip3 install wpiformat
run: pip3 install wpiformat==2025.75
- name: Run
run: wpiformat
- name: Check output
@@ -36,25 +39,25 @@ jobs:
- name: Generate diff
run: git diff HEAD > wpiformat-fixes.patch
if: ${{ failure() }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wpiformat fixes
path: wpiformat-fixes.patch
if: ${{ failure() }}
javaformat:
name: "Java Formatting"
needs: [validation]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- run: |
chmod +x gradlew
./gradlew spotlessCheck
- run: ./gradlew spotlessCheck
name: Run spotless
client-lint-format:
name: "PhotonClient Lint and Formatting"
@@ -63,26 +66,20 @@ jobs:
working-directory: photon-client
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
node-version: 18
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: photon-client/pnpm-lock.yaml
- name: Install Dependencies
run: npm ci
run: pnpm i --frozen-lockfile
- name: Check Linting
run: npm run lint-ci
run: pnpm run lint-ci
- name: Check Formatting
run: npm run format-ci
server-index:
name: "Check server index.html not changed"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Fetch all history and metadata
run: |
git fetch --prune --unshallow
git checkout -b pr
git branch -f master origin/master
- name: Check index.html not changed
run: git --no-pager diff --exit-code origin/master photon-server/src/main/resources/web/index.html
run: pnpm run format-ci

150
.github/workflows/photon-api-docs.yml vendored Normal file
View File

@@ -0,0 +1,150 @@
name: Photon API Documentation
on:
# Run on pushes to main and pushed tags, and on pull requests against main, but ignore the docs folder
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
build_demo:
name: Build PhotonClient Demo
defaults:
run:
working-directory: photon-client
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: photon-client/pnpm-lock.yaml
- name: Install Dependencies
run: pnpm i --frozen-lockfile
- name: Build Production Client
run: pnpm run build-demo
- uses: actions/upload-artifact@v4
with:
name: demo
path: photon-client/dist/
run_java_cpp_docs:
name: Build Java and C++ API Docs
needs: [validation]
runs-on: "ubuntu-22.04"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --tags --force
- name: Install Java 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Build javadocs/doxygen
run: |
chmod +x gradlew
./gradlew photon-docs:generateJavaDocs photon-docs:doxygen
- uses: actions/upload-artifact@v4
with:
name: docs-java-cpp
path: photon-docs/build/docs
run_py_docs:
name: Build Python API Docs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r photon-lib/py/docs/requirements.txt
- name: Build Sphinx site
run: |
sphinx-apidoc -o docs/source photonlibpy
make -C docs html
working-directory: photon-lib/py
- name: Upload built site as artifact
uses: actions/upload-artifact@v4
with:
name: docs-python
path: photon-lib/py/docs/build/html
publish_api_docs:
name: Publish API Docs
needs: [ run_java_cpp_docs, run_py_docs ]
runs-on: ubuntu-22.04
steps:
# Download docs artifact
- uses: actions/download-artifact@v4
with:
pattern: docs-*
- run: find .
- name: Publish Docs To Development
# if: github.ref == 'refs/heads/main'
uses: up9cloud/action-rsync@v1.4
env:
HOST: ${{ secrets.WEBMASTER_SSH_HOST }}
USER: ${{ secrets.WEBMASTER_SSH_USERNAME }}
KEY: ${{secrets.WEBMASTER_SSH_KEY}}
TARGET: /var/www/html/photonvision-docs/development/
- name: Publish Docs To Release
if: startsWith(github.ref, 'refs/tags/v')
uses: up9cloud/action-rsync@v1.4
env:
HOST: ${{ secrets.WEBMASTER_SSH_HOST }}
USER: ${{ secrets.WEBMASTER_SSH_USERNAME }}
KEY: ${{ secrets.WEBMASTER_SSH_KEY }}
TARGET: /var/www/html/photonvision-docs/release/
publish_demo:
name: Publish PhotonClient Demo
needs: [build_demo]
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v4
with:
name: demo
- run: find .
- name: Publish demo
if: github.ref == 'refs/heads/main'
uses: up9cloud/action-rsync@v1.4
env:
HOST: ${{ secrets.WEBMASTER_SSH_HOST }}
USER: ${{ secrets.WEBMASTER_SSH_USERNAME }}
KEY: ${{ secrets.WEBMASTER_SSH_KEY }}
TARGET: /var/www/html/photonvision-demo

51
.github/workflows/photonvision-rtd.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: PhotonVision ReadTheDocs Checks
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
name: Build and Check Docs
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install and upgrade pip
run: python -m pip install --upgrade pip
- name: Install graphviz
run: |
sudo apt-get update
sudo apt-get -y install graphviz
- name: Install Python dependencies
working-directory: docs
run: |
pip install sphinx sphinx_rtd_theme sphinx-tabs sphinxext-opengraph doc8
pip install -r requirements.txt
- name: Check links
working-directory: docs
run: make linkcheck
continue-on-error: true
- name: Check lint
working-directory: docs
run: make lint
- name: Compile HTML
working-directory: docs
run: make html

View File

@@ -5,15 +5,15 @@ permissions:
on:
push:
branches: [ master ]
tags:
- 'v*'
pull_request:
branches: [ master ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
buildAndDeploy:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout code
@@ -29,7 +29,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel pytest
pip install setuptools wheel pytest mypy mkdocs mkdocs-gen-files
- name: Build wheel
working-directory: ./photon-lib/py
@@ -42,6 +42,14 @@ jobs:
pip install --no-cache-dir dist/*.whl
pytest
# Disable due to robotpy issue. See
# https://github.com/PhotonVision/photonvision/issues/1968
# - name: Run mypy type checking
# uses: liskin/gh-problem-matcher-wrap@v3
# with:
# linters: mypy
# run: |
# mypy --show-column-numbers --config-file photon-lib/py/pyproject.toml photon-lib
- name: Upload artifacts
uses: actions/upload-artifact@master

58
.github/workflows/website.yml vendored Normal file
View File

@@ -0,0 +1,58 @@
name: Website
on:
push:
pull_request:
jobs:
rsync:
name: Build and Sync Files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: website/pnpm-lock.yaml
- name: Install packages
run: pnpm i --frozen-lockfile
working-directory: website
- name: Build project
run: pnpm run build
working-directory: website
- uses: up9cloud/action-rsync@v1.4
if: github.ref == 'refs/heads/main'
env:
HOST: ${{ secrets.WEBMASTER_SSH_HOST }}
USER: ${{ secrets.WEBMASTER_SSH_USERNAME }}
KEY: ${{secrets.WEBMASTER_SSH_KEY}}
SOURCE: website/dist/*
TARGET: /var/www/html/photonvision-website
format-check:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: website/pnpm-lock.yaml
- name: Install Packages
run: pnpm i --frozen-lockfile
working-directory: website
- name: Run Formatting Check
run: pnpm prettier -c .
working-directory: website

52
.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/*
!.vscode/settings.json
# 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,33 +119,16 @@ compile_commands.json
.clangd/
.cache/
New client/photon-client/*
*.prefs
*.jfr
.DS_Store
# *.iml
photon-server/build
photon-server/photon-vision
photon-server/src/main/resources/web
photon-server/src/main/java/org/photonvision/PhotonVersion.java
photon-server/src/main/generated/native/include/org_photonvision_raspi_PicamJNI.h
*.bin
.gradle
.gradle/*
photonvision_config
build/spotlessJava
build/*
build
photon-lib/src/main/java/org/photonvision/PhotonVersion.java
photon-lib/bin/main/images/*
/photonlib-java-examples/bin/
photon-lib/src/generate/native/include/PhotonVersion.h
.gitattributes
lib/*
photon-server/lib/libapriltag.so
photon-server/bin/main/nativelibraries/apriltag/*
photon-server/src/main/resources/nativelibraries/apriltag/*
bin*/
build*/
photonlib-java-examples/*/vendordeps/*
photonlib-cpp-examples/*/vendordeps/*
@@ -161,6 +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/index.html
venv
.venv/*
.venv
networktables.json
# Web stuff
photon-server/src/main/resources/web/*
node_modules
dist
components.d.ts
# Py docs stuff
photon-lib/py/docs/build
photon-server/src/main/resources/web/index.html

1
.python-version Normal file
View File

@@ -0,0 +1 @@
3.11

30
.readthedocs.yaml Normal file
View File

@@ -0,0 +1,30 @@
version: 2
sphinx:
builder: html
configuration: docs/source/conf.py
fail_on_warning: true
build:
os: ubuntu-22.04
tools:
python: "3.11"
apt_packages:
- graphviz
jobs:
post_checkout:
# Cancel building pull requests when there aren't changed in the docs directory or YAML file.
# You can add any other files or directories that you'd like here as well,
# like your docs requirements file, or other files that will change your docs build.
#
# If there are no changes (git diff exits with 0) we force the command to return with 183.
# This is a special exit code on Read the Docs that will cancel the build immediately.
- |
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/master -- docs/ .readthedocs.yaml;
then
exit 183;
fi
python:
install:
- requirements: docs/requirements.txt

View File

@@ -1,33 +0,0 @@
cppHeaderFileInclude {
\.h$
\.hpp$
\.inc$
\.inl$
}
cppSrcFileInclude {
\.cpp$
}
modifiableFileExclude {
\.jpg$
\.jpeg$
\.png$
\.gif$
\.so$
\.dll$
\.webp$
\.ico$
gradlew
}
includeProject {
^photonLib/
}
includeOtherLibs {
^frc/
^networktables/
^units/
^wpi/
}

5
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.cwd": "photon-lib/py"
}

25
.wpiformat Normal file
View File

@@ -0,0 +1,25 @@
cppHeaderFileInclude {
\.h$
}
modifiableFileExclude {
\.dll$
\.gif$
\.ico$
\.jpeg$
\.jpg$
\.mp4$
\.pdf$
\.png$
\.rknn$
\.so$
\.svg$
\.tflite$
\.ttf$
\.webp$
\.woff2$
gradlew
photon-lib/py/photonlibpy/generated/
photon-targeting/src/generated/
photon-targeting/src/main/native/cpp/photon/constrained_solvepnp/generate/
}

105
README.md
View File

@@ -1,10 +1,10 @@
# Photon Vision
# PhotonVision
[![CI](https://github.com/PhotonVision/photonvision/workflows/CI/badge.svg)](https://github.com/PhotonVision/photonvision/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/PhotonVision/photonvision/branch/master/graph/badge.svg)](https://codecov.io/gh/PhotonVision/photonvision) [![Discord](https://img.shields.io/discord/725836368059826228?color=%23738ADB&label=Join%20our%20Discord&logo=discord&logoColor=white)](https://discord.gg/wYxTwym)
[![Discord](https://img.shields.io/discord/725836368059826228?color=%23738ADB&label=Join%20our%20Discord&logo=discord&logoColor=white)](https://discord.gg/wYxTwym)
PhotonVision is the free, fast, and easy-to-use computer vision solution for the *FIRST* Robotics Competition. You can read an overview of our features [on our website](https://photonvision.org). You can find our comprehensive documentation [here](https://docs.photonvision.org).
A copy of the latest Raspberry Pi image is available [here](https://github.com/PhotonVision/photon-pi-gen/releases). A copy of the latest standalone JAR is available [here](https://github.com/PhotonVision/photonvision/releases). If you are a Gloworm user you can find the latest Gloworm image [here](https://github.com/gloworm-vision/pi-gen/releases).
The latest release of platform-specific jars and images is found [here](https://github.com/PhotonVision/photonvision/releases).
If you are interested in contributing code or documentation to the project, please [read our getting started page for contributors](https://docs.photonvision.org/en/latest/docs/contributing/index.html) and **[join the Discord](https://discord.gg/wYxTwym) to introduce yourself!** We hope to provide a welcoming community to anyone who is interested in helping.
@@ -14,54 +14,44 @@ If you are interested in contributing code or documentation to the project, plea
<img src="https://contrib.rocks/image?repo=PhotonVision/photonvision" />
</a>
## Documentation
- Our main documentation page: [docs.photonvision.org](https://docs.photonvision.org)
- Photon UI demo: [http://photonvision.global/](http://photonvision.global/)
- Javadocs: [javadocs.photonvision.org](https://javadocs.photonvision.org)
- C++ Doxygen [cppdocs.photonvision.org](https://cppdocs.photonvision.org)
- Python Documentation [pydocs.photonvision.org](https://pydocs.photonvision.org)
## Building
Gradle is used for all C++ and Java code, and pnpm is used for the web UI. Instructions to compile PhotonVision yourself can be found [in our docs](https://docs.photonvision.org/en/latest/docs/contributing/building-photon.html#compiling-instructions).
You can run one of the many built in examples straight from the command line, too! They contain a fully featured robot project, and some include simulation support. The projects can be found inside the [`photonlib-java-examples`](photonlib-java-examples) and [`photonlib-cpp-examples`](photonlib-cpp-examples) subdirectories, respectively. Instructions for running these examples directly from the repo are found [in the docs](https://docs.photonvision.org/en/latest/docs/contributing/building-photon.html#running-examples).
## Gradle Arguments
Note that these are case sensitive!
* `-PArchOverride=foobar`: builds for a target system other than your current architecture. Valid overrides are:
* linuxathena
* linuxarm32
* `-PArchOverride=foobar`: builds for a target system other than your current architecture. [Valid overrides](https://github.com/wpilibsuite/wpilib-tool-plugin/blob/main/src/main/java/edu/wpi/first/tools/NativePlatforms.java) are:
* winx32
* winx64
* winarm64
* macx64
* macarm64
* linuxx64
* linuxarm64
* arm32
* arm64
* x86-64
* x86
- `-PtgtIp`: Specifies where `./gradlew deploy` should try to copy the fat JAR to
* linuxathena
- `-PtgtIP`: Specifies where `./gradlew deploy` should try to copy the fat JAR to
- `-PtgtUser`: Specifies custom username for `./gradlew deploy` to SSH into
- `-PtgtPw`: Specifies custom password for `./gradlew deploy` to SSH into
- `-Pprofile`: enables JVM profiling
- `-PwithSanitizers`: On Linux, enables `-fsanitize=address,undefined,leak`
## Building
Gradle is used for all C++ and Java code, and NPM is used for the web UI. Instructions to compile PhotonVision yourself can be found [in our docs](https://docs.photonvision.org/en/latest/docs/contributing/photonvision/build-instructions.html?highlight=npm%20install#compiling-instructions).
You can run one of the many built in examples straight from the command line, too! They contain a fully featured robot project, and some include simulation support. The projects can be found inside the `photonlib-java-examples` and `photonlib-cpp-examples` subdirectories, respectively. The projects currently available include:
- photonlib-java-examples:
- aimandrange:simulateJava
- aimattarget:simulateJava
- getinrange:simulateJava
- simaimandrange:simulateJava
- simposeest:simulateJava
- photonlib-cpp-examples:
- aimandrange:simulateNative
- getinrange:simulateNative
To run them, use the commands listed below. Photonlib must first be published to your local maven repository, then the `copyPhotonlib` task will copy the generated vendordep json file into each example. After that, the simulateJava/simulateNative task can be used like a normal robot project. Robot simulation with attached debugger is technically possible by using simulateExternalJava and modifying the launch script it exports, though unsupported.
```
~/photonvision$ ./gradlew publishToMavenLocal
~/photonvision$ cd photonlib-java-examples
~/photonvision/photonlib-java-examples$ ./gradlew copyPhotonlib
~/photonvision/photonlib-java-examples$ ./gradlew <example-name>:simulateJava
~/photonvision$ cd photonlib-cpp-examples
~/photonvision/photonlib-cpp-examples$ ./gradlew copyPhotonlib
~/photonvision/photonlib-cpp-examples$ ./gradlew <example-name>:simulateNative
```
If you're cross-compiling, you'll need the wpilib toolchain installed. This can be done via Gradle: for example `./gradlew installArm64Toolchain` or `./gradlew installRoboRioToolchain`
## Out-of-Source Dependencies
PhotonVision uses the following additonal out-of-source repositories for building code.
PhotonVision uses the following additional out-of-source repositories for building code.
- Base system images for Raspberry Pi & Orange Pi: https://github.com/PhotonVision/photon-image-modifier
- C++ driver for Raspberry Pi CSI cameras: https://github.com/PhotonVision/photon-libcamera-gl-driver
@@ -69,12 +59,19 @@ PhotonVision uses the following additonal out-of-source repositories for buildin
- Custom build of OpenCV with GStreamer/Protobuf/other custom flags: https://github.com/PhotonVision/thirdparty-opencv
- JNI code for aruco-nano: https://github.com/PhotonVision/aruconano-jni
## Additional packages
For now, using mrcal requires installing these additional packages on Linux systems:
```
sudo apt install libcholmod3 liblapack3 libsuitesparseconfig5
```
## Acknowledgments
PhotonVision was forked from [Chameleon Vision](https://github.com/Chameleon-Vision/chameleon-vision/). Thank you to everyone who worked on the original project.
* [WPILib](https://github.com/wpilibsuite) - Specifically [cscore](https://github.com/wpilibsuite/allwpilib/tree/master/cscore), [CameraServer](https://github.com/wpilibsuite/allwpilib/tree/master/cameraserver), [NTCore](https://github.com/wpilibsuite/allwpilib/tree/master/ntcore), and [OpenCV](https://github.com/wpilibsuite/thirdparty-opencv).
* [WPILib](https://github.com/wpilibsuite) - Specifically [cscore](https://github.com/wpilibsuite/allwpilib/tree/main/cscore), [CameraServer](https://github.com/wpilibsuite/allwpilib/tree/main/cameraserver), [NTCore](https://github.com/wpilibsuite/allwpilib/tree/main/ntcore), and [OpenCV](https://github.com/wpilibsuite/thirdparty-opencv).
* [Apache Commons](https://commons.apache.org/) - Specifically [Commons Math](https://commons.apache.org/proper/commons-math/), and [Commons Lang](https://commons.apache.org/proper/commons-lang/)
@@ -85,25 +82,9 @@ PhotonVision was forked from [Chameleon Vision](https://github.com/Chameleon-Vis
* [FasterXML](https://github.com/FasterXML) - Specifically [jackson](https://github.com/FasterXML/jackson)
## License
PhotonVision is licensed under the [GNU General Public License](https://www.gnu.org/licenses/gpl-3.0.html)
PhotonVision is licensed under the [GNU General Public License](https://www.gnu.org/licenses/gpl-3.0.html).
## Meeting Notes
Our meeting notes can be found in the wiki section of this repository.
* [2020 Meeting Notes](https://github.com/PhotonVision/photonvision/wiki/2020-Meeting-Notes)
* [2021 Meeting Notes](https://github.com/PhotonVision/photonvision/wiki/2021-Meeting-Notes)
## Additional packages
For now, using mrcal requires installing these additional packages on Linux systems:
```
sudo apt install libcholmod3 liblapack3 libsuitesparseconfig5
```
## Documentation
- Our main documentation page: [docs.photonvision.org](https://docs.photonvision.org)
- Photon UI demo: [demo.photonvision.org](https://demo.photonvision.org) (or [manual link](https://photonvision.github.io/photonvision/built-client/))
- Javadocs: [javadocs.photonvision.org](https://javadocs.photonvision.org) (or [manual link](https://photonvision.github.io/photonvision/built-docs/javadoc/))
- C++ Doxygen [cppdocs.photonvision.org](https://cppdocs.photonvision.org) (or [manual link](https://photonvision.github.io/photonvision/built-docs/doxygen/html/))
Our [meeting notes](https://github.com/PhotonVision/photonvision/wiki/PhotonVision-Meeting-Notes) can be found in the wiki section of this repository.

View File

@@ -1,35 +1,48 @@
import edu.wpi.first.toolchain.*
plugins {
id "com.diffplug.spotless" version "6.22.0"
id "edu.wpi.first.NativeUtils" version "2024.6.1" apply false
id "cpp"
id "com.diffplug.spotless" version "6.24.0"
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
id "edu.wpi.first.GradleRIO" version "2024.1.1"
id "edu.wpi.first.GradleRIO" version "2025.3.2"
id 'edu.wpi.first.WpilibTools' version '1.3.0'
id 'com.google.protobuf' version '0.9.4' apply false
id 'com.google.protobuf' version '0.9.3' apply false
id 'edu.wpi.first.GradleJni' version '1.1.0'
id "org.ysb33r.doxygen" version "2.0.0" apply false
id 'com.gradleup.shadow' version '8.3.4' apply false
id "com.github.node-gradle.node" version "7.0.1" apply false
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven { url = "https://maven.photonvision.org/repository/internal/" }
maven { url = "https://maven.photonvision.org/repository/snapshots/" }
maven { url = "https://maven.photonvision.org/releases" }
maven { url = "https://maven.photonvision.org/snapshots" }
maven { url = "https://jogamp.org/deployment/maven/" }
}
wpilibRepositories.addAllReleaseRepositories(it)
wpilibRepositories.addAllDevelopmentRepositories(it)
}
ext.localMavenURL = file("$project.buildDir/outputs/maven")
ext.allOutputsFolder = file("$project.buildDir/outputs")
// Configure the version number.
apply from: "versioningHelper.gradle"
ext {
wpilibVersion = "2024.1.1"
wpilibVersion = "2025.3.2"
wpimathVersion = wpilibVersion
openCVversion = "4.8.0-2"
joglVersion = "2.4.0-rc-20200307"
javalinVersion = "5.6.2"
photonGlDriverLibVersion = "dev-v2023.1.0-9-g75fc678"
frcYear = "2024"
mrcalVersion = "dev-v2024.0.0-7-gc976aaa";
openCVYear = "2025"
openCVversion = "4.10.0-3"
javalinVersion = "6.7.0"
libcameraDriverVersion = "v2025.0.4"
rknnVersion = "dev-v2025.0.0-5-g666c0c6"
rubikVersion = "dev-v2025.1.0-6-g4a5e508"
frcYear = "2025"
mrcalVersion = "v2025.0.0";
pubVersion = versionString
isDev = pubVersion.startsWith("dev")
@@ -46,13 +59,17 @@ ext {
println("Building for platform " + jniPlatform + " wpilib: " + wpilibNativeName)
println("Using Wpilib: " + wpilibVersion)
println("Using OpenCV: " + openCVversion)
photonMavenURL = 'https://maven.photonvision.org/' + (isDev ? 'snapshots' : 'releases');
println("Publishing Photonlib to " + photonMavenURL)
}
spotless {
java {
target fileTree('.') {
include '**/*.java'
exclude '**/build/**', '**/build-*/**', "photon-core\\src\\main\\java\\org\\photonvision\\PhotonVersion.java", "photon-lib\\src\\main\\java\\org\\photonvision\\PhotonVersion.java"
exclude '**/build/**', '**/build-*/**', '**/src/generated/**'
}
toggleOffOn()
googleJavaFormat()
@@ -72,20 +89,10 @@ spotless {
trimTrailingWhitespace()
endWithNewline()
}
format 'xml', {
target fileTree('.') {
include '**/*.xml'
exclude '**/build/**', '**/build-*/**', "**/.idea/**"
}
eclipseWtp('xml')
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
format 'misc', {
target fileTree('.') {
include '**/*.md', '**/.gitignore'
exclude '**/build/**', '**/build-*/**'
exclude '**/build/**', '**/build-*/**', '**/node_modules/**'
}
trimTrailingWhitespace()
indentWithSpaces(2)
@@ -94,5 +101,23 @@ spotless {
}
wrapper {
gradleVersion '8.4'
gradleVersion = '8.14.3'
}
ext.getCurrentArch = {
return NativePlatforms.desktop
}
subprojects {
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
options.encoding = 'UTF-8'
}
// Enables UTF-8 support in Javadoc
tasks.withType(Javadoc) {
options.addStringOption("charset", "utf-8")
options.addStringOption("docencoding", "utf-8")
options.addStringOption("encoding", "utf-8")
}
}

View File

@@ -1,19 +1,17 @@
import argparse
import base64
from dataclasses import dataclass
import json
import os
from typing import Union
import cv2
import numpy as np
from dataclasses import dataclass
import mrcal
import numpy as np
from wpimath.geometry import Quaternion as _Quat
@dataclass
class Size:
width: int
height: int
width: float
height: float
@dataclass
@@ -24,14 +22,6 @@ class JsonMatOfDoubles:
data: list[float]
@dataclass
class JsonMat:
rows: int
cols: int
type: int
data: str # Base64-encoded PNG data
@dataclass
class Point2:
x: float
@@ -84,8 +74,7 @@ class Observation:
# If we should use this observation when re-calculating camera calibration
includeObservationInCalibration: bool
snapshotName: str
# The actual image the snapshot is from
snapshotData: JsonMat
snapshotDataLocation: str
@dataclass
@@ -97,6 +86,7 @@ class CameraCalibration:
calobjectWarp: list[float]
calobjectSize: Size
calobjectSpacing: float
lensmodel: str
def __convert_cal_to_mrcal_cameramodel(
@@ -127,6 +117,13 @@ def __convert_cal_to_mrcal_cameramodel(
]
return np.concatenate((r, t))
imagersize = (int(cal.resolution.width), int(cal.resolution.height))
def fill_missing_corners(observations: list[list[float]], width: int, height: int):
num_corners = width * height
observations += [[0, 0, -1] for x in range(num_corners - len(observations))]
return observations
imagersize = (cal.resolution.width, cal.resolution.height)
# Always weight=1 for Photon data
@@ -135,8 +132,12 @@ def __convert_cal_to_mrcal_cameramodel(
[
# note that we expect row-major observations here. I think this holds
np.array(
list(map(lambda it: [it.x, it.y, WEIGHT], o.locationInImageSpace))
).reshape((cal.calobjectSize.width, cal.calobjectSize.height, 3))
fill_missing_corners(
list(map(lambda it: [it.x, it.y, WEIGHT], o.locationInImageSpace)),
int(cal.calobjectSize.width),
int(cal.calobjectSize.height),
)
).reshape((int(cal.calobjectSize.width), int(cal.calobjectSize.height), 3))
for o in cal.observations
]
)
@@ -162,9 +163,9 @@ def __convert_cal_to_mrcal_cameramodel(
"indices_point_camintrinsics_camextrinsics": None,
"lensmodel": model,
"imagersizes": np.array([imagersize], dtype=np.int32),
"calobject_warp": np.array(cal.calobjectWarp)
if len(cal.calobjectWarp) > 0
else None,
"calobject_warp": (
np.array(cal.calobjectWarp) if len(cal.calobjectWarp) > 0 else None
),
# We always do all the things
"do_optimize_intrinsics_core": True,
"do_optimize_intrinsics_distortions": True,
@@ -206,14 +207,6 @@ def convert_photon_to_mrcal(photon_cal_json_path: str, output_folder: str):
if not os.path.exists(output_folder):
os.makedirs(output_folder)
# Decode each image and save it as a png
for obs in camera_cal_data.observations:
image = obs.snapshotData.data
decoded_data = base64.b64decode(image)
np_data = np.frombuffer(decoded_data, np.uint8)
img = cv2.imdecode(np_data, cv2.IMREAD_UNCHANGED)
cv2.imwrite(f"{output_folder}/{obs.snapshotName}", img)
# And create a VNL file for use with mrcal
with open(f"{output_folder}/corners.vnl", "w+") as vnl_file:
vnl_file.write("# filename x y level\n")

395
docs/LICENSE Normal file
View File

@@ -0,0 +1,395 @@
Attribution 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More_considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution 4.0 International Public License ("Public License"). To the
extent this Public License may be interpreted as a contract, You are
granted the Licensed Rights in consideration of Your acceptance of
these terms and conditions, and the Licensor grants You such rights in
consideration of benefits the Licensor receives from making the
Licensed Material available under these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
d. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
g. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's
License You apply must not prevent recipients of the Adapted
Material from complying with this Public License.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.

24
docs/Makefile Normal file
View File

@@ -0,0 +1,24 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS = -W --keep-going
SPHINXBUILD = sphinx-build
SOURCEDIR = source
LINTER = doc8
LINTEROPTS = --ignore D001 # D001 is linelength
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
lint:
@$(LINTER) $(LINTEROPTS) $(SOURCEDIR)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

9
docs/README.MD Normal file
View File

@@ -0,0 +1,9 @@
# PhotonVision ReadTheDocs
[![Documentation Status](https://readthedocs.org/projects/photonvision-docs/badge/?version=latest)](https://docs.photonvision.org/en/latest/?badge=latest)
PhotonVision is a free open-source vision processing software for FRC teams.
This repository is the source code for our ReadTheDocs documentation, which can be found [here](https://docs.photonvision.org).
[Contribution and formatting guidelines for this project](https://docs.photonvision.org/en/latest/docs/contributing/index.html)

View File

@@ -1,287 +0,0 @@
// From allwpilib/docs. Licensed under the WPILib BSD License
plugins {
id 'java'
id "org.ysb33r.doxygen" version "0.7.0"
}
evaluationDependsOn ':photon-targeting'
evaluationDependsOn ':photon-core'
evaluationDependsOn ':photon-server'
evaluationDependsOn ':photon-lib'
def baseArtifactIdCpp = 'documentation'
def artifactGroupIdCpp = 'org.photonvision.wpilibc'
def zipBaseNameCpp = '_GROUP_org.photonvision_cpp_ID_documentation_CLS'
def baseArtifactIdJava = 'documentation'
def artifactGroupIdJava = 'org.photonvision.wpilibj'
def zipBaseNameJava = '_GROUP_org.photonvision_java_ID_documentation_CLS'
def outputsFolder = file("$project.buildDir/outputs")
def cppProjectZips = []
def cppIncludeRoots = []
cppProjectZips.add(project(':photon-lib').cppHeadersZip)
cppProjectZips.add(project(':photon-targeting').cppHeadersZip)
doxygen {
// Doxygen binaries are only provided for x86_64 platforms
// Other platforms will need to provide doxygen via their system
// See below maven and https://doxygen.nl/download.html for provided binaries
String arch = System.getProperty("os.arch");
if (arch.equals("x86_64") || arch.equals("amd64")) {
executables {
doxygen version : '1.9.4',
baseURI : 'https://frcmaven.wpi.edu/artifactory/generic-release-mirror/doxygen'
}
}
}
doxygen {
generate_html true
html_extra_stylesheet 'theme.css'
cppProjectZips.each {
dependsOn it
source it.source
it.ext.includeDirs.each {
cppIncludeRoots.add(it.absolutePath)
}
}
cppIncludeRoots << '../ntcore/build/generated/main/native/include/'
if (project.hasProperty('docWarningsAsErrors')) {
// Eigen
exclude 'Eigen/**'
exclude 'unsupported/**'
// LLVM
exclude 'wpi/AlignOf.h'
exclude 'wpi/Casting.h'
exclude 'wpi/Chrono.h'
exclude 'wpi/Compiler.h'
exclude 'wpi/ConvertUTF.h'
exclude 'wpi/DenseMap.h'
exclude 'wpi/DenseMapInfo.h'
exclude 'wpi/Endian.h'
exclude 'wpi/EpochTracker.h'
exclude 'wpi/Errc.h'
exclude 'wpi/Errno.h'
exclude 'wpi/ErrorHandling.h'
exclude 'wpi/bit.h'
exclude 'wpi/fs.h'
exclude 'wpi/FunctionExtras.h'
exclude 'wpi/function_ref.h'
exclude 'wpi/Hashing.h'
exclude 'wpi/iterator.h'
exclude 'wpi/iterator_range.h'
exclude 'wpi/ManagedStatic.h'
exclude 'wpi/MapVector.h'
exclude 'wpi/MathExtras.h'
exclude 'wpi/MemAlloc.h'
exclude 'wpi/PointerIntPair.h'
exclude 'wpi/PointerLikeTypeTraits.h'
exclude 'wpi/PointerUnion.h'
exclude 'wpi/raw_os_ostream.h'
exclude 'wpi/raw_ostream.h'
exclude 'wpi/SmallPtrSet.h'
exclude 'wpi/SmallSet.h'
exclude 'wpi/SmallString.h'
exclude 'wpi/SmallVector.h'
exclude 'wpi/StringExtras.h'
exclude 'wpi/StringMap.h'
exclude 'wpi/SwapByteOrder.h'
exclude 'wpi/type_traits.h'
exclude 'wpi/VersionTuple.h'
exclude 'wpi/WindowsError.h'
// fmtlib
exclude 'fmt/**'
// libuv
exclude 'uv.h'
exclude 'uv/**'
exclude 'wpinet/uv/**'
// json
exclude 'wpi/adl_serializer.h'
exclude 'wpi/byte_container_with_subtype.h'
exclude 'wpi/detail/**'
exclude 'wpi/json.h'
exclude 'wpi/json_fwd.h'
exclude 'wpi/ordered_map.h'
exclude 'wpi/thirdparty/**'
// memory
exclude 'wpi/memory/**'
// mpack
exclude 'wpi/mpack.h'
// units
exclude 'units/**'
}
//TODO: building memory docs causes search to break
exclude 'wpi/memory/**'
exclude '*.pb.h'
// Save space by excluding protobuf and eigen
exclude 'Eigen/**'
exclude 'google/protobuf/**'
aliases 'effects=\\par <i>Effects:</i>^^',
'notes=\\par <i>Notes:</i>^^',
'requires=\\par <i>Requires:</i>^^',
'requiredbe=\\par <i>Required Behavior:</i>^^',
'concept{2}=<a href=\"md_doc_concepts.html#\1\">\2</a>',
'defaultbe=\\par <i>Default Behavior:</i>^^'
case_sense_names false
extension_mapping 'inc=C++', 'no_extension=C++'
extract_all true
extract_static true
file_patterns '*'
full_path_names true
generate_html true
generate_latex false
generate_treeview true
html_extra_stylesheet 'theme.css'
html_timestamp true
javadoc_autobrief true
project_name 'PhotonVision C++'
project_logo '../wpiutil/src/main/native/resources/wpilib-128.png'
project_number pubVersion
quiet true
recursive true
strip_code_comments false
strip_from_inc_path cppIncludeRoots as String[]
strip_from_path cppIncludeRoots as String[]
use_mathjax true
warnings false
warn_if_incomplete_doc true
warn_if_undocumented false
warn_no_paramdoc true
//enable doxygen preprocessor expansion of WPI_DEPRECATED to fix MotorController docs
enable_preprocessing true
macro_expansion true
expand_only_predef true
predefined "WPI_DEPRECATED(x)=[[deprecated(x)]]\"\\\n" +
"\"__cplusplus\"\\\n" +
"\"HAL_ENUM(name)=enum name : int32_t"
if (project.hasProperty('docWarningsAsErrors')) {
warn_as_error 'FAIL_ON_WARNINGS'
}
}
tasks.register("zipCppDocs", Zip) {
archiveBaseName = zipBaseNameCpp
destinationDirectory = outputsFolder
dependsOn doxygen
from ("$buildDir/docs/doxygen/html")
into '/'
}
// Java
configurations {
javaSource {
transitive false
}
}
ext {
sharedCvConfigs = [:]
staticCvConfigs = [:]
useJava = true
useCpp = false
skipDev = true
useDocumentation = true
}
task generateJavaDocs(type: Javadoc) {
def exportedProjects = [
':photon-core',
':photon-server',
':photon-targeting',
':photon-lib'
]
source exportedProjects.collect { project(it).sourceSets.main.allJava }
classpath = files(exportedProjects.collect { project(it).sourceSets.main.compileClasspath })
dependsOn project(':photon-core').writeCurrentVersion
options.links("https://docs.oracle.com/en/java/javase/17/docs/api/")
options.addStringOption("tag", "pre:a:Pre-Condition")
options.addBooleanOption("Xdoclint:html,missing,reference,syntax", true)
options.addBooleanOption('html5', true)
failOnError = true
title = "PhotonVision $pubVersion"
ext.entryPoint = "$destinationDir/index.html"
if (JavaVersion.current().isJava8Compatible() && project.hasProperty('docWarningsAsErrors')) {
// Treat javadoc warnings as errors.
//
// The second argument '-quiet' is a hack. The one parameter
// addStringOption() doesn't work, so we add '-quiet', which is added
// anyway by gradle. See https://github.com/gradle/gradle/issues/2354.
//
// See JDK-8200363 (https://bugs.openjdk.java.net/browse/JDK-8200363)
// for information about the nonstandard -Xwerror option. JDK 15+ has
// -Werror.
options.addStringOption('Xwerror', '-quiet')
}
if (JavaVersion.current().isJava11Compatible()) {
if (!JavaVersion.current().isJava12Compatible()) {
options.addBooleanOption('-no-module-directories', true)
}
doLast {
// This is a work-around for https://bugs.openjdk.java.net/browse/JDK-8211194. Can be removed once that issue is fixed on JDK's side
// Since JDK 11, package-list is missing from javadoc output files and superseded by element-list file, but a lot of external tools still need it
// Here we generate this file manually
new File(destinationDir, 'package-list').text = new File(destinationDir, 'element-list').text
}
}
}
tasks.register("zipJavaDocs", Zip) {
archiveBaseName = zipBaseNameJava
destinationDirectory = outputsFolder
dependsOn generateJavaDocs
from ("$buildDir/docs/javadoc")
into '/'
}
tasks.register("zipDocs") {
dependsOn zipCppDocs
dependsOn zipJavaDocs
}
apply plugin: 'maven-publish'
publishing {
publications {
java(MavenPublication) {
artifact zipJavaDocs
artifactId = "${baseArtifactIdJava}"
groupId artifactGroupIdJava
version pubVersion
}
cpp(MavenPublication) {
artifact zipCppDocs
artifactId = "${baseArtifactIdCpp}"
groupId artifactGroupIdCpp
version pubVersion
}
}
}

36
docs/make.bat Normal file
View File

@@ -0,0 +1,36 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXOPTS=-W --keep-going
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
:end
popd

59
docs/requirements.txt Normal file
View File

@@ -0,0 +1,59 @@
alabaster==0.7.16
anyio==4.9.0
babel==2.17.0
beautifulsoup4==4.13.4
certifi==2025.4.26
charset-normalizer==3.4.2
click==8.1.8
colorama==0.4.6
doc8==1.1.2
docopt==0.6.2
docutils==0.20.1
furo==2024.8.6
h11==0.16.0
idna==3.10
imagesize==1.4.1
Jinja2==3.1.6
markdown-it-py==3.0.0
MarkupSafe==3.0.2
mdit-py-plugins==0.4.2
mdurl==0.1.2
myst-parser==4.0.1
packaging==25.0
pbr==6.1.1
pipreqs==0.5.0
Pygments==2.19.1
PyYAML==6.0.2
requests==2.32.4
restructuredtext-lint==1.4.0
roman-numerals-py==3.1.0
setuptools==80.3.1
six==1.17.0
sniffio==1.3.1
snowballstemmer==3.0.0.1
soupsieve==2.7
Sphinx==8.1.3
sphinx-autobuild==2024.10.3
sphinx-basic-ng==1.0.0b2
sphinx-notfound-page==1.1.0
sphinx-rtd-theme==3.0.2
sphinx-tabs==3.4.7
sphinx_design==0.6.1
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-ghcontributors==0.2.3
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
sphinxext-opengraph==0.10.0
sphinxext-remoteliteralinclude==0.5.0
starlette==0.47.2
stevedore==5.4.1
typing_extensions==4.13.2
urllib3==2.5.0
uvicorn==0.34.2
watchfiles==1.0.5
websockets==15.0.1
yarg==0.1.9

7
docs/source/404.md Normal file
View File

@@ -0,0 +1,7 @@
---
orphan: true
---
# Requested Page Not Found
This page you were looking for was not found. If you think this is a mistake, [file an issue on our GitHub.](https://github.com/PhotonVision/photonvision-docs/issues)

20
docs/source/Makefile Normal file
View File

@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,4 @@
.code-block-caption>.headerlink, dl dt>.headerlink, h1>.headerlink, h2>.headerlink, h3>.headerlink, h4>.headerlink, h5>.headerlink, h6>.headerlink, p.caption>.headerlink, table>caption>.headerlink {
font-family: FontAwesome;
font-size: 0.75em;
}

View File

@@ -0,0 +1,6 @@
/*!
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2024 Fonticons, Inc.
*/
@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype");unicode-range:u+f003,u+f006,u+f014,u+f016-f017,u+f01a-f01b,u+f01d,u+f022,u+f03e,u+f044,u+f046,u+f05c-f05d,u+f06e,u+f070,u+f087-f088,u+f08a,u+f094,u+f096-f097,u+f09d,u+f0a0,u+f0a2,u+f0a4-f0a7,u+f0c5,u+f0c7,u+f0e5-f0e6,u+f0eb,u+f0f6-f0f8,u+f10c,u+f114-f115,u+f118-f11a,u+f11c-f11d,u+f133,u+f147,u+f14e,u+f150-f152,u+f185-f186,u+f18e,u+f190-f192,u+f196,u+f1c1-f1c9,u+f1d9,u+f1db,u+f1e3,u+f1ea,u+f1f7,u+f1f9,u+f20a,u+f247-f248,u+f24a,u+f24d,u+f255-f25b,u+f25d,u+f271-f274,u+f278,u+f27b,u+f28c,u+f28e,u+f29c,u+f2b5,u+f2b7,u+f2ba,u+f2bc,u+f2be,u+f2c0-f2c1,u+f2c3,u+f2d0,u+f2d2,u+f2d4,u+f2dc}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-v4compatibility.woff2) format("woff2"),url(../webfonts/fa-v4compatibility.ttf) format("truetype");unicode-range:u+f041,u+f047,u+f065-f066,u+f07d-f07e,u+f080,u+f08b,u+f08e,u+f090,u+f09a,u+f0ac,u+f0ae,u+f0b2,u+f0d0,u+f0d6,u+f0e4,u+f0ec,u+f10a-f10b,u+f123,u+f13e,u+f148-f149,u+f14c,u+f156,u+f15e,u+f160-f161,u+f163,u+f175-f178,u+f195,u+f1f8,u+f219,u+f27a}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

184
docs/source/conf.py Normal file
View File

@@ -0,0 +1,184 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
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
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx_rtd_theme",
"sphinx.ext.autosectionlabel",
"sphinx.ext.todo",
"notfound.extension",
"sphinxext.remoteliteralinclude",
"sphinxext.opengraph",
"sphinxcontrib.ghcontributors",
"sphinx_design",
"myst_parser",
"sphinx.ext.mathjax",
"sphinx.ext.graphviz",
]
# Configure OpenGraph support
ogp_site_url = "https://docs.photonvision.org/en/latest/"
ogp_site_name = "PhotonVision Documentation"
ogp_image = "https://raw.githubusercontent.com/PhotonVision/photonvision-docs/main/source/assets/RectLogo.png"
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# Enable hover content on glossary term
hoverxref_roles = ["term"]
# Autosection labels prefix document path and filename
autosectionlabel_prefix_document = True
# -- Options for HTML output -------------------------------------------------
html_title = "PhotonVision Docs"
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "furo"
html_favicon = "assets/RoundLogo.png"
# Specify canonical root
# This tells search engines that this domain is preferred
html_baseurl = "https://docs.photonvision.org/en/latest/"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
source_suffix = [".rst", ".md"]
def setup(app):
app.add_css_file("css/v4-font-face.min.css")
app.add_css_file("css/pv-icons.css")
pygments_style = "sphinx"
html_theme_options = {
"sidebar_hide_name": True,
"top_of_page_buttons": ["view", "edit"],
"source_edit_link": "https://github.com/PhotonVision/photonvision/edit/main/docs/source/{filename}",
"source_view_link": "https://github.com/PhotonVision/photonvision/blob/main/docs/source/{filename}",
"light_logo": "assets/PhotonVision-Header-onWhite.png",
"dark_logo": "assets/PhotonVision-Header-noBG.png",
"light_css_variables": {
"font-stack": "-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, roboto, noto, arial, sans-serif;",
"admonition-font-size": "1rem",
"admonition-title-font-size": "1rem",
"color-background-primary": "#ffffff",
"color-background-secondary": "#f7f7f7",
"color-background-hover": "#efeff400",
"color-background-hover--transparent": "#efeff400",
"color-brand-primary": "#006492",
"color-brand-content": "#006492",
"color-foreground-primary": "#2d2d2d",
"color-foreground-secondary": "#39a4d5",
"color-foreground-muted": "#2d2d2d",
"color-foreground-border": "#ffffff",
"color-background-border": "ffffff",
"color-api-overall": "#101010",
},
"dark_css_variables": {
"color-background-primary": "#242c37",
"color-background-secondary": "#006492",
"color-background-hover": "#efeff400",
"color-background-hover--transparent": "#efeff400",
"color-brand-primary": "#ffd843",
"color-brand-secondary": "#39a4d5",
"color-brand-content": "#ffd843",
"color-foreground-primary": "#ffffff",
"color-foreground-secondary": "#ffffff",
"color-foreground-muted": "#ffffff",
"color-foreground-border": "transparent",
"color-background-border": "transparent",
"color-api-overall": "#101010",
"color-inline-code-background": "#0d0d0d",
},
"footer_icons": [
{
"name": "GitHub",
"url": "https://github.com/photonvision/photonvision",
"html": """
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path>
</svg>
""",
"class": "",
},
],
}
suppress_warnings = ["epub.unknown_project_files"]
sphinx_tabs_valid_builders = ["epub", "linkcheck"]
# -- Options for linkcheck -------------------------------------------------
# Excluded links for linkcheck
# These should be periodically checked by hand to ensure that they are still functional
linkcheck_ignore = [
R"https://www.raspberrypi.com/software/",
R"http://10\..+",
R"https://www.gnu.org/",
]
token = os.environ.get("GITHUB_TOKEN", None)
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", "substitution"]

View File

@@ -0,0 +1,37 @@
# Best Practices For Competition
## Before Competition
- Ensure you have spares of the relevant electronics if you can afford it (switch, coprocessor, cameras, etc.).
- Stay on the latest version of PhotonVision until you have tested your full robot system to be functional.
- 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.
- 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.
## 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
- Use the field calibration time given at the start of the event:
- Bring your robot to the field at the allotted time.
- 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, 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.
- Do this for each coprocessor on your robot that runs PhotonVision, and name your exports with meaningful names.
- This will contain camera information/calibration, pipeline information, network settings, etc.
- In the event of software/hardware failures (IE lost SD Card, broken device), you can then use the "Import Settings" button and select "All Settings" to restore your settings.
- This effectively works as a snapshot of your PhotonVision data that can be restored at any point.
- Before every match:
- Check the ethernet and USB connectors are seated fully.
- Close streaming dashboards when you don't need them to reduce bandwidth.
- Stream at as low of a resolution as possible while still detecting AprilTags to stay within field bandwidth limits.

View File

@@ -0,0 +1,53 @@
# Filesystem Directory
PhotonVision stores and loads settings in the {code}`photonvision_config` directory, in the same folder as the PhotonVision JAR is stored. On supported hardware, this is in the {code}`/opt/photonvision` directory. The contents of this directory can be exported as a zip archive from the settings page of the interface, under "export settings". This export will contain everything detailed below. These settings can later be uploaded using "import settings", to restore configurations from previous backups.
## Directory Structure
The directory structure is outlined below.
```{image} images/configDir.png
:alt: Config directory structure
:width: 600
```
- calibImgs
- Images saved from the last run of the calibration routine
- cameras
- Contains a subfolder for each camera. This folder contains the following files:
- pipelines folder, which contains a {code}`json` file for each user-created pipeline.
- config.json, which contains all camera-specific configuration. This includes FOV, pitch, current pipeline index, and calibration data
- drivermode.json, which contains settings for the driver mode pipeline
- imgSaves
- Contains images saved with the input/output save commands.
- logs
- Contains timestamped logs in the format {code}`photonvision-YYYY-MM-D_HH-MM-SS.log`. These timestamps will likely be significantly behind the real time. Coprocessors on the robot have no way to get current time.
- hardwareSettings.json
- Contains hardware settings. Currently this includes only the LED brightness.
- networkSettings.json
- Contains network settings, including team number (or remote network tables address), static/dynamic settings, and hostname.
## Importing and Exporting Settings
The entire settings directory can be exported as a ZIP archive from the settings page.
```{raw} html
<video width="85%" controls>
<source src="../../_static/assets/import-export-settings.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
```
A variety of files can be imported back into PhotonVision:
- ZIP Archive ({code}`.zip`)
- Useful for restoring a full configuration from a different PhotonVision instance.
- Single Config File
- Currently-supported Files
- {code}`hardwareConfig.json`
- {code}`hardwareSettings.json`
- {code}`networkSettings.json`
- Useful for simple hardware or network configuration tasks without overwriting all settings.

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -0,0 +1,70 @@
# NetworkTables API
## About
:::{warning}
PhotonVision interfaces with PhotonLib, our vendor dependency, using NetworkTables. If you are running PhotonVision on a robot (ie. with a RoboRIO), you should **turn the NetworkTables server switch (in the settings tab) off** in order to get PhotonLib to work. Also ensure that you set your team number. The NetworkTables server should only be enabled if you know what you're doing!
:::
## API
:::{warning}
NetworkTables is not a supported setup/viable option when using PhotonVision as we only send one target at a time (this is problematic when using AprilTags, which will return data from multiple tags at once). We recommend using PhotonLib.
:::
The tables below contain the the name of the key for each entry that PhotonVision sends over the network and a short description of the key. The entries should be extracted from a subtable with your camera's nickname (visible in the PhotonVision UI) under the main `photonvision` table.
### Getting Target Information
| Key | Type | Description |
| --------------- | ---------- | ------------------------------------------------------------------------ |
| `rawBytes` | `byte[]` | A byte-packed string that contains target info from the same timestamp. |
| `latencyMillis` | `double` | The latency of the pipeline in milliseconds. |
| `hasTarget` | `boolean` | Whether the pipeline is detecting targets or not. |
| `targetPitch` | `double` | The pitch of the target in degrees (positive up). |
| `targetYaw` | `double` | The yaw of the target in degrees (positive right). |
| `targetArea` | `double` | The area (percent of bounding box in screen) as a percent (0-100). |
| `targetSkew` | `double` | The skew of the target in degrees (counter-clockwise positive). |
| `targetPose` | `double[]` | The pose of the target relative to the robot (x, y, z, qw, qx, qy, qz) |
| `targetPixelsX` | `double` | The target crosshair location horizontally, in pixels (origin top-right) |
| `targetPixelsY` | `double` | The target crosshair location vertically, in pixels (origin top-right) |
### Changing Settings
| Key | Type | Description |
| --------------- | --------- | --------------------------- |
| `pipelineIndex` | `int` | Changes the pipeline index. |
| `driverMode` | `boolean` | Toggles driver mode. |
### Saving Images
PhotonVision can save images to file on command. The image is saved when PhotonVision detects the command went from `false` to `true`.
PhotonVision will automatically set these back to `false` after 500ms.
Be careful saving images rapidly - it will slow vision processing performance and take up disk space very quickly.
Images are returned as part of the .zip package from the "Export" operation in the Settings tab.
| Key | Type | Description |
| ------------------ | --------- | ------------------------------------------------- |
| `inputSaveImgCmd` | `boolean` | Triggers saving the current input image to file. |
| `outputSaveImgCmd` | `boolean` | Triggers saving the current output image to file. |
:::{warning}
If you manage to make calls to these commands faster than 500ms (between calls), additional photos will not be captured.
:::
### Global Entries
These entries are global, meaning that they should be called on the main `photonvision` table.
| Key | Type | Description |
| --------- | ----- | -------------------------------------------------------- |
| `ledMode` | `int` | Sets the LED Mode (-1: default, 0: off, 1: on, 2: blink) |
:::{warning}
Setting the LED mode to -1 (default) when `multiple` cameras are connected may result in unexpected behavior. {ref}`This is a known limitation of PhotonVision. <docs/troubleshooting/common-errors:LED Control>`
Single camera operation should work without issue.
:::

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@@ -0,0 +1,18 @@
# Advanced Installation
This page will help you install PhotonVision on non-supported coprocessor.
## Step 1: Software Install
This section will walk you through how to install PhotonVision on your coprocessor. Your coprocessor is the device that has the camera and you are using to detect targets (ex. if you are using a Limelight / Raspberry Pi, that is your coprocessor and you should follow those instructions).
:::{warning}
You only need to install PhotonVision on the coprocessor/device that is being used to detect targets, you do NOT need to install it on the device you use to view the webdashboard. All you need to view the webdashboard is for a device to be on the same network as your vision coprocessor and an internet browser.
:::
```{toctree}
:maxdepth: 3
sw_install/index
prerelease-software
```

View File

@@ -0,0 +1,23 @@
# Installing Pre-Release Versions
Pre-release/development version of PhotonVision can be tested by installing/downloading artifacts from Github Actions (see below), which are built automatically on commits to open pull requests and to PhotonVision's `main` branch, or by {ref}`compiling PhotonVision locally <docs/contributing/building-photon:Build Instructions>`.
:::{warning}
If testing a pre-release version of PhotonVision with a robot, PhotonLib must be updated to match the version downloaded! If not, packet schema definitions may not match and unexpected things will occur. To update PhotonLib, refer to {ref}`installing specific version of PhotonLib<docs/programming/photonlib/adding-vendordep:Install Specific Version - Java/C++>`.
:::
GitHub Actions builds pre-release version of PhotonVision automatically on PRs and on each commit merged to main. To test a particular commit to main, navigate to the [PhotonVision commit list](https://github.com/PhotonVision/photonvision/commits/main/) and click on the check mark (below). Scroll to "Build / Build fat JAR - PLATFORM", click details, and then summary. From here, JAR and image files can be downloaded to be flashed or uploaded using "Offline Update".
```{image} images/gh_actions_1.png
:alt: Github Actions Badge
```
```{image} images/gh_actions_2.png
:alt: Github Actions artifact list
```
Built JAR files (but not image files) can also be downloaded from PRs before they are merged. Navigate to the PR in GitHub, and select Checks at the top. Click on "Build" to display the same artifact list as above.
```{image} images/gh_actions_3.png
:alt: Github Actions artifacts from PR
```

View File

@@ -0,0 +1,56 @@
# Advanced Command Line Usage
PhotonVision exposes some command line options which may be useful for customizing execution on Debian-based installations.
## Running a JAR File
Assuming `java` has been installed, and the appropriate environment variables have been set upon installation (a package manager like `apt` should automatically set these), you can use `java -jar` to run a JAR file. If you downloaded the latest stable JAR of PhotonVision from the [GitHub releases page](https://github.com/PhotonVision/photonvision/releases), you can run the following to start the program:
```bash
java -jar /path/to/photonvision/photonvision.jar
```
## Updating a JAR File
When you need to update your JAR file, run the following:
```bash
wget https://git.io/JqkQ9 -O update.sh
sudo chmod +x update.sh
sudo ./update.sh
sudo reboot now
```
## Creating a `systemd` Service
You can also create a systemd service that will automatically run on startup. To do so, first navigate to `/lib/systemd/system`. Create a file called `photonvision.service` (or name it whatever you want) using `touch photonvision.service`. Then open this file in the editor of your choice and paste the following text:
```
[Unit]
Description=Service that runs PhotonVision
[Service]
WorkingDirectory=/path/to/photonvision
# Optional: run photonvision at "nice" -10, which is higher priority than standard
# Nice=-10
ExecStart=/usr/bin/java -jar /path/to/photonvision/photonvision.jar
[Install]
WantedBy=multi-user.target
```
Then copy the `.service` file to `/etc/systemd/system/` using `cp photonvision.service /etc/systemd/system/photonvision.service`. Then modify the file to have `644` permissions using `chmod 644 /etc/systemd/system/photonvision.service`.
:::{note}
Many ARM processors have a big.LITTLE architecture where some of the CPU cores are more powerful than others. On this type of architecture, you may get more consistent performance by limiting which cores PhotonVision can use. To do this, add the parameter `AllowedCPUs` to the systemd service file in the `[Service]` section.
For instance, for an Orange Pi 5, cores 4 through 7 are the fast ones, and you can target those cores with the line `AllowedCPUs=4-7`.
:::
## Installing the `systemd` Service
To install the service, simply run `systemctl enable photonvision.service`.
:::{note}
It is recommended to reload configurations by running `systemctl daemon-reload`.
:::

View File

@@ -0,0 +1,9 @@
{
"deviceName" : "Limelight 2+",
"supportURL" : "https://limelightvision.io",
"ledPins" : [ 13, 18 ],
"ledsCanDim" : true,
"ledPWMRange" : [ 0, 100 ],
"ledPWMFrequency" : 30000,
"vendorFOV" : 75.76079874010732
}

View File

@@ -0,0 +1,7 @@
{
"deviceName" : "Limelight 2",
"supportURL" : "https://limelightvision.io",
"ledPins" : [ 17, 18 ],
"ledsCanDim" : false,
"vendorFOV" : 75.76079874010732
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -0,0 +1,21 @@
# Software Installation
## Desktop Environments
```{toctree}
:maxdepth: 1
windows-pc
linux-pc
mac-os
```
## Other
```{toctree}
:maxdepth: 1
other-coprocessors
advanced-cmd
romi
```

View File

@@ -0,0 +1,47 @@
# Linux PC Installation
PhotonVision may be run on a Debian-based Linux Desktop PC for basic testing and evaluation.
:::{note}
You do not need to install PhotonVision on a Windows PC in order to access the webdashboard (assuming you are using an external coprocessor like a Raspberry Pi).
:::
## Installing Java
PhotonVision requires a JDK installed and on the system path. JDK 17 is needed (different versions will not work). If you don't have JDK 17 already, run the following to install it:
```
$ sudo apt-get install openjdk-17-jdk
```
:::{warning}
Using a JDK other than JDK17 will cause issues when running PhotonVision and is not supported.
:::
## Downloading the Latest Stable Release of PhotonVision
Go to the [GitHub releases page](https://github.com/PhotonVision/photonvision/releases) and download the relevant .jar file for your coprocessor.
:::{note}
If your coprocessor has a 64 bit ARM based CPU architecture (OrangePi, Raspberry Pi, etc.), download the LinuxArm64.jar file.
If your coprocessor has an 64 bit x86 based CPU architecture (Mini PC, laptop, etc.), download the Linuxx64.jar file.
:::
:::{warning}
Be careful to pick the latest stable release. "Draft" or "Pre-Release" versions are not stable and often have bugs.
:::
## Running PhotonVision
To run PhotonVision, open a terminal window of your choice and run the following command:
```
$ java -jar /path/to/photonvision/photonvision-xxx.jar
```
If your computer has a compatible webcam connected, PhotonVision should startup without any error messages. If there are error messages, your webcam isn't supported or another issue has occurred. If it is the latter, please open an issue on the [PhotonVision issues page](https://github.com/PhotonVision/photonvision/issues).
## Accessing the PhotonVision Interface
Once the Java backend is up and running, you can access the main vision interface by navigating to `localhost:5800` inside your browser.

View File

@@ -0,0 +1,53 @@
# Mac OS Installation
:::{warning}
Due to current [cscore](https://github.com/wpilibsuite/allwpilib/tree/main/cscore) restrictions, the PhotonVision server backend may have issues running macOS.
:::
:::{note}
You do not need to install PhotonVision on a Mac in order to access the webdashboard (assuming you are using an external coprocessor like a Raspberry Pi).
:::
VERY Limited macOS support is available.
## Installing Java
PhotonVision requires a JDK installed and on the system path. JDK 17 is needed (different versions will not work). You may already have this if you have installed WPILib 2025+. If not, [download and install it from here](https://adoptium.net/temurin/releases?version=17).
:::{warning}
Using a JDK other than JDK17 will cause issues when running PhotonVision and is not supported.
:::
## Downloading the Latest Stable Release of PhotonVision
Go to the [GitHub releases page](https://github.com/PhotonVision/photonvision/releases) and download the relevant .jar file for your coprocessor.
:::{note}
If you have an M Series Mac, download the macarm64.jar file.
If you have an Intel based Mac, download the macx64.jar file.
:::
:::{warning}
Be careful to pick the latest stable release. "Draft" or "Pre-Release" versions are not stable and often have bugs.
:::
## Running PhotonVision
To run PhotonVision, open a terminal window of your choice and run the following command:
```
$ java -jar /path/to/photonvision/photonvision-xxx.jar
```
:::{warning}
Due to current [cscore](https://github.com/wpilibsuite/allwpilib/tree/main/cscore) restrictions, the PhotonVision using test mode is all that is known to work currently.
:::
## Accessing the PhotonVision Interface
Once the Java backend is up and running, you can access the main vision interface by navigating to `localhost:5800` inside your browser.
:::{warning}
Due to current [cscore](https://github.com/wpilibsuite/allwpilib/tree/main/cscore) restrictions, it is unlikely any streams will open from real webcams.
:::

View File

@@ -0,0 +1,39 @@
# Other Debian-Based Co-Processor Installation
:::{warning}
Working with unsupported coprocessors requires some level of "know how" of your system. The install script has only been tested on Debian/Raspberry Pi OS Buster and Ubuntu Bionic. If any issues arise with your specific OS, please open an issue on our [issues page](https://github.com/PhotonVision/photonvision/issues).
:::
:::{note}
We'd love to have your input! If you get PhotonVision working on another coprocessor, consider documenting your steps and submitting a [docs issue](https://github.com/PhotonVision/photonvision-docs/issues)., [pull request](https://github.com/PhotonVision/photonvision-docs/pulls) , or [ping us on Discord](https://discord.com/invite/wYxTwym). For example, Limelight and Romi install instructions came about because someone spent the time to figure it out, and did a writeup.
:::
## Installing PhotonVision
We provide an [install script](https://git.io/JJrEP) for other Debian-based systems (with `apt`) that will automatically install PhotonVision and make sure that it runs on startup.
```bash
$ wget https://git.io/JJrEP -O install.sh
$ sudo chmod +x install.sh
$ sudo ./install.sh
$ sudo reboot now
```
:::{note}
Your co-processor will require an Internet connection for this process to work correctly.
:::
For installation on any other co-processors, we recommend reading the {ref}`advanced command line documentation <docs/advanced-installation/sw_install/advanced-cmd:Advanced Command Line Usage>`.
## Updating PhotonVision
PhotonVision can be updated by downloading the latest jar file, copying it onto the processor, and restarting the service.
For example, from another computer, run the following commands. Substitute the correct username for "\[user\]" ( Provided images use username "pi")
```bash
$ scp [jar name].jar [user]@photonvision.local:~/
$ ssh [user]@photonvision.local
$ sudo mv [jar name].jar /opt/photonvision/photonvision.jar
$ sudo systemctl restart photonvision.service
```

View File

@@ -0,0 +1,43 @@
# Romi Installation
The [Romi](https://docs.wpilib.org/en/latest/docs/romi-robot/index.html) is a small robot that can be controlled with the WPILib software. The main controller is a Raspberry Pi that must be imaged with [WPILibPi](https://docs.wpilib.org/en/latest/docs/romi-robot/imaging-romi.html) .
## Installation
The WPILibPi image includes FRCVision, which reserves USB cameras; to use PhotonVision, we need to edit the `/home/pi/runCamera` script to disable it. First we will need to make the file system writeable; the easiest way to do this is to go to `10.0.0.2` and choose "Writable" at the top.
SSH into the Raspberry Pi (using Windows command line, or a tool like [Putty](https://www.chiark.greenend.org.uk/~sgtatham/putty/) ) at the Romi's default address `10.0.0.2`. The default user is `pi`, and the password is `raspberry`.
:::.. The following paragraph can be restored when WPILibPi becomes compatible with the current version of PhotonVision.
:::.. Follow the process for installing PhotonVision on {ref}`"Other Debian-Based Co-Processor Installation" <docs/advanced-installation/sw_install/other-coprocessors:Other Debian-Based Co-Processor Installation>`. As it mentions, this will require an internet connection so connecting the Raspberry Pi to an internet-connected router via an Ethernet cable will be the easiest solution. The pi must remain writable while you are following these steps!
:::..Temporary instructions explaining how to install the older version of PhotonVision on a Romi. Remove when no longer needed.
:::{attention}
The version of WPILibPi for the Romi is 2023.2.1, which is not compatible with the current version of PhotonVision. **If you are using WPILibPi 2023.2.1 on your Romi, you must install PhotonVision v2023.4.2 or earlier!**
To install a compatible version of PhotonVision, enter these commands in the SSH terminal connected to the Raspberry Pi. This will download and run the install script, which will install PhotonVision on your Raspberry Pi and configure it to run at startup.
```bash
$ wget https://git.io/JJrEP -O install.sh
$ sudo chmod +x install.sh
$ sudo ./install.sh -v v2023.4.2
```
The install script requires an internet connection, so connecting the Raspberry Pi to an internet-connected router via an Ethernet cable will be the easiest solution. The pi must remain writable while you are following these steps!
:::
:::..End of temporary instructions.
Next, from the SSH terminal, run `sudo nano /home/pi/runCamera` then arrow down to the start of the exec line and press "Enter" to add a new line. Then add `#` before the exec command to comment it out. Then, arrow up to the new line and type `sleep 10000`. Hit "Ctrl + O" and then "Enter" to save the file. Finally press "Ctrl + X" to exit nano. Now, reboot the Romi by typing `sudo reboot now`.
```{image} images/nano.png
```
After the Romi reboots, you should be able to open the PhotonVision UI at: [`http://10.0.0.2:5800/`](http://10.0.0.2:5800/). From here, you can adjust settings and configure {ref}`Pipelines <docs/pipelines/index:Pipelines>`.
:::{warning}
In order for settings, logs, etc. to be saved / take effect, ensure that PhotonVision is in writable mode.
:::
:::{attention}
When using an older version of PhotonVision, the user interface and features may be different than what appears in the online documentation. The [Documentation](http://10.0.0.2:5800/#/docs) link in the User Interface will open a bundled version of the documentation that matches the PhotonVision version running on your coprocessor.
:::

View File

@@ -0,0 +1,45 @@
# Windows PC Installation
PhotonVision may be run on a Windows Desktop PC for basic testing and evaluation.
:::{note}
You do not need to install PhotonVision on a Windows PC in order to access the webdashboard (assuming you are using an external coprocessor like a Raspberry Pi).
:::
## Install Bonjour
Bonjour provides more stable networking when using Windows PCs. Install [Bonjour here](https://support.apple.com/downloads/DL999/en_US/BonjourPSSetup.exe) before continuing to ensure a stable experience while using PhotonVision.
## Installing Java
PhotonVision requires a JDK installed and on the system path. **JDK 17 is needed. Windows Users must use the JDK that ships with WPILib.** [Download and install it from here.](https://github.com/wpilibsuite/allwpilib/releases/tag/v2025.3.2) Either ensure the only Java on your PATH is the WPILIB Java or specify it to gradle with `-Dorg.gradle.java.home=C:\Users\Public\wpilib\2025\jdk`:
```
> ./gradlew run "-Dorg.gradle.java.home=C:\Users\Public\wpilib\2025\jdk"
```
:::{warning}
Using a JDK other than WPILIB's JDK17 will cause issues when running PhotonVision and is not supported.
:::
## Downloading the Latest Stable Release of PhotonVision
Go to the [GitHub releases page](https://github.com/PhotonVision/photonvision/releases) and download the winx64.jar file.
## Running PhotonVision
To run PhotonVision, open a terminal window of your choice and run the following command:
```
> java -jar C:\path\to\photonvision\NAME OF JAR FILE GOES HERE.jar
```
If your computer has a compatible webcam connected, PhotonVision should startup without any error messages. If there are error messages, your webcam isn't supported or another issue has occurred. If it is the latter, please open an issue on the [PhotonVision issues page](https://github.com/PhotonVision/photonvision/issues).
:::{warning}
Using an integrated laptop camera may cause issues when trying to run PhotonVision. If you are unable to run PhotonVision on a laptop with an integrated camera, try disabling the camera's driver in Windows Device Manager.
:::
## Accessing the PhotonVision Interface
Once the Java backend is up and running, you can access the main vision interface by navigating to `localhost:5800` inside your browser.

View File

@@ -0,0 +1,56 @@
# 2D AprilTag Tuning / Tracking
## 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.
```{image} images/apriltag.png
:align: center
```
You are now able to detect and track AprilTags in 2D (yaw, pitch, roll, etc.). In order to get 3D data from your AprilTags, please see {ref}`here. <docs/apriltag-pipelines/3D-tracking:3D Tracking>`
## 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.
```{image} images/apriltag-tune.png
:align: center
:scale: 45 %
```
### Target Family
Target families are defined by two numbers (before and after the h). The first number is the number of bits the tag is able to encode (which means more tags are available in the respective family) and the second is the hamming distance. Hamming distance describes the ability for error correction while identifying tag ids. A high hamming distance generally means that it will be easier for a tag to be identified even if there are errors. However, as hamming distance increases, the number of available tags decreases.
The 2025 FRC game will be using 36h11 tags, which can be found [here](https://github.com/AprilRobotics/apriltag-imgs/tree/main/tag36h11).
### Decimate
Decimation (also known as down-sampling) is the process of reducing the sampling frequency of a signal (in our case, the image). Increasing decimate will lead to an increased detection rate while decreasing detection distance. We recommend keeping this at the default value.
### Blur
This controls the sigma of Gaussian blur for tag detection. In clearer terms, increasing blur will make the image blurrier, decreasing it will make it closer to the original image. We strongly recommend that you keep blur to a minimum (0) due to it's high performance intensity unless you have an extremely noisy image.
### Threads
Threads refers to the threads within your coprocessor's CPU. The theoretical maximum is device dependent, but we recommend that users to stick to one less than the amount of CPU threads that your coprocessor has. Increasing threads will increase performance at the cost of increased CPU load, temperature increase, etc. It may take some experimentation to find the most optimal value for your system.
### Refine Edges
The edges of the each polygon are adjusted to "snap to" high color differences surrounding it. It is recommended to use this in tandem with decimate as it can increase the quality of the initial estimate.
### Pose Iterations
Pose iterations represents the amount of iterations done in order for the AprilTag algorithm to converge on its pose solution(s). A smaller number between 0-100 is recommended. A smaller amount of iterations cause a more noisy set of poses when looking at the tag straight on, while higher values much more consistently stick to a (potentially wrong) pair of poses. WPILib contains many useful filter classes in order to account for a noisy tag reading.
### Max Error Bits
Max error bits, also known as hamming distance, is the number of positions at which corresponding pieces of data / tag are different. Put more generally, this is the number of bits (think of these as squares in the tag) that need to be changed / corrected in the tag to correctly detect it. A higher value means that more tags will be detected while a lower value cuts out tags that could be "questionable" in terms of detection.
We recommend a value of 0 for the 16h5 and at most 3 for the 36h11 family.
### Decision Margin Cutoff
The decision margin cutoff is how much “margin” the detector has left before it rejects a tag; increasing this rejects poorer tags. We recommend you keep this value around a 30.

View File

@@ -0,0 +1,13 @@
# 3D Tracking
3D AprilTag tracking will allow you to track the real-world position and rotation of a tag relative to the camera's image sensor. This is useful for robot pose estimation and other applications like autonomous scoring. In order to use 3D tracking, you must first {ref}`calibrate your camera <docs/calibration/calibration:Calibrating Your Camera>`. Once you have, you need to enable 3D mode in the UI and you will now be able to get 3D pose information from the tag! For information on getting and using this information in your code, see {ref}`the programming reference <docs/programming/index:Programming Reference>`.
## Ambiguity
Translating from 2D to 3D using data from the calibration and the four tag corners can lead to "pose ambiguity", where it appears that the AprilTag pose is flipping between two different poses. You can read more about this issue [here](https://docs.wpilib.org/en/stable/docs/software/vision-processing/apriltag/apriltag-intro.html#d-to-3d-ambiguity). Ambiguity is calculated as the ratio of reprojection errors between two pose solutions (if they exist), where reprojection error is the error corresponding to the image distance between where the apriltag's corners are detected vs where we expect to see them based on the tag's estimated camera relative pose.
There are a few steps you can take to resolve/mitigate this issue:
1. Mount cameras at oblique angles so it is less likely that the tag will be seen straight on.
2. Use the {ref}`MultiTag system <docs/apriltag-pipelines/multitag:MultiTag Localization>` in order to combine the corners from multiple tags to get a more accurate and unambiguous pose.
3. Reject all tag poses where the ambiguity ratio (available via PhotonLib) is greater than 0.2.

View File

@@ -0,0 +1,14 @@
# About AprilTags
```{image} images/pv-apriltag.png
:align: center
:scale: 20 %
```
AprilTags are a common type of visual fiducial marker. Visual fiducial markers are artificial landmarks added to a scene to allow "localization" (finding your current position) via images. In simpler terms, tags mark known points of reference that you can use to find your current location. They are similar to QR codes in which they encode information, however, they hold only a single number. By placing AprilTags in known locations around the field and detecting them using PhotonVision, you can easily get full field localization / pose estimation. Alternatively, you can use AprilTags the same way you used retroreflective tape, simply using them to turn to goal without any pose estimation.
A more technical explanation can be found in the [WPILib documentation](https://docs.wpilib.org/en/latest/docs/software/vision-processing/apriltag/apriltag-intro.html).
:::{note}
You can get FIRST's [official PDF of the targets used in 2025 here](https://firstfrc.blob.core.windows.net/frc2025/FieldAssets/Apriltag_Images_and_User_Guide.pdf).
:::

View File

@@ -0,0 +1,40 @@
# Coordinate Systems
## Field and Robot Coordinate Frame
PhotonVision follows the WPILib conventions for the robot and field coordinate systems, as defined [here](https://docs.wpilib.org/en/stable/docs/software/advanced-controls/geometry/coordinate-systems.html).
You define the camera to robot transform in the robot coordinate frame.
## Camera Coordinate Frame
OpenCV by default uses x-left/y-down/z-out for camera transforms. PhotonVision applies a base rotation to this transformation to make robot to tag transforms more in line with the WPILib coordinate system. The x, y, and z axes are also shown in red, green, and blue in the 3D mini-map and targeting overlay in the UI.
- The origin is the focal point of the camera lens
- The x-axis points out of the camera
- The y-axis points to the left
- The z-axis points upwards
```{image} images/camera-coord.png
:align: center
:scale: 45 %
```
```{image} images/multiple-tags.png
:align: center
:scale: 45 %
```
## AprilTag Coordinate Frame
The AprilTag coordinate system is defined as follows, relative to the center of the AprilTag itself, and when viewing the tag as a robot would. Again, PhotonVision changes this coordinate system to be more in line with WPILib. This means that a robot facing a tag head-on would see a robot-to-tag transform with a translation only in x, and a rotation of 180 degrees about z. The tag coordinate system is also shown with x/y/z in red/green/blue in the UI target overlay and mini-map.
- The origin is the center of the tag
- The x-axis is normal to the plane the tag is printed on, pointing outward from the visible side of the tag.
- The y-axis points to the right
- The z-axis points upwards
```{image} images/apriltag-coords.png
:align: center
:scale: 45 %
```

View File

@@ -0,0 +1,15 @@
# AprilTag Pipeline Types
PhotonVision offers two different AprilTag pipeline types based on different implementations of the underlying algorithm. Each one has its advantages / disadvantages, which are detailed below.
:::{note}
Note that both of these pipeline types detect AprilTag markers and are just two different algorithms for doing so.
:::
## 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.
## 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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@@ -0,0 +1,10 @@
# AprilTag Detection
```{toctree}
about-apriltags
detector-types
2D-tracking-tuning
3D-tracking
multitag
coordinate-systems
```

View File

@@ -0,0 +1,80 @@
# MultiTag Localization
PhotonVision can combine AprilTag detections from multiple simultaneously observed AprilTags from a particular camera with information about where tags are expected to be located on the field to produce a better estimate of where the camera (and therefore robot) is located on the field. PhotonVision can calculate this multi-target result on your coprocessor, reducing CPU usage on your RoboRio. This result is sent over NetworkTables along with other detected targets as part of the `PhotonPipelineResult` provided by PhotonLib.
:::{warning}
MultiTag requires an accurate field layout JSON to be uploaded! Differences between this layout and the tags' physical location will drive error in the estimated pose output.
:::
:::{warning}
For the 2025 Reefscape Season, there are two different field layouts. The first is the [welded field layout](https://github.com/wpilibsuite/allwpilib/blob/main/apriltag/src/main/native/resources/edu/wpi/first/apriltag/2025-reefscape-welded.json), which photonvision ships with. The second is the [Andymark field layout](https://github.com/wpilibsuite/allwpilib/blob/main/apriltag/src/main/native/resources/edu/wpi/first/apriltag/2025-reefscape-andymark.json). It is very important to ensure that you use the correct field layout, both in the [PhotonPoseEstimator](https://docs.photonvision.org/en/latest/docs/programming/photonlib/robot-pose-estimator.html#apriltags-and-photonposeestimator) and on the [coprocessor](https://docs.photonvision.org/en/latest/docs/apriltag-pipelines/multitag.html#updating-the-field-layout).
:::
## Enabling MultiTag
Ensure that your camera is calibrated and 3D mode is enabled. Navigate to the Output tab and enable "Do Multi-Target Estimation". This enables MultiTag to use the uploaded field layout JSON to calculate your camera's pose in the field. This 3D transform will be shown as an additional table in the "targets" tab, along with the IDs of AprilTags used to compute this transform.
```{image} images/multitag-ui.png
:alt: Multitarget enabled and running in the PhotonVision UI
:width: 600
```
:::{note}
By default, enabling multi-target will disable calculating camera-to-target transforms for each observed AprilTag target to increase performance; the X/Y/angle numbers shown in the target table of the UI are instead calculated using the tag's expected location (per the field layout JSON) and the field-to-camera transform calculated using MultiTag. If you additionally want the individual camera-to-target transform calculated using SolvePNP for each target, enable "Always Do Single-Target Estimation".
:::
This multi-target pose estimate can be accessed using PhotonLib. We suggest using {ref}`the PhotonPoseEstimator class <docs/programming/photonlib/robot-pose-estimator:AprilTags and PhotonPoseEstimator>` with the `MULTI_TAG_PNP_ON_COPROCESSOR` strategy to simplify code, but the transform can be directly accessed using `getMultiTagResult`/`MultiTagResult()`/`multitagResult` (Java/C++/Python).
```{eval-rst}
.. tab-set-code::
.. code-block:: java
var results = camera.getAllUnreadResults();
for (var result : results) {
var multiTagResult = result.getMultiTagResult();
if (multiTagResult.isPresent()) {
var fieldToCamera = multiTagResult.get().estimatedPose.best;
}
}
.. code-block:: c++
auto results = camera.GetAllUnreadResults();
for (auto &result : results)
{
auto multiTagResult = result.MultiTagResult();
if (multiTagResult.has_value()) {
frc::Transform3d fieldToCamera = multiTagResult->estimatedPose.best;
}
}
.. code-block:: python
results = camera.getAllUnreadResults()
for result in results:
multitagResult = result.multitagResult
if multitagResult is not None:
fieldToCamera = multitagResult.estimatedPose.best
```
:::{note}
The returned field to camera transform is a transform from the fixed field origin to the camera's coordinate system. This does not change based on alliance color, and by convention is on the BLUE ALLIANCE wall.
:::
## Updating the Field Layout
PhotonVision ships by default with the [2025 welded field layout JSON](https://github.com/wpilibsuite/allwpilib/blob/main/apriltag/src/main/native/resources/edu/wpi/first/apriltag/2025-reefscape-welded.json). The layout can be inspected by navigating to the settings tab and scrolling down to the "AprilTag Field Layout" card, as shown below.
```{image} images/field-layout.png
:alt: The currently saved field layout in the Photon UI
:width: 600
```
An updated field layout can be uploaded by navigating to the "Device Control" card of the Settings tab and clicking "Import Settings". In the pop-up dialog, select the "AprilTag Layout" type and choose an updated layout JSON (in the same format as the WPILib field layout JSON linked above) using the paperclip icon, and select "Import Settings". The AprilTag layout in the "AprilTag Field Layout" card below should be updated to reflect the new layout.
:::{note}
Currently, there is no way to update this layout using PhotonLib, although this feature is under consideration.
:::

View File

@@ -0,0 +1,8 @@
# Performance Benchmarks
```{toctree}
:maxdepth: 0
:titlesonly: true
rknn-model-benchmarks
```

View File

@@ -0,0 +1,125 @@
# RKNN Benchmarks
## Description
This benchmark compares the performance of four object detection models: YOLOv5, YOLOv5u, YOLOv8, and YOLOv11 on the [COCO 2017 Validation Set](http://images.cocodataset.org/zips/val2017.zip). The main purpose is to assess and compare the inference speed and detection accuracy of these models when deployed on the Orange Pi devices using the RKNN framework and int8 quantization.
## Methodology
- **Dataset**: [COCO 2017 Validation Set](http://images.cocodataset.org/zips/val2017.zip) (5,000 images)
- **Platform**: Orange Pi 5 with RK3588
- **Quantization**: int8 using 20 randomly selected images from the validation set
- **Framework**: RKNN Toolkit 2
## Operator-Level Benchmark Results
The following tables break down the average CPU time, NPU time, and total execution time (in microseconds) for each operator used by the models. Each value represents the mean ± standard deviation across 5,000 inferences.
### YOLOv5
| OpType | CPU Time (μs) | NPU Time (μs) | Total Time (μs) | Time Ratio (%) | Number of Times Called |
|-----------------|---------------------|----------------------|-----------------------|---------------------|-----------------------|
| ConvExSwish | 0.00 ± 0.00 | 10968.81 ± 1126.00 | 10968.81 ± 1126.00 | 73.06 ± 0.94 | 57 |
| ConvSigmoid | 0.00 ± 0.00 | 1243.49 ± 67.66 | 1243.49 ± 67.66 | 8.33 ± 0.57 | 3 |
| Concat | 0.00 ± 0.00 | 1080.68 ± 259.40 | 1080.68 ± 259.40 | 7.09 ± 0.87 | 13 |
| Conv | 0.00 ± 0.00 | 732.15 ± 29.42 | 732.15 ± 29.42 | 4.92 ± 0.42 | 1 |
| Add | 0.00 ± 0.00 | 473.71 ± 131.48 | 473.71 ± 131.48 | 3.10 ± 0.50 | 7 |
| MaxPool | 0.00 ± 0.00 | 272.40 ± 110.52 | 272.40 ± 110.52 | 1.76 ± 0.51 | 6 |
| Resize | 0.00 ± 0.00 | 147.61 ± 38.89 | 147.61 ± 38.89 | 0.97 ± 0.15 | 2 |
| OutputOperator | 106.60 ± 15.00 | 0.00 ± 0.00 | 106.60 ± 15.00 | 0.72 ± 0.13 | 3 |
| InputOperator | 8.64 ± 1.79 | 0.00 ± 0.00 | 8.64 ± 1.79 | 0.06 ± 0.02 | 1 |
| **Total** | **115.24 ± 16.16** | **14918.85 ± 1735.45**| **15034.09 ± 1734.28**| | **93** |
### YOLOv5u
| OpType | CPU Time (μs) | NPU Time (μs) | Total Time (μs) | Time Ratio (%) | Number of Times Called |
|-----------------|---------------------|----------------------|-----------------------|---------------------|-----------------------|
| ConvExSwish | 0.00 ± 0.00 | 16828.24 ± 1332.73 | 16828.24 ± 1332.73 | 83.04 ± 1.61 | 69 |
| Concat | 0.00 ± 0.00 | 1265.94 ± 250.24 | 1265.94 ± 250.24 | 6.17 ± 0.69 | 13 |
| ConvSigmoid | 0.00 ± 0.00 | 613.88 ± 62.97 | 613.88 ± 62.97 | 3.03 ± 0.15 | 3 |
| Add | 0.00 ± 0.00 | 553.75 ± 131.17 | 553.75 ± 131.17 | 2.69 ± 0.44 | 7 |
| Conv | 0.00 ± 0.00 | 298.61 ± 72.72 | 298.61 ± 72.72 | 1.45 ± 0.25 | 3 |
| ConvClip | 0.00 ± 0.00 | 256.02 ± 64.48 | 256.02 ± 64.48 | 1.24 ± 0.23 | 3 |
| MaxPool | 0.00 ± 0.00 | 178.68 ± 58.72 | 178.68 ± 58.72 | 0.86 ± 0.23 | 3 |
| Resize | 0.00 ± 0.00 | 170.87 ± 40.14 | 170.87 ± 40.14 | 0.83 ± 0.13 | 2 |
| OutputOperator | 126.89 ± 16.53 | 0.00 ± 0.00 | 126.89 ± 16.53 | 0.63 ± 0.10 | 9 |
| InputOperator | 8.69 ± 1.45 | 0.00 ± 0.00 | 8.69 ± 1.45 | 0.04 ± 0.01 | 1 |
| **Total** | **135.57 ± 17.51** | **20165.99 ± 1963.70**| **20301.56 ± 1965.88**| | **113** |
### YOLOv8
| OpType | CPU Time (μs) | NPU Time (μs) | Total Time (μs) | Time Ratio (%) | Number of Times Called |
|-----------------|---------------------|----------------------|-----------------------|---------------------|-----------------------|
| ConvExSwish | 0.00 ± 0.00 | 13017.04 ± 1165.76 | 13017.04 ± 1165.76 | 75.66 ± 1.96 | 57 |
| Concat | 0.00 ± 0.00 | 1489.94 ± 257.22 | 1489.94 ± 257.22 | 8.58 ± 0.53 | 13 |
| Split | 0.00 ± 0.00 | 681.47 ± 166.62 | 681.47 ± 166.62 | 3.89 ± 0.53 | 8 |
| ConvSigmoid | 0.00 ± 0.00 | 596.08 ± 75.01 | 596.08 ± 75.01 | 3.45 ± 0.18 | 3 |
| Add | 0.00 ± 0.00 | 443.60 ± 118.05 | 443.60 ± 118.05 | 2.53 ± 0.41 | 6 |
| Conv | 0.00 ± 0.00 | 269.61 ± 78.65 | 269.61 ± 78.65 | 1.54 ± 0.30 | 3 |
| Resize | 0.00 ± 0.00 | 236.79 ± 37.74 | 236.79 ± 37.74 | 1.37 ± 0.08 | 2 |
| ConvClip | 0.00 ± 0.00 | 231.82 ± 68.44 | 231.82 ± 68.44 | 1.32 ± 0.27 | 3 |
| MaxPool | 0.00 ± 0.00 | 156.85 ± 56.94 | 156.85 ± 56.94 | 0.89 ± 0.23 | 3 |
| OutputOperator | 124.86 ± 20.74 | 0.00 ± 0.00 | 124.86 ± 20.74 | 0.73 ± 0.15 | 9 |
| InputOperator | 8.47 ± 1.66 | 0.00 ± 0.00 | 8.47 ± 1.66 | 0.05 ± 0.01 | 1 |
| **Total** | **133.33 ± 21.95** | **17123.19 ± 1985.72**| **17256.52 ± 1986.77** | | **108** |
---
### YOLOv11
| OpType | CPU Time (μs) | NPU Time (μs) | Total Time (μs) | Time Ratio (%) | Number of Times Called |
|-----------------|---------------------|----------------------|-----------------------|---------------------|-----------------------|
| ConvExSwish | 0.00 ± 0.00 | 16034.00 ± 1331.95 | 16034.00 ± 1331.95 | 69.90 ± 1.55 | 77 |
| Concat | 0.00 ± 0.00 | 1888.89 ± 293.99 | 1888.89 ± 293.99 | 8.17 ± 0.51 | 17 |
| exSDPAttention | 0.00 ± 0.00 | 1210.88 ± 17.73 | 1210.88 ± 17.73 | 5.32 ± 0.52 | 1 |
| Split | 0.00 ± 0.00 | 908.30 ± 183.92 | 908.30 ± 183.92 | 3.91 ± 0.45 | 10 |
| Add | 0.00 ± 0.00 | 871.64 ± 212.79 | 871.64 ± 212.79 | 3.73 ± 0.60 | 12 |
| ConvSigmoid | 0.00 ± 0.00 | 617.61 ± 59.61 | 617.61 ± 59.61 | 2.69 ± 0.16 | 3 |
| Conv | 0.00 ± 0.00 | 419.72 ± 89.88 | 419.72 ± 89.88 | 1.80 ± 0.24 | 5 |
| Resize | 0.00 ± 0.00 | 272.09 ± 49.91 | 272.09 ± 49.91 | 1.18 ± 0.12 | 2 |
| ConvClip | 0.00 ± 0.00 | 260.08 ± 59.12 | 260.08 ± 59.12 | 1.12 ± 0.18 | 3 |
| MaxPool | 0.00 ± 0.00 | 181.93 ± 53.32 | 181.93 ± 53.32 | 0.78 ± 0.18 | 3 |
| OutputOperator | 131.48 ± 22.93 | 0.00 ± 0.00 | 131.48 ± 22.93 | 0.58 ± 0.12 | 9 |
| ConvAdd | 0.00 ± 0.00 | 126.79 ± 35.28 | 126.79 ± 35.28 | 0.54 ± 0.11 | 2 |
| Reshape | 0.00 ± 0.00 | 56.61 ± 18.03 | 56.61 ± 18.03 | 0.24 ± 0.06 | 3 |
| InputOperator | 8.66 ± 1.59 | 0.00 ± 0.00 | 8.66 ± 1.59 | 0.04 ± 0.01 | 1 |
| **Total** | **140.14 ± 24.26** | **22848.54 ± 2351.95**| **22988.68 ± 2355.97**| | **148** |
## Model Summary and Accuracy Metrics
The table below summarizes the mean average precision (mAP) and total inference time for each model. These metrics provide a high-level view of how each model performs in terms of both detection accuracy and runtime efficiency.
### Mean Average Precision (mAP) by Model
| Metric | YOLOv5 | YOLOv5u | YOLOv8 | YOLOv11 |
|--------|------------|------------|------------|------------|
| **mAP** | 0.2243 | 0.2745 | 0.3051 | 0.3251 |
| **mAP50** | 0.3538 | 0.3834 | 0.4145 | 0.4406 |
| **mAP75** | 0.2432 | 0.2997 | 0.3349 | 0.3568 |
| **mAP85** | 0.3054 | 0.3472 | 0.3867 | 0.4068 |
| **mAP95** | 0.3708 | 0.4822 | 0.5483 | 0.5858 |
### Model Execution Time and Call Frequency
| Model | Total Time (μs) | Number of Processing Calls |
|---------|------------------------|----------------------------|
| **YOLOv5** | 15034.09 ± 1734.28 | 93 |
| **YOLOv5u** | 20301.56 ± 1965.88 | 113 |
| **YOLOv8** | 17256.52 ± 1986.77 | 108 |
| **YOLOv11** | 22988.68 ± 2355.97 | 148 |
## Conclusion
The benchmark reveals a clear performance trade-off between inference time and detection accuracy:
- **YOLOv5** is the fastest model with the lowest total inference time, making it well-suited for situations where speed is more important than high detection precision.
- **YOLOv11** achieves the highest accuracy (mAP) across all IoU thresholds but comes with the longest inference time, which may limit its use in real-time applications.
- **YOLOv8** offers a strong balance between speed and accuracy, making it a practical choice when both factors matter.
- **YOLOv5u** improves accuracy compared to YOLOv5 but falls behind YOLOv8 in both speed and detection quality.
When choosing a model for edge devices like the Orange Pi 5, its important to weigh how much latency your system can tolerate versus how much accuracy you need. A faster model may give quicker results, while a more accurate one may offer better detection reliability, but at the cost of speed.

Some files were not shown because too many files have changed in this diff Show More