Running Grip Pipeline On Jetson TX1


#1

We have a Jetson TX1 and we need to run a java file on it that we generated from grip. We have tried to use Gradle as well, and when we try to run ./gradlew build, it says command not found. We are wanting to know how to run this Grip file to do off board vision processing. Are we doing it right? Do we just install the WPI Libraries into the java installed on the Jetson? Any help would be appreciated.


#2

I think you’ll definitely have to post code - show us what your gradle build configurations look like, what your project layout looks like, what the filesystem on the TK1 looks like for where the pipeline is supposed to be deployed to, and the exact text of the error message you’re seeing.

Unfortunately, this is not a permutation I’ve attempted, So I probably won’t be of much help regardless. Others will know more though.


#3

Here’s what I had to compile for support libraries on an older version of GRIP to get it to compile on TK1.

https://www.chiefdelphi.com/forums/showthread.php?p=1537667#post1537667


#4

That’s for an old version, there is probably other dependencies that have been added since then.


#5

I don’t necessarily want to run GRIP on the jetson itself, but run the code I generated from it on a windows laptop on the Jetson. Do I have to build the code with Gradle on the windows laptop. If so, I have ran into errors with it.

First, I tried to build on windows with the sample project from WPI just to try to get it to work:

C:\Users\Administrator\Downloads\VisionBuildSamples-1.0.0\VisionBuildSamples-1.0.0\Java>gradlew build
Downloading https://services.gradle.org/distributions/gradle-3.3-bin.zip
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
................................................................................................................................................................
..................................................................................................................................................
Unzipping C:\Users\Administrator\.gradle\wrapper\dists\gradle-3.3-bin\64bhckfm0iuu9gap9hg3r7ev2\gradle-3.3-bin.zip to C:\Users\Administrator\.gradle\wrapper\dis
ts\gradle-3.3-bin\64bhckfm0iuu9gap9hg3r7ev2
Starting a Gradle Daemon (subsequent builds will be faster)
Download https://plugins.gradle.org/m2/com/github/jengelman/gradle/plugins/shadow/1.2.4/shadow-1.2.4.pom
Download https://plugins.gradle.org/m2/org/jdom/jdom2/2.0.5/jdom2-2.0.5.pom
Download https://plugins.gradle.org/m2/org/ow2/asm/asm/5.0.3/asm-5.0.3.pom
Download https://plugins.gradle.org/m2/org/ow2/asm/asm-parent/5.0.3/asm-parent-5.0.3.pom
Download https://plugins.gradle.org/m2/org/ow2/ow2/1.3/ow2-1.3.pom
Download https://plugins.gradle.org/m2/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.pom
Download https://plugins.gradle.org/m2/commons-io/commons-io/2.4/commons-io-2.4.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/25/commons-parent-25.pom
Download https://plugins.gradle.org/m2/org/apache/apache/9/apache-9.pom
Download https://plugins.gradle.org/m2/org/apache/ant/ant/1.9.4/ant-1.9.4.pom
Download https://plugins.gradle.org/m2/org/apache/ant/ant-parent/1.9.4/ant-parent-1.9.4.pom
Download https://plugins.gradle.org/m2/org/codehaus/plexus/plexus-utils/2.0.6/plexus-utils-2.0.6.pom
Download https://plugins.gradle.org/m2/org/codehaus/plexus/plexus/2.0.7/plexus-2.0.7.pom
Download https://plugins.gradle.org/m2/org/codehaus/groovy/groovy-backports-compat23/2.4.4/groovy-backports-compat23-2.4.4.pom
Download https://plugins.gradle.org/m2/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.pom
Download https://plugins.gradle.org/m2/org/apache/ant/ant-launcher/1.9.4/ant-launcher-1.9.4.pom
Download https://plugins.gradle.org/m2/com/github/jengelman/gradle/plugins/shadow/1.2.4/shadow-1.2.4.jar
Download https://plugins.gradle.org/m2/org/jdom/jdom2/2.0.5/jdom2-2.0.5.jar
Download https://plugins.gradle.org/m2/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar
Download https://plugins.gradle.org/m2/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.jar
Download https://plugins.gradle.org/m2/commons-io/commons-io/2.4/commons-io-2.4.jar
Download https://plugins.gradle.org/m2/org/apache/ant/ant/1.9.4/ant-1.9.4.jar
Download https://plugins.gradle.org/m2/org/codehaus/plexus/plexus-utils/2.0.6/plexus-utils-2.0.6.jar
Download https://plugins.gradle.org/m2/org/codehaus/groovy/groovy-backports-compat23/2.4.4/groovy-backports-compat23-2.4.4.jar
Download https://plugins.gradle.org/m2/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar
Download https://plugins.gradle.org/m2/org/apache/ant/ant-launcher/1.9.4/ant-launcher-1.9.4.jar
:compileJava
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/wpilib/networktables/java/NetworkTables/3.1.7/NetworkTables-3.1.7.pom
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/cscore/java/cscore/1.0.2/cscore-1.0.2.pom
Download http://first.wpi.edu/FRC/roborio/maven/release/org/opencv/opencv-java/3.2.0/opencv-java-3.2.0.pom
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/first/wpilib/networktables/java/NetworkTables/3.1.7/NetworkTables-3.1.7-armhf.jar
Download http://first.wpi.edu/FRC/roborio/maven/release/edu/wpi/cscore/java/cscore/1.0.2/cscore-1.0.2-armhf.jar
Download http://first.wpi.edu/FRC/roborio/maven/release/org/opencv/opencv-java/3.2.0/opencv-java-3.2.0.jar
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Could not find tools.jar. Please check that C:\Program Files\Java\jdk1.8.0_161b contains a valid JDK installation.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 19.359 secs

Then, since i saw that the “tools.jar” was missing, i copied it from my jdk1.8.0_161 folder to the jdk1.8.0_161b folder and tries again, and i got this:


C:\Users\Administrator\Downloads\VisionBuildSamples-1.0.0\VisionBuildSamples-1.0.0\Java>gradlew build
:compileJava
:processResources UP-TO-DATE
:classes
:jar
:startScripts
:downloadOpenCv
Download http://first.wpi.edu/FRC/roborio/maven/release/org/opencv/opencv-jni/3.2.0/opencv-jni-3.2.0.pom
:downloadOpenCv FAILED

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\Administrator\Downloads\VisionBuildSamples-1.0.0\VisionBuildSamples-1.0.0\Java\dependencies.gradle' line: 58

* What went wrong:
Execution failed for task ':downloadOpenCv'.
> Could not resolve all files for configuration ':detachedConfiguration1'.
   > Could not find opencv-jni-linux-armhf.jar (org.opencv:opencv-jni:3.2.0).
     Searched in the following locations:
         http://first.wpi.edu/FRC/roborio/maven/release/org/opencv/opencv-jni/3.2.0/opencv-jni-3.2.0-linux-armhf.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 8.014 secs

C:\Users\Administrator\Downloads\VisionBuildSamples-1.0.0\VisionBuildSamples-1.0.0\Java>

It looks like it cant find the opencv. That is the same problem i have been having on the jetson as well so this is not a windows thing. My second question is where in that gradle folder should i put the GRIP generated code?


#6

Hmmmm.

I’m always a bit cautious about copying installed binaries between folders - in general a program assumes it has a full set of files it was installed with. If one thing is missing, usually it means multiple things are too, and subsequent failures may not be as obvious as the one you saw. However, presuming that JDK install is functional…

The final failure points to “downloadOpenCv FAILED” and includes a URL. Were you able to access that URL from your browser? (I could). No firewall blocking the download? What is the nature of that step that’s failing - based on the name I tend to guess its “Download the file from the internet to the local PC before building with it”, but that’s just a guess…


#7

The final failure points to “downloadOpenCv FAILED” and includes a URL. Were you able to access that URL from your browser? (I could)…

I could not. To me it was a broken link. I was at my school so that could have been a problem, but i doubt they would block something like that. I will have to do some more playing with it. I re-flashed the Jetson and we will try again.


#8

That vision sample you are trying never was compiled for the TX1, so fixing the download issue still wouldn’t work.

If you want to run vision on the TX1 with network tables you will need to compile everything on the device. The allwpilib repo has a cmake build and some cmake documentation on how to do this. That will get you the libraries for the TX1.


#9

I do not believe WPI has compiled opencv V3.2.0 for arm and has it available on their Maven site.

If you look in WPI Opencv 3.2.0 Maven I do not see an arm version.Switch your opencv version to 3.1.0 and it should work. Don’t forget to change your

System.loadLibrary

statement if it is hardcoded.

Also, running the GRIP pipeline on the Jetson will not take advantage of the GPUs by default. IMHO, you are better off using the Raspberry Pi at this point until someone takes on the GPU task (not easy).

I have code and a bunch of videos if you are interested. See Spartan Robotics Youtube Channel


#10

Not necessarily, the CPUs on the TX1 run circles around the rPi so if you need the speed then it can help regardless. That being said, the GPU offload can offer a substantial performance increase if you’re willing to put in the time to translate the code and move bits around - it’s not a straightforward task though.