Go to Post FIRST will continue searching for rules and procedures to keep us from hurting ourselves. However, none of this will substitute for judicious application of common sense. - Richard Wallace [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 04-08-2010, 08:29
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,284
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: Is the crio powerful enough?

Quote:
Originally Posted by PAR_WIG1350 View Post
I love trig

team 1350 used binocular vision in 2006 somewhat successfully, I wasn't there to get the specifics, but it used 2 CMUcams and trig, and that was with the old IFI rc, assuming there is a target that can be easily picked up at a low resolution, and the servos controlling the cameras are accurate enough (the closer the object, the less acurate they need to be), it should be *relatively simple. Streamlining the rest of the code to free up memory should also help.

Hint, research "boids", it could help with programing how to react to other robots.
If memory serves, you guys also used a Gumstix as a Co-Processor to handle the stereo vision. I dont think the old controller could handle two CMU cams very well.
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)
  #17   Spotlight this post!  
Unread 04-08-2010, 10:44
Nadav Zingerman Nadav Zingerman is offline
Registered User
FRC #2230
Team Role: Programmer
 
Join Date: Jul 2009
Rookie Year: 2009
Location: Israel
Posts: 90
Nadav Zingerman is a splendid one to beholdNadav Zingerman is a splendid one to beholdNadav Zingerman is a splendid one to beholdNadav Zingerman is a splendid one to beholdNadav Zingerman is a splendid one to beholdNadav Zingerman is a splendid one to beholdNadav Zingerman is a splendid one to behold
Re: Is the crio powerful enough?

The cRIO is powerful enough so that a few trig functions make absolutely no difference. We used a couple dozen of them for our drive routine with no noticeable slow-down at all. Using them in the vision routine should be no different. The main thing that will be slow is image processing, which is mostly affected by the camera resolution.

In addition, I imagine that the existing trig functions are already highly optimized for real-time applications, as that's what the cRIO is for. The cRIO has a floating point processor, so that should work pretty well.

Also, in my experience, one camera is good enough for range finding, provided you know the physical dimensions of the target, which has been the case in the last few games.
  #18   Spotlight this post!  
Unread 04-08-2010, 12:37
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Is the crio powerful enough?

This conversation is focusing way too much on the cost of the trig functions, compared to the cost of the vision functions. Trig is a lot more expensive than addition and subtraction, but trivial compared to vision.
  #19   Spotlight this post!  
Unread 04-08-2010, 15:47
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Is the crio powerful enough?

In summary:
Yes, the cRIO is powerful enough for trig functions.
No, the cRIO is not powerful enough for stereo image processing at 60hz, without reprogramming the FPGA.
__________________
-- Marshal Horn
  #20   Spotlight this post!  
Unread 04-08-2010, 19:51
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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: Is the crio powerful enough?

On a 3.4GHz Pentium D, the sin() function is about 3 times slower than a 3rd degree polynomial approximation.

But since we're only talking 0.3 microseconds for the sin() function, it's not to worry. Anybody have numbers for the cRIO, just curious?
  #21   Spotlight this post!  
Unread 04-08-2010, 20:07
biojae's Avatar
biojae biojae is offline
Likes Omni drives :)
AKA: Justin Stocking
FTC #5011 (BOT SQUAD) && FTC#72(Garage bots)&& FRC#0399 (Eagle Robotics)
Team Role: College Student
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Lancaster
Posts: 276
biojae is a jewel in the roughbiojae is a jewel in the roughbiojae is a jewel in the rough
Re: Is the crio powerful enough?

Which vision target are you designing for?
Green light (2005 - 2007) / Pink and green (2009)
Concentric ellipses

If it is the first one then the cRio might be able to process it.
The thresholding operations take much less processing power.

Are you trying to use stereoscopic vision techniques, or just triangulation?
__________________
FTC Team 72 - No site
FRC Team 399 - http://www.team399.org
2010 Rockwell Collins Innovation in Control Award - (Use of the CAN bus, among other reasons) Phoenix, Arizona!
  #22   Spotlight this post!  
Unread 04-08-2010, 20:14
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Is the crio powerful enough?

