Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   What is T_Packet_Data.my ?? (http://www.chiefdelphi.com/forums/showthread.php?t=43948)

354.FIRST 13-02-2006 20:04

What is T_Packet_Data.my ??
 
Help

In terminal.c there is the following code:


// does the camera have a tracking solution?
if(T_Packet_Data.my == 0)

how exactly does T_Packet_Data.my give us whether the camera has found a centered target? Is this what we should be using to know if our camera has a target in sight and centered?

thanks

-354

Mike 13-02-2006 20:08

Re: What is T_Packet_Data.my ??
 
This is the y axis location of the "blob" (the green target) on the cameras view. If there is no blob, it is zero. Theres no specific variable saying if something is in view, but this works just as well.

354.FIRST 13-02-2006 20:18

Re: What is T_Packet_Data.my ??
 
Thanks.
What's the best way to tell if the camera has a centered target?
-354

Greg Marra 13-02-2006 20:21

Re: What is T_Packet_Data.my ??
 
Well, logically, if the blob was centered in both the x and y dimensions, it would be safe to assume that the camera was centered on the target.

Now how could you tell how where the blob is....

Mike 13-02-2006 20:27

Re: What is T_Packet_Data.my ??
 
Quote:

Originally Posted by 354.FIRST
Thanks.
What's the best way to tell if the camera has a centered target?
-354

I'm not totally sure where Kevin found this information (maybe he can elaborate more) but in tracking.h I see
Code:

// parameters for CMUcam2 with OV7620 camera module
#define IMAGE_WIDTH 159
#define IMAGE_HEIGHT 239

So from this data you can figure that the middle point of the field of view is (79, 119) which, is also the value of the defines PAN_CENTER_PWM_DEFAULT and TILT_CENTER_PWM_DEFAULT.

So, what you want to do is get T_Packet_Data.my the closest you can to TILT_CENTER_PWM_DEFAULT and T_Packet_Data.mx to PAN_CENTER_PWM_DEFAULT.

-Mike

Greg Ross 13-02-2006 20:32

Re: What is T_Packet_Data.my ??
 
Quote:

Originally Posted by Mike
If there is no blob, it is zero.

That's what I thought too, but in debugging, it looked to me like mx and my DO NOT get cleared when the target is lost. As I noted in another thread, I changed the if(T_Packet_Data.my == 0) tests in tracking.c to if(T_Packet_Data.confidence <= 1) to make the tracking more reliable.

354.FIRST 13-02-2006 20:44

Re: What is T_Packet_Data.my ??
 
thanks for all the help y'all.
Totally saving my butt.
Can you point me to that other thread you mention? I am not finding it.
-354

Quote:

Originally Posted by GW (Greg) Ross
That's what I thought too, but in debugging, it looked to me like mx and my DO NOT get cleared when the target is lost. As I noted in another thread, I changed the if(T_Packet_Data.my == 0) tests in tracking.c to if(T_Packet_Data.confidence <= 1) to make the tracking more reliable.


Greg Ross 13-02-2006 21:01

Re: What is T_Packet_Data.my ??
 
Quote:

Originally Posted by 354.FIRST
thanks for all the help y'all.
Totally saving my butt.
Can you point me to that other thread you mention? I am not finding it.
-354

http://www.chiefdelphi.com/forums/sh...897#post448897

X-Istence 13-02-2006 21:30

Re: What is T_Packet_Data.my ??
 
Quote:

Originally Posted by GW (Greg) Ross
That's what I thought too, but in debugging, it looked to me like mx and my DO NOT get cleared when the target is lost. As I noted in another thread, I changed the if(T_Packet_Data.my == 0) tests in tracking.c to if(T_Packet_Data.confidence <= 1) to make the tracking more reliable.


Ehm, where did you get that from? They get cleared when there is new data from the camera, and if the data from the camera contains a y that does not exist, it will be set to 0, as in it can not find it.

That is at least what I got from the code, and the fact that each time the slow loop is run data is retrieved from the camera.

Kevin Watson 13-02-2006 21:44

Re: What is T_Packet_Data.my ??
 
Quote:

Originally Posted by GW (Greg) Ross
That's what I thought too, but in debugging, it looked to me like mx and my DO NOT get cleared when the target is lost. As I noted in another thread, I changed the if(T_Packet_Data.my == 0) tests in tracking.c to if(T_Packet_Data.confidence <= 1) to make the tracking more reliable.

Seriously? I've never seen it do that, but I'll look into it. I'm working on an updated tracking.c and I'll incorporate the fix(s) when I understand the problem better. BTW, did Rob Steele know about this?

-Kevin

Kevin Watson 13-02-2006 21:46

Re: What is T_Packet_Data.my ??
 
Quote:

Originally Posted by 354.FIRST
Is this what we should be using to know if our camera has a target in sight and centered?

Use the error values for this.

-Kevin

Kevin Watson 13-02-2006 22:33

Re: What is T_Packet_Data.my ??
 
Quote:

Originally Posted by GW (Greg) Ross
That's what I thought too, but in debugging, it looked to me like mx and my DO NOT get cleared when the target is lost. As I noted in another thread, I changed the if(T_Packet_Data.my == 0) tests in tracking.c to if(T_Packet_Data.confidence <= 1) to make the tracking more reliable.

Greg, are you saying that the CMUcam2 will occasionally send a t-packet with a non-zero value for .my when it does *not* have a tracking solution?

-Kevin

Mike 13-02-2006 23:25

Re: What is T_Packet_Data.my ??
 
Quote:

Originally Posted by Kevin Watson
Greg, are you saying that the CMUcam2 will occasionally send a t-packet with a non-zero value for .my when it does *not* have a tracking solution?

-Kevin

I don't think he is saying that it sends a t-packet with a non-zero value for .my/.mx but rather that the .my/.mx that is already stored does not change it's value when the image of a blob is lost.

X-Istence 13-02-2006 23:26

Re: What is T_Packet_Data.my ??
 
Quote:

Originally Posted by Mike
I don't think he is saying that it sends a t-packet with a non-zero value for .my/.mx but rather that the .my/.mx that is already stored does not change it's value when the image of a blob is lost.


It however does when it gets new information from the camera, so that would make no sense.

Keith Watson 13-02-2006 23:30

Re: What is T_Packet_Data.my ??
 
Quote:

Originally Posted by GW (Greg) Ross
That's what I thought too, but in debugging, it looked to me like mx and my DO NOT get cleared when the target is lost. As I noted in another thread, I changed the if(T_Packet_Data.my == 0) tests in tracking.c to if(T_Packet_Data.confidence <= 1) to make the tracking more reliable.

After reading what Greg found in the other thread, Saturday our programmer changed the terminal routine to dump out mx, my, and confidence and we ran tests. We saw non-zero mx, my values with confidence up to 6 or so with the target outside the camera's field of view. When the target is in the field of view the confidence was as low as 140 but was mostly well over 200.

The room the tests were run in had the camera on a 3' table, rows of white flourescent lights were 8'-9' up, and the target was at 3'. We determined the camera was picking up the white lights and putting those in the mx, my values. When we put the target on the floor and limited the tilt up angle the camera no longer picked up the white lights.

Our programmer changed the code to use confidence and it worked perfectly even with white lights in the field of view.


All times are GMT -5. The time now is 01:37.

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