Go to Post Yes, a big part of FIRST is learning from others. But a just as important part of FIRST is learning from discovery. - [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 13-02-2006, 23:40
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 354.FIRST
Is this what we should be using to know if our camera has a target in sight and centered?
No. Looking at mx, my, or even confidence does not mean the target is centered. Mx and my are undocumented but they are the target centroid in pixels in the sensor grid of IMAGE_WIDTH pixels by IMAGE_HEIGHT pixels which Mike reported. The tracking code which has modes of searching, tracking, and locked is separate. But the default tracking code does not make these modes available for use elseswhere. I modified our tracking code to make these available.
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.
  #17   Spotlight this post!  
Unread 14-02-2006, 00:14
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 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.
This isn't possible. The .mx value is only tested when the camera has sent a new t-packet. From what Greg and Keith are saying, it seems as though the camera does spit-out funky t-packets under weird lighting conditions.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #18   Spotlight this post!  
Unread 14-02-2006, 14:45
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 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?
Correct. I believe I saw non-zero "my"s with very low confidence (possibly as low as 0.)


Quote:
Originally Posted by Kevin Watson
BTW, did Rob Steele know about this?
I'm not sure if Rob was around when I made the discovery.


What Keith reported corresponds very closely to my experience, although I didn't attempt controlled experiments. I just noticed that sometimes the camera locked on to a spot well away from the target, and noted that the confidence was zero (or so.)
__________________
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
  #19   Spotlight this post!  
Unread 14-02-2006, 14:58
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
Correct. I believe I saw non-zero "my"s with very low confidence (possibly as low as 0.)

What Keith reported corresponds very closely to my experience, although I didn't attempt controlled experiments. I just noticed that sometimes the camera locked on to a spot well away from the target, and noted that the confidence was zero (or so.)
Okay, I'll update the code to use the .confidence value as a discriminator instead of .my. Thanks for the information.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #20   Spotlight this post!  
Unread 15-02-2006, 23:11
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 Keith Watson
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.
I'm altering the tracking code to use the t-packet confidence value as a discriminator. Do you have a better idea of what the default value should be for the code?

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #21   Spotlight this post!  
Unread 16-02-2006, 00:42
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 Kevin Watson
I'm altering the tracking code to use the t-packet confidence value as a discriminator. Do you have a better idea of what the default value should be for the code?

-Kevin
When we saw values down to 140 with the green light that was with the target light tilted more than 45 degrees away and objects possibly partially blocking the light. But I consider 140 valid. With white lights we saw a maximum of 6. I would consider up to 10 invalid. That leaves a pretty large unknown range. Our programmer chose a level of 100. I think it was Greg who mentioned using 80 or 90.
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.
  #22   Spotlight this post!  
Unread 16-02-2006, 01:25
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 Keith Watson
When we saw values down to 140 with the green light that was with the target light tilted more than 45 degrees away and objects possibly partially blocking the light. But I consider 140 valid. With white lights we saw a maximum of 6. I would consider up to 10 invalid. That leaves a pretty large unknown range. Our programmer chose a level of 100. I think it was Greg who mentioned using 80 or 90.
Keith,

Can you do me a favor? Can you grab this code and test it under the conditions that caused the camera to send the low confidence t-packets? These are the changes I've made so far:

1) All changes to servo position are now done through two functions, which will make it easier for teams to use the CMUcam2 servo outputs if they desire.

2) Fixed bug in search initialization code where temp_pan_servo was initialized to zero instead of Tracking_Config_Data.Pan_Min_PWM.

3) Altered tracking algorithm to use the t-packet confidence value to determine whether the code should track or search. This value can also the changed on-the-fly from the tracking menu.

4) Added Get_Tracking_State() function, which can be used to determine if the camera is on target. New code in Process_Data_From_Master_uP( ) uses this function to turn on the switch3 LED on the operator interface when the camera is on target.


-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #23   Spotlight this post!  
Unread 16-02-2006, 13:47
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 ??

Kevin,

I have arranged to get some camera time to test your changes. It will be on Saturday morning before the bot goes to a scrimmage. It will be Saturday evening before I can report back.

Keith
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.
  #24   Spotlight this post!  
Unread 17-02-2006, 11:38
kevlarman kevlarman is offline
"why cant i install Linux?" guy
AKA: Roman Tetelman
None #0100
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Belmont, CA
Posts: 11
kevlarman is an unknown quantity at this point
Re: What is T_Packet_Data.my ??

The non-zero my's probably come from stray pixels that the camera finds (like if the room is lit w/ flourescent lights and there is green or yellow paper on the walls), this doesn't make much of a difference most of the time, but it's annoying that it resets the search pattern, which results in the camera getting stuck going in circles and never finding the target (in our debugging we have gotten around this by covering its field of view until it was facing the target, we should probably make it not reset the search pattern ourselves, but hasn't annoyed us enough to do so yet)
EDIT:
i would also try changing
Code:
if(new_search == 1)
in tracking.c to:
Code:
if(FALSE)
(or if you aren't as lazy as I am just get rid of the whole if block and remove the else)
EDIT 2:
it's also be possible to not set new_search to 1 until after ~.5 seconds of seeing the target, since it will usually lose the stray pixels by then, but I don't see the benefit of reseting the search pattern.

Last edited by kevlarman : 17-02-2006 at 11:57.
  #25   Spotlight this post!  
Unread 17-02-2006, 13:23
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 kevlarman
The non-zero my's probably come from stray pixels that the camera finds (like if the room is lit w/ flourescent lights and there is green or yellow paper on the walls), this doesn't make much of a difference most of the time, but it's annoying that it resets the search pattern, which results in the camera getting stuck going in circles and never finding the target (in our debugging we have gotten around this by covering its field of view until it was facing the target, we should probably make it not reset the search pattern ourselves, but hasn't annoyed us enough to do so yet)
If the logic for tracking vs searching is changed from "is there a target pixel" to "is there confidence" then this problem goes away. For some reason confidence is only large if there is a green light.
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.
  #26   Spotlight this post!  
Unread 17-02-2006, 13:30
kevlarman kevlarman is offline
"why cant i install Linux?" guy
AKA: Roman Tetelman
None #0100
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Belmont, CA
Posts: 11
kevlarman is an unknown quantity at this point
Re: What is T_Packet_Data.my ??

the confidence can drop sharply if there is a reflection of the target somewhere (which is likely considering all the reflective surfaces on the field), so finding that value that won't pick up the reflections but will pick up the real thing may be difficult.
  #27   Spotlight this post!  
Unread 19-02-2006, 15:14
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 Keith Watson
Kevin,

I have arranged to get some camera time to test your changes. It will be on Saturday morning before the bot goes to a scrimmage. It will be Saturday evening before I can report back.

Keith
Kevin,

I have sent email with feedback. It looks good. The feedback is just a couple of minor things in the comments.

Keith
__________________
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