Skip to content

Commit c0f77d2

Browse files
committed
Initial snapshot of Work In Progress
0 parents  commit c0f77d2

12 files changed

+934
-0
lines changed

.gitattributes

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+

.gitignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Compiled class file
2+
*.class
3+
4+
# Log file
5+
*.log
6+
7+
# BlueJ files
8+
*.ctxt
9+
10+
# Mobile Tools for Java (J2ME)
11+
.mtj.tmp/
12+
13+
# Package Files #
14+
*.jar
15+
*.war
16+
*.nar
17+
*.ear
18+
*.zip
19+
*.tar.gz
20+
*.rar
21+
22+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23+
hs_err_pid*
24+
replay_pid*
25+
26+
# Ignore Gradle project-specific cache directory
27+
.gradle
28+
29+
# Ignore Gradle build output directory
30+
build
31+
bin
32+
33+
# Ignore log files
34+
logs/**/*.txt
35+
36+
# Ignore saved videos
37+
videos

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"java.configuration.updateBuildConfiguration": "interactive"
3+
}

build.gradle

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
plugins {
2+
// Apply the application plugin to add support for building a CLI application in Java.
3+
id 'application'
4+
}
5+
6+
repositories {
7+
// Use Maven Central for resolving dependencies.
8+
mavenCentral()
9+
maven {
10+
url = uri("https://frcmaven.wpi.edu/artifactory/release")
11+
}
12+
}
13+
14+
dependencies {
15+
implementation 'edu.wpi.first.cameraserver:cameraserver-java:2025.2.1'
16+
implementation 'edu.wpi.first.cscore:cscore-java:2025.2.1'
17+
implementation 'edu.wpi.first.wpilibj:wpilibj-java:2025.2.1'
18+
implementation 'org.openpnp:opencv:4.6.0-0' // available for download up to 4.9.0 but APT only goes up to 4.6
19+
implementation 'edu.wpi.first.ntcore:ntcore-java:2024.3.2'
20+
implementation 'edu.wpi.first.wpiutil:wpiutil-java:2024.3.2'
21+
implementation 'edu.wpi.first.wpinet:wpinet-java:2024.3.2'
22+
implementation 'edu.wpi.first.wpimath:wpimath-java:2024.3.2'
23+
implementation 'com.google.code.gson:gson:2.11.0'
24+
25+
// runtimeOnly 'edu.wpi.first.cscore:cscorejni:2025.2.1:linuxx86-64'
26+
runtimeOnly 'edu.wpi.first.wpiunits:wpiunits-java:2024.3.2' // needed for wpimath
27+
runtimeOnly 'edu.wpi.first.ntcore:ntcore-jni:2024.3.2:linuxarm64' // needed for ntcore
28+
runtimeOnly 'edu.wpi.first.wpiutil:wpiutil-jni:2024.3.2:linuxarm64' // needed for ntcore
29+
runtimeOnly 'edu.wpi.first.wpinet:wpinet-jni:2024.3.2:linuxarm64'
30+
runtimeOnly 'edu.wpi.first.ntcore:ntcore-jni:2024.3.2:linuxx86-64' // needed for ntcore
31+
runtimeOnly 'edu.wpi.first.wpiutil:wpiutil-jni:2024.3.2:linuxx86-64' // needed for ntcore
32+
runtimeOnly 'edu.wpi.first.wpinet:wpinet-jni:2024.3.2:linuxx86-64'
33+
runtimeOnly 'edu.wpi.first.cscore:cscore-jni:2025.2.1:linuxx86-64'
34+
runtimeOnly 'com.fasterxml.jackson.core:jackson-core:2.18.0' // needed so wpiutil doesn't get upset
35+
runtimeOnly 'us.hebi.quickbuf:quickbuf-runtime:1.4' // needed so wpimath doesn't get upset
36+
runtimeOnly 'org.ejml:ejml-core:0.43.1' // needed for wpimath
37+
}
38+
39+
// Apply a specific Java toolchain to ease working on different environments.
40+
java {
41+
toolchain {
42+
languageVersion = JavaLanguageVersion.of(17)
43+
}
44+
}
45+
46+
application {
47+
// Define the main class for the application.
48+
mainClass = 'frc.drivercam.DrivercamMain'
49+
// Look, this is supposed to just make you able to attach JDB but for some reason I can't reproduce the crash when it's enabled
50+
// When disabled, there problems in the RectVisionLibrary, somewhere near or within the call to Imgproc.findContours call
51+
// There are segfaults, and we get errors directly from malloc and free-- it seems to be corrupting the allocation header
52+
// If anyone else wants to find out what caused this, good luck.
53+
applicationDefaultJvmArgs = ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n']
54+
}
55+
56+
tasks.register("setupRunScript") {
57+
dependsOn "compileJava"
58+
mkdir "$buildDir"
59+
def path = sourceSets.main.runtimeClasspath.asPath
60+
def f = file("$buildDir/run.sh")
61+
f.setText("#!/bin/sh\nexport CLASSPATH=\"$path\"\nexport LD_PRELOAD=\"\$(find \"\${NATIVECACHE:-\$HOME/.wpilib/nativecache}\" -name '*wpiutil*' | paste -sd :)\"\njava -agentlib:jdwp=transport=dt_socket,server=y,suspend=n frc.drivercam.DrivercamMain \"\$@\"")
62+
f.setExecutable(true)
63+
}
64+
65+
tasks.named("build") {
66+
dependsOn "setupRunScript"
67+
}
68+
69+
tasks.withType(JavaCompile) {}
70+
71+
tasks.withType(JavaExec) {
72+
def found = fileTree(dir: System.properties["user.home"] + "/.wpilib/nativecache", include: "**/*wpiutil*").join ":"
73+
environment "LD_PRELOAD", found
74+
}

frc.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"team": 4121,
3+
"ntmode": "client",
4+
"cameras": [
5+
{
6+
"name": "front",
7+
"path": "/dev/video0",
8+
"pixel format": "MJPEG",
9+
"width": 640,
10+
"height": 480,
11+
"fps": 30,
12+
"brightness": 50,
13+
"white balance": "hold",
14+
"exposure": "hold"
15+
}
16+
]
17+
}

gradle/libs.versions.toml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was generated by the Gradle 'init' task.
2+
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
3+
4+
[versions]
5+
guava = "33.0.0-jre"
6+
junit-jupiter = "5.10.2"
7+
8+
[libraries]
9+
guava = { module = "com.google.guava:guava", version.ref = "guava" }
10+
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)