Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   our own allternative code for the cmu camera (http://www.chiefdelphi.com/forums/showthread.php?t=43165)

Gili 02-02-2006 15:24

our own allternative code for the cmu camera
 
We had a lot of problems working with Kevin's tracking code for the CMUcam, so we decided to develop our own. we worked all night (literally) and came up with a program that works with our camera. the program itself tracks the green target and if it doesn't find it, it searches for it. if you also have any problems with Kevin's tracking code (sorry Kevin but we tried :p ), take a look at what we did, its worth a try.

click here to go to our forum and download the code

BTW, if you see any bugs or have any suggestions, we will be happy to hear what you have to say :)

nheft 02-02-2006 16:14

Re: our own allternative code for the cmu camera
 
I tried the link you posted and got a 3 K file called 1577camera.rar. Where do I go from here?

Quote:

Originally Posted by Gili
We had a lot of problems working with Kevin's tracking code for the CMUcam, so we decided to develop our own. we worked all night (literally) and came up with a program that works with our camera. the program itself tracks the green target and if it doesn't find it, it searches for it. if you also have any problems with Kevin's tracking code (sorry Kevin but we tried :p ), take a look at what we did, its worth a try.

click here to go to our forum and download the code

BTW, if you see any bugs or have any suggestions, we will be happy to hear what you have to say :)


Jared Russell 02-02-2006 16:19

Re: our own allternative code for the cmu camera
 
I would STRONGLY suggest putting only function forward declarations in the .h file and putting the rest in a .c file...

Gili 02-02-2006 16:20

Re: our own allternative code for the cmu camera
 
Quote:

Originally Posted by nheft
I tried the link you posted and got a 3 K file called 1577camera.rar. Where do I go from here?



hi nheft!
the file you downloaded is a rar file. open it with WinRaR (if you don't have it download from here ).
after downloading, extract the files with winrar and follow the instructions in readme.txt. it should be pretty easy from there. if you still have any problems, feel free to ask any question and we will be happy to help :) .

Gili 02-02-2006 16:21

Re: our own allternative code for the cmu camera
 
Quote:

Originally Posted by Abwehr
I would STRONGLY suggest putting only function forward declarations in the .h file and putting the rest in a .c file...


ok, we added a .c and changed the .h as you recommended. thanks again!

ps. we will be happy to hear more comments.. we are kind of C noobs so tell us what you think :)

nheft 02-02-2006 17:34

Re: our own allternative code for the cmu camera
 
Thank you

Quote:

Originally Posted by Gili
hi nheft!
the file you downloaded is a rar file. open it with WinRaR (if you don't have it download from here ).
after downloading, extract the files with winrar and follow the instructions in readme.txt. it should be pretty easy from there. if you still have any problems, feel free to ask any question and we will be happy to help :) .


Jon236 03-02-2006 08:32

Re: our own allternative code for the cmu camera
 
Quote:

Originally Posted by Gili
ok, we added a .c and changed the .h as you recommended. thanks again!

ps. we will be happy to hear more comments.. we are kind of C noobs so tell us what you think :)

Thanks for the code...will try it out in a bit...

When is your regional?.....I hope to come, but there are no dates!!!!!!

Jon Mittelman
Team236 Mentor

Gili 03-02-2006 08:58

Re: our own allternative code for the cmu camera
 
sorry...i don't know the dates yet...
when i will i'll post them
we'll be glad to see you in Israel :)

Jon236 06-02-2006 21:36

Re: our own allternative code for the cmu camera
 
Quote:

Originally Posted by Gili
sorry...i don't know the dates yet...
when i will i'll post them
we'll be glad to see you in Israel :)

I wanted to share our base driver code with you. It allows simultaneous operation of the camera, gyro, sonar, quadrature encoders and yaw sensor.

You can find at at the end of this thread:

http://www.chiefdelphi.com/forums/sh...0&page=2&pp=15


Good luck and here's hoping to see you guys in Tel Aviv!

Jon Mittelman
Team236

Calvin 08-02-2006 20:07

Re: our own allternative code for the cmu camera
 
Ok I have been testing your code... but I have run into a problem!

At the beginning the camera goes wild and finds the light object...
- as either the camera mount moves or the light moves, the camera follows it.

If you cover up the camera, the xerror and yerror values turn 0... Camera stands still and nothing happens... as you uncover the camera it detects the light and does a little adjusting...

BUT now here is where the problem comes in:
- Cover up the camera. (xerror = 0, yerror = 0)
- Now move the camera away from the light.
- Uncover the camera.
- The camera stands still!

What if during the competion a robot blocks your camera, and your robot moves away (hence your camera moves away from light)... The camera won't respond until it is shown a glimps of the light.

Maybe you should add a piece of code that after a certian amount of time (while xerror = 0 and yerror = 0) to restart the camera and do that wild scan again.

Gal 09-02-2006 07:56

Re: our own allternative code for the cmu camera
 
Quote:

Originally Posted by Calvin
If you cover up the camera, the xerror and yerror values turn 0... Camera stands still and nothing happens... as you uncover the camera it detects the light and does a little adjusting...

If you cover up the camera, it should start searching for the light. If you look in the 1577camera.c we supplied, in the search() function it says:

Code:

if (xerror != 0 && yerror != 0)
    track();

That means that if the xerror and yerror are NOT 0, the camera should track the light. If the xerror and yerror ARE 0, the camera should perform a search as written in the code.
I don't know why your camera doesn't perform that search but i know it should...
This code works for us very well, but maybe we should add an 'else' after that 'if'.
Anyway, are you sure you followed all of the instructions in the readme we made?

Calvin 09-02-2006 11:24

Re: our own allternative code for the cmu camera
 
Alrighty I will play around somemore today...

X-Istence 09-02-2006 19:33

Re: our own allternative code for the cmu camera
 
Would you mind sticking one in a zip file online. On Mac OS X there is no standard unrar utility, and I can't find one that does not cost money.

Gal 09-02-2006 20:15

Re: our own allternative code for the cmu camera
 
Quote:

Originally Posted by X-Istence
Would you mind sticking one in a zip file online. On Mac OS X there is no standard unrar utility, and I can't find one that does not cost money.


I uploaded the zipped file to our forum: http://www.avivrobotics.net/forum/viewtopic.php?p=27

Calvin 12-02-2006 04:58

Re: our own allternative code for the cmu camera
 
I would suggest you try putting the camera into a place with no lights at all,
Does it restart search if no target is found?

Anyways, with a bit modification I was able to have the code restart search (after 5 seconds ) if no target was found... for once we don't want it to restart just because something quickly got in it's way.

Gili 12-02-2006 16:35

Re: our own allternative code for the cmu camera
 
Quote:

Originally Posted by Calvin
Anyways, with a bit modification I was able to have the code restart search (after 5 seconds ) if no target was found... for once we don't want it to restart just because something quickly got in it's way.

what you're saying might be good if your camera isn't placed on the top of the robot, and the other robots may interfere.
our camera is placed at the very top of the robot, and therefore we don't need the camera to wait a few seconds.

Calvin 17-02-2006 00:16

Re: our own allternative code for the cmu camera
 
Question:
Camera is move following the object, but than when the camera reaches it's limit (PAN) it turns to the other direction and stops. I don't think it will be a problem since I'm going to have the shooter (with camera attached to it) follow the camera angle... Just thought I'd point it out.


All times are GMT -5. The time now is 23:08.

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