mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-02 02:51:40 +00:00
Compare commits
12 Commits
v2026.1.1-
...
v2026.1.1-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c9a142622 | ||
|
|
149c214897 | ||
|
|
a952bab4c9 | ||
|
|
bc208bca85 | ||
|
|
dbd6eea4e9 | ||
|
|
afb73b3918 | ||
|
|
9011e285d2 | ||
|
|
8a141904a6 | ||
|
|
121433fd90 | ||
|
|
22567dea74 | ||
|
|
ba4eb621c3 | ||
|
|
43608c5113 |
32
.github/workflows/build.yml
vendored
32
.github/workflows/build.yml
vendored
@@ -555,32 +555,32 @@ jobs:
|
||||
minimum_free_mb: ${{ matrix.minimum_free_mb }}
|
||||
root_location: ${{ matrix.root_location || 'partition=2' }}
|
||||
shrink_image: ${{ matrix.shrink_image || 'yes' }}
|
||||
commands: |
|
||||
chmod +x scripts/armrunner.sh
|
||||
./scripts/armrunner.sh
|
||||
java -jar *.jar --smoketest --platform=${{ matrix.plat_override }}
|
||||
commands: ./scripts/armrunner.sh
|
||||
|
||||
- name: Compress image
|
||||
# Compress the standard images
|
||||
if: ${{ ! startsWith(matrix.image_suffix, 'rubik') }}
|
||||
run: |
|
||||
set -ex
|
||||
new_jar=$(realpath $(find . -name photonvision\*-linuxarm64.jar))
|
||||
new_image_name=$(basename "${new_jar/.jar/_${{ matrix.image_suffix }}.img}")
|
||||
sudo mv ${{ steps.generate_image.outputs.image }} $new_image_name
|
||||
sudo xz -T 0 -v $new_image_name
|
||||
sudo xz -T 0 -kv $new_image_name
|
||||
echo "smoketest_image_loc=${new_image_name}" >> $GITHUB_ENV
|
||||
|
||||
- name: Tar built image
|
||||
- name: Tar built image (Rubik)
|
||||
# Build the RubikPi3-specific tar file
|
||||
if: ${{ startsWith(matrix.image_suffix, 'rubik') }}
|
||||
run: |
|
||||
set -ex
|
||||
new_jar=$(realpath $(find . -name photonvision\*-linuxarm64.jar))
|
||||
new_image_name=$(basename "${new_jar/.jar/_${{ matrix.image_suffix }}.img}")
|
||||
|
||||
tardir=$(basename "${new_jar/.jar/_${{ matrix.image_suffix }}.img}")
|
||||
imagedir=$(dirname ${{ steps.generate_image.outputs.image }})
|
||||
tardir=${new_image_name}
|
||||
sudo mkdir --parents ${tardir}
|
||||
sudo mv ${imagedir}/* ${tardir}/
|
||||
sudo tar -I 'xz -T0' -cf ${new_image_name}.tar.xz ${tardir} --checkpoint=10000 --checkpoint-action=echo='%T'
|
||||
sudo cp ${imagedir}/* ${tardir}/
|
||||
sudo tar -I 'xz -T0' -cf ${tardir}.tar.xz ${tardir} --checkpoint=10000 --checkpoint-action=echo='%T'
|
||||
# Point smoketest to the old image
|
||||
echo "smoketest_image_loc=${{ steps.generate_image.outputs.image }}" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/upload-artifact@v6
|
||||
name: Upload image
|
||||
@@ -588,6 +588,16 @@ jobs:
|
||||
name: image-${{ matrix.image_suffix }}
|
||||
path: photonvision*.xz
|
||||
|
||||
# This is done after uploading the image to avoid contaminating the image with logs, caches, etc.
|
||||
- uses: photonvision/photon-image-runner@HEAD
|
||||
name: Smoketest Image
|
||||
with:
|
||||
image_url: file://${{ env.smoketest_image_loc }}
|
||||
minimum_free_mb: ${{ matrix.minimum_free_mb }}
|
||||
root_location: ${{ matrix.root_location || 'partition=2' }}
|
||||
shrink_image: ${{ matrix.shrink_image || 'yes' }}
|
||||
commands: java -jar *.jar --smoketest --platform=${{ matrix.plat_override }}
|
||||
|
||||
matrix-checker:
|
||||
# This job always runs last to set the overall result based on the matrix jobs. If any matrix job failed, this job will fail.
|
||||
# This makes it so that we don't need to add each matrix job individually to CI checks.
|
||||
|
||||
100
.github/workflows/python.yml
vendored
100
.github/workflows/python.yml
vendored
@@ -12,7 +12,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
build-py:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
@@ -29,38 +29,57 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install setuptools wheel pytest mypy
|
||||
pip install setuptools wheel
|
||||
|
||||
- name: Build wheel
|
||||
working-directory: ./photon-lib/py
|
||||
run: python setup.py sdist bdist_wheel
|
||||
|
||||
- name: Run Unit Tests
|
||||
working-directory: ./photon-lib/py
|
||||
run: |
|
||||
pip install --no-cache-dir dist/*.whl
|
||||
pytest
|
||||
|
||||
- name: Run mypy type checking
|
||||
run: mypy --show-column-numbers --config-file photon-lib/py/pyproject.toml photon-lib
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: dist
|
||||
path: ./photon-lib/py/dist/
|
||||
|
||||
- name: Publish package distributions to TestPyPI
|
||||
# Only upload on tags
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
packages-dir: ./photon-lib/py/dist/
|
||||
test-py:
|
||||
needs: build-py
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
permissions:
|
||||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: 3.14
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pytest mypy
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
|
||||
- name: Install package
|
||||
shell: bash
|
||||
run: pip install --no-cache-dir dist/*.whl
|
||||
|
||||
- name: Run Unit Tests
|
||||
shell: bash
|
||||
run: pytest --import-mode=importlib photon-lib/py/test/
|
||||
|
||||
- name: Run mypy type checking
|
||||
run: mypy --show-column-numbers --config-file photon-lib/py/pyproject.toml photon-lib
|
||||
|
||||
build-python-examples:
|
||||
needs: build-py
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-24.04, windows-2022, macos-14]
|
||||
@@ -81,28 +100,18 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install setuptools wheel pytest mypy
|
||||
|
||||
- name: Build wheel
|
||||
working-directory: ./photon-lib/py
|
||||
run: python setup.py sdist bdist_wheel
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: dist
|
||||
path: ./photon-lib/py/dist/
|
||||
|
||||
- name: Build and configure PhotonLibPy
|
||||
working-directory: ./photon-lib/py
|
||||
shell: bash
|
||||
run: |
|
||||
./buildAndTest.sh
|
||||
./enableUsingDevBuilds.sh
|
||||
|
||||
- name: Run Unit Tests
|
||||
- name: Install PhotonLibPy package
|
||||
working-directory: ./photon-lib/py
|
||||
shell: bash
|
||||
run: |
|
||||
pip install --no-cache-dir dist/*.whl
|
||||
pytest
|
||||
|
||||
- name: Run mypy type checking
|
||||
run: mypy --show-column-numbers --config-file photon-lib/py/pyproject.toml photon-lib
|
||||
|
||||
- name: Build Python examples
|
||||
working-directory: photonlib-python-examples
|
||||
@@ -113,3 +122,24 @@ jobs:
|
||||
echo $folder
|
||||
./run.sh $folder
|
||||
done
|
||||
|
||||
deploy:
|
||||
needs: [test-py, build-python-examples]
|
||||
runs-on: ubuntu-24.04
|
||||
# Only upload on tags
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
|
||||
- name: Publish package distributions to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
packages-dir: ./dist/
|
||||
|
||||
permissions:
|
||||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
|
||||
|
||||
@@ -4,7 +4,7 @@ plugins {
|
||||
id "cpp"
|
||||
id "com.diffplug.spotless" version "8.1.0"
|
||||
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.1.1"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.2.1"
|
||||
id 'org.photonvision.tools.WpilibTools' version '2.3.3-photon'
|
||||
id 'com.google.protobuf' version '0.9.3' apply false
|
||||
id 'edu.wpi.first.GradleJni' version '1.1.0'
|
||||
@@ -32,7 +32,7 @@ ext.allOutputsFolder = file("$project.buildDir/outputs")
|
||||
apply from: "versioningHelper.gradle"
|
||||
|
||||
ext {
|
||||
wpilibVersion = "2026.1.1"
|
||||
wpilibVersion = "2026.2.1"
|
||||
wpimathVersion = wpilibVersion
|
||||
openCVYear = "2025"
|
||||
openCVversion = "4.10.0-3"
|
||||
|
||||
@@ -83,7 +83,7 @@ Details about a particular calibration can be viewed by clicking on that resolut
|
||||
More info on what these parameters mean can be found in [OpenCV's docs](https://docs.opencv.org/4.8.0/d4/d94/tutorial_camera_calibration.html)
|
||||
:::
|
||||
|
||||
- Fx/Fy: Estimated camera focal length, in mm
|
||||
- Fx/Fy: Estimated camera focal length, in pixels
|
||||
- Fx/Cy: Estimated camera optical center, in pixels. This should be at about the center of the image
|
||||
- Distortion: OpenCV camera model distortion coefficients
|
||||
- FOV: calculated using estimated focal length and image size. Useful for gut-checking calibration results
|
||||
|
||||
@@ -99,6 +99,7 @@ const patternHeight = ref(8);
|
||||
const boardType = ref<CalibrationBoardTypes>(CalibrationBoardTypes.Charuco);
|
||||
const useOldPattern = ref(false);
|
||||
const tagFamily = ref<CalibrationTagFamilies>(CalibrationTagFamilies.Dict_4X4_1000);
|
||||
const requestedVideoFormatIndex = ref(0);
|
||||
|
||||
// Emperical testing - with stack size limit of 1MB, we can handle at -least- 700k points
|
||||
const tooManyPoints = computed(
|
||||
@@ -191,6 +192,7 @@ const startCalibration = () => {
|
||||
useCameraSettingsStore().currentCameraSettings.currentPipelineIndex = WebsocketPipelineType.Calib3d;
|
||||
// isCalibrating.value = true;
|
||||
calibCanceled.value = false;
|
||||
requestedVideoFormatIndex.value = useStateStore().calibrationData.videoFormatIndex;
|
||||
};
|
||||
const showCalibEndDialog = ref(false);
|
||||
const calibCanceled = ref(false);
|
||||
@@ -559,7 +561,7 @@ const setSelectedVideoFormat = (format: VideoFormat) => {
|
||||
{{
|
||||
useCameraSettingsStore().currentCameraSettings.validVideoFormats.map((f) =>
|
||||
getResolutionString(f.resolution)
|
||||
)[useStateStore().calibrationData.videoFormatIndex]
|
||||
)[requestedVideoFormatIndex]
|
||||
}}!
|
||||
</v-card-text>
|
||||
</template>
|
||||
|
||||
@@ -187,7 +187,7 @@ const viewingImg = ref(0);
|
||||
.getCalibrationCoeffs(props.videoFormat.resolution)
|
||||
?.cameraIntrinsics.data[0].toFixed(2) || 0.0
|
||||
}}
|
||||
mm
|
||||
px
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -198,7 +198,7 @@ const viewingImg = ref(0);
|
||||
.getCalibrationCoeffs(props.videoFormat.resolution)
|
||||
?.cameraIntrinsics.data[4].toFixed(2) || 0.0
|
||||
}}
|
||||
mm
|
||||
px
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -26,7 +26,7 @@ const importWidth = ref<number | null>(null);
|
||||
const importVersion = ref<string | null>(null);
|
||||
|
||||
// TODO gray out the button when model is uploading
|
||||
const handleImport = async () => {
|
||||
const handleImport = () => {
|
||||
if (importModelFile.value === null) return;
|
||||
|
||||
const formData = new FormData();
|
||||
@@ -72,13 +72,13 @@ const handleImport = async () => {
|
||||
importVersion.value = null;
|
||||
};
|
||||
|
||||
const deleteModel = async (model: ObjectDetectionModelProperties) => {
|
||||
const deleteModel = (model: ObjectDetectionModelProperties) => {
|
||||
axiosPost("/objectdetection/delete", "delete an object detection model", {
|
||||
modelPath: model.modelPath
|
||||
});
|
||||
};
|
||||
|
||||
const renameModel = async (model: ObjectDetectionModelProperties, newName: string) => {
|
||||
const renameModel = (model: ObjectDetectionModelProperties, newName: string) => {
|
||||
useStateStore().showSnackbarMessage({
|
||||
message: "Renaming Object Detection Model...",
|
||||
color: "secondary",
|
||||
|
||||
@@ -22,7 +22,7 @@ export const statusCheck = async (timeout: number, ip?: string): Promise<boolean
|
||||
while (pollLimit > 0) {
|
||||
try {
|
||||
pollLimit--;
|
||||
await axios.get(ip ? `http://${ip}/status` : "/status");
|
||||
await axios.get(ip ? `http://${ip}/api/status` : "/status");
|
||||
return true;
|
||||
} catch {
|
||||
// Backend not ready yet, wait and retry
|
||||
|
||||
@@ -146,7 +146,7 @@ public class NeuralNetworkModelManager {
|
||||
"vase",
|
||||
"scissors",
|
||||
"teddy bear",
|
||||
"hair drier",
|
||||
"hair drier", // Typo in official COCO documentation
|
||||
"toothbrush"));
|
||||
|
||||
nnProps.addModelProperties(
|
||||
|
||||
@@ -4,15 +4,13 @@ import subprocess
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
gitDescribeResult = (
|
||||
subprocess.check_output(
|
||||
["git", "describe", "--tags", "--match=v*", "--exclude=*rc*", "--always"]
|
||||
)
|
||||
subprocess.check_output(["git", "describe", "--tags", "--match=v*", "--always"])
|
||||
.decode("utf-8")
|
||||
.strip()
|
||||
)
|
||||
|
||||
m = re.search(
|
||||
r"(v[0-9]{4}\.[0-9]{1}\.[0-9]{1})-?((?:beta)?(?:alpha)?)-?([0-9\.]*)",
|
||||
r"v([0-9]{4}\.[0-9]{1}\.[0-9]{1})-?((?:beta|alpha|rc)?)-?([0-9\.]*)",
|
||||
gitDescribeResult,
|
||||
)
|
||||
|
||||
@@ -26,7 +24,7 @@ if m:
|
||||
prefix = m.group(1)
|
||||
maturity = m.group(2)
|
||||
suffix = m.group(3).replace(".", "")
|
||||
versionString = f"{prefix}.{maturity}.{suffix}"
|
||||
versionString = f"{prefix}{maturity}{suffix}"
|
||||
else:
|
||||
split = gitDescribeResult.split("-")
|
||||
if len(split) == 3:
|
||||
@@ -35,8 +33,7 @@ if m:
|
||||
versionString = f"{year[1:]}post{commits}"
|
||||
print("using dev release " + versionString)
|
||||
else:
|
||||
year = gitDescribeResult
|
||||
versionString = year[1:]
|
||||
versionString = gitDescribeResult[1:]
|
||||
print("using full release " + versionString)
|
||||
|
||||
|
||||
@@ -60,12 +57,12 @@ setup(
|
||||
package_data={"photonlibpy": ["py.typed"]},
|
||||
version=versionString,
|
||||
install_requires=[
|
||||
"numpy~=2.4",
|
||||
"wpilib==2026.1.1",
|
||||
"robotpy-wpimath==2026.1.1",
|
||||
"robotpy-apriltag==2026.1.1",
|
||||
"robotpy-cscore==2026.1.1",
|
||||
"pyntcore==2026.1.1",
|
||||
"numpy~=2.3",
|
||||
"wpilib>=2026.2.1,<2027",
|
||||
"robotpy-wpimath>=2026.2.1,<2027",
|
||||
"robotpy-apriltag>=2026.2.1,<2027",
|
||||
"robotpy-cscore>=2026.2.1,<2027",
|
||||
"pyntcore>=2026.2.1,<2027",
|
||||
"opencv-python;platform_machine!='roborio'",
|
||||
],
|
||||
description=descriptionStr,
|
||||
|
||||
@@ -45,7 +45,6 @@ import edu.wpi.first.wpilibj.Alert;
|
||||
import edu.wpi.first.wpilibj.Alert.AlertType;
|
||||
import edu.wpi.first.wpilibj.DriverStation;
|
||||
import edu.wpi.first.wpilibj.Timer;
|
||||
import edu.wpi.first.wpilibj.util.WPILibVersion;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -189,50 +188,6 @@ public class PhotonCamera implements AutoCloseable {
|
||||
|
||||
static void verifyDependencies() {
|
||||
// spotless:off
|
||||
if (!WPILibVersion.Version.equals(PhotonVersion.wpilibTargetVersion)) {
|
||||
String bfw = """
|
||||
|
||||
|
||||
|
||||
|
||||
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\s
|
||||
>>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\s
|
||||
>>> \s
|
||||
>>> You are running an incompatible version \s
|
||||
>>> of PhotonVision ! \s
|
||||
>>> \s
|
||||
>>> PhotonLib """
|
||||
+ PhotonVersion.versionString
|
||||
+ " is built for WPILib "
|
||||
+ PhotonVersion.wpilibTargetVersion
|
||||
+ "\n"
|
||||
+ ">>> but you are using WPILib "
|
||||
+ WPILibVersion.Version
|
||||
+ """
|
||||
\n>>> \s
|
||||
>>> This is neither tested nor supported. \s
|
||||
>>> You MUST update WPILib, PhotonLib, or both.
|
||||
>>> Check `./gradlew dependencies` and ensure\s
|
||||
>>> all mentions of OpenCV match the version \s
|
||||
>>> that PhotonLib was built for. If you find a
|
||||
>>> a mismatched version in a dependency, you\s
|
||||
>>> must take steps to update the version of \s
|
||||
>>> OpenCV used in that dependency. If you do\s
|
||||
>>> not control that dependency and an updated\s
|
||||
>>> version is not available, contact the \s
|
||||
>>> developers of that dependency. \s
|
||||
>>> \s
|
||||
>>> Your code will now crash. \s
|
||||
>>> We hope your day gets better. \s
|
||||
>>> \s
|
||||
>>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\s
|
||||
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\s
|
||||
""";
|
||||
|
||||
DriverStation.reportWarning(bfw, false);
|
||||
DriverStation.reportError(bfw, false);
|
||||
throw new UnsupportedOperationException(bfw);
|
||||
}
|
||||
if (!Core.VERSION.equals(PhotonVersion.opencvTargetVersion)) {
|
||||
String bfw = """
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include <WPILibVersion.h>
|
||||
#include <frc/Errors.h>
|
||||
#include <frc/RobotController.h>
|
||||
#include <frc/Timer.h>
|
||||
@@ -47,48 +46,6 @@ static constexpr units::second_t WARN_DEBOUNCE_SEC = 5_s;
|
||||
static constexpr units::second_t HEARTBEAT_DEBOUNCE_SEC = 500_ms;
|
||||
|
||||
inline void verifyDependencies() {
|
||||
if (!(std::string_view{GetWPILibVersion()} ==
|
||||
std::string_view{photon::PhotonVersion::wpilibTargetVersion})) {
|
||||
std::string bfw =
|
||||
"\n\n\n\n\n"
|
||||
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"
|
||||
">>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
|
||||
">>> \n"
|
||||
">>> You are running an incompatible version \n"
|
||||
">>> of PhotonVision ! \n"
|
||||
">>> \n"
|
||||
">>> PhotonLib ";
|
||||
bfw += photon::PhotonVersion::versionString;
|
||||
bfw += " is built for WPILib ";
|
||||
bfw += photon::PhotonVersion::wpilibTargetVersion;
|
||||
bfw +=
|
||||
"\n"
|
||||
">>> but you are using WPILib ";
|
||||
bfw += GetWPILibVersion();
|
||||
bfw +=
|
||||
"\n>>> \n"
|
||||
">>> This is neither tested nor supported. \n"
|
||||
">>> You MUST update WPILib, PhotonLib, or both.\n"
|
||||
">>> Check `./gradlew dependencies` and ensure\n"
|
||||
">>> all mentions of WPILib match the version \n"
|
||||
">>> that PhotonLib was built for. If you find a"
|
||||
">>> a mismatched version in a dependency, you\n"
|
||||
">>> must take steps to update the version of \n"
|
||||
">>> WPILib used in that dependency. If you do\n"
|
||||
">>> not control that dependency and an updated\n"
|
||||
">>> version is not available, contact the \n"
|
||||
">>> developers of that dependency. \n"
|
||||
">>> \n"
|
||||
">>> Your code will now crash. \n"
|
||||
">>> We hope your day gets better. \n"
|
||||
">>> \n"
|
||||
">>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
|
||||
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n";
|
||||
|
||||
FRC_ReportWarning(bfw);
|
||||
FRC_ReportError(frc::err::Error, bfw);
|
||||
throw new std::runtime_error(std::string{bfw});
|
||||
}
|
||||
if (!(std::string_view{cv::getVersionString()} ==
|
||||
std::string_view{photon::PhotonVersion::opencvTargetVersion})) {
|
||||
std::string bfw =
|
||||
|
||||
@@ -852,6 +852,12 @@ public class RequestHandler {
|
||||
ctx.result("There was an error while saving the uploaded object detection models");
|
||||
logger.error("There was an error while saving the uploaded object detection models");
|
||||
}
|
||||
|
||||
DataChangeService.getInstance()
|
||||
.publishEvent(
|
||||
new OutgoingUIEvent<>(
|
||||
"fullsettings",
|
||||
UIPhotonConfiguration.programStateToUi(ConfigManager.getInstance().getConfig())));
|
||||
}
|
||||
|
||||
private record DeleteObjectDetectionModelRequest(Path modelPath) {}
|
||||
@@ -898,17 +904,17 @@ public class RequestHandler {
|
||||
|
||||
ctx.status(200).result("Successfully deleted object detection model");
|
||||
|
||||
DataChangeService.getInstance()
|
||||
.publishEvent(
|
||||
new OutgoingUIEvent<>(
|
||||
"fullsettings",
|
||||
UIPhotonConfiguration.programStateToUi(ConfigManager.getInstance().getConfig())));
|
||||
|
||||
} catch (Exception e) {
|
||||
ctx.status(500);
|
||||
ctx.result("Error deleting object detection model: " + e.getMessage());
|
||||
logger.error("Error deleting object detection model", e);
|
||||
}
|
||||
|
||||
DataChangeService.getInstance()
|
||||
.publishEvent(
|
||||
new OutgoingUIEvent<>(
|
||||
"fullsettings",
|
||||
UIPhotonConfiguration.programStateToUi(ConfigManager.getInstance().getConfig())));
|
||||
}
|
||||
|
||||
private record RenameObjectDetectionModelRequest(Path modelPath, String newName) {}
|
||||
@@ -951,6 +957,12 @@ public class RequestHandler {
|
||||
|
||||
NeuralNetworkModelManager.getInstance().discoverModels();
|
||||
ctx.status(200).result("Successfully renamed object detection model");
|
||||
|
||||
DataChangeService.getInstance()
|
||||
.publishEvent(
|
||||
new OutgoingUIEvent<>(
|
||||
"fullsettings",
|
||||
UIPhotonConfiguration.programStateToUi(ConfigManager.getInstance().getConfig())));
|
||||
} catch (Exception e) {
|
||||
ctx.status(500);
|
||||
ctx.result("Error renaming object detection model: " + e.getMessage());
|
||||
@@ -970,6 +982,12 @@ public class RequestHandler {
|
||||
ctx.result("Error clearing object detection models: " + e.getMessage());
|
||||
logger.error("Error clearing object detection models", e);
|
||||
}
|
||||
|
||||
DataChangeService.getInstance()
|
||||
.publishEvent(
|
||||
new OutgoingUIEvent<>(
|
||||
"fullsettings",
|
||||
UIPhotonConfiguration.programStateToUi(ConfigManager.getInstance().getConfig())));
|
||||
}
|
||||
|
||||
public static void onDeviceRestartRequest(Context ctx) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id "cpp"
|
||||
id "google-test-test-suite"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.1.1"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.2.1"
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -11,8 +11,8 @@ repositories {
|
||||
|
||||
wpi.maven.useLocal = false
|
||||
wpi.maven.useDevelopment = false
|
||||
wpi.versions.wpilibVersion = "2026.1.1"
|
||||
wpi.versions.wpimathVersion = "2026.1.1"
|
||||
wpi.versions.wpilibVersion = "2026.2.1"
|
||||
wpi.versions.wpimathVersion = "2026.2.1"
|
||||
|
||||
// Define my targets (RoboRIO) and artifacts (deployable files)
|
||||
// This is added by GradleRIO's backing project DeployUtils.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id "cpp"
|
||||
id "google-test-test-suite"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.1.1"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.2.1"
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -11,8 +11,8 @@ repositories {
|
||||
|
||||
wpi.maven.useLocal = false
|
||||
wpi.maven.useDevelopment = false
|
||||
wpi.versions.wpilibVersion = "2026.1.1"
|
||||
wpi.versions.wpimathVersion = "2026.1.1"
|
||||
wpi.versions.wpilibVersion = "2026.2.1"
|
||||
wpi.versions.wpimathVersion = "2026.2.1"
|
||||
|
||||
// Define my targets (RoboRIO) and artifacts (deployable files)
|
||||
// This is added by GradleRIO's backing project DeployUtils.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id "cpp"
|
||||
id "google-test-test-suite"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.1.1"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.2.1"
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -11,8 +11,8 @@ repositories {
|
||||
|
||||
wpi.maven.useLocal = false
|
||||
wpi.maven.useDevelopment = false
|
||||
wpi.versions.wpilibVersion = "2026.1.1"
|
||||
wpi.versions.wpimathVersion = "2026.1.1"
|
||||
wpi.versions.wpilibVersion = "2026.2.1"
|
||||
wpi.versions.wpimathVersion = "2026.2.1"
|
||||
|
||||
// Define my targets (RoboRIO) and artifacts (deployable files)
|
||||
// This is added by GradleRIO's backing project DeployUtils.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.1.1"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.2.1"
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
@@ -13,8 +13,8 @@ repositories {
|
||||
}
|
||||
|
||||
wpi.maven.useDevelopment = true
|
||||
wpi.versions.wpilibVersion = "2026.1.1"
|
||||
wpi.versions.wpimathVersion = "2026.1.1"
|
||||
wpi.versions.wpilibVersion = "2026.2.1"
|
||||
wpi.versions.wpimathVersion = "2026.2.1"
|
||||
|
||||
|
||||
// Define my targets (RoboRIO) and artifacts (deployable files)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.1.1"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.2.1"
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
@@ -9,8 +9,8 @@ targetCompatibility = JavaVersion.VERSION_17
|
||||
def ROBOT_MAIN_CLASS = "frc.robot.Main"
|
||||
|
||||
wpi.maven.useDevelopment = true
|
||||
wpi.versions.wpilibVersion = "2026.1.1"
|
||||
wpi.versions.wpimathVersion = "2026.1.1"
|
||||
wpi.versions.wpilibVersion = "2026.2.1"
|
||||
wpi.versions.wpimathVersion = "2026.2.1"
|
||||
|
||||
|
||||
// Define my targets (RoboRIO) and artifacts (deployable files)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.1.1"
|
||||
id "edu.wpi.first.GradleRIO" version "2026.2.1"
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
@@ -9,8 +9,8 @@ targetCompatibility = JavaVersion.VERSION_17
|
||||
def ROBOT_MAIN_CLASS = "frc.robot.Main"
|
||||
|
||||
wpi.maven.useDevelopment = true
|
||||
wpi.versions.wpilibVersion = "2026.1.1"
|
||||
wpi.versions.wpimathVersion = "2026.1.1"
|
||||
wpi.versions.wpilibVersion = "2026.2.1"
|
||||
wpi.versions.wpimathVersion = "2026.2.1"
|
||||
|
||||
|
||||
// Define my targets (RoboRIO) and artifacts (deployable files)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
[tool.robotpy]
|
||||
|
||||
# Version of robotpy this project depends on
|
||||
robotpy_version = "2026.1.1"
|
||||
robotpy_version = "2026.2.1"
|
||||
|
||||
# Which extra RobotPy components should be installed
|
||||
# -> equivalent to `pip install robotpy[extra1, ...]
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
[tool.robotpy]
|
||||
|
||||
# Version of robotpy this project depends on
|
||||
robotpy_version = "2026.1.1"
|
||||
robotpy_version = "2026.2.1"
|
||||
|
||||
# Which extra RobotPy components should be installed
|
||||
# -> equivalent to `pip install robotpy[extra1, ...]
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
[tool.robotpy]
|
||||
|
||||
# Version of robotpy this project depends on
|
||||
robotpy_version = "2026.1.1"
|
||||
robotpy_version = "2026.2.1"
|
||||
|
||||
# Which extra RobotPy components should be installed
|
||||
# -> equivalent to `pip install robotpy[extra1, ...]
|
||||
|
||||
@@ -5,19 +5,6 @@ if [ $# -eq 0 ]
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# To run any example, we want to use photonlib out of this repo
|
||||
# Build the wheel first
|
||||
pushd ../photon-lib/py
|
||||
if [ -d build ]
|
||||
then rm -rdf build
|
||||
fi
|
||||
python3 setup.py bdist_wheel
|
||||
popd
|
||||
|
||||
# Add the output directory to PYTHONPATH to make sure it gets picked up
|
||||
export PHOTONLIBPY_ROOT=../photon-lib/py
|
||||
export PYTHONPATH=$PHOTONLIBPY_ROOT
|
||||
|
||||
# Move to the right example folder
|
||||
cd $1
|
||||
|
||||
|
||||
0
scripts/armrunner.sh
Normal file → Executable file
0
scripts/armrunner.sh
Normal file → Executable file
@@ -33,6 +33,27 @@
|
||||
],
|
||||
"id": "500d656b7cc0ebd7"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"#### *Numpy Fix* - Important for Google Colab Users\n",
|
||||
"\n",
|
||||
"Google Colab comes with an incompatible version of Numpy installed. To fix this, please run the following cells below and **restart your session** when prompted."
|
||||
],
|
||||
"id": "b3a9e1a334bce144"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"%pip uninstall numpy -y\n",
|
||||
"%pip install \"numpy==1.26.4\""
|
||||
],
|
||||
"id": "7156e69495f48f49"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "markdown",
|
||||
@@ -41,7 +62,7 @@
|
||||
"\n",
|
||||
"Please run the cell below to be able to use the `create_onnx` and `create_rknn` functions."
|
||||
],
|
||||
"id": "798298b1dbe33d2d"
|
||||
"id": "51566ff74470e57"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
@@ -132,6 +153,7 @@
|
||||
" os.path.join(ultralytics_folder_name_yolov5, \"requirements.txt\"),\n",
|
||||
" \"torch<2.6.0\",\n",
|
||||
" \"onnx==1.18.0\",\n",
|
||||
" \"numpy==1.26.4\",\n",
|
||||
" \"onnxscript\",\n",
|
||||
" ]\n",
|
||||
" )\n",
|
||||
@@ -172,7 +194,7 @@
|
||||
"def run_onnx_conversion_no_anchor(model_path):\n",
|
||||
" check_or_clone_rockchip_repo(yolo_non_anchor_repo)\n",
|
||||
" run_pip_install_or_else_exit(\n",
|
||||
" [\"-e\", ultralytics_default_folder_name, \"onnx==1.18.0\", \"onnxscript\"]\n",
|
||||
" [\"-e\", ultralytics_default_folder_name, \"onnx==1.18.0\", \"numpy==1.26.4\", \"onnxscript\"]\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
" sys.path.insert(0, os.path.abspath(ultralytics_default_folder_name))\n",
|
||||
@@ -384,28 +406,7 @@
|
||||
" except SystemExit:\n",
|
||||
" print(\"RKNN Conversion failed, see output above\")\n"
|
||||
],
|
||||
"id": "ea6869140a61126d"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"#### *Numpy Fix* - Important for Google Colab Users\n",
|
||||
"\n",
|
||||
"Google Colab comes with an incompatible version of Numpy installed. To fix this, please run the following cells below and **restart your session** when prompted."
|
||||
],
|
||||
"id": "b3a9e1a334bce144"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"%pip uninstall numpy -y\n",
|
||||
"%pip install \"numpy>=1.23.0,<2.0.0\""
|
||||
],
|
||||
"id": "7156e69495f48f49"
|
||||
"id": "4d7a8adee7a03377"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
|
||||
Reference in New Issue
Block a user