Go to Post i will not post here...i will not post here....well...okay, yes I will - David66 [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 13-11-2012, 23:20
2185Bilal's Avatar
2185Bilal 2185Bilal is offline
Driver, Ld. Programmer, Electrical
AKA: Bilal Majeed
FRC #2185 (Ramazoidz)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Toronto, Canada
Posts: 110
2185Bilal will become famous soon enough
Camera Programming

So after three years, our team has finally decided to use a camera on the robot.
Since I was in the team three years ago, i dont have a single idea how to program the camera.

So I would like to ask the greater programmers at CD, to help me.

What do I need to program a robot to track the 4 squares (used in rebound rumble), and then move the robot so it aligns straight towards the target.

Like what electrical components do i need and how do I program a camera

thanks for the help
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote
  #2   Spotlight this post!  
Unread 14-11-2012, 09:42
McGurky's Avatar
McGurky McGurky is offline
Geek
AKA: Kyle McGurk
FRC #1716 (Redbird Robotics)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Houghton, MI
Posts: 291
McGurky is just really niceMcGurky is just really niceMcGurky is just really niceMcGurky is just really nice
Re: Camera Programming

Electrically, all you need is the camera (axis cam), an Ethernet cord to plug into your bridge, and the power cable wired to 5v on the Power Distribution Board.

For setting up and configuring the camera, refer to this document (search camera)

http://www.usfirst.org/sites/default...20System_2.pdf

There is a great write up on the vision targets here:

http://firstforge.wpi.edu/sf/docman/...ib/docman.root

With Java code examples and an explanation of the theory! (Read all the documentation and you will learn alot, if you have specific questions, ask them here and the community will help!)
__________________
RTFM -Read The First Manual

You already are who you are, I may be able to show you a fancy trick or two, but the term "Better" is relative to the potential you already have.
Take a look at my website/Blog!

Last edited by McGurky : 14-11-2012 at 09:53.
Reply With Quote
  #3   Spotlight this post!  
Unread 14-11-2012, 20:11
2185Bilal's Avatar
2185Bilal 2185Bilal is offline
Driver, Ld. Programmer, Electrical
AKA: Bilal Majeed
FRC #2185 (Ramazoidz)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Toronto, Canada
Posts: 110
2185Bilal will become famous soon enough
Post Re: Camera Programming

Okay thanks,

So I do have one question:

So here I have a snippet of the sample code given for Java programming:
Code:
//ColorImage image = camera.getImage();     // comment if using stored images
ColorImage image;                           // next 2 lines read image from flash on cRIO
image =  new RGBImage("/10ft2.jpg");
BinaryImage thresholdImage = image.thresholdRGB(255, 255, 0, 0, 0, 0);   // keep only red objects
BinaryImage bigObjectsImage = thresholdImage.removeSmallObjects(false, 2);  // remove small artifacts
BinaryImage convexHullImage = bigObjectsImage.convexHull(false);          // fill in occluded rectangles
BinaryImage filteredImage = convexHullImage.particleFilter(cc);           // find filled in rectangles
Now, the part that I have in bold, when I remove the "//" from the "ColourImage image = camera.getImage();" and comment out the other two lines. Netbeans gives me the error saying:
Code:
unreported exception AxisCameraException; must be caught or declared to be thrown
So what does this mean, and am I supposed to get this error, because I want to use my camera to obtain my image, not the sample images.

Also, I was just wondering. If I do happen to use the sample image, how do I get it on the cRIO. I know in the documentations it says, ftp to the root directory. But what does that actually mean, like how do i ftp to the cRIO, which software do I use and etc.

Thanks in advance
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote
  #4   Spotlight this post!  
Unread 15-11-2012, 15:17
~Cory~'s Avatar
~Cory~ ~Cory~ is offline
Student
AKA: Cory Rypkema
FRC #0706
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Worcester MA
Posts: 216
~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold
Re: Camera Programming

camera.getImage() can cause errors (think about if you tried to fetch an image that didn't exist) so you need to surround it with a

try{
//getImage
}
catch (Exception e){
//insert code to log error here, if wanted

//handle the error by notifying the user to fix what ever is throwing the //error.

}
__________________
corin.rypkema.org
WPI Class of '17
'12 Dean's List Finalist, Mentor of 706 - Cyberhawks
Reply With Quote
  #5   Spotlight this post!  
Unread 15-11-2012, 16:21
2185Bilal's Avatar
2185Bilal 2185Bilal is offline
Driver, Ld. Programmer, Electrical
AKA: Bilal Majeed
FRC #2185 (Ramazoidz)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Toronto, Canada
Posts: 110
2185Bilal will become famous soon enough
Re: Camera Programming

Okay thanks
But how do i download the sample images to the crio via ftp

Could u like tell me how to do it
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote
  #6   Spotlight this post!  
Unread 15-11-2012, 19:35
cgmv123's Avatar
cgmv123 cgmv123 is online now
FRC RI/FLL Field Manager
AKA: Max Vrany
FRC #1306 (BadgerBOTS)
Team Role: College Student
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Madison, WI
Posts: 2,080
cgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond repute
Re: Camera Programming

ftp://10.28.15.2/
__________________
BadgerBOTS Robotics|@team1306|Facebook: BadgerBOTS
2016 FIRST Championship Tesla Division | 2016 Wisconsin Regional Engineering Inspiration Award

2015 FIRST Championship Carson Division | 2015 Wisconsin Regional Chairman's Award

2013 FIRST Championship Curie Division | 2013 Wisconsin Regional Chairman's Award

2012 FIRST Championship Archimedes Division | 2012 Wisconsin Regional Engineering Inspiration Award, Woodie Flowers Finalist Award (Lead Mentor Ben Senson)

Reply With Quote
  #7   Spotlight this post!  
Unread 15-11-2012, 23:14
~Cory~'s Avatar
~Cory~ ~Cory~ is offline
Student
AKA: Cory Rypkema
FRC #0706
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Worcester MA
Posts: 216
~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold
Re: Camera Programming

Use the address that cgmv123 posted (if you are using the default ip set up).

You can use FileZilla which has a graphic user interface or the default ftp

using a CLI FTP
Change to the current directory to the one with the image files
run ftp
type "open 10.28.15.2" and press enter
leave username and password blank
type "bin"
use the "cd" command to move to the directory that you want the files in
the use the "put" command to upload files.
__________________
corin.rypkema.org
WPI Class of '17
'12 Dean's List Finalist, Mentor of 706 - Cyberhawks
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


All times are GMT -5. The time now is 13:36.

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