Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Camera locked on (http://www.chiefdelphi.com/forums/showthread.php?t=43560)

railerobotics 08-02-2006 17:02

Camera locked on
 
I have searched forever in the code but I cannot find a variable that says if the camera is or isn't locked on to the target. In atonomous I have trying to make our cannon fire once that the camera is locked on the the target.

kaszeta 08-02-2006 17:09

Re: Camera locked on
 
Quote:

Originally Posted by railerobotics
I have searched forever in the code but I cannot find a variable that says if the camera is or isn't locked on to the target. In atonomous I have trying to make our cannon fire once that the camera is locked on the the target.

Look in terminal.c in Kevin's camera code. Basically, you can check the value of T_Packet_Data.my, T_Packet_Data.pixels, or T_Packet_Data.confidence.

railerobotics 08-02-2006 17:15

Re: Camera locked on
 
Thanks

Greg Ross 08-02-2006 17:20

Re: Camera locked on
 
Quote:

Originally Posted by kaszeta
Look in terminal.c in Kevin's camera code. Basically, you can check the value of T_Packet_Data.my, T_Packet_Data.pixels, or T_Packet_Data.confidence.

Be careful about using T_Packet_Data.my. Kevin's code uses it extensively for distinguishing when the target is or is not in its view. Unfortunately, T_Packet_Data.my does not get cleared when the camera loses the target. I found that this would cause the camera to get stuck pointing off into space sometimes, so I changed all those references to use T_Packet_Data.confidence instead.

Keith Watson 08-02-2006 19:47

Re: Camera locked on
 
Quote:

Originally Posted by kaszeta
Look in terminal.c in Kevin's camera code. Basically, you can check the value of T_Packet_Data.my, T_Packet_Data.pixels, or T_Packet_Data.confidence.

The tracking code also uses PAN_ALLOWABLE_ERROR_DEFAULT and TILT_ALLOWABLE_ERROR_DEFAULT to determine whether the camera is locked or not. Search_Target() already has most (but not all) of the logic. It was simple to modify our code to report the tracking state (searching/tracking/locked) and the target centroid location.

Keith Watson 08-02-2006 19:50

Re: Camera locked on
 
Quote:

Originally Posted by GW (Greg) Ross
Be careful about using T_Packet_Data.my. Kevin's code uses it extensively for distinguishing when the target is or is not in its view. Unfortunately, T_Packet_Data.my does not get cleared when the camera loses the target. I found that this would cause the camera to get stuck pointing off into space sometimes, so I changed all those references to use T_Packet_Data.confidence instead.

Thanks for pointing this out!


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi