Files
PhotonVision/photon-server/build.gradle

147 lines
4.9 KiB
Groovy
Raw Normal View History

apply plugin: "com.github.node-gradle.node"
apply plugin: 'com.gradleup.shadow'
apply plugin: "application"
apply from: "${rootDir}/shared/common.gradle"
2020-03-18 01:51:30 -04:00
dependencies {
implementation project(':photon-core')
2020-03-18 01:51:30 -04:00
2024-11-06 20:16:36 -05:00
// Zip
implementation 'org.zeroturnaround:zt-zip:1.14'
// Needed for Javalin Runtime Logging
implementation "org.slf4j:slf4j-simple:2.0.7"
}
2020-03-18 01:51:30 -04:00
group = 'org.photonvision'
version = versionString + (project.hasProperty('pionly') ? "-raspi" : "")
application {
mainClass = 'org.photonvision.Main'
2020-03-18 01:51:30 -04:00
}
jar {
from file("$rootDir/LICENSE")
}
shadowJar {
dependsOn 'buildAndCopyUI'
archiveBaseName = "photonvision"
archiveVersion = project.version as String
archiveClassifier.set(wpilibTools.currentPlatform.platformName)
configurations = [
project.configurations.runtimeClasspath
]
}
node {
nodeProjectDir = file("${projectDir}/../photon-client")
}
tasks.register('copyClientUIToResources', Copy) {
from "${projectDir}/../photon-client/dist/"
into "${projectDir}/src/main/resources/web/"
}
tasks.register('buildClient', PnpmTask) {
inputs.dir fileTree(dir: "${projectDir}/../photon-client", exclude: "dist/")
outputs.dir file("${projectDir}/../photon-client/dist")
args = ["build"]
dependsOn "pnpmInstall"
}
tasks.register('buildAndCopyUI') {
dependsOn "buildClient"
finalizedBy "copyClientUIToResources"
}
processResources {
dependsOn copyClientUIToResources
}
run {
environment "PATH_PREFIX", "../"
Add GPU Acceleration on the Raspberry Pi (#140) * Add native stuff * use runtimeloader * add more native methods * more stuff * Switch JNI methods to static * Remove non-java classes from the picam jni * Add gradle task for JNI generation * Migrate my previous GPU accel work * Initial work on defining JNI interface * Change libpicam to a symlink for now * Initial work on adding no-copy OMX GPU accel on the pi * Make DIRECT_OMX GPU accel mode not crash * Clean up OMX changes (still not getting valid data back) * Re-add GPU unit test * A couple debugging tweaks/notes * Add temporary special cases to get RGB out of ProcessingMode.NONE * Code clarity improvements; fix possible VBO bug * Get DIRECT_OMX working * Remove some debugging switches in GPUAccelerator * Pipe in VCSM stuff to read out pixels FAST * Apply Spotless * Revert versioningHelper changes * Add missing import * Convert to MMAL and move everything to native * Re-add shared object * Rework to use MMAL and do everything natively * Condense pipeline settings classes * Add OutputStreamPipeline * Apply spotless * Fix duplicate variable inits and add more video modes * Integrate color frames and latency measurements for GPU * Fix camera detection on pi and other platforms * Add proper color copy disabling and camera settings calls * Fix things that were broken by rebase * Fix spotless issues and remove uneeded prints * Remove libpicam symlink * Fix stream resolution limiting * Remove testing code in GPUAcceleratedHSVPipe * Make profiling options general to all computers * Make PicamJNI load from resources * run spotlessApply * Address review comments * Update Maven repo for JOGL * Fix release race condition * Only run GPU accel test on the pi * Lint fix and merge conflict accident fixes * Make Jackson ignore extra fields when unmarshalling HardwareConfig * Fix Mat releasing data race * Spotless apply * Remove broken header generation task * Fix shared library loading typo * Add a ZeroCopyPicam quirk to allow setting gain with the MMAL backend * Make sure that exposure/brightness/gain get set after res changes * Make rawInputMat properly local * Remove bogus set of shouldRun flag * Clean up small GPUHSVPipe print * Add in some things that missed the ZeroCopyPiCameraSource rename * Fix incorrect scoping introduced in past rebase * Don't filter out too-low resolutions * Only show latency when GPU accel is enabled * Don't free Mats in stream thread before we use them * Fix use-after-free and latency caluclation bugs on USB camera source * Update libpicam * Remove unwanted print * Add libpicam forceLoad in unit test * Fix streaming during camera calibration * Fix zerocopy Picam calculation * Use logger trace method instead of raw prints * Fix calibration and driver mode pipes with the Picam Co-authored-by: Matt <matthew.morley.ca@gmail.com> Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
2020-12-08 02:34:21 -05:00
if (project.hasProperty("profile")) {
jvmArgs=[
"-Dcom.sun.management.jmxremote=true",
"-Dcom.sun.management.jmxremote.ssl=false",
"-Dcom.sun.management.jmxremote.authenticate=false",
"-Dcom.sun.management.jmxremote.port=5000",
"-Djava.rmi.server.hostname=0.0.0.0",
Add GPU Acceleration on the Raspberry Pi (#140) * Add native stuff * use runtimeloader * add more native methods * more stuff * Switch JNI methods to static * Remove non-java classes from the picam jni * Add gradle task for JNI generation * Migrate my previous GPU accel work * Initial work on defining JNI interface * Change libpicam to a symlink for now * Initial work on adding no-copy OMX GPU accel on the pi * Make DIRECT_OMX GPU accel mode not crash * Clean up OMX changes (still not getting valid data back) * Re-add GPU unit test * A couple debugging tweaks/notes * Add temporary special cases to get RGB out of ProcessingMode.NONE * Code clarity improvements; fix possible VBO bug * Get DIRECT_OMX working * Remove some debugging switches in GPUAccelerator * Pipe in VCSM stuff to read out pixels FAST * Apply Spotless * Revert versioningHelper changes * Add missing import * Convert to MMAL and move everything to native * Re-add shared object * Rework to use MMAL and do everything natively * Condense pipeline settings classes * Add OutputStreamPipeline * Apply spotless * Fix duplicate variable inits and add more video modes * Integrate color frames and latency measurements for GPU * Fix camera detection on pi and other platforms * Add proper color copy disabling and camera settings calls * Fix things that were broken by rebase * Fix spotless issues and remove uneeded prints * Remove libpicam symlink * Fix stream resolution limiting * Remove testing code in GPUAcceleratedHSVPipe * Make profiling options general to all computers * Make PicamJNI load from resources * run spotlessApply * Address review comments * Update Maven repo for JOGL * Fix release race condition * Only run GPU accel test on the pi * Lint fix and merge conflict accident fixes * Make Jackson ignore extra fields when unmarshalling HardwareConfig * Fix Mat releasing data race * Spotless apply * Remove broken header generation task * Fix shared library loading typo * Add a ZeroCopyPicam quirk to allow setting gain with the MMAL backend * Make sure that exposure/brightness/gain get set after res changes * Make rawInputMat properly local * Remove bogus set of shouldRun flag * Clean up small GPUHSVPipe print * Add in some things that missed the ZeroCopyPiCameraSource rename * Fix incorrect scoping introduced in past rebase * Don't filter out too-low resolutions * Only show latency when GPU accel is enabled * Don't free Mats in stream thread before we use them * Fix use-after-free and latency caluclation bugs on USB camera source * Update libpicam * Remove unwanted print * Add libpicam forceLoad in unit test * Fix streaming during camera calibration * Fix zerocopy Picam calculation * Use logger trace method instead of raw prints * Fix calibration and driver mode pipes with the Picam Co-authored-by: Matt <matthew.morley.ca@gmail.com> Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
2020-12-08 02:34:21 -05:00
]
}
}
import edu.wpi.first.deployutils.deploy.artifact.*
import edu.wpi.first.deployutils.deploy.target.RemoteTarget
import edu.wpi.first.deployutils.deploy.target.location.SshDeployLocation
deploy {
targets {
pi(RemoteTarget) {
// Can't login as root, so deploy our file to /tmp, which is owned by pi
directory = '/tmp'
locations {
ssh(SshDeployLocation) {
if (project.hasProperty('tgtIP')) {
address = tgtIP
} else {
address = "photonvision.local"
}
if (project.hasProperty('tgtUser')) {
user = tgtUser
} else {
user = "photon"
}
if (project.hasProperty('tgtPw')) {
password = tgtPw
} else {
password = "vision"
}
}
}
artifacts {
stop(CommandArtifact) {
predeploy << {
println 'Starting deployment to ' + deploy.targets.pi.locations.ssh.address
println 'targetArch = ' + wpilibTools.platformMapper.currentPlatform.platformName
}
//Stop photonvision before manipulating its files
command = "sudo systemctl stop photonvision.service"
}
sleep(CommandArtifact) {
// gerth2 - I was having issues with the .jar being in use still - waiting a tiny bit here seems to get rid of it on a pi4
command = "sleep 3"
dependsOn artifacts.stop.deployTask
}
photonvisionJar(JavaArtifact) {
jarTask = shadowJar
filename = "photonvision.jar"
dependsOn artifacts.sleep.deployTask
}
moveJar(CommandArtifact) {
//belt-and-suspenders. Make sure the old jar is gone first before moving in the new .jar
command = "sudo rm -f /opt/photonvision/photonvision.jar && sudo mv /tmp/photonvision.jar /opt/photonvision/photonvision.jar"
dependsOn artifacts.photonvisionJar.deployTask
}
chmodJar(CommandArtifact) {
//Make sure it's executable
command = "sudo chmod +x /opt/photonvision/photonvision.jar"
dependsOn artifacts.moveJar.deployTask
}
start(CommandArtifact) {
//Fire up photonvision again
command = "sudo systemctl start photonvision.service"
dependsOn artifacts.chmodJar.deployTask
}
cleanUp(CommandArtifact) {
command = 'sudo rm -f /tmp/photonvision.jar'
dependsOn artifacts.moveJar.deployTask
}
}
}
}
}