Go to Post but look at the bright side, you will now be able to size 1/4-20 nuts with your forearm and i doubt there are many people who can say that :p - Greg Needel [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 21-02-2006, 10:28
DemonYawgmoth's Avatar
DemonYawgmoth DemonYawgmoth is offline
Registered User
AKA: Artem Kochnev
FRC #1396 (Pyrobots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Staten Island, NY
Posts: 28
DemonYawgmoth is an unknown quantity at this point
Send a message via AIM to DemonYawgmoth Send a message via MSN to DemonYawgmoth
How to test if the camera is locked on?

We want to do some stuff in autonomous mode for testing if the camera is locked on, and some stuff in normal mode (light up an LED or something) to test if the camera is locked on. I looked around and found a few people saying that I could look at T_Packet_Data.confidence (or whatever that variable is) and somehow from that determine it, but I ran a test on the light, and the camera went through a nasty amount of different numbers, ranging from 8 to 200+, for the confidence. Is there anything else I can do to test if the camera is locked on? If not, is there anything I can do with the confidence value to see if the camera is locked on? Thanks a lot guys.
  #2   Spotlight this post!  
Unread 21-02-2006, 11:48
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: How to test if the camera is locked on?

Quote:
Originally Posted by DemonYawgmoth
We want to do some stuff in autonomous mode for testing if the camera is locked on, and some stuff in normal mode (light up an LED or something) to test if the camera is locked on.
This is a feature built into the version I uploaded last night.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #3   Spotlight this post!  
Unread 21-02-2006, 11:57
DemonYawgmoth's Avatar
DemonYawgmoth DemonYawgmoth is offline
Registered User
AKA: Artem Kochnev
FRC #1396 (Pyrobots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Staten Island, NY
Posts: 28
DemonYawgmoth is an unknown quantity at this point
Send a message via AIM to DemonYawgmoth Send a message via MSN to DemonYawgmoth
Re: How to test if the camera is locked on?

Yeah, we have a whole bunch of code that we wrote for then streamlined version of the code, and would really not like to mess with the bells and whistles code, so is there any way to do that with the old streamlined code and / or to take the function Get_Camera_State() from your new code?
  #4   Spotlight this post!  
Unread 21-02-2006, 12:06
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: How to test if the camera is locked on?

Quote:
Originally Posted by DemonYawgmoth
Yeah, we have a whole bunch of code that we wrote for then streamlined version of the code, and would really not like to mess with the bells and whistles code, so is there any way to do that with the old streamlined code and / or to take the function Get_Camera_State() from your new code?
I should have the new version of the streamlined code up tonight or tomorrow night.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #5   Spotlight this post!  
Unread 21-02-2006, 12:15
DemonYawgmoth's Avatar
DemonYawgmoth DemonYawgmoth is offline
Registered User
AKA: Artem Kochnev
FRC #1396 (Pyrobots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Staten Island, NY
Posts: 28
DemonYawgmoth is an unknown quantity at this point
Send a message via AIM to DemonYawgmoth Send a message via MSN to DemonYawgmoth
Re: How to test if the camera is locked on?

Err, we kinda have to ship out later today, and we'd like to be finished before that, so is there any way to do this without new code, as that would be pretty unpleasant if we had to use new code. Is there any way to do it with the old code, basically like you did it for the new code just with the old one?
  #6   Spotlight this post!  
Unread 21-02-2006, 12:37
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: How to test if the camera is locked on?

If you diff the original code against Kevin's new code you can pull out just the pieces for Get_Tracking_State(). Or you can modify your own code to implement that feature. It's pretty simple.
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.
  #7   Spotlight this post!  
Unread 21-02-2006, 12:59
DemonYawgmoth's Avatar
DemonYawgmoth DemonYawgmoth is offline
Registered User
AKA: Artem Kochnev
FRC #1396 (Pyrobots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Staten Island, NY
Posts: 28
DemonYawgmoth is an unknown quantity at this point
Send a message via AIM to DemonYawgmoth Send a message via MSN to DemonYawgmoth
Re: How to test if the camera is locked on?

Yeah, we took a look at the code to see what was different and we found that his new code uses all of the EEPROM stuff that we dont want to use as that is complex and we just want a simple solution. I also took a look at how he tried to use this Get_Camera_State() and we couldnt figure out the craziness that is going on inside his code. Is there any simple way to do with without any new code or crazy code comparisons?
  #8   Spotlight this post!  
Unread 22-02-2006, 00:13
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: How to test if the camera is locked on?

Crazy code comparisons are a way of life.

If you want just Kevin's Get_Tracking_State() functionality just look for everything having to do with tracking_state. Or more specifically you will need the following lines of code from the new version.

tracking.h
lines 126-135: the tracking state defines
line 171: the Get_Tracking_State() declaration

tracking.c
lines 55-57: the tracking state variable
lines 118-122: setting the tracking state variable
lines 136-138: setting the tracking state variable
lines 197-198: setting the tracking state variable
lines 278-279: setting the tracking state variable
lines 551-593: the Get_Tracking_State() definition

I think that's all.
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.
  #9   Spotlight this post!  
Unread 22-02-2006, 02:19
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: How to test if the camera is locked on?

My first cut at the 2.0 revision of the streamlined code can be found here: http://kevin.org/frc/frc_camera_s_beta.zip.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #10   Spotlight this post!  
Unread 23-02-2006, 11:51
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: How to test if the camera is locked on?

on my robot i have the user display show the camera confidence. i found it hovers between 175 and 225 when it has a good lock and drops below 10 when it has lost the light.

code to show confidence on the user display:

User_Mode_byte = T_packet_Data.confidence;

once you know what your camera is returning you could add more code to turn on an LED or whatever.

if (T_Packet_Data.confidence > 150)
{
Turn_On_LED;// add Signal code here
}
NOTE: if you put eather code sample in User_Rutiens.c add
#include "Tracking.h"

where Turn_On_LED is add your signaling code. you could even make the LED Flash at a verying rate depending on how confident the camera is.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
CMU Camera kills robot controller if not found. Chris_Elston Programming 21 27-03-2006 14:30
Camera shows no love to drive motors anifinder Programming 4 13-02-2006 10:31
Camera locked on railerobotics Programming 5 08-02-2006 19:50
How To Use the Google Camera generalbrando Kit & Additional Hardware 2 07-02-2006 16:00
Camera test Guido470 Programming 0 11-01-2005 12:36


All times are GMT -5. The time now is 13:22.

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