2021-01-18 22:12:57 -05:00
|
|
|
apply plugin: "application"
|
|
|
|
|
apply plugin: "com.github.johnrengelman.shadow"
|
|
|
|
|
apply plugin: "org.hidetake.ssh"
|
2020-03-18 01:51:30 -04:00
|
|
|
|
2021-01-14 21:45:26 -05:00
|
|
|
evaluationDependsOn(':photon-core')
|
2020-07-17 23:22:42 -07:00
|
|
|
|
Bootup sprint (#18)
* Did some stuff
* Fix gradle, start implementing mjpeg frame consumer
* Did some stuff
* bade changes
* rename camera config to USBCameraConfiguration, add name
* unrename cameraconfiguration
* Add pub/sub framework
* Add setResolution to mjpeg frame consumer
* add NTDataConsumer
* Add some totally broken hsv hacks
* Start refactoring UI data
* Update index.js
* Commit and push, he says
* Fix up some errors
* Fix input tab
* Fix fps
* Update index.js
* Add pipeline field setting, update PipelineManager, fix nullpointers and USBCameraSettables
* Change v-model to point to data()
* update hsv to use mutations
* Work on saving, fix hsv
* Rename shouldErode/shouldDilate to erode and dilate
* Hook all the tabs up to the Store
* Change handleData to handlePipelineData
* camera quirk redo, add ICCSub to SocketHandler
* Fix some property names
* Fixed tons of naming in UI, fix backend for multi-val PSCs, fix PSC enums
* change pipeline type to an int in store
* Fix mutation naming
* Attempt threshold fix
* Update SocketHandler.java
* Add truthy data sending
* Start adding logging support
* [UI] Add delay to slider input boxes (#1)
* [UI] [Backend] potentially fix camera settings, various logging tweaks
* Don't release raw input mat
* add setVideoModeIndex to vision settables
* Implement pipeline index in socket handler, add framework for renaming/changing pipes
* (ish) get pipeline change working
* Create index.html
* Cleanups, fix pipeline index bug, fix stream res for MJPG, add dashboard stream (unused)
* Refactor UI to use mutatePipeline, send pipeline results
* Update NetworkConfig.java
* Change double to number
* Run spotless
* Fix reversal of large/small comparators
* Fix left/right
* Fix pitch/yaw calculation bug, fix area bug
* Use Vue.set instead of assignment
This fixes {{ }}
* Update App.vue
* run spotless
* Actually add pipelines and reassign indecies
* Delete old pipeline configs
Fixes duplication on renaming pipeline
* Start working on deleting pipes
* Fix camera nickname change
* run spotless
* Fix some test stuff
* Update VisionModuleManagerTest.java
* vision source manager test is still broken
* Fix VisionSourceManager test
* Apply spotless 2 electric boogaloo
Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
Co-authored-by: Aaryan Agrawal <54345060+13Ducks@users.noreply.github.com>
2020-07-07 01:01:58 -07:00
|
|
|
mainClassName = 'org.photonvision.Main'
|
|
|
|
|
|
2020-06-28 04:40:43 -04:00
|
|
|
group 'org.photonvision'
|
2021-12-20 10:08:17 -08:00
|
|
|
version versionString + (project.hasProperty('pionly') ? "-raspi" : "")
|
2020-03-28 19:08:03 -04:00
|
|
|
|
2021-01-18 22:12:57 -05:00
|
|
|
apply from: "${rootDir}/shared/common.gradle"
|
2020-03-18 01:51:30 -04:00
|
|
|
|
|
|
|
|
dependencies {
|
2021-01-14 21:45:26 -05:00
|
|
|
implementation project(':photon-core')
|
2022-10-08 09:27:27 -04:00
|
|
|
implementation project(':photon-targeting')
|
2020-03-18 01:51:30 -04:00
|
|
|
|
2022-01-08 10:17:28 -08:00
|
|
|
implementation "io.javalin:javalin:4.2.0"
|
2020-03-18 01:51:30 -04:00
|
|
|
|
2022-01-08 10:17:28 -08:00
|
|
|
implementation "org.msgpack:msgpack-core:0.9.0"
|
|
|
|
|
implementation "org.msgpack:jackson-dataformat-msgpack:0.9.0"
|
2020-03-18 01:51:30 -04:00
|
|
|
|
2021-11-21 17:22:56 -08:00
|
|
|
implementation "org.slf4j:slf4j-simple:1.8.0-beta4"
|
2020-03-18 01:51:30 -04:00
|
|
|
}
|
|
|
|
|
|
2020-06-28 10:39:14 -07:00
|
|
|
shadowJar {
|
|
|
|
|
configurations = [project.configurations.runtimeClasspath]
|
2021-12-18 12:53:08 -05:00
|
|
|
String name = "photonvision-${project.version}"
|
|
|
|
|
archiveFileName.set("${name}.jar")
|
2020-06-28 10:39:14 -07:00
|
|
|
}
|
|
|
|
|
|
2020-06-28 17:57:23 -04:00
|
|
|
task runNpmOnClient(type: Exec) {
|
|
|
|
|
workingDir "${projectDir}/../photon-client"
|
|
|
|
|
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
|
|
|
|
|
commandLine 'cmd', '/c', 'npm run build'
|
|
|
|
|
} else {
|
2020-07-03 11:49:08 -04:00
|
|
|
commandLine 'npm', 'run', 'build'
|
2020-06-28 17:57:23 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task copyClientUIToResources(type: Copy) {
|
|
|
|
|
from "${projectDir}/../photon-client/dist/"
|
|
|
|
|
into "${projectDir}/src/main/resources/web/"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task buildAndCopyUI {}
|
|
|
|
|
|
|
|
|
|
buildAndCopyUI.dependsOn copyClientUIToResources
|
|
|
|
|
copyClientUIToResources.dependsOn runNpmOnClient
|
|
|
|
|
copyClientUIToResources.shouldRunAfter runNpmOnClient
|
|
|
|
|
|
2020-12-08 02:34:21 -05:00
|
|
|
run {
|
|
|
|
|
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",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-27 10:18:21 -05:00
|
|
|
|
|
|
|
|
remotes {
|
|
|
|
|
pi {
|
|
|
|
|
host = 'photonvision.local'
|
|
|
|
|
user = 'pi'
|
|
|
|
|
password = 'raspberry'
|
|
|
|
|
knownHosts = allowAnyHosts
|
|
|
|
|
}
|
|
|
|
|
gloworm {
|
|
|
|
|
host = 'gloworm.local'
|
|
|
|
|
user = 'pi'
|
|
|
|
|
password = 'raspberry'
|
|
|
|
|
knownHosts = allowAnyHosts
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-21 17:22:56 -08:00
|
|
|
import java.io.*;
|
|
|
|
|
import java.net.*;
|
2020-10-27 10:18:21 -05:00
|
|
|
|
|
|
|
|
task findDeployTarget {
|
|
|
|
|
doLast {
|
|
|
|
|
if(project.hasProperty('tgtIP')){
|
|
|
|
|
//If user specificed IP, default to using the PI profile
|
|
|
|
|
// but adjust hostname to match the provided IP address
|
|
|
|
|
findDeployTarget.ext.rmt = remotes.pi
|
|
|
|
|
findDeployTarget.ext.rmt.host=tgtIP
|
|
|
|
|
} else {
|
|
|
|
|
findDeployTarget.ext.rmt = null
|
|
|
|
|
for(testRmt in remotes){
|
|
|
|
|
println "Checking for " + testRmt.host
|
|
|
|
|
boolean canContact = false;
|
|
|
|
|
try {
|
|
|
|
|
InetAddress testAddr = InetAddress.getByName(testRmt.host)
|
2021-12-20 10:08:17 -08:00
|
|
|
canContact = testAddr.isReachable(2000)
|
2020-10-27 10:18:21 -05:00
|
|
|
} catch(UnknownHostException e) {
|
|
|
|
|
canContact = false;
|
|
|
|
|
}
|
|
|
|
|
if(canContact){
|
|
|
|
|
println "Found!"
|
|
|
|
|
findDeployTarget.ext.rmt = testRmt
|
|
|
|
|
break
|
|
|
|
|
} else {
|
|
|
|
|
println "Not Found."
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(findDeployTarget.ext.rmt == null ){
|
|
|
|
|
throw new GradleException("Could not find a supported target for deployment!")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-28 18:21:41 -07:00
|
|
|
run {
|
|
|
|
|
environment "PATH_PREFIX", "../"
|
|
|
|
|
}
|
2020-10-27 10:18:21 -05:00
|
|
|
|
|
|
|
|
task deploy {
|
|
|
|
|
dependsOn assemble
|
|
|
|
|
dependsOn findDeployTarget
|
|
|
|
|
doLast {
|
|
|
|
|
println 'Starting deployment to ' + findDeployTarget.rmt.host
|
|
|
|
|
ssh.run{
|
|
|
|
|
session(findDeployTarget.rmt) {
|
|
|
|
|
//Stop photonvision before manipulating its files
|
|
|
|
|
execute 'sudo systemctl stop photonvision.service'
|
|
|
|
|
// 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
|
|
|
|
|
execute 'sleep 3'
|
|
|
|
|
// Copy into a folder owned by PI. Mostly because, as far as I can tell, the put command doesn't support sudo.
|
|
|
|
|
put from: "${projectDir}/build/libs/photonvision-${project.version}.jar", into: "/tmp/photonvision.jar"
|
|
|
|
|
//belt-and-suspenders. Make sure the old jar is gone first.
|
|
|
|
|
execute 'sudo rm -f /opt/photonvision/photonvision.jar'
|
|
|
|
|
//Copy in the new .jar and make sure it's executable
|
|
|
|
|
execute 'sudo mv /tmp/photonvision.jar /opt/photonvision/photonvision.jar'
|
|
|
|
|
execute 'sudo chmod +x /opt/photonvision/photonvision.jar'
|
|
|
|
|
//Fire up photonvision again
|
|
|
|
|
execute 'sudo systemctl start photonvision.service'
|
|
|
|
|
//Cleanup
|
|
|
|
|
execute 'sudo rm -f /tmp/photonvision.jar'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|