Go to Post Like a wizard, Car Nack is never late. He always arrives precisely when he meets you. - EricH [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
  #1   Spotlight this post!  
Unread 13-02-2006, 20:04
354.FIRST 354.FIRST is offline
Registered User
FRC #0354
 
Join Date: Jan 2006
Location: Brooklyn, NY
Posts: 26
354.FIRST is an unknown quantity at this point
Question 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
  #2   Spotlight this post!  
Unread 13-02-2006, 20:08
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
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.
__________________
http://www.mikesorrenti.com/
  #3   Spotlight this post!  
Unread 13-02-2006, 20:18
354.FIRST 354.FIRST is offline
Registered User
FRC #0354
 
Join Date: Jan 2006
Location: Brooklyn, NY
Posts: 26
354.FIRST is an unknown quantity at this point
Re: What is T_Packet_Data.my ??

Thanks.
What's the best way to tell if the camera has a centered target?
-354
  #4   Spotlight this post!  
Unread 13-02-2006, 20:21
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,031
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
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....
  #5   Spotlight this post!  
Unread 13-02-2006, 20:27
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
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
__________________
http://www.mikesorrenti.com/
  #6   Spotlight this post!  
Unread 13-02-2006, 20:32
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
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.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #7   Spotlight this post!  
Unread 13-02-2006, 20:44
354.FIRST 354.FIRST is offline
Registered User
FRC #0354
 
Join Date: Jan 2006
Location: Brooklyn, NY
Posts: 26
354.FIRST is an unknown quantity at this point
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.
  #8   Spotlight this post!  
Unread 13-02-2006, 21:01
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
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
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #9   Spotlight this post!  
Unread 13-02-2006, 21:30
X-Istence X-Istence is offline
Melt the RC controller!
AKA: Bert JW Regeer
no team
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Montville
Posts: 151
X-Istence will become famous soon enoughX-Istence will become famous soon enough
Send a message via AIM to X-Istence Send a message via MSN to X-Istence
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.
__________________
My Blog!
  #10   Spotlight this post!  
Unread 13-02-2006, 21:44
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
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
Engineer at stealth-mode startup
http://kevin.org
  #11   Spotlight this post!  
Unread 13-02-2006, 21:46
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
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
Engineer at stealth-mode startup
http://kevin.org
  #12   Spotlight this post!  
Unread 13-02-2006, 22:33
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
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
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org

Last edited by Kevin Watson : 13-02-2006 at 22:36.
  #13   Spotlight this post!  
Unread 13-02-2006, 23:25
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
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.
__________________
http://www.mikesorrenti.com/
  #14   Spotlight this post!  
Unread 13-02-2006, 23:26
X-Istence X-Istence is offline
Melt the RC controller!
AKA: Bert JW Regeer
no team
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Montville
Posts: 151
X-Istence will become famous soon enoughX-Istence will become famous soon enough
Send a message via AIM to X-Istence Send a message via MSN to X-Istence
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.
__________________
My Blog!
  #15   Spotlight this post!  
Unread 13-02-2006, 23:30
Keith Watson Keith Watson is offline
Registered User
FRC #0957 (WATSON)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Wilsonville, OR
Posts: 112
Keith Watson is just really niceKeith Watson is just really niceKeith Watson is just really niceKeith Watson is just really nice
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.
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.
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


All times are GMT -5. The time now is 17:48.

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