Quote:
Originally Posted by Ether View Post
On a 3.4GHz Pentium D, the sin() function is about 3 times slower than a 3rd degree polynomial approximation.

But since we're only talking 0.3 microseconds for the sin() function, it's not to worry. Anybody have numbers for the cRIO, just curious?
Ether -

How did you measure 0.3 microseconds?

I recently wrote a sin function that runs in ~0.7 microseconds on an 80MHz Arm Cortex-M3, with comparable accuracy.
  #23   Spotlight this post!  
Unread 04-08-2010, 20:20
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Is the crio powerful enough?

Quote:
Originally Posted by biojae View Post
Which vision target are you designing for?
Green light (2005 - 2007) / Pink and green (2009)
Concentric ellipses

If it is the first one then the cRio might be able to process it.
The thresholding operations take much less processing power.

Are you trying to use stereoscopic vision techniques, or just triangulation?
The target is any target really, its not specific targets, but just an object that has similar colors. I will go further and do object identification, but I am not thinking that far ahead, Its just alot easier to use an IR Rangefinder and probably more accurate, but I want it to be actually useful. Also 3d mapping is one idea I have in my head
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #24   Spotlight this post!  
Unread 05-08-2010, 00:22
PAR_WIG1350's Avatar
PAR_WIG1350 PAR_WIG1350 is offline
Registered User
AKA: Alan Wells
FRC #1350 (Rambots)
Team Role: Alumni
 
Join Date: Dec 2009
Rookie Year: 2009
Location: Rhode Island
Posts: 1,190
PAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond repute
Re: Is the crio powerful enough?

Quote:
Originally Posted by EricVanWyk View Post
Ether -
How did you measure 0.3 microseconds?
you don't, you just perform the same operation a few million times and divide.
__________________
  #25   Spotlight this post!  
Unread 05-08-2010, 01:31
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Is the crio powerful enough?

Quote:
Originally Posted by PAR_WIG1350 View Post
you don't, you just perform the same operation a few million times and divide.
I don't suppose there's any reason to perform it with changing input values, is there? Computers take just as long to multiply 0x0 as they do 57x291, correct?

Just in case, I used a random-number generator. (This prevents LabVIEW from compiling the results as constants in the program)


It took about 0.000492ms per iteration of the sine function, measured over a million iterations. To put it on the same scale as Ether's measurement, that's 0.5 microseconds.
__________________
-- Marshal Horn

Last edited by kamocat : 05-08-2010 at 01:52.
  #26   Spotlight this post!  
Unread 05-08-2010, 02:05
biojae's Avatar
biojae biojae is offline
Likes Omni drives :)
AKA: Justin Stocking
FTC #5011 (BOT SQUAD) && FTC#72(Garage bots)&& FRC#0399 (Eagle Robotics)
Team Role: College Student
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Lancaster
Posts: 276
biojae is a jewel in the roughbiojae is a jewel in the roughbiojae is a jewel in the rough
Re: Is the crio powerful enough?

Like what was said previously, the trig is not going to be a problem instead its the vision proc.

The triangulation tracking won't take much more processing then 2 *(current load for 1 camera + pointing).

However, a 3d disparity map for stereo optics will take the load of the previous as well as the load of the calculations to make the map and then find a target and distance.

Here is a whitepaper on stereo optics
http://www.cse.unr.edu/~bebis/CS791E...ereoCamera.pdf
__________________
FTC Team 72 - No site
FRC Team 399 - http://www.team399.org
2010 Rockwell Collins Innovation in Control Award - (Use of the CAN bus, among other reasons) Phoenix, Arizona!
  #27   Spotlight this post!  
Unread 05-08-2010, 08:54
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Is the crio powerful enough?

Quote:
Originally Posted by kamocat View Post
I don't suppose there's any reason to perform it with changing input values, is there? Computers take just as long to multiply 0x0 as they do 57x291, correct?
Actually, that isn't always true. For example, the Cortex-M3 multiply timing follows:
32 bits x 32 bits = 32 bits is always one cycle
32b x 32b = 64b takes 3 cycles if the result is small
32b x 32b = 64b takes 5 cycles if the result is big

Also, it is relatively common for functions to bail early for special values, such as 0. For example, my sine function bails in less than half of the usual execution time if the input is a multiple of 45 degrees.

Quote:
Originally Posted by kamocat View Post

Just in case, I used a random-number generator. (This prevents LabVIEW from compiling the results as constants in the program)


It took about 0.000492ms per iteration of the sine function, measured over a million iterations. To put it on the same scale as Ether's measurement, that's 0.5 microseconds.
Thanks!
  #28   Spotlight this post!  
Unread 05-08-2010, 18:55
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Is the crio powerful enough?

I was not very aware of FPGAs, so I read up on them; essentially FPGAs are processors that are highly customizable to fit specific functions? So do FPGAs need to be configured hardwarely before it can be programmed? Is the cRio a type of FPGA? If not, which FPGA is a suitable FPGA for the purpose of image processing? Also would the FPGAs be used primarily to capture the images or process the images? Regarding cameras, would they need to be directly communicating with the FPGA, like the middle man, or would the cameras be communicating with the cRio? If the cameras were to be communicating with the cRio, would a Ethernet network cable splitter suffice? Would the cameras show up as two separate cameras or would the set up just fail?
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #29   Spotlight this post!  
Unread 05-08-2010, 19:59
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Is the crio powerful enough?

An FPGA is not a processor. It does not have to work with only four bytes at a time. It doesn't have to grab data from a register, manipulate it, and then put it somewhere else in memory; it can just process the data continuously. It runs in parallel, like analog hardware. Think of it as a million operational amplifiers you can connect in whatever pattern you like, but instead of having to remanufacture it each time, you can reconfigure it electronically. In truth, it actually loads its configuration from non-volatile memory each time it is turned on, as opposed to it being burned in like a CD.

On the cRIO, there is a processor and an FPGA. I'm not sure about the ethernet or RS232, but I know that every one of the eight modules goes through the FPGA to get to the processor. For example, a small part of our FPGA is programmed as an accumulator for the gyro, to integrate degrees/second into absolute degrees. The FPGA is also used to improve the performance of the processor by acquiring data so that interrupts are rarely necessary; when the processor requests an input, the data is right there.

Now, as to how to get access to the FPGA: We aren't given the LabVIEW FPGA module in FRC. That's because
  1. It's believed to be too difficult for highschoolers in 6 weeks.
  2. It contains the system watchdog, and FIRST would be worried about safety hazards if it is disabled.
  3. It is a very valuble product of National Instruments, and it's a lot of what prevents loss of profit through piracy of the software we get for free. If we were to buy this software and a cRIO, it would be around $8,000 (single license).
Now, with that said, if you download a trial of LabVIEW, you have 30 days to play with it. LabVIEW 2010 just came out yesterday. It is common to have multiple versions of LabVIEW on a single computer without conflict, but if you like, feel free to back it up. After the 30 days, you license will expire, but your code will still be functional if it is deployed. If you'd like to use your code in LabVIEW 8.6, make sure to back-save it so that you can open it with the earlier version of LabVIEW.
When you'd like to use the cRIO for FIRST again, you will have to re-image.
__________________
-- Marshal Horn

Last edited by kamocat : 05-08-2010 at 20:02. Reason: spellcheck
  #30   Spotlight this post!  
Unread 05-08-2010, 20:02
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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: Is the crio powerful enough?

Quote:
Originally Posted by EricVanWyk View Post
Ether -
How did you measure 0.3 microseconds?
First thing I did was to make a FreeDOS boot disk and boot that so I could access the hardware directly. Then I programmed the 8254 PIT to time 100 calcs of each (plus an empty loop so I could subtract out overhead).

~
Closed Thread


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
Reimaging the cRio Issues there are no cRio devices on the subnet Stuart FRC Control System 2 25-02-2009 23:41
617 IN THE LIMELIGHT (Close Enough) bsmmoney Chit-Chat 0 08-03-2008 00:01
pic: The gearbox that makes us so powerful keenanmolner Robot Showcase 6 20-02-2007 02:11
The end of mindstorms - no smiley face sad enough Eric Reed FIRST Lego League 20 15-01-2004 16:00
Enough with the bumpers! archiver 2000 2 23-06-2002 22:32


All times are GMT -5. The time now is 03:42.

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