mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-27 02:01:40 +00:00
Compare commits
5 Commits
v2024.1.1-
...
v2024.1.1-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7eb4645ee2 | ||
|
|
5136dad535 | ||
|
|
5a4eb54693 | ||
|
|
12774591a4 | ||
|
|
6666b22fc1 |
@@ -22,10 +22,10 @@ Note that these are case sensitive!
|
||||
* linuxathena
|
||||
* linuxarm32
|
||||
* linuxarm64
|
||||
* arm32"
|
||||
* arm64"
|
||||
* x86-64"
|
||||
* x86"
|
||||
* arm32
|
||||
* arm64
|
||||
* x86-64
|
||||
* x86
|
||||
- `-PtgtIp`: Specifies where `./gradlew deploy` should try to copy the fat JAR to
|
||||
- `-Pprofile`: enables JVM profiling
|
||||
|
||||
|
||||
11
build.gradle
11
build.gradle
@@ -2,7 +2,7 @@ plugins {
|
||||
id "com.diffplug.spotless" version "6.22.0"
|
||||
id "edu.wpi.first.NativeUtils" version "2024.2.0" apply false
|
||||
id "edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin" version "2020.2"
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-2"
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3"
|
||||
id 'edu.wpi.first.WpilibTools' version '1.3.0'
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ allprojects {
|
||||
apply from: "versioningHelper.gradle"
|
||||
|
||||
ext {
|
||||
wpilibVersion = "2024.1.1-beta-2"
|
||||
openCVversion = "4.8.0-1"
|
||||
wpilibVersion = "2024.1.1-beta-3"
|
||||
openCVversion = "4.8.0-2"
|
||||
joglVersion = "2.4.0-rc-20200307"
|
||||
javalinVersion = "5.6.2"
|
||||
frcYear = "2024"
|
||||
@@ -41,6 +41,11 @@ ext {
|
||||
|
||||
wpilibTools.deps.wpilibVersion = wpilibVersion
|
||||
|
||||
// Tell gradlerio what version of things to use (that we care about)
|
||||
// See: https://github.com/wpilibsuite/GradleRIO/blob/main/src/main/java/edu/wpi/first/gradlerio/wpi/WPIVersionsExtension.java
|
||||
wpi.getVersions().getOpencvVersion().convention(openCVversion);
|
||||
wpi.getVersions().getWpilibVersion().convention(wpilibVersion);
|
||||
|
||||
spotless {
|
||||
java {
|
||||
target fileTree('.') {
|
||||
|
||||
@@ -30,4 +30,6 @@ public enum CameraQuirk {
|
||||
CompletelyBroken,
|
||||
/** Has adjustable focus and autofocus switch */
|
||||
AdjustableFocus,
|
||||
/** Changing FPS repeatedly with small delay does not work correctly */
|
||||
StickyFPS,
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ public class QuirkyCamera {
|
||||
new QuirkyCamera(
|
||||
-1, -1, "mmal service 16.1", CameraQuirk.PiCam), // PiCam (via V4L2, not zerocopy)
|
||||
new QuirkyCamera(-1, -1, "unicam", CameraQuirk.PiCam), // PiCam (via V4L2, not zerocopy)
|
||||
new QuirkyCamera(0x85B, 0x46D, CameraQuirk.AdjustableFocus) // Logitech C925-e
|
||||
new QuirkyCamera(0x85B, 0x46D, CameraQuirk.AdjustableFocus), // Logitech C925-e
|
||||
new QuirkyCamera(0x6366, 0x0c45, CameraQuirk.StickyFPS) // Arducam OV2311
|
||||
);
|
||||
|
||||
public static final QuirkyCamera DefaultCamera = new QuirkyCamera(0, 0, "");
|
||||
|
||||
@@ -102,7 +102,8 @@ public class USBCameraSource extends VisionSource {
|
||||
protected USBCameraSettables(CameraConfiguration configuration) {
|
||||
super(configuration);
|
||||
getAllVideoModes();
|
||||
setVideoMode(videoModes.get(0));
|
||||
if (!cameraQuirks.hasQuirk(CameraQuirk.StickyFPS))
|
||||
setVideoMode(videoModes.get(0)); // fixes double FPS set
|
||||
}
|
||||
|
||||
public void setAutoExposure(boolean cameraAutoExposure) {
|
||||
|
||||
@@ -53,8 +53,6 @@ public class DataSocketHandler {
|
||||
@SuppressWarnings("FieldCanBeLocal")
|
||||
private final UIOutboundSubscriber uiOutboundSubscriber = new UIOutboundSubscriber(this);
|
||||
|
||||
public static class UIMap extends HashMap<String, Object> {}
|
||||
|
||||
private static class ThreadSafeSingleton {
|
||||
private static final DataSocketHandler INSTANCE = new DataSocketHandler();
|
||||
}
|
||||
@@ -70,23 +68,23 @@ public class DataSocketHandler {
|
||||
}
|
||||
|
||||
public void onConnect(WsConnectContext context) {
|
||||
users.add(context);
|
||||
context.session.setIdleTimeout(
|
||||
Duration.ofMillis(Long.MAX_VALUE)); // TODO: determine better value
|
||||
var remote = (InetSocketAddress) context.session.getRemoteAddress();
|
||||
var host = remote.getAddress().toString() + ":" + remote.getPort();
|
||||
logger.info("New websocket connection from " + host);
|
||||
users.add(context);
|
||||
dcService.publishEvent(
|
||||
new IncomingWebSocketEvent<>(
|
||||
DataChangeDestination.DCD_GENSETTINGS, "userConnected", context));
|
||||
}
|
||||
|
||||
protected void onClose(WsCloseContext context) {
|
||||
users.remove(context);
|
||||
var remote = (InetSocketAddress) context.session.getRemoteAddress();
|
||||
var host = remote.getAddress().toString() + ":" + remote.getPort();
|
||||
var reason = context.reason() != null ? context.reason() : "Connection closed by client";
|
||||
logger.info("Closing websocket connection from " + host + " for reason: " + reason);
|
||||
users.remove(context);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
@@ -349,7 +347,9 @@ public class DataSocketHandler {
|
||||
|
||||
private void sendMessage(Object message, WsContext user) throws JsonProcessingException {
|
||||
ByteBuffer b = ByteBuffer.wrap(objectMapper.writeValueAsBytes(message));
|
||||
user.send(b);
|
||||
if (user.session.isOpen()) {
|
||||
user.send(b);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastMessage(Object message, WsContext userToSkip)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "com.diffplug.spotless" version "6.1.2"
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-2" apply false
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3" apply false
|
||||
}
|
||||
|
||||
allprojects {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "com.diffplug.spotless" version "6.1.2"
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-2" apply false
|
||||
id "edu.wpi.first.GradleRIO" version "2024.1.1-beta-3" apply false
|
||||
}
|
||||
|
||||
apply from: "examples.gradle"
|
||||
|
||||
Reference in New Issue
Block a user