|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Camera Code Help Please
We cant figure out why the distance is not correct. We have the light at 4 ft and the camera is 15.5 inches off the ground. We used the equation, and it is giving us strange answers. Any help of ideas would be appeciated
--------------------------------------------------------------------- #include <stdio.h> #include "ifi_aliases.h" #include "ifi_default.h" #include "camera.h" #include "tracking.h" #include "math.h" void Tracking_Info_Terminal(void) { static unsigned char i = 0; static unsigned char j = 0; static unsigned int old_camera_t_packets = 0; static unsigned int distance_woota = 0 ; // has a new camera tracking packet arrived since we last checked? if(camera_t_packets != old_camera_t_packets) { // increment the t-packet counter i++; distance_woota = (33/(tan(((TILT_SERVO - 144) * 25)/50))); // reset the "no camera data" loop counter j = 0; // only show data on every twenty t-packets if(i >= 20) { // reset the local t-packet counter i = 0; // does the camera have a tracking solution? if(Get_Tracking_State() == SEARCHING) { printf("Searching...\r\n"); } else { printf("\r\n"); // pan angle = ((current pan PWM) - (pan center PWM)) * degrees/pan PWM step printf(" Pan Angle (degrees) = %d\r\n", (((int)PAN_SERVO - 144) * 65)/124); // tilt angle = ((current tilt PWM) - (tilt center PWM)) * degrees/tilt PWM step printf("Tilt Angle (degrees) = %d\r\n", (((int)TILT_SERVO - 144) * 25)/50); printf(" Pan Error (Pixels) = %d\r\n", (int)T_Packet_Data.mx - Tracking_Config_Data.Pan_Target_Pixel); printf("Tilt Error (Pixels) = %d\r\n", (int)T_Packet_Data.my - Tracking_Config_Data.Tilt_Target_Pixel); printf(" Blob Size (Pixels) = %u\r\n", (unsigned int)T_Packet_Data.pixels); printf("Confidence (Pixels) = %u\r\n", (unsigned int)T_Packet_Data.confidence); printf("DiStAnCe HAHAHHA = %d\r\n", (int) distance_woota); ------------------------------------------------------------------------ Any ideas would be greatly appreciated. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Camera servos too slow, help please | Lablabla | Programming | 9 | 19-01-2007 11:59 |
| Premiere won't recognize camera - please help | sanddrag | IT / Communications | 9 | 04-01-2007 20:17 |
| please help me to plag in the camera | CompMaster | Programming | 1 | 16-02-2006 11:24 |
| HELP US PLEASE?!?!(pressure switch code) | kingpin3787 | General Forum | 1 | 21-02-2004 15:13 |
| hey need some help with writing a code please help me here | magical hands | Programming | 9 | 01-01-2004 21:46 |