Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up Vision according to advantage kit #69

Merged
merged 24 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
71fce4b
closely follow advantage kit template
linglejack06 Dec 8, 2024
b7e248b
separate things into methods for easier readability of periodic in Vi…
linglejack06 Dec 8, 2024
79df6c2
fix self errors and attempt akit fix
linglejack06 Dec 10, 2024
65aa589
exactly follows advantage kit build gradle, still throwing error rela…
linglejack06 Dec 10, 2024
35288ad
add build.gradle file for wpilib interface
linglejack06 Dec 11, 2024
f2d6f29
actually add build.gradle to wpilib_iinterface (forgot to click save …
linglejack06 Dec 11, 2024
cd3bd70
add subproject implementations and google json
linglejack06 Dec 11, 2024
2fefea6
switch to implementation from maven central
linglejack06 Dec 11, 2024
26f5ea4
remove deployment task to fix error with project implementation
linglejack06 Dec 11, 2024
536cb6a
change naming of reject pose method
linglejack06 Dec 11, 2024
39b9efe
move camera std dev factors to constructor for configuration
linglejack06 Dec 11, 2024
a499a06
update junit comment
linglejack06 Dec 11, 2024
0ab7d14
remove maven-publish plugin
linglejack06 Dec 11, 2024
9b694f0
move controller json reader to correct location
linglejack06 Dec 11, 2024
df437dc
update version
linglejack06 Dec 11, 2024
7931091
update param name
linglejack06 Dec 11, 2024
28bd4f3
revert back to old include
linglejack06 Dec 11, 2024
64a8a14
add code to add all poses under robotPoses
linglejack06 Dec 12, 2024
17a381e
use number of tags for distance based variance
linglejack06 Dec 12, 2024
92f6458
update num tags variance
linglejack06 Dec 12, 2024
577c460
update single and multi tag deviations
linglejack06 Dec 12, 2024
3c8463d
add ambiguity factor for pose rejection
linglejack06 Dec 12, 2024
f116cf4
remove 1 + from distance based variance and multi tag varaince
linglejack06 Dec 12, 2024
e2fb6b0
format
linglejack06 Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"**/.factorypath": true
},
"C_Cpp.default.configurationProvider": "vscode-wpilib",
"java.compile.nullAnalysis.mode": "automatic"
"java.compile.nullAnalysis.mode": "automatic",
"java.import.gradle.annotationProcessing.enabled": false
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=2025.0.0-beta
version=2025.0.0-ak-vision
91 changes: 38 additions & 53 deletions vision/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,96 +5,81 @@ import com.vanniktech.maven.publish.JavadocJar

plugins {
id "java"
id "maven-publish"
id "com.peterabeles.gversion" version "1.10"
id "com.diffplug.spotless" version "6.24.0"
id "com.vanniktech.maven.publish" version "0.30.0"
id "edu.wpi.first.GradleRIO" version "2025.1.1-beta-2"
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

// Set to true to use debug for JNI.
wpi.java.debugJni = false

// Set this to true to enable desktop support.
def includeDesktopSupport = true

configurations.all {
// exclude group: "edu.wpi.first.wpilibj"
// Configuration for AdvantageKit
repositories {
maven {
url = uri("https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit")
credentials {
username = "Mechanical-Advantage-Bot"
password = "\u0067\u0068\u0070\u005f\u006e\u0056\u0051\u006a\u0055\u004f\u004c\u0061\u0079\u0066\u006e\u0078\u006e\u0037\u0051\u0049\u0054\u0042\u0032\u004c\u004a\u006d\u0055\u0070\u0073\u0031\u006d\u0037\u004c\u005a\u0030\u0076\u0062\u0070\u0063\u0051"
}
}
mavenLocal()
}

task(checkAkitInstall, dependsOn: "classes", type: JavaExec) {
mainClass = "org.littletonrobotics.junction.CheckInstall"
task(replayWatch, type: JavaExec) {
mainClass = "org.littletonrobotics.junction.ReplayWatch"
classpath = sourceSets.main.runtimeClasspath
}
// TODO: Figure out why advantagekit won't let us build the project
//compileJava.finalizedBy checkAkitInstall

// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
// Also defines JUnit 5.
// Also defines JUnit 5
dependencies {
def wpilibVersion = "2025.1.1-beta-1"
implementation "edu.wpi.first.wpilibj:wpilibj-java:$wpilibVersion"
implementation "edu.wpi.first.wpilibNewCommands:wpilibNewCommands-java:$wpilibVersion"
implementation "edu.wpi.first.apriltag:apriltag-java:$wpilibVersion"

//def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text)
//annotationProcessor "org.littletonrobotics.akit.junction:junction-autolog:$akitJson.version"
def akitVersion = "4.0.0-alpha-1"
annotationProcessor "org.littletonrobotics.akit.junction:junction-autolog:$akitVersion"
annotationProcessor wpi.java.deps.wpilibAnnotations()
implementation wpi.java.deps.wpilib()
implementation wpi.java.vendor.java()

implementation "org.littletonrobotics.akit.junction:junction-core:$akitVersion"
nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop)
nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop)
simulationDebug wpi.sim.enableDebug()

def photonVersion = "v2025.0.0-beta-5"
implementation "org.photonvision:photonlib-java:$photonVersion"
implementation "org.photonvision:photontargeting-java:$photonVersion"
nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop)
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
simulationRelease wpi.sim.enableRelease()

testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

implementation 'com.googlecode.json-simple:json-simple:1.1.1'
def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text)
annotationProcessor "org.littletonrobotics.akit:akit-autolog:$akitJson.version"
}

test {
useJUnitPlatform()
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
}

// Simulation configuration (e.g. environment variables).
//
// The sim GUI is *disabled* by default to support running
// AdvantageKit log replay from the command line. Set the
// value to "true" to enable the sim GUI by default (this
// is the standard WPILib behavior).
wpi.sim.addGui().defaultEnabled = false
wpi.sim.addDriverstation()

// Configure string concat to always inline compile
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
}

// project.compileJava.dependsOn(createVersionFile)
// gversion {
// srcDir = "src/main/java/"
// classPackage = "frc.robot"
// className = "BuildConstants"
// dateFormat = "yyyy-MM-dd HH:mm:ss z"
// timeZone = "America/New_York"
// indent = " "
// }

repositories {
mavenCentral()
mavenLocal()
maven {
url 'https://frcmaven.wpi.edu/artifactory/release/'
}
maven {
url = uri("https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit")
credentials {
username = "Mechanical-Advantage-Bot"
password = "\u0067\u0068\u0070\u005f\u006e\u0056\u0051\u006a\u0055\u004f\u004c\u0061\u0079\u0066\u006e\u0078\u006e\u0037\u0051\u0049\u0054\u0042\u0032\u004c\u004a\u006d\u0055\u0070\u0073\u0031\u006d\u0037\u004c\u005a\u0030\u0076\u0062\u0070\u0063\u0051"
}
}
gradlePluginPortal()
maven {
name "photonvisionRepositoryReleases"
url "https://maven.photonvision.org/releases"
}
}


spotless {
// optional: limit format enforcement to just the files changed by this feature branch
ratchetFrom 'origin/main'
Expand Down
106 changes: 0 additions & 106 deletions vision/src/main/java/coppercore/vision/Camera.java

This file was deleted.

23 changes: 0 additions & 23 deletions vision/src/main/java/coppercore/vision/CameraContainer.java

This file was deleted.

48 changes: 0 additions & 48 deletions vision/src/main/java/coppercore/vision/CameraContainerReal.java

This file was deleted.

44 changes: 0 additions & 44 deletions vision/src/main/java/coppercore/vision/CameraContainerReplay.java

This file was deleted.

Loading
Loading