|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Using VirtualWindow() ... how?
I'm looking to track two lights to be able to center the robot between them, but I am clueless.
If I tell the camera to use a VW, will it go back to using a full window in the next loop? Will I still be able to use the pan/tilt angles as printed by the default camera code? Where will I find the coordinate values of the bounding box? If I create two VWs in one loop of autonomous code (for two lights), how can I get the coordinates of the bounding box for each? Also, I'm assuming I don't need to change the camera to Raw Mode because the initialization function does that. Basically, as is very clear, I'm new to using the camera. Any help is appreciated. |
|
#2
|
||||
|
||||
|
Re: Using VirtualWindow() ... how?
Quote:
extern unsigned int camera_acks; extern unsigned int camera_ncks; The new virtual window is persistent until the camera is reset, at which point the camera will revert back to using the full frame. You do not need to call Raw_Mode( ) again. The coordinant frame is discussed in the command dictionary, which is available at http://kevin.org/frc. If you mounted the camera using the instructions in the workbook, pixel 1,1 in in the upper left corner, otherwise it's located in the lower right corner. -Kevin |
|
#3
|
|||
|
|||
|
Re: Using VirtualWindow() ... how?
Today we just got it (somewhat) working, and we found it helpful to call Pole Mode (as mentioned by JT250 in the sticky) which is a command that causes the camera to only return 1 packet when track color is called.
So basically, after calling camera idle the we first put the camera in pole mode, and then get out of it after we are done splitting and checking our virtual windows. Just a suggestion, it might not be necessary. Code:
void Pole_Mode(unsigned char x)
{
Write_Camera_Serial_Port('P');
Write_Camera_Serial_Port('M');
Write_Camera_Serial_Port(1);
Write_Camera_Serial_Port(x);
}
Last edited by abrockhoff : 28-01-2007 at 23:05. Reason: typos |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| poll: how many teams are using ramps? | Aaron Harvey | Rules/Strategy | 4 | 26-01-2007 01:26 |
| How many teams are using the Camera? | Matt Goulart | Programming | 5 | 06-02-2005 15:06 |
| How many teams are using the Camera? | Matt Goulart | Electrical | 3 | 30-01-2005 09:29 |
| How many motors are you using to drive? | Joseph F | Motors | 18 | 16-10-2002 21:24 |
| How fast, how strong, how long? | Wayne C. | General Forum | 6 | 24-01-2002 21:32 |