Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

OverheadVisionClient Class Reference

#include <overhead_vision_client.h>

Inheritance diagram for OverheadVisionClient:

OverheadVisionClientBluetooth OverheadVisionClientWifi List of all members.

Public Member Functions

 OverheadVisionClient (int patternNumber=0)
 Constructor for base vision client class.
virtual ~OverheadVisionClient (void)
 Short Description.
int nextPacket (void)
 Gets next packet in vision packet queue.
int findMyPattern (void)
int findPattern (int patternNumber)
 Short Description.
int getIndex (int index)
 Short Description.
virtual int recv (void)=0
virtual int recvNoWait (void)=0
int getSeqNum (void)
int getCount (void)
int getID (void)
float getX (void)
float getZ (void)
float getAngle (void)

Protected Types

enum  { CONTROL_DATA = 0, VISION_DATA = 1, CRAFT2CRAFT = 2 }

Protected Attributes

int myPatternNumber
std::queue< srv_packet_tpacketQ
const srv_packet_tcurrentPacket
const unsigned short * currentData

Static Protected Attributes

static const float toMeters = 1.0 / 10000.0
static const float toRadians = M_PI / 1800.0

Private Member Functions

 OverheadVisionClient (const OverheadVisionClient &o)
const OverheadVisionClientoperator= (const OverheadVisionClient &o)

Detailed Description

Definition at line 83 of file overhead_vision_client.h.


Member Enumeration Documentation

anonymous enum [protected]
 

Enumerator:
CONTROL_DATA 
VISION_DATA 
CRAFT2CRAFT 

Definition at line 87 of file overhead_vision_client.h.


Constructor & Destructor Documentation

OverheadVisionClient::OverheadVisionClient int  patternNumber = 0  ) 
 

Constructor for base vision client class.

In normal operation the system will be connect to the server and it will continously send vision packets to this client. You can use either a blocking or non-blocking recieve to get the packets from the network. Calling recv[NoWait]() will only queue packets locally. nextPacket() must be used to iterate through packets in the queue. The reasons for queue packets is two-fold. First with network stream protocols (TCP / Bluetooth RFCOMM) there is no gaurantee that recv will only return one vision packet with each call. It's also possible to put the recv() and nextPacket() functions in seperate threads, where one thread recv()'s in a tight loop, and the other thread could be a realtime thread that can quickly read packets from the queue. Each vision packet may contain data for multiple vehicles so findPattern() can be used to lookup the data for a specific pattern number (if it exists). If you want to iterate over over all the data in the vision packet use getIndex().

Parameters:
<patternNumber> <used as the default pattern number for findMyPattern(), it is also need when connecting to server>
Author:
<Derek>

Definition at line 70 of file overhead_vision_client.cpp.

OverheadVisionClient::~OverheadVisionClient void   )  [virtual]
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 43 of file overhead_vision_client.cpp.

OverheadVisionClient::OverheadVisionClient const OverheadVisionClient o  )  [inline, private]
 

Definition at line 125 of file overhead_vision_client.h.


Member Function Documentation

int OverheadVisionClient::findMyPattern void   )  [inline]
 

Definition at line 96 of file overhead_vision_client.h.

References findPattern(), and myPatternNumber.

Referenced by main().

int OverheadVisionClient::findPattern int  patternNumber  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 123 of file overhead_vision_client.cpp.

References currentData, currentPacket, srv_packet_t::data, srv_packet_t::header, i, and srv_pkt_header_t::num_hc_included.

Referenced by findMyPattern().

float OverheadVisionClient::getAngle void   )  [inline]
 

Definition at line 162 of file overhead_vision_client.h.

References currentData, and toRadians.

int OverheadVisionClient::getCount void   )  [inline]
 

Definition at line 138 of file overhead_vision_client.h.

References currentPacket, srv_packet_t::header, and srv_pkt_header_t::num_hc_included.

Referenced by main().

int OverheadVisionClient::getID void   )  [inline]
 

Definition at line 144 of file overhead_vision_client.h.

References currentData.

int OverheadVisionClient::getIndex int  index  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 150 of file overhead_vision_client.cpp.

References currentData, currentPacket, and srv_packet_t::data.

int OverheadVisionClient::getSeqNum void   )  [inline]
 

Definition at line 132 of file overhead_vision_client.h.

References currentPacket, srv_packet_t::header, and srv_pkt_header_t::seq_number.

Referenced by main().

float OverheadVisionClient::getX void   )  [inline]
 

Definition at line 150 of file overhead_vision_client.h.

References currentData, and toMeters.

Referenced by main().

float OverheadVisionClient::getZ void   )  [inline]
 

Definition at line 156 of file overhead_vision_client.h.

References currentData, and toMeters.

Referenced by main().

int OverheadVisionClient::nextPacket void   ) 
 

Gets next packet in vision packet queue.

In normal operation recv will be called and will usually get no more than one packet at a time. But it may be possible re

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 93 of file overhead_vision_client.cpp.

References currentPacket, and packetQ.

Referenced by main().

const OverheadVisionClient& OverheadVisionClient::operator= const OverheadVisionClient o  )  [inline, private]
 

Definition at line 126 of file overhead_vision_client.h.

virtual int OverheadVisionClient::recv void   )  [pure virtual]
 

Implemented in OverheadVisionClientBluetooth, and OverheadVisionClientWifi.

Referenced by main().

virtual int OverheadVisionClient::recvNoWait void   )  [pure virtual]
 

Implemented in OverheadVisionClientBluetooth, and OverheadVisionClientWifi.


Member Data Documentation

const unsigned short* OverheadVisionClient::currentData [protected]
 

Definition at line 116 of file overhead_vision_client.h.

Referenced by findPattern(), getAngle(), getID(), getIndex(), getX(), and getZ().

const srv_packet_t* OverheadVisionClient::currentPacket [protected]
 

Definition at line 115 of file overhead_vision_client.h.

Referenced by findPattern(), getCount(), getIndex(), getSeqNum(), and nextPacket().

int OverheadVisionClient::myPatternNumber [protected]
 

Definition at line 112 of file overhead_vision_client.h.

Referenced by findMyPattern().

std::queue<srv_packet_t> OverheadVisionClient::packetQ [protected]
 

Definition at line 114 of file overhead_vision_client.h.

Referenced by nextPacket(), OverheadVisionClientWifi::tcpRecv(), and OverheadVisionClientWifi::udpRecv().

const float OverheadVisionClient::toMeters = 1.0 / 10000.0 [static, protected]
 

Definition at line 118 of file overhead_vision_client.h.

Referenced by getX(), and getZ().

const float OverheadVisionClient::toRadians = M_PI / 1800.0 [static, protected]
 

Definition at line 119 of file overhead_vision_client.h.

Referenced by getAngle().


The documentation for this class was generated from the following files:
Generated on Fri Sep 1 14:26:01 2006 for Raptor by  doxygen 1.4.4