Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Is the crio powerful enough? (http://www.chiefdelphi.com/forums/showthread.php?t=86470)

davidthefat 03-08-2010 20:01

Is the crio powerful enough?
 
:confused: Its been a long time I have posted, nothing got accomplished for my fully autonomous robot idea, just whole bunch of notes and drawing in a notebook. My ideas involve heavy use of trig functions (due to the fact that I took trig in the summer, it inspired me). Now trig functions do take lots of power considering the fact that I might be using at least a dozen of them every cycle, while processing images (mass blob detection), and the locomotion and all that good stuff. Since there is no direct way to monitor memory and processor usage on the crio (or am I just unaware) how can I find out how much it is using? Am I good to go with the Math functions or do I have to make a "Trig chart" or have a onboard processor helping the crio?

If you want to know what I am doing:

I am thinking of using 2 60fps cameras as a stereo vision system and its not very complex on paper either. I think it is the perfect system to use


http://www.cellularfactory.com/lapto...108185&eng=fro
Does that look legit to you guys? Seem pretty "shady" as in Made In China status, do you really think its 60FPS? its pretty cheap though

biojae 03-08-2010 20:51

Re: Is the crio powerful enough?
 
If you are using too much trig processing, then you could always use a lookup table.

You would only need one table for both Sin and Cos because of the identity "sin((PI/2.0) - X) == cos(x)"

You could also cache the results of your equations.

What are you using the trig for?

davidthefat 03-08-2010 21:02

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by biojae (Post 970814)
If you are using too much trig processing, then you could always use a lookup table.

You would only need one table for both Sin and Cos because of the identity "sin((PI/2.0) - X) == cos(x)"

You could also cache the results of your equations.

What are you using the trig for?

The distance of an object purely based on cameras, if you think about it, you will get it very easily, I need diagrams to explain it and might take long time to actually explain though. One phrase: Isosceles triangle with a known base

Ether 03-08-2010 21:15

Re: Is the crio powerful enough?
 
Quote:

If you are using too much trig processing, then you could always use a lookup table.
Or you could use a polynomial approximation.

You can get a very good approximation to the sine curve from zero to pi/2 (which is all you need to construct the entire curve) with only three multiplies and three adds:

sin(x) ~ -.0017 + x*(1.027 - x*(.0729 + x*(.1116)))


~

Hawiian Cadder 03-08-2010 21:15

Re: Is the crio powerful enough?
 
if the trig is too much you could attach a TI-83 to the crio, but i doubt the trig will be where the problem is, but in the image processing.

kamocat 03-08-2010 21:50

Re: Is the crio powerful enough?
 
I actually think that doing the trig functions would be faster than doing a lookup table. How long does it take to graph a sine wave on an iBook G4?
Now, what will take a while is the processing of images, ESPECIALLY with disparity maps. You'll probably require an FPGA to get the performance you're looking for. Too bad sbRIOs are in OEM quantities only.

JewishDan18 03-08-2010 22:08

Re: Is the crio powerful enough?
 
The Taylor approximation stated above is both extremely accurate and extremely fast. If it is not accurate enough, just add another term. However, I am pretty sure this is how it is done behind the scenes. It doesn't really make that much of a difference. This year, my team did crab drive w/ gyro and I used a ton of trig functions every cycle. The image processing is much much much more processing intense.

davidthefat 03-08-2010 22:11

Re: Is the crio powerful enough?
 
So all of you are saying that I should use extra help to process the images, but I doubt there is a legit way to do this though...

gblake 03-08-2010 22:21

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by davidthefat (Post 970818)
The distance of an object purely based on cameras, if you think about it, you will get it very easily, I need diagrams to explain it and might take long time to actually explain though. One phrase: Isosceles triangle with a known base

Before you invest too much in this project, assume a reasonable error in the angles you are able to measure after you try to get both cameras to lock onto a single small point on the object. Additionally assume the object is not perfectly "broadside" to your two cameras. Then compute the range of distance errors that will arise as a consequence of those angular errors.

If you are thinking of using an FRC bot for the base of your triangle, and you are trying get the distances to objects that are scattered around an FRC field, You might be disappointed by the probable size of the distance errors

Or you might be perfectly happy. Just don't overlook the extreme precision required for accurate distance measurements across a reasonably wide field of view.

Blake

davidthefat 03-08-2010 22:28

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by gblake (Post 970836)
Before you invest too much in this project, assume a reasonable error in the angles you are able to measure after you try to get both cameras to lock onto a single small point on the object. Additionally assume the object is not perfectly "broadside" to your two cameras. Then compute the range of distance errors that will arise as a consequence of those angular errors.

If you are thinking of using an FRC bot for the base of your triangle, and you are trying get the distances to objects that are scattered around an FRC field, You might be disappointed by the probable size of the distance errors

Or you might be perfectly happy. Just don't overlook the extreme precision required for accurate distance measurements across a reasonably wide field of view.

Blake

I am perfectly fine with "that object is close" "that object is farther" type of thing, I am not making the next mars rover or anything:eek: I don't need to be that exact, may be off by a foot or 2 is fine

gblake 03-08-2010 22:38

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by davidthefat (Post 970837)
... off by a foot or 2 is fine

How about a foot or 50? ... There are important non-linearities in the calculations that magnify small measurement errors dramatically.

davidthefat 03-08-2010 22:42

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by gblake (Post 970838)
How about a foot or 50? ... There are important non-linearities in the calculations that magnify small measurement errors dramatically.

I have no idea what that means, but... Its like the IR Range finders, the voltage output is a curve, gradually evening out and becoming very inaccurate; is this an example of your explanation?

PAR_WIG1350 03-08-2010 23:12

Re: Is the crio powerful enough?
 
I love trig:D

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.

kamocat 04-08-2010 00:27

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by davidthefat (Post 970839)
I have no idea what that means, but... Its like the IR Range finders, the voltage output is a curve, gradually evening out and becoming very inaccurate; is this an example of your explanation?

It's an secant function where x is your angle and y is your distance.
You can see that after about 60 degrees it gets very inaccurate.
The IR sensor, on the other hand, is exponential decay, which makes a slightly friendlier curve. (Your error at 75% maximum distance is only +-25% of the total range of the IR sensor)

rahilm 04-08-2010 04:29

Re: Is the crio powerful enough?
 
Quote:

Originally Posted by davidthefat (Post 970818)
The distance of an object purely based on cameras, if you think about it, you will get it very easily, I need diagrams to explain it and might take long time to actually explain though. One phrase: Isosceles triangle with a known base

If this is the only extent you are using this for, I think the simplest method is using an approximating equation based on just one camera.

We've tried this in the past and our greatest error was about 2inches (at a distance of 52 feet). Basically, all you have to do is take a bunch of values of the width or length of the blob versus the the actual measured distance from the camera to the object. Since sight is logarithmic, take a calculator, plug in the datapoints, generate a logarithmic regression and you're good to go.

Edit: Of course, I am speaking in terms of the last 2 games, for which 2 inches would have been a small enough tolerance.


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

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