|
Re: Java Camera display on Classmate
There's actually some decent sample code for getting the camera working using Java:
(For ease of description, I am assuming you are developing on the Classmate and everything has been updated)
1. Open NetBeans
2. Choose New Project under the File menu
3. Under Categories scroll down to Samples
4. In Samples choose FRC Java
5. Under project choose CircleTrackerDemoProject.zip
6. Click Next
7. Name your project TheEngineerIsAHeroNow
8. Assuming your robot is on and your Classmate has communications with the robot, "Run" your project (Right click it in the Projects tab and find Run)
This should build and deploy your code to the robot. I believe it sets up an arcade style drive with two PWMs and one joystick. If your driver station is up and running you should see moving pictures from your cam. We added:
cam.writeCompression(30);
to ensure smooth frame rates. I think you might need to have a gyro installed, too, or modify the code to not use it. Finally, with a target in the field of view, pull the trigger and the code will lock on and line up the robot.
At least that's how it worked for us.
Last edited by TubaMorg : 26-02-2010 at 12:22.
Reason: For Some Reason I Used a Lot of Capital Letters, Still Too Many, but What Can I Do?
|