mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-26 01:51:40 +00:00
Compare commits
8 Commits
v2025.0.0-
...
v2025.0.0-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61552ad6ca | ||
|
|
fa66ed866c | ||
|
|
08b4bd1f03 | ||
|
|
c536a1c312 | ||
|
|
adb18fe711 | ||
|
|
7d1e748b0e | ||
|
|
3a9d22c76b | ||
|
|
417e1a65b6 |
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
@@ -16,6 +16,7 @@ on:
|
||||
- '**'
|
||||
- '!docs/**'
|
||||
- '.github/**'
|
||||
merge_group:
|
||||
|
||||
jobs:
|
||||
build-client:
|
||||
|
||||
1
.github/workflows/lint-format.yml
vendored
1
.github/workflows/lint-format.yml
vendored
@@ -16,6 +16,7 @@ on:
|
||||
- '**'
|
||||
- '!docs/**'
|
||||
- '.github/**'
|
||||
merge_group:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
||||
|
||||
1
.github/workflows/photon-code-docs.yml
vendored
1
.github/workflows/photon-code-docs.yml
vendored
@@ -16,6 +16,7 @@ on:
|
||||
- '**'
|
||||
- '!docs/**'
|
||||
- '.github/**'
|
||||
merge_group:
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
|
||||
1
.github/workflows/photonvision-docs.yml
vendored
1
.github/workflows/photonvision-docs.yml
vendored
@@ -11,6 +11,7 @@ on:
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- '.github/**'
|
||||
merge_group:
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
1
.github/workflows/python.yml
vendored
1
.github/workflows/python.yml
vendored
@@ -18,6 +18,7 @@ on:
|
||||
- '**'
|
||||
- '!docs/**'
|
||||
- '.github/**'
|
||||
merge_group:
|
||||
|
||||
jobs:
|
||||
buildAndDeploy:
|
||||
|
||||
@@ -20,6 +20,8 @@ modifiableFileExclude {
|
||||
\.ico$
|
||||
\.rknn$
|
||||
gradlew
|
||||
photon-lib/py/photonlibpy/generated/
|
||||
photon-targeting/src/generated/
|
||||
}
|
||||
|
||||
includeProject {
|
||||
|
||||
@@ -5,7 +5,7 @@ plugins {
|
||||
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 "2025.1.1-beta-1"
|
||||
id "edu.wpi.first.GradleRIO" version "2025.1.1-beta-2"
|
||||
id 'edu.wpi.first.WpilibTools' version '1.3.0'
|
||||
id 'com.google.protobuf' version '0.9.3' apply false
|
||||
id 'edu.wpi.first.GradleJni' version '1.1.0'
|
||||
@@ -30,7 +30,7 @@ ext.allOutputsFolder = file("$project.buildDir/outputs")
|
||||
apply from: "versioningHelper.gradle"
|
||||
|
||||
ext {
|
||||
wpilibVersion = "2025.1.1-beta-1"
|
||||
wpilibVersion = "2025.1.1-beta-2"
|
||||
wpimathVersion = wpilibVersion
|
||||
openCVYear = "2024"
|
||||
openCVversion = "4.8.0-4"
|
||||
@@ -109,7 +109,7 @@ spotless {
|
||||
}
|
||||
|
||||
wrapper {
|
||||
gradleVersion '8.4'
|
||||
gradleVersion '8.11'
|
||||
}
|
||||
|
||||
ext.getCurrentArch = {
|
||||
|
||||
@@ -88,4 +88,4 @@ The address in the code above (`photonvision.local`) is the hostname of the copr
|
||||
|
||||
## Camera Stream Ports
|
||||
|
||||
The camera streams start at they begin at 1181 with two ports for each camera (ex. 1181 and 1182 for camera one, 1183 and 1184 for camera two, etc.). The easiest way to identify the port of the camera that you want is by double clicking on the stream, which opens it in a separate page. The port will be listed below the stream.
|
||||
The camera streams start at 1181 with two ports for each camera (ex. 1181 and 1182 for camera one, 1183 and 1184 for camera two, etc.). The easiest way to identify the port of the camera that you want is by double clicking on the stream, which opens it in a separate page. The port will be listed below the stream.
|
||||
|
||||
@@ -8,7 +8,7 @@ In order for photonvision to connect to the roborio it needs to know your team n
|
||||
|
||||
### Camera Nickname
|
||||
|
||||
You **must** nickname your cameras in photonvision to ensure that every camera has a unique name. This is how we will identify cameras in robot code. The camera can be nickname using the edit button next to the camera name in the upper right of the Dashboard tab.
|
||||
You **must** nickname your cameras in PhotonVision to ensure that every camera has a unique name. This is how you will identify cameras in robot code. The camera can be nicknamed using the edit button next to the camera name in the upper right of the Dashboard tab.
|
||||
|
||||
```{image} images/editCameraName.png
|
||||
:align: center
|
||||
@@ -38,7 +38,7 @@ When detecting AprilTags, it's important to minimize 'motion blur' as much as po
|
||||
- Fixes
|
||||
- Lower your exposure as low as possible. Using gain and brightness to account for lack of brightness.
|
||||
- Other Options:
|
||||
- Don't use/rely vision measurements while moving.
|
||||
- Don't use/rely on vision measurements while moving.
|
||||
|
||||
```{image} images/motionblur.png
|
||||
:align: center
|
||||
@@ -51,7 +51,7 @@ When using an Orange Pi 5 with an OV9782 teams will usually change the following
|
||||
- Resolution:
|
||||
- Resolutions higher than 640x640 may not result in any higher detection accuracy and may lower {ref}`performance<docs/objectDetection/about-object-detection:Letterboxing>`.
|
||||
- Confidence:
|
||||
- 0.75 - 0.95 Lower values are fpr detecting warn game pieces or less ideal game pieces. Higher for less warn, more ideal game pieces.
|
||||
- 0.75 - 0.95 Lower values are for detecting worn game pieces or less ideal game pieces. Higher for less worn, more ideal game pieces.
|
||||
- White Balance Temperature:
|
||||
- Adjust this to achieve better color accuracy. This may be needed to increase confidence.
|
||||
- Set arducam specific camera type selector to OV9782
|
||||
|
||||
@@ -6,3 +6,4 @@ org.gradle.jvmargs= \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
|
||||
org.ysb33r.gradle.doxygen.download.url=https://frcmaven.wpi.edu/artifactory/generic-release-mirror/doxygen
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=permwrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
7
gradlew
vendored
7
gradlew
vendored
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -84,7 +86,8 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
22
gradlew.bat
vendored
22
gradlew.bat
vendored
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
|
||||
@@ -89,6 +89,21 @@ public class NetworkConfig {
|
||||
setShouldManage(shouldManage);
|
||||
}
|
||||
|
||||
public NetworkConfig(NetworkConfig config) {
|
||||
this(
|
||||
config.ntServerAddress,
|
||||
config.connectionType,
|
||||
config.staticIp,
|
||||
config.hostname,
|
||||
config.runNTServer,
|
||||
config.shouldManage,
|
||||
config.shouldPublishProto,
|
||||
config.networkManagerIface,
|
||||
config.setStaticCommand,
|
||||
config.setDHCPcommand,
|
||||
config.matchCamerasOnlyByPath);
|
||||
}
|
||||
|
||||
public Map<String, Object> toHashMap() {
|
||||
try {
|
||||
var ret = new ObjectMapper().convertValue(this, JacksonUtils.UIMap.class);
|
||||
|
||||
@@ -21,19 +21,6 @@ import edu.wpi.first.apriltag.AprilTagFieldLayout;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import org.photonvision.PhotonVersion;
|
||||
import org.photonvision.common.hardware.Platform;
|
||||
import org.photonvision.common.networking.NetworkManager;
|
||||
import org.photonvision.common.networking.NetworkUtils;
|
||||
import org.photonvision.common.util.SerializationUtils;
|
||||
import org.photonvision.mrcal.MrCalJNILoader;
|
||||
import org.photonvision.raspi.LibCameraJNILoader;
|
||||
import org.photonvision.vision.calibration.UICameraCalibrationCoefficients;
|
||||
import org.photonvision.vision.camera.QuirkyCamera;
|
||||
import org.photonvision.vision.processes.VisionModule;
|
||||
import org.photonvision.vision.processes.VisionModuleManager;
|
||||
import org.photonvision.vision.processes.VisionSource;
|
||||
|
||||
public class PhotonConfiguration {
|
||||
@@ -124,81 +111,6 @@ public class PhotonConfiguration {
|
||||
return cameraConfigurations.remove(name) != null;
|
||||
}
|
||||
|
||||
public Map<String, Object> toHashMap() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
var settingsSubmap = new HashMap<String, Object>();
|
||||
|
||||
// Hack active interfaces into networkSettings
|
||||
var netConfigMap = networkConfig.toHashMap();
|
||||
netConfigMap.put("networkInterfaceNames", NetworkUtils.getAllActiveWiredInterfaces());
|
||||
netConfigMap.put("networkingDisabled", NetworkManager.getInstance().networkingIsDisabled);
|
||||
|
||||
settingsSubmap.put("networkSettings", netConfigMap);
|
||||
|
||||
var lightingConfig = new UILightingConfig();
|
||||
lightingConfig.brightness = hardwareSettings.ledBrightnessPercentage;
|
||||
lightingConfig.supported = !hardwareConfig.ledPins.isEmpty();
|
||||
settingsSubmap.put("lighting", SerializationUtils.objectToHashMap(lightingConfig));
|
||||
// General Settings
|
||||
var generalSubmap = new HashMap<String, Object>();
|
||||
generalSubmap.put("version", PhotonVersion.versionString);
|
||||
generalSubmap.put(
|
||||
"gpuAcceleration",
|
||||
LibCameraJNILoader.isSupported()
|
||||
? "Zerocopy Libcamera Working"
|
||||
: ""); // TODO add support for other types of GPU accel
|
||||
generalSubmap.put("mrCalWorking", MrCalJNILoader.getInstance().isLoaded());
|
||||
generalSubmap.put("availableModels", NeuralNetworkModelManager.getInstance().getModels());
|
||||
generalSubmap.put(
|
||||
"supportedBackends", NeuralNetworkModelManager.getInstance().getSupportedBackends());
|
||||
generalSubmap.put(
|
||||
"hardwareModel",
|
||||
hardwareConfig.deviceName.isEmpty()
|
||||
? Platform.getHardwareModel()
|
||||
: hardwareConfig.deviceName);
|
||||
generalSubmap.put("hardwarePlatform", Platform.getPlatformName());
|
||||
settingsSubmap.put("general", generalSubmap);
|
||||
// AprilTagFieldLayout
|
||||
settingsSubmap.put("atfl", this.atfl);
|
||||
|
||||
map.put(
|
||||
"cameraSettings",
|
||||
VisionModuleManager.getInstance().getModules().stream()
|
||||
.map(VisionModule::toUICameraConfig)
|
||||
.map(SerializationUtils::objectToHashMap)
|
||||
.collect(Collectors.toList()));
|
||||
map.put("settings", settingsSubmap);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
public static class UILightingConfig {
|
||||
public int brightness = 0;
|
||||
public boolean supported = true;
|
||||
}
|
||||
|
||||
public static class UICameraConfiguration {
|
||||
@SuppressWarnings("unused")
|
||||
public double fov;
|
||||
|
||||
public String nickname;
|
||||
public String uniqueName;
|
||||
public HashMap<String, Object> currentPipelineSettings;
|
||||
public int currentPipelineIndex;
|
||||
public List<String> pipelineNicknames;
|
||||
public HashMap<Integer, HashMap<String, Object>> videoFormatList;
|
||||
public int outputStreamPort;
|
||||
public int inputStreamPort;
|
||||
public List<UICameraCalibrationCoefficients> calibrations;
|
||||
public boolean isFovConfigurable = true;
|
||||
public QuirkyCamera cameraQuirks;
|
||||
public boolean isCSICamera;
|
||||
public double minExposureRaw;
|
||||
public double maxExposureRaw;
|
||||
public double minWhiteBalanceTemp;
|
||||
public double maxWhiteBalanceTemp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PhotonConfiguration [\n hardwareConfig="
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.photonvision.common.configuration.ConfigManager;
|
||||
import org.photonvision.common.configuration.NetworkConfig;
|
||||
import org.photonvision.common.dataflow.DataChangeService;
|
||||
import org.photonvision.common.dataflow.events.OutgoingUIEvent;
|
||||
import org.photonvision.common.dataflow.websocket.UIPhotonConfiguration;
|
||||
import org.photonvision.common.hardware.HardwareManager;
|
||||
import org.photonvision.common.logging.LogGroup;
|
||||
import org.photonvision.common.logging.LogLevel;
|
||||
@@ -165,7 +166,8 @@ public class NetworkTablesManager {
|
||||
DataChangeService.getInstance()
|
||||
.publishEvent(
|
||||
new OutgoingUIEvent<>(
|
||||
"fullsettings", ConfigManager.getInstance().getConfig().toHashMap()));
|
||||
"fullsettings",
|
||||
UIPhotonConfiguration.programStateToUi(ConfigManager.getInstance().getConfig())));
|
||||
} catch (IOException e) {
|
||||
logger.error("Error deserializing atfl!");
|
||||
logger.error(atfl_json);
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) Photon Vision.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.photonvision.common.dataflow.websocket;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import org.photonvision.vision.calibration.UICameraCalibrationCoefficients;
|
||||
import org.photonvision.vision.camera.QuirkyCamera;
|
||||
|
||||
public class UICameraConfiguration {
|
||||
@SuppressWarnings("unused")
|
||||
public double fov;
|
||||
|
||||
public String nickname;
|
||||
public String uniqueName;
|
||||
public HashMap<String, Object> currentPipelineSettings;
|
||||
public int currentPipelineIndex;
|
||||
public List<String> pipelineNicknames;
|
||||
public HashMap<Integer, HashMap<String, Object>> videoFormatList;
|
||||
public int outputStreamPort;
|
||||
public int inputStreamPort;
|
||||
public List<UICameraCalibrationCoefficients> calibrations;
|
||||
public boolean isFovConfigurable = true;
|
||||
public QuirkyCamera cameraQuirks;
|
||||
public boolean isCSICamera;
|
||||
public double minExposureRaw;
|
||||
public double maxExposureRaw;
|
||||
public double minWhiteBalanceTemp;
|
||||
public double maxWhiteBalanceTemp;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (C) Photon Vision.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.photonvision.common.dataflow.websocket;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class UIGeneralSettings {
|
||||
public UIGeneralSettings(
|
||||
String version,
|
||||
String gpuAcceleration,
|
||||
boolean mrCalWorking,
|
||||
Map<String, ArrayList<String>> availableModels,
|
||||
List<String> supportedBackends,
|
||||
String hardwareModel,
|
||||
String hardwarePlatform) {
|
||||
this.version = version;
|
||||
this.gpuAcceleration = gpuAcceleration;
|
||||
this.mrCalWorking = mrCalWorking;
|
||||
this.availableModels = availableModels;
|
||||
this.supportedBackends = supportedBackends;
|
||||
this.hardwareModel = hardwareModel;
|
||||
this.hardwarePlatform = hardwarePlatform;
|
||||
}
|
||||
|
||||
public String version;
|
||||
public String gpuAcceleration;
|
||||
public boolean mrCalWorking;
|
||||
public Map<String, ArrayList<String>> availableModels;
|
||||
public List<String> supportedBackends;
|
||||
public String hardwareModel;
|
||||
public String hardwarePlatform;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) Photon Vision.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.photonvision.common.dataflow.websocket;
|
||||
|
||||
public class UILightingConfig {
|
||||
public UILightingConfig(int brightness, boolean supported) {
|
||||
this.brightness = brightness;
|
||||
this.supported = supported;
|
||||
}
|
||||
|
||||
public int brightness = 0;
|
||||
public boolean supported = true;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) Photon Vision.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.photonvision.common.dataflow.websocket;
|
||||
|
||||
import java.util.List;
|
||||
import org.photonvision.common.configuration.NetworkConfig;
|
||||
import org.photonvision.common.networking.NetworkUtils.NMDeviceInfo;
|
||||
|
||||
public class UINetConfig extends NetworkConfig {
|
||||
public UINetConfig(
|
||||
NetworkConfig config, List<NMDeviceInfo> networkInterfaceNames, boolean networkingDisabled) {
|
||||
super(config);
|
||||
this.networkInterfaceNames = networkInterfaceNames;
|
||||
this.networkingDisabled = networkingDisabled;
|
||||
}
|
||||
|
||||
public List<NMDeviceInfo> networkInterfaceNames;
|
||||
public boolean networkingDisabled;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) Photon Vision.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.photonvision.common.dataflow.websocket;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import org.photonvision.PhotonVersion;
|
||||
import org.photonvision.common.configuration.NeuralNetworkModelManager;
|
||||
import org.photonvision.common.configuration.PhotonConfiguration;
|
||||
import org.photonvision.common.hardware.Platform;
|
||||
import org.photonvision.common.networking.NetworkManager;
|
||||
import org.photonvision.common.networking.NetworkUtils;
|
||||
import org.photonvision.mrcal.MrCalJNILoader;
|
||||
import org.photonvision.raspi.LibCameraJNILoader;
|
||||
import org.photonvision.vision.processes.VisionModule;
|
||||
import org.photonvision.vision.processes.VisionModuleManager;
|
||||
|
||||
public class UIPhotonConfiguration {
|
||||
public List<UICameraConfiguration> cameraSettings;
|
||||
public UIProgramSettings settings;
|
||||
|
||||
public UIPhotonConfiguration(
|
||||
UIProgramSettings settings, List<UICameraConfiguration> cameraSettings) {
|
||||
this.cameraSettings = cameraSettings;
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
public static UIPhotonConfiguration programStateToUi(PhotonConfiguration c) {
|
||||
return new UIPhotonConfiguration(
|
||||
new UIProgramSettings(
|
||||
new UINetConfig(
|
||||
c.getNetworkConfig(),
|
||||
NetworkUtils.getAllActiveWiredInterfaces(),
|
||||
NetworkManager.getInstance().networkingIsDisabled),
|
||||
new UILightingConfig(
|
||||
c.getHardwareSettings().ledBrightnessPercentage,
|
||||
!c.getHardwareConfig().ledPins.isEmpty()),
|
||||
new UIGeneralSettings(
|
||||
PhotonVersion.versionString,
|
||||
// TODO add support for other types of GPU accel
|
||||
LibCameraJNILoader.isSupported() ? "Zerocopy Libcamera Working" : "",
|
||||
MrCalJNILoader.getInstance().isLoaded(),
|
||||
NeuralNetworkModelManager.getInstance().getModels(),
|
||||
NeuralNetworkModelManager.getInstance().getSupportedBackends(),
|
||||
c.getHardwareConfig().deviceName.isEmpty()
|
||||
? Platform.getHardwareModel()
|
||||
: c.getHardwareConfig().deviceName,
|
||||
Platform.getPlatformName()),
|
||||
c.getApriltagFieldLayout()),
|
||||
VisionModuleManager.getInstance().getModules().stream()
|
||||
.map(VisionModule::toUICameraConfig)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) Photon Vision.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.photonvision.common.dataflow.websocket;
|
||||
|
||||
import edu.wpi.first.apriltag.AprilTagFieldLayout;
|
||||
|
||||
public class UIProgramSettings {
|
||||
public UIProgramSettings(
|
||||
UINetConfig networkSettings,
|
||||
UILightingConfig lighting,
|
||||
UIGeneralSettings general,
|
||||
AprilTagFieldLayout atfl) {
|
||||
this.networkSettings = networkSettings;
|
||||
this.lighting = lighting;
|
||||
this.general = general;
|
||||
this.atfl = atfl;
|
||||
}
|
||||
|
||||
public UINetConfig networkSettings;
|
||||
public UILightingConfig lighting;
|
||||
public UIGeneralSettings general;
|
||||
public AprilTagFieldLayout atfl;
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import org.photonvision.common.configuration.CameraConfiguration;
|
||||
import org.photonvision.common.configuration.ConfigManager;
|
||||
import org.photonvision.common.dataflow.DataChangeService;
|
||||
import org.photonvision.common.dataflow.events.OutgoingUIEvent;
|
||||
import org.photonvision.common.dataflow.websocket.UIPhotonConfiguration;
|
||||
import org.photonvision.common.logging.LogGroup;
|
||||
import org.photonvision.common.logging.Logger;
|
||||
import org.photonvision.vision.pipeline.*;
|
||||
@@ -231,7 +232,8 @@ public class PipelineManager {
|
||||
DataChangeService.getInstance()
|
||||
.publishEvent(
|
||||
new OutgoingUIEvent<>(
|
||||
"fullsettings", ConfigManager.getInstance().getConfig().toHashMap()));
|
||||
"fullsettings",
|
||||
UIPhotonConfiguration.programStateToUi(ConfigManager.getInstance().getConfig())));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,13 +30,14 @@ import java.util.stream.Collectors;
|
||||
import org.opencv.core.Size;
|
||||
import org.photonvision.common.configuration.CameraConfiguration;
|
||||
import org.photonvision.common.configuration.ConfigManager;
|
||||
import org.photonvision.common.configuration.PhotonConfiguration;
|
||||
import org.photonvision.common.dataflow.CVPipelineResultConsumer;
|
||||
import org.photonvision.common.dataflow.DataChangeService;
|
||||
import org.photonvision.common.dataflow.events.OutgoingUIEvent;
|
||||
import org.photonvision.common.dataflow.networktables.NTDataPublisher;
|
||||
import org.photonvision.common.dataflow.statusLEDs.StatusLEDConsumer;
|
||||
import org.photonvision.common.dataflow.websocket.UICameraConfiguration;
|
||||
import org.photonvision.common.dataflow.websocket.UIDataPublisher;
|
||||
import org.photonvision.common.dataflow.websocket.UIPhotonConfiguration;
|
||||
import org.photonvision.common.hardware.HardwareManager;
|
||||
import org.photonvision.common.logging.LogGroup;
|
||||
import org.photonvision.common.logging.Logger;
|
||||
@@ -489,7 +490,8 @@ public class VisionModule {
|
||||
DataChangeService.getInstance()
|
||||
.publishEvent(
|
||||
new OutgoingUIEvent<>(
|
||||
"fullsettings", ConfigManager.getInstance().getConfig().toHashMap()));
|
||||
"fullsettings",
|
||||
UIPhotonConfiguration.programStateToUi(ConfigManager.getInstance().getConfig())));
|
||||
}
|
||||
|
||||
void saveAndBroadcastSelective(WsContext originContext, String propertyName, Object value) {
|
||||
@@ -516,8 +518,8 @@ public class VisionModule {
|
||||
saveAndBroadcastAll();
|
||||
}
|
||||
|
||||
public PhotonConfiguration.UICameraConfiguration toUICameraConfig() {
|
||||
var ret = new PhotonConfiguration.UICameraConfiguration();
|
||||
public UICameraConfiguration toUICameraConfig() {
|
||||
var ret = new UICameraConfiguration();
|
||||
|
||||
ret.fov = visionSource.getSettables().getFOV();
|
||||
ret.isCSICamera = visionSource.getCameraConfiguration().cameraType == CameraType.ZeroCopyPicam;
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.photonvision.common.configuration.CameraConfiguration;
|
||||
import org.photonvision.common.configuration.ConfigManager;
|
||||
import org.photonvision.common.dataflow.DataChangeService;
|
||||
import org.photonvision.common.dataflow.events.OutgoingUIEvent;
|
||||
import org.photonvision.common.dataflow.websocket.UIPhotonConfiguration;
|
||||
import org.photonvision.common.hardware.Platform;
|
||||
import org.photonvision.common.hardware.Platform.OSType;
|
||||
import org.photonvision.common.logging.LogGroup;
|
||||
@@ -122,7 +123,8 @@ public class VisionSourceManager {
|
||||
DataChangeService.getInstance()
|
||||
.publishEvent(
|
||||
new OutgoingUIEvent<>(
|
||||
"fullsettings", ConfigManager.getInstance().getConfig().toHashMap()));
|
||||
"fullsettings",
|
||||
UIPhotonConfiguration.programStateToUi(ConfigManager.getInstance().getConfig())));
|
||||
}
|
||||
|
||||
protected List<VisionSource> tryMatchCamImpl() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id "org.ysb33r.doxygen" version "0.7.0"
|
||||
id "org.ysb33r.doxygen" version "1.0.4"
|
||||
}
|
||||
|
||||
|
||||
@@ -36,15 +36,16 @@ doxygen {
|
||||
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 {
|
||||
executableByVersion('1.12.0')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
doxygen {
|
||||
generate_html true
|
||||
html_extra_stylesheet 'theme.css'
|
||||
option 'generate_html', true
|
||||
option 'html_extra_stylesheet', 'theme.css'
|
||||
|
||||
cppProjectZips.each {
|
||||
dependsOn it
|
||||
@@ -53,126 +54,37 @@ doxygen {
|
||||
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 '../photon-client/src/assets/images/logoSmall.svg'
|
||||
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
|
||||
option 'case_sense_names', false
|
||||
option 'extension_mapping', 'inc=C++ no_extension=C++'
|
||||
option 'extract_all', true
|
||||
option 'extract_static', true
|
||||
option 'file_patterns', '*'
|
||||
option 'full_path_names', true
|
||||
option 'generate_html', true
|
||||
option 'generate_latex', false
|
||||
option 'generate_treeview', true
|
||||
option 'html_extra_stylesheet', 'theme.css'
|
||||
option 'html_timestamp', true
|
||||
option 'javadoc_autobrief', true
|
||||
option 'project_name', 'PhotonVision C++'
|
||||
option 'project_logo', '../docs/source/assets/RoundLogo.png'
|
||||
option 'project_number', pubVersion
|
||||
option 'quiet', true
|
||||
option 'recursive', true
|
||||
option 'strip_code_comments', false
|
||||
option 'strip_from_inc_path', cppIncludeRoots
|
||||
option 'strip_from_path', cppIncludeRoots
|
||||
option 'use_mathjax', true
|
||||
option 'warnings', false
|
||||
option 'warn_if_incomplete_doc', true
|
||||
option 'warn_if_undocumented', false
|
||||
option '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" +
|
||||
option 'enable_preprocessing', true
|
||||
option 'macro_expansion', true
|
||||
option 'expand_only_predef', true
|
||||
option 'predefined', "WPI_DEPRECATED(x)=[[deprecated(x)]]\"\\\n" +
|
||||
"\"__cplusplus\"\\\n" +
|
||||
"\"HAL_ENUM(name)=enum name : int32_t"
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import math
|
||||
from typing import Any
|
||||
|
||||
@@ -11,6 +12,8 @@ from .rotTrlTransform3d import RotTrlTransform3d
|
||||
NWU_TO_EDN = Rotation3d(np.array([[0, -1, 0], [0, 0, -1], [1, 0, 0]]))
|
||||
EDN_TO_NWU = Rotation3d(np.array([[0, 0, 1], [-1, 0, 0], [0, -1, 0]]))
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class OpenCVHelp:
|
||||
@staticmethod
|
||||
@@ -243,7 +246,7 @@ class OpenCVHelp:
|
||||
|
||||
# solvePnP failed
|
||||
if reprojectionError is None or math.isnan(reprojectionError[0, 0]):
|
||||
print("SolvePNP_Square failed!")
|
||||
logger.error("SolvePNP_Square failed!")
|
||||
return None
|
||||
|
||||
if alt:
|
||||
@@ -303,6 +306,7 @@ class OpenCVHelp:
|
||||
)
|
||||
|
||||
if math.isnan(error):
|
||||
logger.error("SolvePNP_SQPNP failed!")
|
||||
return None
|
||||
|
||||
# We have no alternative so set it to best as well
|
||||
|
||||
@@ -42,9 +42,7 @@ class PhotonPipelineResultSerde:
|
||||
ret = Packet()
|
||||
|
||||
# metadata is of non-intrinsic type PhotonPipelineMetadata
|
||||
ret.encodeBytes(
|
||||
PhotonPipelineMetadata.photonStruct.pack(value.metadata).getData()
|
||||
)
|
||||
ret.encodeBytes(PhotonPipelineMetadata.photonStruct.pack(value.metadata).getData())
|
||||
|
||||
# targets is a custom VLA!
|
||||
ret.encodeList(value.targets, PhotonTrackedTarget.photonStruct)
|
||||
|
||||
@@ -298,43 +298,42 @@ class PhotonCamera:
|
||||
|
||||
# Check mdef UUID
|
||||
localUUID = PhotonPipelineResult.photonStruct.MESSAGE_VERSION
|
||||
remoteUUID = str(self._rawBytesEntry.getTopic().getProperty("message_uuid"))
|
||||
remoteUUID = self._rawBytesEntry.getTopic().getProperty("message_uuid")
|
||||
|
||||
if not remoteUUID:
|
||||
if remoteUUID is None:
|
||||
wpilib.reportWarning(
|
||||
f"PhotonVision coprocessor at path {self._path} has not reported a message interface UUID - is your coprocessor's camera started?",
|
||||
True,
|
||||
)
|
||||
else:
|
||||
# ntcore hands us a JSON string with leading/trailing quotes - remove those
|
||||
remoteUUID = str(remoteUUID).replace('"', "")
|
||||
|
||||
assert isinstance(remoteUUID, str)
|
||||
# ntcore hands us a JSON string with leading/trailing quotes - remove those
|
||||
remoteUUID = remoteUUID.replace('"', "")
|
||||
if localUUID != remoteUUID:
|
||||
# Verified version mismatch
|
||||
|
||||
if localUUID != remoteUUID:
|
||||
# Verified version mismatch
|
||||
bfw = """
|
||||
\n\n\n
|
||||
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
>>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
>>>
|
||||
>>> You are running an incompatible version
|
||||
>>> of PhotonVision on your coprocessor!
|
||||
>>>
|
||||
>>> This is neither tested nor supported.
|
||||
>>> You MUST update PhotonVision,
|
||||
>>> PhotonLib, or both.
|
||||
>>>
|
||||
>>> Your code will now crash.
|
||||
>>> We hope your day gets better.
|
||||
>>>
|
||||
>>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
\n\n
|
||||
"""
|
||||
|
||||
bfw = """
|
||||
\n\n\n
|
||||
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
>>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
>>>
|
||||
>>> You are running an incompatible version
|
||||
>>> of PhotonVision on your coprocessor!
|
||||
>>>
|
||||
>>> This is neither tested nor supported.
|
||||
>>> You MUST update PhotonVision,
|
||||
>>> PhotonLib, or both.
|
||||
>>>
|
||||
>>> Your code will now crash.
|
||||
>>> We hope your day gets better.
|
||||
>>>
|
||||
>>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
\n\n
|
||||
"""
|
||||
wpilib.reportWarning(bfw)
|
||||
|
||||
wpilib.reportWarning(bfw)
|
||||
|
||||
errText = f"Photonlibpy version {PHOTONLIB_VERSION} (With message UUID {localUUID}) does not match coprocessor version {versionString} (with message UUID {remoteUUID}). Please install photonlibpy version {versionString}, or update your coprocessor to {PHOTONLIB_VERSION}."
|
||||
wpilib.reportError(errText, True)
|
||||
raise Exception(errText)
|
||||
errText = f"Photonlibpy version {PHOTONLIB_VERSION} (With message UUID {localUUID}) does not match coprocessor version {versionString} (with message UUID {remoteUUID}). Please install photonlibpy version {versionString}, or update your coprocessor to {PHOTONLIB_VERSION}."
|
||||
wpilib.reportError(errText, True)
|
||||
raise Exception(errText)
|
||||
|
||||
1
photon-lib/py/photonlibpy/py.typed
Normal file
1
photon-lib/py/photonlibpy/py.typed
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
@@ -9,6 +9,8 @@ from wpimath.units import hertz, seconds
|
||||
|
||||
from ..estimation import RotTrlTransform3d
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SimCameraProperties:
|
||||
"""Calibration and performance values for this camera.
|
||||
@@ -46,7 +48,7 @@ class SimCameraProperties:
|
||||
) -> None:
|
||||
if fovDiag.degrees() < 1.0 or fovDiag.degrees() > 179.0:
|
||||
fovDiag = Rotation2d.fromDegrees(max(min(fovDiag.degrees(), 179.0), 1.0))
|
||||
logging.error("Requested invalid FOV! Clamping between (1, 179) degrees...")
|
||||
logger.error("Requested invalid FOV! Clamping between (1, 179) degrees...")
|
||||
|
||||
resDiag = math.sqrt(width * width + height * height)
|
||||
diagRatio = math.tan(fovDiag.radians() / 2.0)
|
||||
|
||||
@@ -55,6 +55,7 @@ descriptionStr = f"Pure-python implementation of PhotonLib for interfacing with
|
||||
setup(
|
||||
name="photonlibpy",
|
||||
packages=find_packages(),
|
||||
package_data={"photonlibpy": ["py.typed"]},
|
||||
version=versionString,
|
||||
install_requires=[
|
||||
"numpy~=2.1",
|
||||
|
||||
@@ -305,6 +305,7 @@ void PhotonCamera::VerifyVersion() {
|
||||
FRC_ReportError(frc::warn::Warning,
|
||||
"Cannot find property message_uuid for PhotonCamera {}",
|
||||
path);
|
||||
return;
|
||||
}
|
||||
std::string remote_uuid{remote_uuid_json};
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ bool:
|
||||
cpp_type: bool
|
||||
java_decode_method: decodeBoolean
|
||||
java_encode_shim: encodeBoolean
|
||||
python_decode_shim: decodeBoolean
|
||||
python_encode_shim: encodeBoolean
|
||||
int16:
|
||||
len: 2
|
||||
java_type: short
|
||||
@@ -13,27 +15,37 @@ int16:
|
||||
java_decode_method: decodeShort
|
||||
java_list_decode_method: decodeShortList
|
||||
java_encode_shim: encodeShort
|
||||
python_decode_shim: decodeShort
|
||||
python_encode_shim: encodeShort
|
||||
int32:
|
||||
len: 4
|
||||
java_type: int
|
||||
cpp_type: int32_t
|
||||
java_decode_method: decodeInt
|
||||
java_encode_shim: encodeInt
|
||||
python_decode_shim: decodeInt
|
||||
python_encode_shim: encodeInt
|
||||
int64:
|
||||
len: 8
|
||||
java_type: long
|
||||
cpp_type: int64_t
|
||||
java_decode_method: decodeLong
|
||||
java_encode_shim: encodeLong
|
||||
python_decode_shim: decodeLong
|
||||
python_encode_shim: encodeLong
|
||||
float32:
|
||||
len: 4
|
||||
java_type: float
|
||||
cpp_type: float
|
||||
java_decode_method: decodeFloat
|
||||
java_encode_shim: encodeFloat
|
||||
python_decode_shim: decodeFloat
|
||||
python_encode_shim: encodeFloat
|
||||
float64:
|
||||
len: 8
|
||||
java_type: double
|
||||
cpp_type: double
|
||||
java_decode_method: decodeDouble
|
||||
java_encode_shim: encodeDouble
|
||||
python_decode_shim: decodeDouble
|
||||
python_encode_shim: encodeDouble
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
java_encode_shim: PacketUtils.packTransform3d
|
||||
cpp_type: frc::Transform3d
|
||||
cpp_include: "<frc/geometry/Transform3d.h>"
|
||||
python_decode_shim: packet.decodeTransform
|
||||
python_decode_shim: decodeTransform
|
||||
python_encode_shim: encodeTransform
|
||||
java_import: edu.wpi.first.math.geometry.Transform3d
|
||||
# shim since we expect fields to at least exist
|
||||
|
||||
@@ -54,26 +54,26 @@ public class {{ name }}Serde implements PacketSerde<{{name}}> {
|
||||
@Override
|
||||
public void pack(Packet packet, {{ name }} value) {
|
||||
{%- for field in fields -%}
|
||||
{%- if field.type | is_shimmed %}
|
||||
{%- if field.type | is_shimmed %}
|
||||
{{ get_message_by_name(field.type).java_encode_shim }}(packet, value.{{ field.name }});
|
||||
{%- elif field.optional == True %}
|
||||
{%- elif field.optional == True %}
|
||||
// {{ field.name }} is optional! it better not be a VLA too
|
||||
packet.encodeOptional(value.{{ field.name }});
|
||||
{%- elif field.vla == True and field.type | is_intrinsic %}
|
||||
{%- elif field.vla == True and field.type | is_intrinsic %}
|
||||
// {{ field.name }} is a intrinsic VLA!
|
||||
packet.encode(value.{{ field.name }});
|
||||
{%- elif field.vla == True %}
|
||||
{%- elif field.vla == True %}
|
||||
// {{ field.name }} is a custom VLA!
|
||||
packet.encodeList(value.{{ field.name }});
|
||||
{%- elif field.type | is_intrinsic %}
|
||||
{%- elif field.type | is_intrinsic %}
|
||||
// field {{ field.name }} is of intrinsic type {{ field.type }}
|
||||
packet.encode(({{ type_map[field.type].java_type }}) value.{{ field.name }});
|
||||
{%- else %}
|
||||
{%- else %}
|
||||
// field {{ field.name }} is of non-intrinsic type {{ field.type }}
|
||||
{{ field.type }}.photonStruct.pack(packet, value.{{ field.name }});
|
||||
{%- endif %}
|
||||
{%- if not loop.last %}
|
||||
{% endif -%}
|
||||
{%- endif %}
|
||||
{%- if not loop.last %}
|
||||
{% endif -%}
|
||||
{% endfor%}
|
||||
}
|
||||
|
||||
@@ -81,26 +81,26 @@ public class {{ name }}Serde implements PacketSerde<{{name}}> {
|
||||
public {{ name }} unpack(Packet packet) {
|
||||
var ret = new {{ name }}();
|
||||
{% for field in fields -%}
|
||||
{%- if field.type | is_shimmed %}
|
||||
{%- if field.type | is_shimmed %}
|
||||
ret.{{ field.name }} = {{ get_message_by_name(field.type).java_decode_shim }}(packet);
|
||||
{%- elif field.optional == True %}
|
||||
{%- elif field.optional == True %}
|
||||
// {{ field.name }} is optional! it better not be a VLA too
|
||||
ret.{{ field.name }} = packet.decodeOptional({{ field.type }}.photonStruct);
|
||||
{%- elif field.vla == True and not field.type | is_intrinsic %}
|
||||
{%- elif field.vla == True and not field.type | is_intrinsic %}
|
||||
// {{ field.name }} is a custom VLA!
|
||||
ret.{{ field.name }} = packet.decodeList({{ field.type }}.photonStruct);
|
||||
{%- elif field.vla == True and field.type | is_intrinsic %}
|
||||
{%- elif field.vla == True and field.type | is_intrinsic %}
|
||||
// {{ field.name }} is a custom VLA!
|
||||
ret.{{ field.name }} = packet.decode{{ type_map[field.type].java_type.title() }}List();
|
||||
{%- elif field.type | is_intrinsic %}
|
||||
{%- elif field.type | is_intrinsic %}
|
||||
// {{ field.name }} is of intrinsic type {{ field.type }}
|
||||
ret.{{field.name}} = packet.{{ type_map[field.type].java_decode_method }}();
|
||||
{%- else %}
|
||||
{%- else %}
|
||||
// {{ field.name }} is of non-intrinsic type {{ field.type }}
|
||||
ret.{{field.name}} = {{ field.type }}.photonStruct.unpack(packet);
|
||||
{%- endif %}
|
||||
{%- if not loop.last %}
|
||||
{% endif -%}
|
||||
{%- endif %}
|
||||
{%- if not loop.last %}
|
||||
{% endif -%}
|
||||
{% endfor%}
|
||||
|
||||
return ret;
|
||||
@@ -125,4 +125,4 @@ public class {{ name }}Serde implements PacketSerde<{{name}}> {
|
||||
{%- endfor%}
|
||||
};
|
||||
}
|
||||
}
|
||||
}{{'\n'}}
|
||||
|
||||
@@ -24,21 +24,21 @@ namespace photon {
|
||||
using StructType = SerdeType<{{ name }}>;
|
||||
|
||||
void StructType::Pack(Packet& packet, const {{ name }}& value) {
|
||||
{% for field in fields -%}
|
||||
packet.Pack<{{ field | get_qualified_name }}>(value.{{ field.name }});
|
||||
{%- if not loop.last %}
|
||||
{% endif -%}
|
||||
{% endfor %}
|
||||
{% for field in fields -%}
|
||||
packet.Pack<{{ field | get_qualified_name }}>(value.{{ field.name }});
|
||||
{%- if not loop.last %}
|
||||
{% endif -%}
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
{{ name }} StructType::Unpack(Packet& packet) {
|
||||
return {{ name }}{ {{ name }}_PhotonStruct{
|
||||
{% for field in fields -%}
|
||||
.{{ field.name}} = packet.Unpack<{{ field | get_qualified_name }}>(),
|
||||
{%- if not loop.last %}
|
||||
{% endif -%}
|
||||
{% endfor %}
|
||||
}};
|
||||
return {{ name }}{ {{ name }}_PhotonStruct{
|
||||
{% for field in fields -%}
|
||||
.{{ field.name}} = packet.Unpack<{{ field | get_qualified_name }}>(),
|
||||
{%- if not loop.last %}
|
||||
{% endif -%}
|
||||
{% endfor %}
|
||||
}};
|
||||
}
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon{{'\n'}}
|
||||
|
||||
@@ -48,4 +48,4 @@ struct WPILIB_DLLEXPORT SerdeType<{{ name }}> {
|
||||
|
||||
static_assert(photon::PhotonStructSerializable<photon::{{ name }}>);
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon{{'\n'}}
|
||||
|
||||
@@ -44,7 +44,7 @@ class {{ name }}Serde:
|
||||
MESSAGE_FORMAT = "{{ message_fmt }}"
|
||||
|
||||
@staticmethod
|
||||
def pack(value: '{{ name }}' ) -> 'Packet':
|
||||
def pack(value: "{{ name }}") -> "Packet":
|
||||
ret = Packet()
|
||||
{% for field in fields -%}
|
||||
{%- if field.type | is_shimmed %}
|
||||
@@ -60,7 +60,7 @@ class {{ name }}Serde:
|
||||
ret.encode{{ type_map[field.type].java_type.title() }}List(value.{{ field.name }})
|
||||
{%- elif field.type | is_intrinsic %}
|
||||
# {{ field.name }} is of intrinsic type {{ field.type }}
|
||||
ret.{{ type_map[field.type].java_encode_shim }}(value.{{field.name}})
|
||||
ret.{{ type_map[field.type].python_encode_shim }}(value.{{field.name}})
|
||||
{%- else %}
|
||||
# {{ field.name }} is of non-intrinsic type {{ field.type }}
|
||||
ret.encodeBytes({{ field.type }}.photonStruct.pack(value.{{field.name}}).getData())
|
||||
@@ -70,13 +70,12 @@ class {{ name }}Serde:
|
||||
{% endfor%}
|
||||
return ret
|
||||
|
||||
|
||||
@staticmethod
|
||||
def unpack(packet: 'Packet') -> '{{ name }}':
|
||||
def unpack(packet: "Packet") -> "{{ name }}":
|
||||
ret = {{ name }}()
|
||||
{% for field in fields -%}
|
||||
{%- if field.type | is_shimmed %}
|
||||
ret.{{ field.name }} = {{ get_message_by_name(field.type).python_decode_shim }}()
|
||||
ret.{{ field.name }} = packet.{{ get_message_by_name(field.type).python_decode_shim }}()
|
||||
{%- elif field.optional == True %}
|
||||
# {{ field.name }} is optional! it better not be a VLA too
|
||||
ret.{{ field.name }} = packet.decodeOptional({{ field.type }}.photonStruct)
|
||||
@@ -88,7 +87,7 @@ class {{ name }}Serde:
|
||||
ret.{{ field.name }} = packet.decode{{ type_map[field.type].java_type.title() }}List()
|
||||
{%- elif field.type | is_intrinsic %}
|
||||
# {{ field.name }} is of intrinsic type {{ field.type }}
|
||||
ret.{{field.name}} = packet.{{ type_map[field.type].java_decode_method }}()
|
||||
ret.{{field.name}} = packet.{{ type_map[field.type].python_decode_shim }}()
|
||||
{%- else %}
|
||||
# {{ field.name }} is of non-intrinsic type {{ field.type }}
|
||||
ret.{{field.name}} = {{ field.type }}.photonStruct.unpack(packet)
|
||||
@@ -101,4 +100,4 @@ class {{ name }}Serde:
|
||||
|
||||
|
||||
# Hack ourselves into the base class
|
||||
{{ name }}.photonStruct = {{ name }}Serde()
|
||||
{{ name }}.photonStruct = {{ name }}Serde(){{'\n'}}
|
||||
|
||||
@@ -36,4 +36,4 @@ struct {{ name }}_PhotonStruct {
|
||||
friend bool operator==({{ name }}_PhotonStruct const&, {{ name }}_PhotonStruct const&) = default;
|
||||
};
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon{{'\n'}}
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.photonvision.common.dataflow.events.DataChangeEvent;
|
||||
import org.photonvision.common.dataflow.events.IncomingWebSocketEvent;
|
||||
import org.photonvision.common.dataflow.events.OutgoingUIEvent;
|
||||
import org.photonvision.common.dataflow.networktables.NetworkTablesManager;
|
||||
import org.photonvision.common.dataflow.websocket.UIPhotonConfiguration;
|
||||
import org.photonvision.common.logging.Logger;
|
||||
|
||||
public class UIInboundSubscriber extends DataChangeSubscriber {
|
||||
@@ -43,7 +44,8 @@ public class UIInboundSubscriber extends DataChangeSubscriber {
|
||||
if (incomingWSEvent.propertyName.equals("userConnected")
|
||||
|| incomingWSEvent.propertyName.equals("sendFullSettings")) {
|
||||
// Send full settings
|
||||
var settings = ConfigManager.getInstance().getConfig().toHashMap();
|
||||
var settings =
|
||||
UIPhotonConfiguration.programStateToUi(ConfigManager.getInstance().getConfig());
|
||||
var message =
|
||||
new OutgoingUIEvent<>("fullsettings", settings, incomingWSEvent.originContext);
|
||||
DataChangeService.getInstance().publishEvent(message);
|
||||
|
||||
@@ -25,13 +25,7 @@ import edu.wpi.first.apriltag.jni.AprilTagJNI;
|
||||
import edu.wpi.first.cscore.CameraServerJNI;
|
||||
import edu.wpi.first.cscore.OpenCvLoader;
|
||||
import edu.wpi.first.hal.JNIWrapper;
|
||||
import edu.wpi.first.math.jni.ArmFeedforwardJNI;
|
||||
import edu.wpi.first.math.jni.DAREJNI;
|
||||
import edu.wpi.first.math.jni.EigenJNI;
|
||||
import edu.wpi.first.math.jni.Ellipse2dJNI;
|
||||
import edu.wpi.first.math.jni.Pose3dJNI;
|
||||
import edu.wpi.first.math.jni.StateSpaceUtilJNI;
|
||||
import edu.wpi.first.math.jni.TrajectoryUtilJNI;
|
||||
import edu.wpi.first.math.jni.WPIMathJNI;
|
||||
import edu.wpi.first.net.WPINetJNI;
|
||||
import edu.wpi.first.networktables.NetworkTablesJNI;
|
||||
import edu.wpi.first.util.CombinedRuntimeLoader;
|
||||
@@ -48,18 +42,8 @@ public class WpilibLoader {
|
||||
OpenCvLoader.Helper.setExtractOnStaticLoad(false);
|
||||
JNIWrapper.Helper.setExtractOnStaticLoad(false);
|
||||
WPINetJNI.Helper.setExtractOnStaticLoad(false);
|
||||
WPIMathJNI.Helper.setExtractOnStaticLoad(false);
|
||||
AprilTagJNI.Helper.setExtractOnStaticLoad(false);
|
||||
|
||||
// wpimathjni is a bit odd, it's all in the wpimathjni shared lib, but the java side stuff has
|
||||
// been split.
|
||||
ArmFeedforwardJNI.Helper.setExtractOnStaticLoad(false);
|
||||
DAREJNI.Helper.setExtractOnStaticLoad(false);
|
||||
EigenJNI.Helper.setExtractOnStaticLoad(false);
|
||||
Ellipse2dJNI.Helper.setExtractOnStaticLoad(false);
|
||||
Pose3dJNI.Helper.setExtractOnStaticLoad(false);
|
||||
StateSpaceUtilJNI.Helper.setExtractOnStaticLoad(false);
|
||||
TrajectoryUtilJNI.Helper.setExtractOnStaticLoad(false);
|
||||
|
||||
try {
|
||||
CombinedRuntimeLoader.loadLibraries(
|
||||
WpilibLoader.class,
|
||||
|
||||
@@ -34,6 +34,7 @@ import edu.wpi.first.util.struct.Struct;
|
||||
* Auto-generated serialization/deserialization helper for MultiTargetPNPResult
|
||||
*/
|
||||
public class MultiTargetPNPResultSerde implements PacketSerde<MultiTargetPNPResult> {
|
||||
|
||||
@Override
|
||||
public final String getInterfaceUUID() { return "541096947e9f3ca2d3f425ff7b04aa7b"; }
|
||||
@Override
|
||||
@@ -79,6 +80,7 @@ public class MultiTargetPNPResultSerde implements PacketSerde<MultiTargetPNPResu
|
||||
@Override
|
||||
public Struct<?>[] getNestedWpilibMessages() {
|
||||
return new Struct<?>[] {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import edu.wpi.first.util.struct.Struct;
|
||||
* Auto-generated serialization/deserialization helper for PhotonPipelineMetadata
|
||||
*/
|
||||
public class PhotonPipelineMetadataSerde implements PacketSerde<PhotonPipelineMetadata> {
|
||||
|
||||
@Override
|
||||
public final String getInterfaceUUID() { return "ac0a45f686457856fb30af77699ea356"; }
|
||||
@Override
|
||||
@@ -84,12 +85,14 @@ public class PhotonPipelineMetadataSerde implements PacketSerde<PhotonPipelineMe
|
||||
@Override
|
||||
public PacketSerde<?>[] getNestedPhotonMessages() {
|
||||
return new PacketSerde<?>[] {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Struct<?>[] getNestedWpilibMessages() {
|
||||
return new Struct<?>[] {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import edu.wpi.first.util.struct.Struct;
|
||||
* Auto-generated serialization/deserialization helper for PhotonPipelineResult
|
||||
*/
|
||||
public class PhotonPipelineResultSerde implements PacketSerde<PhotonPipelineResult> {
|
||||
|
||||
@Override
|
||||
public final String getInterfaceUUID() { return "4b2ff16a964b5e2bf04be0c1454d91c4"; }
|
||||
@Override
|
||||
@@ -78,13 +79,14 @@ public class PhotonPipelineResultSerde implements PacketSerde<PhotonPipelineResu
|
||||
@Override
|
||||
public PacketSerde<?>[] getNestedPhotonMessages() {
|
||||
return new PacketSerde<?>[] {
|
||||
MultiTargetPNPResult.photonStruct,PhotonPipelineMetadata.photonStruct,PhotonTrackedTarget.photonStruct
|
||||
PhotonPipelineMetadata.photonStruct,MultiTargetPNPResult.photonStruct,PhotonTrackedTarget.photonStruct
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Struct<?>[] getNestedWpilibMessages() {
|
||||
return new Struct<?>[] {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import edu.wpi.first.math.geometry.Transform3d;
|
||||
* Auto-generated serialization/deserialization helper for PhotonTrackedTarget
|
||||
*/
|
||||
public class PhotonTrackedTargetSerde implements PacketSerde<PhotonTrackedTarget> {
|
||||
|
||||
@Override
|
||||
public final String getInterfaceUUID() { return "cc6dbb5c5c1e0fa808108019b20863f1"; }
|
||||
@Override
|
||||
|
||||
@@ -34,6 +34,7 @@ import edu.wpi.first.math.geometry.Transform3d;
|
||||
* Auto-generated serialization/deserialization helper for PnpResult
|
||||
*/
|
||||
public class PnpResultSerde implements PacketSerde<PnpResult> {
|
||||
|
||||
@Override
|
||||
public final String getInterfaceUUID() { return "ae4d655c0a3104d88df4f5db144c1e86"; }
|
||||
@Override
|
||||
@@ -86,6 +87,7 @@ public class PnpResultSerde implements PacketSerde<PnpResult> {
|
||||
@Override
|
||||
public PacketSerde<?>[] getNestedPhotonMessages() {
|
||||
return new PacketSerde<?>[] {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import edu.wpi.first.util.struct.Struct;
|
||||
* Auto-generated serialization/deserialization helper for TargetCorner
|
||||
*/
|
||||
public class TargetCornerSerde implements PacketSerde<TargetCorner> {
|
||||
|
||||
@Override
|
||||
public final String getInterfaceUUID() { return "16f6ac0dedc8eaccb951f4895d9e18b6"; }
|
||||
@Override
|
||||
@@ -72,12 +73,14 @@ public class TargetCornerSerde implements PacketSerde<TargetCorner> {
|
||||
@Override
|
||||
public PacketSerde<?>[] getNestedPhotonMessages() {
|
||||
return new PacketSerde<?>[] {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Struct<?>[] getNestedWpilibMessages() {
|
||||
return new Struct<?>[] {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
#include "photon/serde/MultiTargetPNPResultSerde.h"
|
||||
|
||||
@@ -30,10 +29,10 @@ void StructType::Pack(Packet& packet, const MultiTargetPNPResult& value) {
|
||||
}
|
||||
|
||||
MultiTargetPNPResult StructType::Unpack(Packet& packet) {
|
||||
return MultiTargetPNPResult{MultiTargetPNPResult_PhotonStruct{
|
||||
.estimatedPose = packet.Unpack<photon::PnpResult>(),
|
||||
.fiducialIDsUsed = packet.Unpack<std::vector<int16_t>>(),
|
||||
return MultiTargetPNPResult{ MultiTargetPNPResult_PhotonStruct{
|
||||
.estimatedPose = packet.Unpack<photon::PnpResult>(),
|
||||
.fiducialIDsUsed = packet.Unpack<std::vector<int16_t>>(),
|
||||
}};
|
||||
}
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
#include "photon/serde/PhotonPipelineMetadataSerde.h"
|
||||
|
||||
@@ -32,12 +31,12 @@ void StructType::Pack(Packet& packet, const PhotonPipelineMetadata& value) {
|
||||
}
|
||||
|
||||
PhotonPipelineMetadata StructType::Unpack(Packet& packet) {
|
||||
return PhotonPipelineMetadata{PhotonPipelineMetadata_PhotonStruct{
|
||||
.sequenceID = packet.Unpack<int64_t>(),
|
||||
.captureTimestampMicros = packet.Unpack<int64_t>(),
|
||||
.publishTimestampMicros = packet.Unpack<int64_t>(),
|
||||
.timeSinceLastPong = packet.Unpack<int64_t>(),
|
||||
return PhotonPipelineMetadata{ PhotonPipelineMetadata_PhotonStruct{
|
||||
.sequenceID = packet.Unpack<int64_t>(),
|
||||
.captureTimestampMicros = packet.Unpack<int64_t>(),
|
||||
.publishTimestampMicros = packet.Unpack<int64_t>(),
|
||||
.timeSinceLastPong = packet.Unpack<int64_t>(),
|
||||
}};
|
||||
}
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
#include "photon/serde/PhotonPipelineResultSerde.h"
|
||||
|
||||
@@ -27,17 +26,15 @@ using StructType = SerdeType<PhotonPipelineResult>;
|
||||
void StructType::Pack(Packet& packet, const PhotonPipelineResult& value) {
|
||||
packet.Pack<photon::PhotonPipelineMetadata>(value.metadata);
|
||||
packet.Pack<std::vector<photon::PhotonTrackedTarget>>(value.targets);
|
||||
packet.Pack<std::optional<photon::MultiTargetPNPResult>>(
|
||||
value.multitagResult);
|
||||
packet.Pack<std::optional<photon::MultiTargetPNPResult>>(value.multitagResult);
|
||||
}
|
||||
|
||||
PhotonPipelineResult StructType::Unpack(Packet& packet) {
|
||||
return PhotonPipelineResult{PhotonPipelineResult_PhotonStruct{
|
||||
.metadata = packet.Unpack<photon::PhotonPipelineMetadata>(),
|
||||
.targets = packet.Unpack<std::vector<photon::PhotonTrackedTarget>>(),
|
||||
.multitagResult =
|
||||
packet.Unpack<std::optional<photon::MultiTargetPNPResult>>(),
|
||||
return PhotonPipelineResult{ PhotonPipelineResult_PhotonStruct{
|
||||
.metadata = packet.Unpack<photon::PhotonPipelineMetadata>(),
|
||||
.targets = packet.Unpack<std::vector<photon::PhotonTrackedTarget>>(),
|
||||
.multitagResult = packet.Unpack<std::optional<photon::MultiTargetPNPResult>>(),
|
||||
}};
|
||||
}
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
#include "photon/serde/PhotonTrackedTargetSerde.h"
|
||||
|
||||
@@ -40,20 +39,20 @@ void StructType::Pack(Packet& packet, const PhotonTrackedTarget& value) {
|
||||
}
|
||||
|
||||
PhotonTrackedTarget StructType::Unpack(Packet& packet) {
|
||||
return PhotonTrackedTarget{PhotonTrackedTarget_PhotonStruct{
|
||||
.yaw = packet.Unpack<double>(),
|
||||
.pitch = packet.Unpack<double>(),
|
||||
.area = packet.Unpack<double>(),
|
||||
.skew = packet.Unpack<double>(),
|
||||
.fiducialId = packet.Unpack<int32_t>(),
|
||||
.objDetectId = packet.Unpack<int32_t>(),
|
||||
.objDetectConf = packet.Unpack<float>(),
|
||||
.bestCameraToTarget = packet.Unpack<frc::Transform3d>(),
|
||||
.altCameraToTarget = packet.Unpack<frc::Transform3d>(),
|
||||
.poseAmbiguity = packet.Unpack<double>(),
|
||||
.minAreaRectCorners = packet.Unpack<std::vector<photon::TargetCorner>>(),
|
||||
.detectedCorners = packet.Unpack<std::vector<photon::TargetCorner>>(),
|
||||
return PhotonTrackedTarget{ PhotonTrackedTarget_PhotonStruct{
|
||||
.yaw = packet.Unpack<double>(),
|
||||
.pitch = packet.Unpack<double>(),
|
||||
.area = packet.Unpack<double>(),
|
||||
.skew = packet.Unpack<double>(),
|
||||
.fiducialId = packet.Unpack<int32_t>(),
|
||||
.objDetectId = packet.Unpack<int32_t>(),
|
||||
.objDetectConf = packet.Unpack<float>(),
|
||||
.bestCameraToTarget = packet.Unpack<frc::Transform3d>(),
|
||||
.altCameraToTarget = packet.Unpack<frc::Transform3d>(),
|
||||
.poseAmbiguity = packet.Unpack<double>(),
|
||||
.minAreaRectCorners = packet.Unpack<std::vector<photon::TargetCorner>>(),
|
||||
.detectedCorners = packet.Unpack<std::vector<photon::TargetCorner>>(),
|
||||
}};
|
||||
}
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
#include "photon/serde/PnpResultSerde.h"
|
||||
|
||||
@@ -33,13 +32,13 @@ void StructType::Pack(Packet& packet, const PnpResult& value) {
|
||||
}
|
||||
|
||||
PnpResult StructType::Unpack(Packet& packet) {
|
||||
return PnpResult{PnpResult_PhotonStruct{
|
||||
.best = packet.Unpack<frc::Transform3d>(),
|
||||
.alt = packet.Unpack<frc::Transform3d>(),
|
||||
.bestReprojErr = packet.Unpack<double>(),
|
||||
.altReprojErr = packet.Unpack<double>(),
|
||||
.ambiguity = packet.Unpack<double>(),
|
||||
return PnpResult{ PnpResult_PhotonStruct{
|
||||
.best = packet.Unpack<frc::Transform3d>(),
|
||||
.alt = packet.Unpack<frc::Transform3d>(),
|
||||
.bestReprojErr = packet.Unpack<double>(),
|
||||
.altReprojErr = packet.Unpack<double>(),
|
||||
.ambiguity = packet.Unpack<double>(),
|
||||
}};
|
||||
}
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
#include "photon/serde/TargetCornerSerde.h"
|
||||
|
||||
@@ -30,10 +29,10 @@ void StructType::Pack(Packet& packet, const TargetCorner& value) {
|
||||
}
|
||||
|
||||
TargetCorner StructType::Unpack(Packet& packet) {
|
||||
return TargetCorner{TargetCorner_PhotonStruct{
|
||||
.x = packet.Unpack<double>(),
|
||||
.y = packet.Unpack<double>(),
|
||||
return TargetCorner{ TargetCorner_PhotonStruct{
|
||||
.x = packet.Unpack<double>(),
|
||||
.y = packet.Unpack<double>(),
|
||||
}};
|
||||
}
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
#include <wpi/SymbolExports.h>
|
||||
|
||||
@@ -31,6 +30,7 @@
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace photon {
|
||||
|
||||
template <>
|
||||
@@ -40,15 +40,13 @@ struct WPILIB_DLLEXPORT SerdeType<MultiTargetPNPResult> {
|
||||
}
|
||||
|
||||
static constexpr std::string_view GetSchema() {
|
||||
return "PnpResult:ae4d655c0a3104d88df4f5db144c1e86 estimatedPose;int16 "
|
||||
"fiducialIDsUsed[?];";
|
||||
return "PnpResult:ae4d655c0a3104d88df4f5db144c1e86 estimatedPose;int16 fiducialIDsUsed[?];";
|
||||
}
|
||||
|
||||
static photon::MultiTargetPNPResult Unpack(photon::Packet& packet);
|
||||
static void Pack(photon::Packet& packet,
|
||||
const photon::MultiTargetPNPResult& value);
|
||||
static void Pack(photon::Packet& packet, const photon::MultiTargetPNPResult& value);
|
||||
};
|
||||
|
||||
static_assert(photon::PhotonStructSerializable<photon::MultiTargetPNPResult>);
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
#include <wpi/SymbolExports.h>
|
||||
|
||||
@@ -29,6 +28,7 @@
|
||||
// Includes for dependant types
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
namespace photon {
|
||||
|
||||
template <>
|
||||
@@ -38,15 +38,13 @@ struct WPILIB_DLLEXPORT SerdeType<PhotonPipelineMetadata> {
|
||||
}
|
||||
|
||||
static constexpr std::string_view GetSchema() {
|
||||
return "int64 sequenceID;int64 captureTimestampMicros;int64 "
|
||||
"publishTimestampMicros;int64 timeSinceLastPong;";
|
||||
return "int64 sequenceID;int64 captureTimestampMicros;int64 publishTimestampMicros;int64 timeSinceLastPong;";
|
||||
}
|
||||
|
||||
static photon::PhotonPipelineMetadata Unpack(photon::Packet& packet);
|
||||
static void Pack(photon::Packet& packet,
|
||||
const photon::PhotonPipelineMetadata& value);
|
||||
static void Pack(photon::Packet& packet, const photon::PhotonPipelineMetadata& value);
|
||||
};
|
||||
|
||||
static_assert(photon::PhotonStructSerializable<photon::PhotonPipelineMetadata>);
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
#include <wpi/SymbolExports.h>
|
||||
|
||||
@@ -34,6 +33,7 @@
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace photon {
|
||||
|
||||
template <>
|
||||
@@ -43,18 +43,13 @@ struct WPILIB_DLLEXPORT SerdeType<PhotonPipelineResult> {
|
||||
}
|
||||
|
||||
static constexpr std::string_view GetSchema() {
|
||||
return "PhotonPipelineMetadata:ac0a45f686457856fb30af77699ea356 "
|
||||
"metadata;PhotonTrackedTarget:cc6dbb5c5c1e0fa808108019b20863f1 "
|
||||
"targets[?];optional "
|
||||
"MultiTargetPNPResult:541096947e9f3ca2d3f425ff7b04aa7b "
|
||||
"multitagResult;";
|
||||
return "PhotonPipelineMetadata:ac0a45f686457856fb30af77699ea356 metadata;PhotonTrackedTarget:cc6dbb5c5c1e0fa808108019b20863f1 targets[?];optional MultiTargetPNPResult:541096947e9f3ca2d3f425ff7b04aa7b multitagResult;";
|
||||
}
|
||||
|
||||
static photon::PhotonPipelineResult Unpack(photon::Packet& packet);
|
||||
static void Pack(photon::Packet& packet,
|
||||
const photon::PhotonPipelineResult& value);
|
||||
static void Pack(photon::Packet& packet, const photon::PhotonPipelineResult& value);
|
||||
};
|
||||
|
||||
static_assert(photon::PhotonStructSerializable<photon::PhotonPipelineResult>);
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
#include <wpi/SymbolExports.h>
|
||||
|
||||
@@ -32,6 +31,7 @@
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace photon {
|
||||
|
||||
template <>
|
||||
@@ -41,19 +41,13 @@ struct WPILIB_DLLEXPORT SerdeType<PhotonTrackedTarget> {
|
||||
}
|
||||
|
||||
static constexpr std::string_view GetSchema() {
|
||||
return "float64 yaw;float64 pitch;float64 area;float64 skew;int32 "
|
||||
"fiducialId;int32 objDetectId;float32 objDetectConf;Transform3d "
|
||||
"bestCameraToTarget;Transform3d altCameraToTarget;float64 "
|
||||
"poseAmbiguity;TargetCorner:16f6ac0dedc8eaccb951f4895d9e18b6 "
|
||||
"minAreaRectCorners[?];TargetCorner:"
|
||||
"16f6ac0dedc8eaccb951f4895d9e18b6 detectedCorners[?];";
|
||||
return "float64 yaw;float64 pitch;float64 area;float64 skew;int32 fiducialId;int32 objDetectId;float32 objDetectConf;Transform3d bestCameraToTarget;Transform3d altCameraToTarget;float64 poseAmbiguity;TargetCorner:16f6ac0dedc8eaccb951f4895d9e18b6 minAreaRectCorners[?];TargetCorner:16f6ac0dedc8eaccb951f4895d9e18b6 detectedCorners[?];";
|
||||
}
|
||||
|
||||
static photon::PhotonTrackedTarget Unpack(photon::Packet& packet);
|
||||
static void Pack(photon::Packet& packet,
|
||||
const photon::PhotonTrackedTarget& value);
|
||||
static void Pack(photon::Packet& packet, const photon::PhotonTrackedTarget& value);
|
||||
};
|
||||
|
||||
static_assert(photon::PhotonStructSerializable<photon::PhotonTrackedTarget>);
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
#include <wpi/SymbolExports.h>
|
||||
|
||||
@@ -30,6 +29,7 @@
|
||||
#include <frc/geometry/Transform3d.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
namespace photon {
|
||||
|
||||
template <>
|
||||
@@ -39,8 +39,7 @@ struct WPILIB_DLLEXPORT SerdeType<PnpResult> {
|
||||
}
|
||||
|
||||
static constexpr std::string_view GetSchema() {
|
||||
return "Transform3d best;Transform3d alt;float64 bestReprojErr;float64 "
|
||||
"altReprojErr;float64 ambiguity;";
|
||||
return "Transform3d best;Transform3d alt;float64 bestReprojErr;float64 altReprojErr;float64 ambiguity;";
|
||||
}
|
||||
|
||||
static photon::PnpResult Unpack(photon::Packet& packet);
|
||||
@@ -49,4 +48,4 @@ struct WPILIB_DLLEXPORT SerdeType<PnpResult> {
|
||||
|
||||
static_assert(photon::PhotonStructSerializable<photon::PnpResult>);
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
#include <wpi/SymbolExports.h>
|
||||
|
||||
@@ -29,6 +28,7 @@
|
||||
// Includes for dependant types
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
namespace photon {
|
||||
|
||||
template <>
|
||||
@@ -47,4 +47,4 @@ struct WPILIB_DLLEXPORT SerdeType<TargetCorner> {
|
||||
|
||||
static_assert(photon::PhotonStructSerializable<photon::TargetCorner>);
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -17,15 +17,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
// Includes for dependant types
|
||||
#include "photon/targeting/PnpResult.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "photon/targeting/PnpResult.h"
|
||||
|
||||
namespace photon {
|
||||
|
||||
@@ -33,8 +31,7 @@ struct MultiTargetPNPResult_PhotonStruct {
|
||||
photon::PnpResult estimatedPose;
|
||||
std::vector<int16_t> fiducialIDsUsed;
|
||||
|
||||
friend bool operator==(MultiTargetPNPResult_PhotonStruct const&,
|
||||
MultiTargetPNPResult_PhotonStruct const&) = default;
|
||||
friend bool operator==(MultiTargetPNPResult_PhotonStruct const&, MultiTargetPNPResult_PhotonStruct const&) = default;
|
||||
};
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
// Includes for dependant types
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
namespace photon {
|
||||
|
||||
struct PhotonPipelineMetadata_PhotonStruct {
|
||||
@@ -31,8 +31,7 @@ struct PhotonPipelineMetadata_PhotonStruct {
|
||||
int64_t publishTimestampMicros;
|
||||
int64_t timeSinceLastPong;
|
||||
|
||||
friend bool operator==(PhotonPipelineMetadata_PhotonStruct const&,
|
||||
PhotonPipelineMetadata_PhotonStruct const&) = default;
|
||||
friend bool operator==(PhotonPipelineMetadata_PhotonStruct const&, PhotonPipelineMetadata_PhotonStruct const&) = default;
|
||||
};
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -17,18 +17,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
// Includes for dependant types
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "photon/targeting/MultiTargetPNPResult.h"
|
||||
#include "photon/targeting/PhotonPipelineMetadata.h"
|
||||
#include "photon/targeting/PhotonTrackedTarget.h"
|
||||
#include <optional>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace photon {
|
||||
|
||||
@@ -37,8 +35,7 @@ struct PhotonPipelineResult_PhotonStruct {
|
||||
std::vector<photon::PhotonTrackedTarget> targets;
|
||||
std::optional<photon::MultiTargetPNPResult> multitagResult;
|
||||
|
||||
friend bool operator==(PhotonPipelineResult_PhotonStruct const&,
|
||||
PhotonPipelineResult_PhotonStruct const&) = default;
|
||||
friend bool operator==(PhotonPipelineResult_PhotonStruct const&, PhotonPipelineResult_PhotonStruct const&) = default;
|
||||
};
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -17,17 +17,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
// Includes for dependant types
|
||||
#include "photon/targeting/TargetCorner.h"
|
||||
#include <frc/geometry/Transform3d.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <frc/geometry/Transform3d.h>
|
||||
|
||||
#include "photon/targeting/TargetCorner.h"
|
||||
|
||||
namespace photon {
|
||||
|
||||
@@ -45,8 +42,7 @@ struct PhotonTrackedTarget_PhotonStruct {
|
||||
std::vector<photon::TargetCorner> minAreaRectCorners;
|
||||
std::vector<photon::TargetCorner> detectedCorners;
|
||||
|
||||
friend bool operator==(PhotonTrackedTarget_PhotonStruct const&,
|
||||
PhotonTrackedTarget_PhotonStruct const&) = default;
|
||||
friend bool operator==(PhotonTrackedTarget_PhotonStruct const&, PhotonTrackedTarget_PhotonStruct const&) = default;
|
||||
};
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -17,13 +17,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
// Includes for dependant types
|
||||
#include <frc/geometry/Transform3d.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <frc/geometry/Transform3d.h>
|
||||
|
||||
namespace photon {
|
||||
|
||||
@@ -34,8 +33,7 @@ struct PnpResult_PhotonStruct {
|
||||
double altReprojErr;
|
||||
double ambiguity;
|
||||
|
||||
friend bool operator==(PnpResult_PhotonStruct const&,
|
||||
PnpResult_PhotonStruct const&) = default;
|
||||
friend bool operator==(PnpResult_PhotonStruct const&, PnpResult_PhotonStruct const&) = default;
|
||||
};
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -17,20 +17,19 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// THIS std::FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO
|
||||
// NOT MODIFY
|
||||
// THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py. DO NOT MODIFY
|
||||
|
||||
// Includes for dependant types
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
namespace photon {
|
||||
|
||||
struct TargetCorner_PhotonStruct {
|
||||
double x;
|
||||
double y;
|
||||
|
||||
friend bool operator==(TargetCorner_PhotonStruct const&,
|
||||
TargetCorner_PhotonStruct const&) = default;
|
||||
friend bool operator==(TargetCorner_PhotonStruct const&, TargetCorner_PhotonStruct const&) = default;
|
||||
};
|
||||
|
||||
} // namespace photon
|
||||
} // namespace photon
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
id "cpp"
|
||||
id "google-test-test-suite"
|
||||
id "edu.wpi.first.GradleRIO" version "2025.1.1-beta-1"
|
||||
id "edu.wpi.first.GradleRIO" version "2025.1.1-beta-2"
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -11,8 +11,8 @@ repositories {
|
||||
|
||||
wpi.maven.useLocal = false
|
||||
wpi.maven.useDevelopment = false
|
||||
wpi.versions.wpilibVersion = "2025.1.1-beta-1"
|
||||
wpi.versions.wpimathVersion = "2025.1.1-beta-1"
|
||||
wpi.versions.wpilibVersion = "2025.1.1-beta-2"
|
||||
wpi.versions.wpimathVersion = "2025.1.1-beta-2"
|
||||
|
||||
// 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 "2025.1.1-beta-1"
|
||||
id "edu.wpi.first.GradleRIO" version "2025.1.1-beta-2"
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -11,8 +11,8 @@ repositories {
|
||||
|
||||
wpi.maven.useLocal = false
|
||||
wpi.maven.useDevelopment = false
|
||||
wpi.versions.wpilibVersion = "2025.1.1-beta-1"
|
||||
wpi.versions.wpimathVersion = "2025.1.1-beta-1"
|
||||
wpi.versions.wpilibVersion = "2025.1.1-beta-2"
|
||||
wpi.versions.wpimathVersion = "2025.1.1-beta-2"
|
||||
|
||||
// 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 "2025.1.1-beta-1"
|
||||
id "edu.wpi.first.GradleRIO" version "2025.1.1-beta-2"
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -11,8 +11,8 @@ repositories {
|
||||
|
||||
wpi.maven.useLocal = false
|
||||
wpi.maven.useDevelopment = false
|
||||
wpi.versions.wpilibVersion = "2025.1.1-beta-1"
|
||||
wpi.versions.wpimathVersion = "2025.1.1-beta-1"
|
||||
wpi.versions.wpilibVersion = "2025.1.1-beta-2"
|
||||
wpi.versions.wpimathVersion = "2025.1.1-beta-2"
|
||||
|
||||
// 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 "2025.1.1-beta-1"
|
||||
id "edu.wpi.first.GradleRIO" version "2025.1.1-beta-2"
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
@@ -13,8 +13,8 @@ repositories {
|
||||
}
|
||||
|
||||
wpi.maven.useDevelopment = true
|
||||
wpi.versions.wpilibVersion = "2025.1.1-beta-1"
|
||||
wpi.versions.wpimathVersion = "2025.1.1-beta-1"
|
||||
wpi.versions.wpilibVersion = "2025.1.1-beta-2"
|
||||
wpi.versions.wpimathVersion = "2025.1.1-beta-2"
|
||||
|
||||
|
||||
// Define my targets (RoboRIO) and artifacts (deployable files)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO" version "2025.1.1-beta-1"
|
||||
id "edu.wpi.first.GradleRIO" version "2025.1.1-beta-2"
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
@@ -9,8 +9,8 @@ targetCompatibility = JavaVersion.VERSION_11
|
||||
def ROBOT_MAIN_CLASS = "frc.robot.Main"
|
||||
|
||||
wpi.maven.useDevelopment = true
|
||||
wpi.versions.wpilibVersion = "2025.1.1-beta-1"
|
||||
wpi.versions.wpimathVersion = "2025.1.1-beta-1"
|
||||
wpi.versions.wpilibVersion = "2025.1.1-beta-2"
|
||||
wpi.versions.wpimathVersion = "2025.1.1-beta-2"
|
||||
|
||||
|
||||
// Define my targets (RoboRIO) and artifacts (deployable files)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "edu.wpi.first.GradleRIO" version "2025.1.1-beta-1"
|
||||
id "edu.wpi.first.GradleRIO" version "2025.1.1-beta-2"
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
@@ -9,8 +9,8 @@ targetCompatibility = JavaVersion.VERSION_11
|
||||
def ROBOT_MAIN_CLASS = "frc.robot.Main"
|
||||
|
||||
wpi.maven.useDevelopment = true
|
||||
wpi.versions.wpilibVersion = "2025.1.1-beta-1"
|
||||
wpi.versions.wpimathVersion = "2025.1.1-beta-1"
|
||||
wpi.versions.wpilibVersion = "2025.1.1-beta-2"
|
||||
wpi.versions.wpimathVersion = "2025.1.1-beta-2"
|
||||
|
||||
|
||||
// Define my targets (RoboRIO) and artifacts (deployable files)
|
||||
|
||||
Reference in New Issue
Block a user