Quote:
Originally Posted by Ozuru
Yes. Since the SmartDashboard is in Java, it is easily decompileable with tools like JD-GUI. I looked at how the USB camera widget worked and made a public static function in it that allowed me to get the latest frame. In another widget, I had it call that function to get the image and then process it with OpenCV. If you have questions throughout the process, don't be afraid to PM me. It's taken about two seasons but I think I've finally got a grasp on how SmartDashboard's extension system works.
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";
|
Or just make a
TeamForge account and look at the source code? If you decompile the binary you'll lose all of the comments.
Here's another (simplified) reference for the protocol if you don't wanna make an account.