![]() |
unable to compile camera code
After searching forums and docs we are still unable to build the code taken from the WPI user guide. I am using Netbeans, have plugins installed, and installed smartdashboard. I am trying to compile following code from user guide:
package com.crimsonrobotics; import edu.wpi.first.smartdashboard.camera.WPICameraExten sion; import edu.wpi.first.wpijavacv.WPIColorImage; import edu.wpi.first.wpijavacv.WPIImage; /** * * @author * Wayne */ public class BasicCameraExtension extends WPICameraExtension { //@Override public WPIImage processImage(WPIColorImage rawImage) { return rawImage.getRedChannel(); } } here are errors I get: C:\Users\Wayne\Documents\NetBeansProjects\Team2526 Version5\src\com\crimsonrobotics\BasicCameraExtens ion.java:7: package edu.wpi.first.smartdashboard.camera does not exist import edu.wpi.first.smartdashboard.camera.WPICameraExten sion; C:\Users\Wayne\Documents\NetBeansProjects\Team2526 Version5\src\com\crimsonrobotics\BasicCameraExtens ion.java:8: package edu.wpi.first.wpijavacv does not exist import edu.wpi.first.wpijavacv.WPIColorImage; C:\Users\Wayne\Documents\NetBeansProjects\Team2526 Version5\src\com\crimsonrobotics\BasicCameraExtens ion.java:9: package edu.wpi.first.wpijavacv does not exist import edu.wpi.first.wpijavacv.WPIImage; C:\Users\Wayne\Documents\NetBeansProjects\Team2526 Version5\src\com\crimsonrobotics\BasicCameraExtens ion.java:16: cannot find symbol symbol: class WPICameraExtension public class BasicCameraExtension extends WPICameraExtension { C:\Users\Wayne\Documents\NetBeansProjects\Team2526 Version5\src\com\crimsonrobotics\BasicCameraExtens ion.java:18: cannot find symbol symbol : class WPIColorImage location: class com.crimsonrobotics.BasicCameraExtension public WPIImage processImage(WPIColorImage rawImage) { C:\Users\Wayne\Documents\NetBeansProjects\Team2526 Version5\src\com\crimsonrobotics\BasicCameraExtens ion.java:18: cannot find symbol symbol : class WPIImage location: class com.crimsonrobotics.BasicCameraExtension public WPIImage processImage(WPIColorImage rawImage) { 6 errors C:\Users\Wayne\sunspotfrcsdk\ant\compile.xml:48: Compile failed; see the compiler error output for details. BUILD FAILED (total time: 1 second) Once we get past this we can be on our way. Any sugestions? I tried to add jars in all places I could to no avail. |
Re: unable to compile camera code
I'm guessing that you haven't added the SmartDashboard JAR files to your NetBeans project. Here are my suggestions:
This should include all of the JAR files necessary to work on SmartDashboard plugins and driver station side image processing. If you decide to create additional SmartDashboard projects, you should just be able to select the new "SmartDashboard" library we created above (you won't have to add all of the JAR files again). NOTE: We ran across a memory leak in the WPIJavaCV.jar file that causes the system to run out of memory and crash after processing too many images. There was a fix - but I'm not sure it's been pushed out. If you find your program crashing, use Window's Task Manager to observe it when running and see if it consumes a lot of memory when running. If so, you may want to refer to this post: http://www.chiefdelphi.com/forums/sh...67&postcount=6 It has a unofficial replacement for the WPIJavaCV.jar file which was built from the updated source files at the SmartDashboard project. |
Re: unable to compile camera code
Our code is based on the command Base template and when you right click on the project in the left pane libraries is not an option. Is this because it is a freeform project? Does the camera code go in as another class in this project? I am trying to follow the user guide and we are stuck at this point any help appreciated. If others are doing it this way then somewhere along the line we missed something.
|
Re: unable to compile camera code
Quote:
You must create the project as a Java Class Library so that you can compile it as a .jar extension. |
| All times are GMT -5. The time now is 11:41. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi