Go to Post I mean, there is a 40 second period where your alliance has to play defense, so you might as well play it well. - Jeff Rodriguez [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 07-02-2010, 12:53
mark.amber mark.amber is offline
Registered User
FRC #2039
 
Join Date: Jan 2010
Location: Rockford IL
Posts: 12
mark.amber is an unknown quantity at this point
We have some things working with java, if you need help look here

Quote:
I am creating this thread because we needed some help getting all the things working on the robot.
We are using the following computer systems for programming in JAVA:
  • Ubuntu 64 bit, running netbeans 6.8 successfully (Ubuntu 9.10)
  • Ubuntu 32 bit, running netbeans 6.8 successfully (Ubuntu 9.10)
  • Windows Vista, running netbeans 6.8 successfully

Classmate PC running:
  • Netbeans 6.7.1. we do not use netbeans on the classmate
  • Updated driver station with compass in bottom right.
  • Recieving feed of camera from cRIO.
  • Working comunication.

The cRIO:
  • Using Victors.
  • Connected to camera, seems to run the default circle detection code, follows circles with this code.
  • Connected to a WGA600N Gaming adapter, connected to our local network, all Computers listed can download to it.
  • Working Gyro for compensating for the orientation of the robot.
  • Working Servo for adjusting camera angle.

Code contains working sections for:
  • HolonomicDrive: setup so no matter what direction the robot is heading, it will respond to the joystick the same (using mecnum wheels)
  • Controls camera position on servo using a throttle on Attack3 Joystick.
  • Using iterativerobot class
  • Using multiple methods, so the code is segmented, and easier to debug
  • Debug output to Netbeans working.

Procedures we know
  • We know the procedure to download code to the cRIO from Netbeans (complicated).
  • We know how to flash the cRIO with the latest image.
  • We know how to setup the Axis camera, for use on the cRIO.
  • We know how to use the Vision Assistant 2009 to test out different filters.
  • We know how to install the latest updates for driver station (complicated).


Quote:
Just respond to this thread if you want to know how to do one of these things, just quote it, and tell any relevant information.
Reply With Quote
  #2   Spotlight this post!  
Unread 08-02-2010, 14:43
sunit sunit is offline
Registered User
FRC #1504
 
Join Date: Feb 2010
Location: Okemos, MI
Posts: 6
sunit is an unknown quantity at this point
Re: We have some things working with java, if you need help look here

We are looking for some sample code that displays images from the camera on the driver station display. The sample code talks about instantiating the class and then setting brightness level and resolution.

What do we do after the camera instance is created in code to display the picture?

- Sunit
Reply With Quote
  #3   Spotlight this post!  
Unread 08-02-2010, 14:55
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: We have some things working with java, if you need help look here

If you create a sample Java project - the CircleTrackerDemo it will track the target and display the output on the dashboard. You should be able to use that as a model to write your own programs to track the target and display images. When the camera is running it will automatically tries to connect to the dashboard program and send images.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #4   Spotlight this post!  
Unread 09-02-2010, 19:25
Patrick Chiang Patrick Chiang is offline
Programming
FRC #3070 (Team Pronto)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Seattle
Posts: 162
Patrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to all
Re: We have some things working with java, if you need help look here

Mind posting your code on the section about the servos? We couldn't ever get it to work beyond one single movement. (Ex:We can set the sensitivity to whatever we want, but it will only move once in any direction.)
Reply With Quote
  #5   Spotlight this post!  
Unread 14-02-2010, 10:36
mark.amber mark.amber is offline
Registered User
FRC #2039
 
Join Date: Jan 2010
Location: Rockford IL
Posts: 12
mark.amber is an unknown quantity at this point
Re: We have some things working with java, if you need help look here

sorry for forgetting about this thread.

to get camera feed put this in the import section

import edu.wpi.first.wpilibj.camera.AxisCamera;

and this in robot init

AxisCamera.getInstance().writeResolution(AxisCamer a.ResolutionT.k320x240);AxisCamera.getInstance().w riteBrightness(0);

that will start getting the image from the camera, make sure that you have the camera configured properly by using the circle tracker demo



for the servo, you just use:

Servo servo = new Servo(slot, 10);

then to tell the servo where to go you use

servo.set(-1 to 1)

you could also say

servo.set((Joystick(1).getX())) now the servo will go up and down with the jostick
Reply With Quote
  #6   Spotlight this post!  
Unread 28-03-2011, 08:25
johncap100 johncap100 is offline
Registered User
FTC #0658
 
Join Date: Aug 2009
Location: Capital High School
Posts: 95
johncap100 is an unknown quantity at this point
Re: We have some things working with java, if you need help look here

do you have a copy of this default code from last year that you might share, or do you know where i might get a copy from last year?

thanks


Quote:
Originally Posted by mark.amber View Post
We are using the following computer systems for programming in JAVA:
  • Ubuntu 64 bit, running netbeans 6.8 successfully (Ubuntu 9.10)
  • Ubuntu 32 bit, running netbeans 6.8 successfully (Ubuntu 9.10)
  • Windows Vista, running netbeans 6.8 successfully

Classmate PC running:
  • Netbeans 6.7.1. we do not use netbeans on the classmate
  • Updated driver station with compass in bottom right.
  • Recieving feed of camera from cRIO.
  • Working comunication.

The cRIO:
  • Using Victors.
  • Connected to camera, seems to run the default circle detection code, follows circles with this code.
  • Connected to a WGA600N Gaming adapter, connected to our local network, all Computers listed can download to it.
  • Working Gyro for compensating for the orientation of the robot.
  • Working Servo for adjusting camera angle.

Code contains working sections for:
  • HolonomicDrive: setup so no matter what direction the robot is heading, it will respond to the joystick the same (using mecnum wheels)
  • Controls camera position on servo using a throttle on Attack3 Joystick.
  • Using iterativerobot class
  • Using multiple methods, so the code is segmented, and easier to debug
  • Debug output to Netbeans working.

Procedures we know
  • We know the procedure to download code to the cRIO from Netbeans (complicated).
  • We know how to flash the cRIO with the latest image.
  • We know how to setup the Axis camera, for use on the cRIO.
  • We know how to use the Vision Assistant 2009 to test out different filters.
  • We know how to install the latest updates for driver station (complicated).
Reply With Quote
  #7   Spotlight this post!  
Unread 28-03-2011, 22:40
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: We have some things working with java, if you need help look here

Hello Java gurus.

Sorry if this is slightly off-topic, but I've got a Java question I've been unable to find an answer for.

Can anyone tell me: If you start several threads at the same priority, what scheduling policy is used to run them concurrently?

Someone said it was not time-based, but rather based on number of bytecodes executed. Is this correct, and can anyone link to a document where this is discussed? I'm referring to the 2011 FRC Java Framework implementation here specifically.

Thank you.


Reply With Quote
  #8   Spotlight this post!  
Unread 14-05-2011, 23:31
Ivan913's Avatar
Ivan913 Ivan913 is offline
Registered User
FRC #3560
 
Join Date: May 2011
Location: Brampton ON, Canada
Posts: 4
Ivan913 is an unknown quantity at this point
Re: We have some things working with java, if you need help look here

My team is trying to switch over to Java from C++ and we're having difficulties getting netbeans to find the wpilibj class files. I followed the "Getting Started with Java for FRC" pdf. Everything goes off without a hitch except until I try to instantiate any of the wpilibj classes, in which case it tells me it "cannot find symbol".
Reply With Quote
  #9   Spotlight this post!  
Unread 15-05-2011, 00:12
Fletch1373's Avatar
Fletch1373 Fletch1373 is offline
Registered User
AKA: Fletch
FRC #3181 (Panthers)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2004
Location: Rochester, NY
Posts: 251
Fletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud of
Re: We have some things working with java, if you need help look here

Quote:
Originally Posted by Ivan913 View Post
My team is trying to switch over to Java from C++ and we're having difficulties getting netbeans to find the wpilibj class files. I followed the "Getting Started with Java for FRC" pdf. Everything goes off without a hitch except until I try to instantiate any of the wpilibj classes, in which case it tells me it "cannot find symbol".
hello Ivan, the WPILibJ library is made available to NetBeans by installing the FRC NetBeans plugins found at http://firstforge.wpi.edu/sf/frs/do/...e_for_2011_frc. You can either download the files and install them manually, or link NetBeans to the site and allow it to check for updates on it's own(with an internet connection at least). To let it search automatically, point the NetBeans plugin manager to http://first.wpi.edu/FRC/java/netbea...te/updates.xml.

Let me know if you have any more questions. I can give you a step by step if you would like.
__________________
Student:
<04: FRC0213> <05-08: FRC1373>
Mentor:
<09-10: FRC0809> <11-12: FRC3555> <12-14: FRC0073> <15-??: FRC3181>
Volunteer:
<FTAA> <CSA> <Defense Coordinator> <Scorekeeper> <Robot Inspector> <Official Scorer>
2016 Tour:
CTWAT [DefCoord] > Pittsburgh[Mentor/DefCoord] > TVR[FTAA] > FLR[CSA] > NE DCMP[CSA] > CMP[CSA]
Reply With Quote
  #10   Spotlight this post!  
Unread 15-05-2011, 00:27
Ivan913's Avatar
Ivan913 Ivan913 is offline
Registered User
FRC #3560
 
Join Date: May 2011
Location: Brampton ON, Canada
Posts: 4
Ivan913 is an unknown quantity at this point
Re: We have some things working with java, if you need help look here

I already installed the plugins. I've actually done it multiple times. Twice using by linking netbeans to the update site, and once by downloading them manually. In each case all works fine. I can see the little frc logo on the menu and all that. I can open the javadocs and open the templates and everything. But every time I try to test out a SimpleRobot template, I try to instantiate something simple like a gyro or accelerometer and it can't seem to find it. Im running windows 7. Under the FRC Configuration tab in the options menu its using the standard WPILibJ location. The file path is C:/Users/Ivan/sunspotfrcsdk/lib/WPILibJ. Any clue what I'm doing wrong here?
Reply With Quote
  #11   Spotlight this post!  
Unread 15-05-2011, 12:24
Strants Strants is offline
Registered User
AKA: Gavin Stewart
FRC #1977
Team Role: College Student
 
Join Date: Dec 2010
Rookie Year: 2010
Location: Colorado
Posts: 11
Strants is an unknown quantity at this point
Re: We have some things working with java, if you need help look here

Quote:
Originally Posted by Ivan913 View Post
But every time I try to test out a SimpleRobot template, I try to instantiate something simple like a gyro or accelerometer and it can't seem to find it. Im running windows 7. Under the FRC Configuration tab in the options menu its using the standard WPILibJ location. The file path is C:/Users/Ivan/sunspotfrcsdk/lib/WPILibJ. Any clue what I'm doing wrong here?
Are you importing the file? Assuming the SimpleRobot class itself doesn't cause you any problems (and from what you've said, that appears to be the case), I would say you just need to import the files. For example, to import a Gyro, you would put this code at the top of the file, under the package name:

Code:
import edu.wpi.first.wpilibj.Gyro;
This is the same as an include statement in C++. In Netbeans, you can also just press ctrl+i, and the editor will take care of the imports for you.
Reply With Quote
  #12   Spotlight this post!  
Unread 15-05-2011, 13:40
Fletch1373's Avatar
Fletch1373 Fletch1373 is offline
Registered User
AKA: Fletch
FRC #3181 (Panthers)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2004
Location: Rochester, NY
Posts: 251
Fletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud of
Re: We have some things working with java, if you need help look here

Quote:
Originally Posted by Ivan913 View Post
I already installed the plugins. I've actually done it multiple times. Twice using by linking netbeans to the update site, and once by downloading them manually. In each case all works fine. I can see the little frc logo on the menu and all that. I can open the javadocs and open the templates and everything. But every time I try to test out a SimpleRobot template, I try to instantiate something simple like a gyro or accelerometer and it can't seem to find it. Im running windows 7. Under the FRC Configuration tab in the options menu its using the standard WPILibJ location. The file path is C:/Users/Ivan/sunspotfrcsdk/lib/WPILibJ. Any clue what I'm doing wrong here?
So the SimpleRobot template with no modifications still gives you errors? If you are making modifications to the template, make sure you're importing the classes like Strants said. The plugins "should" make everything work. However, on my laptop I've always installed the Labview libraries and DriverStation/dashboard programs first, so it's possible that something in one of those is needed by netbeans....? (unlikely, but who knows)
__________________
Student:
<04: FRC0213> <05-08: FRC1373>
Mentor:
<09-10: FRC0809> <11-12: FRC3555> <12-14: FRC0073> <15-??: FRC3181>
Volunteer:
<FTAA> <CSA> <Defense Coordinator> <Scorekeeper> <Robot Inspector> <Official Scorer>
2016 Tour:
CTWAT [DefCoord] > Pittsburgh[Mentor/DefCoord] > TVR[FTAA] > FLR[CSA] > NE DCMP[CSA] > CMP[CSA]
Reply With Quote
  #13   Spotlight this post!  
Unread 15-05-2011, 19:06
Ivan913's Avatar
Ivan913 Ivan913 is offline
Registered User
FRC #3560
 
Join Date: May 2011
Location: Brampton ON, Canada
Posts: 4
Ivan913 is an unknown quantity at this point
Re: We have some things working with java, if you need help look here

As embarrassed as I am to say it, you guys are right, it was the imports. Its working fine now. Big thanks .
Reply With Quote
  #14   Spotlight this post!  
Unread 16-05-2011, 00:10
Fletch1373's Avatar
Fletch1373 Fletch1373 is offline
Registered User
AKA: Fletch
FRC #3181 (Panthers)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2004
Location: Rochester, NY
Posts: 251
Fletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud of
Re: We have some things working with java, if you need help look here

no problem, I'm glad to help
__________________
Student:
<04: FRC0213> <05-08: FRC1373>
Mentor:
<09-10: FRC0809> <11-12: FRC3555> <12-14: FRC0073> <15-??: FRC3181>
Volunteer:
<FTAA> <CSA> <Defense Coordinator> <Scorekeeper> <Robot Inspector> <Official Scorer>
2016 Tour:
CTWAT [DefCoord] > Pittsburgh[Mentor/DefCoord] > TVR[FTAA] > FLR[CSA] > NE DCMP[CSA] > CMP[CSA]
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Really need some help here... synth3tk General Forum 5 23-05-2008 17:29
Need some help with arm not working... neilcooper Programming 3 15-03-2008 06:16
can i have some help with quadratic equations CmptrGk Math and Science 9 13-12-2004 21:33
Have you ever had fish as a "pet"? If so look here please! Elgin Clock Chit-Chat 15 24-11-2004 19:11
hey need some help with writing a code please help me here magical hands Programming 9 01-01-2004 21:46


All times are GMT -5. The time now is 12:59.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi