![]() |
Custom Vision Processing
Hello,
I am a member of team 2643 and we havedecided to make our own custom vision tool. We were able to get it working marvelously on a regular java project, but as well you may know FRC applications remove some of the java classes and libraries. For example, Math.atan() does no exist. Anyway, our application is dependent on the following classes: java.awt.Image , java.awt.BufferedImage, java.net.URL, java.awt.Graphics, and java.imageio.ImageIO; Here is the problem: none of these classes actually exist in an FRC java application. I have tried fetching those files one by one but the problem is that all that all those files have endless references to other files, making the task impossible. I also the tried extracting all .class files from the .jar files in my JDK directory and decompiling them to .java files and dragging them into the project's SRC directory. This would have worked except it slowed netbeans down to the point that it was inoperable. I guess that what I want is to find a way to upload a library to my FRC application from a .jar file or find an application that can tell me which files are absolutely necessary for my application to work. I anyone can provide me with a solution I would greatly appreciate it. -JuanMeza, Team 2643 |
This is not necessarily possible. The Java environment is based off of J2ME, almost any library you will use is going to be based on J2SE. On a side note the squawk MathUtils class has a lot of implementations of the J2SE math functions.
|
Re: Custom Vision Processing
It is possible to do the vision processing outside of the cRIO (as a stand-alone Java application). You can:
There are several ways to send the information back. Probably the easiest method is to use the NetworkTable objects provided in the FRC plugins. Add the networktables-desktop.jar JAR file to your stand alone Java project. It can be found under the $HOME/sunspotfrcsdk/desktop-lib folder (where $HOME refers to your home directory - something like C:\Users\LOGIN_NAME if you are on a Windows system). Once the JAR file has been added to your project you should be able to use the NetworkTable objects. Somewhere in your initialization code, you can add code similar to the following (use the IP address of your cRIO): Code:
NetworkTable smartDashboard;Code:
private void sendRobotInfo(boolean leftHot, boolean rightHot) {Code:
public boolean isLeftHot() {
Hope that helps. Paul |
| All times are GMT -5. The time now is 22:32. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi