Quote:
Originally Posted by thecoopster20
Thank you very much! I got the build to go through, now to just get it on the pi and then make the vision jar run on startup.
|
Make sure you write a little test program and verify that you can run it. There were runtime native lib. dependency issues i ran into, specifically I had to use this:
http://first.wpi.edu/FRC/roborio/mav...m-raspbian.jar
cscore.
This is my test program:
Code:
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import edu.wpi.first.wpilibj.CameraServer;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.networktables.NetworkTable;
import org.opencv.core.Rect;
import org.opencv.imgproc.Imgproc;
//import com.ctre.CANTalon;
import edu.wpi.cscore.UsbCamera;
import edu.wpi.first.wpilibj.CameraServer;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.vision.VisionRunner;
import edu.wpi.first.wpilibj.vision.VisionThread;
public class Test {
public static void main(String[] args){
VisionThread visionThread;
Object imgLock = new Object();
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
NetworkTable table = NetworkTable.getTable("foo");
Mat mat = Mat.eye(3, 3, CvType.CV_8UC1);
System.out.println("mat = " + mat.dump());
UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();
camera.setResolution(640, 480);
}
}
That's enough to verify that the needed native libraries can be loaded.