|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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
|
||||
|
||||
|
Re: How to test if the camera is locked on?
Quote:
-Kevin |
|
#3
|
||||
|
||||
|
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
|
||||
|
||||
|
Re: How to test if the camera is locked on?
Quote:
-Kevin |
|
#5
|
||||
|
||||
|
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
|
|||
|
|||
|
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.
|
|
#7
|
||||
|
||||
|
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
|
|||
|
|||
|
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. |
|
#9
|
||||
|
||||
|
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 |
|
#10
|
||||
|
||||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |