MVWT Vision System: Difference between revisions
No edit summary |
No edit summary |
||
Line 20: | Line 20: | ||
} VisionPacket; | } VisionPacket; | ||
</pre> | </pre> | ||
==Handing Vision Data== | |||
As an example, the function <code>int handle_vision()</code> is use to process vision data by each robot running the code <code>RFController.c</code>. | |||
Each robot first attempts to receive data from the vision socket. If no data is received, the message "could not receive vision packet" is printed. If a message is received, the robot than checks to see if it's complete - it not, the packet is dropped. If too many consecutive packets are dropped, the robot declares itself invisible to the vision system. | |||
The function extracts the robot's angle <code>theta</code> from the vision system and resets its orientation based on what the vision system reports. It then checks to see if there are any commands waiting on the command socket and executes them if the robot is visible to the vision system. |
Revision as of 17:50, 18 January 2007
The MVWT Vision System operates the four cameras on the ceiling over the testbed and determines the position and orientation of all the robots with hats on the testbed. The vision system will not recognize robots without hats and will not recognize hats that are not near its focus level, which is about 20 cm above the raised floor.
The routine that should be running on the vision system computers (north end of the lab) is called vision_static
.
Data Structure
A copy of the following data structure is produced by the vision system for each robot. This is found in MVWT1VisionPacket.h
.
typedef struct { double timestamp; struct { double x; double y; double theta; double xdot; double ydot; double thetadot; } vehicle[NUM_VEHICLES]; } VisionPacket;
Handing Vision Data
As an example, the function int handle_vision()
is use to process vision data by each robot running the code RFController.c
.
Each robot first attempts to receive data from the vision socket. If no data is received, the message "could not receive vision packet" is printed. If a message is received, the robot than checks to see if it's complete - it not, the packet is dropped. If too many consecutive packets are dropped, the robot declares itself invisible to the vision system.
The function extracts the robot's angle theta
from the vision system and resets its orientation based on what the vision system reports. It then checks to see if there are any commands waiting on the command socket and executes them if the robot is visible to the vision system.