![]() |
Re: Using Processing for custom dashboard
The cameras run an http server used for configuration and for image requests. There is a CGI request on port 80 for requesting single bmp, jpeg, or an mjpeg stream. Some of the newer cameras support other compression types as well.
You can request the images from a dashboard written in any of the FRC languages, from a web browser, or from RoboRealm. Greg McKaskle |
Re: Using Processing for custom dashboard
Ditto Greg.
The Kinect is similar; the main difference is that a specific process has to start for the Kinect image web server. The Kinect image stream has a line in each packet header that says "Image Size: ", with an Integer and Carriage Return + Line Feed following. After that is the image, which is exactly the size of what the Integer was. We read in that many bytes, then call ImageIO.read() to create a BufferedImage. Then we wrote a custom generic LayeredPanel class that does some layering, with the Buffered Image on bottom and some text overlays on top. Additionally, we pass the BufferedImage off to ImageIO.write() (in its own single threaded Executor) with a file name (based upon timestamp from System.currentTimeMillis() to save the image off. This allows us to do frame-by-frame analysis immediately following a match. At 7fps the image decoding & writing takes ~40% of 1 core on an i5 (sorry, don't know the clock speed). I suspect the Axis camera is similar, if you don't want to use a mjpeg stream reader. |
Re: Using Processing for custom dashboard
Sorry if I seem a bit new to this, but how would you "extract the networkTables dependencies". Would I have to get the networktables files and decompile them? If so, where would I put them to use them in processing? or any general java.
|
Re: Using Processing for custom dashboard
Honestly, as with robot design, keep programming simple too. Smart dashboard is easy, effective, and simple to do what you need. The networktable will allow you to send any data you want to and from your dashboards, and it's a helluva lot easier than sockets. Drivers will not want to use a wonky debug driverstation, they want quick data, and smartdashboard will do that without custom dash headaches.
|
Re: Using Processing for custom dashboard
I simply had trouble figuring out how to overlay things onto the image in smartdashboard. That's literally all we use the dashboard for. That's why we stuck with the labview dashboard. It not only had good vision processing, but overlaying was already built in. I was thinking of going custom because processing would allow me to make a "minimap" much more easily compared to the labview dash.
|
Re: Using Processing for custom dashboard
Quote:
|
Re: Using Processing for custom dashboard
So is anyone able to answer my question? Has anyone made a processing library for processing? If not, what would the process be to doing so?
|
Re: Using Processing for custom dashboard
Hey! I haven't had access to the robot in a while so I have no way to test this.... Based on what I've read I think that the following code will work for NetworkTables in Processing. I began with the code from WPIScreenStepsLive and whittled it down until most of the errors were gone. I have no idea if it will work. It doesn't compile, but I'm pretty sure that's because there's no robot-side broadcasting the network tables. I imported the NetworkTables JAR file and the Core files from Processing (see Processing in Eclipse). Most of the advancements I've made so far are with the camera. Let me know what you think!
Code:
import edu.wpi.first.wpilibj.networktables.NetworkTable; |
Re: Using Processing for custom dashboard
getting this error as i try to run it:
Exception in thread "Animation Thread" java.lang.IllegalStateException: Network tables has already been initialized at edu.wpi.first.wpilibj.networktables.NetworkTable.c heckInit(Unknown Source) at edu.wpi.first.wpilibj.networktables.NetworkTable.s etClientMode(Unknown Source) at networktablestest1.NetworkTablesTest1.setup(Networ kTablesTest1.java:23) at processing.core.PApplet.handleDraw(PApplet.java:22 41) at processing.core.PGraphicsJava2D.requestDraw(PGraph icsJava2D.java:243) at processing.core.PApplet.run(PApplet.java:2140) at java.lang.Thread.run(Thread.java:722) |
Re: Using Processing for custom dashboard
Well, it runs without any bugs. It just never connects to the robot when I run it. Is there a special function that needs to be called to initialize a connection?
I used processing in netbeans for mine. |
Re: Using Processing for custom dashboard
I got it to work. It seems a certain letter in the table name was capitalized improperly. Thanks ekepalka for the tip on using the networktables jar as a library.
|
Re: Using Processing for custom dashboard
Hey! I thought this thread was closed :P I stopped trying to mess around with NetworkTables for quite some time and moved on to neural networks (probably not a great idea). Now that my team is picking up working on robots, I have to get this working, but all of my revised code seems to have disappeared when I reformatted my computer. The thing I was hung up on was related to the timing when sending and receiving values. Specifically
Code:
try { Thread.sleep(1000); } |
| All times are GMT -5. The time now is 22:43. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi