|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hello fine members of Chief Delphi!
Team 670 is trying to use OpenCV for vision tracking of the goals, and for various reasons, we exclusively code in Java. Therefore, we are using JavaCV in order to do our tracking. Our algorithm works fine when we use images and run it directly on our PC. However, when we upload the code to the roboRIO, we get an UnsatisfiedLinkError (Stack Trace Below). This error pops up whenever we call any method from any class in the OpenCV package. Code:
ERROR Unhandled exception: java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path at [java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857), java.lang.Runtime.loadLibrary0(Runtime.java:870), java.lang.System.loadLibrary(System.java:1119), org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:597), org.bytedeco.javacpp.Loader.load(Loader.java:438), org.bytedeco.javacpp.Loader.load(Loader.java:381), org.bytedeco.javacpp.opencv_core.<clinit>(opencv_core.java:10), java.lang.Class.forName0(Native Method), java.lang.Class.forName(Class.java:340), org.bytedeco.javacpp.Loader.load(Loader.java:413), org.bytedeco.javacpp.Loader.load(Loader.java:381), org.bytedeco.javacpp.opencv_imgcodecs.<clinit>(opencv_imgcodecs.java:13), org.usfirst.frc.team670.robot.Robot.process(Robot.java:85), org.usfirst.frc.team670.robot.Robot.operatorControl(Robot.java:68), edu.wpi.first.wpilibj.SampleRobot.startCompetition(SampleRobot.java:159), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:242)] WARNING: Robots don't quit! build.properties Code:
# Project specific information
package=org.usfirst.frc.team670.robot
robot.class=${package}.Robot
userLibs = ${user.home}/wpilib/user/lib/javacpp.jar:${user.home}/wpilib/user/lib/opencv.jar:${user.home}/wpilib/user/lib/javacv.jar
Code:
<project name="FRC Deployment" default="deploy">
<property file="${user.home}/wpilib/wpilib.properties"/>
<property file="build.properties"/>
<property file="${user.home}/wpilib/java/${version}/ant/build.properties"/>
<property name="classpath" value="${opencv.jar}:${javacpp.jar}:${javacv.jar}" />
<import file="${wpilib.ant.dir}/build.xml"/>
</project>
Could anyone help with this problem? |
|
#2
|
||||
|
||||
|
Re: JavaCV Help
JavaCV doesn't support the roboRIO out-of-the-box. You could grab the build that GRIP uses and save yourself the trouble of compiling it yourself.
|
|
#3
|
||||
|
||||
|
Re: JavaCV Help
Running vision processing code on your roboRIO itself is generally a bad idea. You should simply intercept the images being sent and perform the analyses on your driver's station.
|
|
#4
|
||||
|
||||
|
Re: JavaCV Help
Thanks for your input. Is there any particular way to intercept the images when using a USB camera?
|
|
#5
|
||||
|
||||
|
Re: JavaCV Help
Quote:
To start off, your SmartDashboard will probably be in C:/Users/<username>/wpilib/tools/SmartDashboard.jar. Open it up in JD-GUI and start poking around for something that resembles the USB camera widget. You'll know it when you find it: Code:
public static final NAME = "USB Webcam Viewer"; |
|
#6
|
||||
|
||||
|
Re: JavaCV Help
Quote:
Here's another (simplified) reference for the protocol if you don't wanna make an account. |
|
#7
|
||||
|
||||
|
Re: JavaCV Help
Quote:
|
|
#8
|
|||
|
|||
|
You don't even need an account: wpilib.screenstepslive.com/s/4485/m/wpilib_source/l/480945-getting-the-source.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|