BallTrackingHead Class Reference

#include <BallTrackingHead.h>

List of all members.

Public Member Functions

 BallTrackingHead ()
virtual ~BallTrackingHead ()
virtual OStatus DoInit (const OSystemEvent &event)
virtual OStatus DoStart (const OSystemEvent &event)
virtual OStatus DoStop (const OSystemEvent &event)
virtual OStatus DoDestroy (const OSystemEvent &event)
void NotifyImage (const ONotifyEvent &event)
void NotifySensor (const ONotifyEvent &event)
void NotifyMovingHeadResult (const ONotifyEvent &event)
void NotifyMovingLegsResult (const ONotifyEvent &event)
void NotifyLostFoundSoundResult (const ONotifyEvent &event)

Public Attributes

OSubject * subject [numOfSubject]
OObserver * observer [numOfObserver]

Private Member Functions

void OpenPrimitives ()
void NewCommandVectorData ()
void PlaySound (BallTrackingHeadCommandType type)
void SetCdtVectorDataOfPinkBall ()
bool CentroidAndDeltaAngle (const OFbkImage &cdtImage, int *xcentroid, int *ycentroid, double *delta_pan, double *delta_pan)
void InitSensorIndex (OSensorFrameVectorData *sensorVec)
void GetPanTiltAngle (longword frameNum, double *pan, double *tilt)
void SearchBall ()
void TrackBall (longword frameNum, double delta_pan, double delta_pan)
void MoveHead (double s_pan, double s_tilt, double e_pan, double e_tilt, double *r_pan, double *r_tilt, double pan_limit, double tilt_limit)
void SetJointValue (RCRegion *rgn, int idx, double start, double end)
RCRegion * FindFreeRegion ()

Private Attributes

BallTrackingHeadState ballTrackingHeadState
OPrimitiveID fbkID
OPrimitiveID jointID [NUM_JOINTS]
RCRegion * region [NUM_COMMAND_VECTOR]
bool initSensorIndex
int sensoridx [NUM_JOINTS]
list< RCRegion * > sensorRegions
double lastRefPan
double lastRefTilt

Static Private Attributes

const size_t NUM_COMMAND_VECTOR = 4
const size_t NUM_SENSOR_VECTOR = 2
const size_t NUM_JOINTS = 2
const size_t NUM_FRAMES = 5
const int TILT_INDEX = 0
const int PAN_INDEX = 1
const byte BALL_THRESHOLD = 10
const int FOUND_THRESHOLD = 2
const int LOST_THRESHOLD = 5
const OCdtChannel BALL_CDT_CHAN = ocdtCHANNEL0
const double FIELD_VIEW_H = 57.6
const double FIELD_VIEW_V = 47.8


Constructor & Destructor Documentation

BallTrackingHead::BallTrackingHead  ) 
 

Definition at line 17 of file BallTrackingHead.cc.

References BTHS_IDLE, jointID, region, and sensoridx.

virtual BallTrackingHead::~BallTrackingHead  )  [inline, virtual]
 

Definition at line 44 of file BallTrackingHead.h.


Member Function Documentation

bool BallTrackingHead::CentroidAndDeltaAngle const OFbkImage &  cdtImage,
int *  xcentroid,
int *  ycentroid,
double *  delta_pan,
double *  delta_pan
[private]
 

Definition at line 146 of file BallTrackingHead_Image.cc.

References byte, FIELD_VIEW_H, and FIELD_VIEW_V.

Referenced by NotifyImage().

OStatus BallTrackingHead::DoDestroy const OSystemEvent &  event  )  [virtual]
 

Definition at line 80 of file BallTrackingHead.cc.

OStatus BallTrackingHead::DoInit const OSystemEvent &  event  )  [virtual]
 

Definition at line 30 of file BallTrackingHead.cc.

References NewCommandVectorData(), OpenPrimitives(), and SetCdtVectorDataOfPinkBall().

OStatus BallTrackingHead::DoStart const OSystemEvent &  event  )  [virtual]
 

Definition at line 46 of file BallTrackingHead.cc.

References ballTrackingHeadState, BTHCMD_MOVE_TO_SLEEPING, BTHCMD_MOVE_TO_ZERO_POS, and subject.

OStatus BallTrackingHead::DoStop const OSystemEvent &  event  )  [virtual]
 

Definition at line 67 of file BallTrackingHead.cc.

References ballTrackingHeadState.

RCRegion * BallTrackingHead::FindFreeRegion  )  [private]
 

Definition at line 119 of file BallTrackingHead_Joint.cc.

References region.

Referenced by MoveHead().

void BallTrackingHead::GetPanTiltAngle longword  frameNum,
double *  pan,
double *  tilt
[private]
 

Definition at line 53 of file BallTrackingHead_Sensor.cc.

References longword, PAN_INDEX, sensoridx, sensorRegions, and TILT_INDEX.

Referenced by TrackBall().

void BallTrackingHead::InitSensorIndex OSensorFrameVectorData *  sensorVec  )  [private]
 

Definition at line 37 of file BallTrackingHead_Sensor.cc.

References jointID, and sensoridx.

Referenced by NotifySensor().

void BallTrackingHead::MoveHead double  s_pan,
double  s_tilt,
double  e_pan,
double  e_tilt,
double *  r_pan,
double *  r_tilt,
double  pan_limit,
double  tilt_limit
[private]
 

Definition at line 70 of file BallTrackingHead_Joint.cc.

References FindFreeRegion(), PAN_INDEX, SetJointValue(), subject, and TILT_INDEX.

Referenced by SearchBall(), and TrackBall().

void BallTrackingHead::NewCommandVectorData  )  [private]
 

Definition at line 182 of file BallTrackingHead.cc.

References jointID, NUM_FRAMES, NUM_JOINTS, and region.

Referenced by DoInit().

void BallTrackingHead::NotifyImage const ONotifyEvent &  event  ) 
 

Definition at line 17 of file BallTrackingHead_Image.cc.

References BALL_CDT_CHAN, ballTrackingHeadState, BTHCMD_PLAY_FOUND_SOUND, BTHCMD_PLAY_LOST_SOUND, byte, CentroidAndDeltaAngle(), observer, PlaySound(), SearchBall(), and TrackBall().

void BallTrackingHead::NotifyLostFoundSoundResult const ONotifyEvent &  event  ) 
 

Definition at line 143 of file BallTrackingHead.cc.

References ballTrackingHeadState, observer, and BallTrackingHeadResult::status.

void BallTrackingHead::NotifyMovingHeadResult const ONotifyEvent &  event  ) 
 

Definition at line 87 of file BallTrackingHead.cc.

References ballTrackingHeadState, observer, SearchBall(), and BallTrackingHeadResult::status.

void BallTrackingHead::NotifyMovingLegsResult const ONotifyEvent &  event  ) 
 

Definition at line 115 of file BallTrackingHead.cc.

References ballTrackingHeadState, observer, SearchBall(), and BallTrackingHeadResult::status.

void BallTrackingHead::NotifySensor const ONotifyEvent &  event  ) 
 

Definition at line 16 of file BallTrackingHead_Sensor.cc.

References InitSensorIndex(), initSensorIndex, observer, and sensorRegions.

void BallTrackingHead::OpenPrimitives  )  [private]
 

Definition at line 160 of file BallTrackingHead.cc.

References fbkID, and jointID.

Referenced by DoInit().

void BallTrackingHead::PlaySound BallTrackingHeadCommandType  type  )  [private]
 

Definition at line 214 of file BallTrackingHead.cc.

References subject.

Referenced by NotifyImage().

void BallTrackingHead::SearchBall  )  [private]
 

Definition at line 20 of file BallTrackingHead_Joint.cc.

References ballTrackingHeadState, lastRefPan, lastRefTilt, and MoveHead().

Referenced by NotifyImage(), NotifyMovingHeadResult(), and NotifyMovingLegsResult().

void BallTrackingHead::SetCdtVectorDataOfPinkBall  )  [private]
 

Definition at line 72 of file BallTrackingHead_Image.cc.

References BALL_CDT_CHAN, and fbkID.

Referenced by DoInit().

void BallTrackingHead::SetJointValue RCRegion *  rgn,
int  idx,
double  start,
double  end
[private]
 

Definition at line 100 of file BallTrackingHead_Joint.cc.

References jointID, and NUM_FRAMES.

Referenced by MoveHead().

void BallTrackingHead::TrackBall longword  frameNum,
double  delta_pan,
double  delta_pan
[private]
 

Definition at line 51 of file BallTrackingHead_Joint.cc.

References ballTrackingHeadState, GetPanTiltAngle(), lastRefPan, lastRefTilt, and MoveHead().

Referenced by NotifyImage().


Member Data Documentation

const OCdtChannel BallTrackingHead::BALL_CDT_CHAN = ocdtCHANNEL0 [static, private]
 

Definition at line 70 of file BallTrackingHead.h.

Referenced by NotifyImage(), and SetCdtVectorDataOfPinkBall().

const byte BallTrackingHead::BALL_THRESHOLD = 10 [static, private]
 

Definition at line 67 of file BallTrackingHead.h.

BallTrackingHeadState BallTrackingHead::ballTrackingHeadState [private]
 

Definition at line 94 of file BallTrackingHead.h.

Referenced by DoStart(), DoStop(), NotifyImage(), NotifyLostFoundSoundResult(), NotifyMovingHeadResult(), NotifyMovingLegsResult(), SearchBall(), and TrackBall().

OPrimitiveID BallTrackingHead::fbkID [private]
 

Definition at line 95 of file BallTrackingHead.h.

Referenced by OpenPrimitives(), and SetCdtVectorDataOfPinkBall().

const double BallTrackingHead::FIELD_VIEW_H = 57.6 [static, private]
 

Definition at line 71 of file BallTrackingHead.h.

Referenced by CentroidAndDeltaAngle().

const double BallTrackingHead::FIELD_VIEW_V = 47.8 [static, private]
 

Definition at line 72 of file BallTrackingHead.h.

Referenced by CentroidAndDeltaAngle().

const int BallTrackingHead::FOUND_THRESHOLD = 2 [static, private]
 

Definition at line 68 of file BallTrackingHead.h.

bool BallTrackingHead::initSensorIndex [private]
 

Definition at line 98 of file BallTrackingHead.h.

Referenced by NotifySensor().

OPrimitiveID BallTrackingHead::jointID[NUM_JOINTS] [private]
 

Definition at line 96 of file BallTrackingHead.h.

Referenced by BallTrackingHead(), InitSensorIndex(), NewCommandVectorData(), OpenPrimitives(), and SetJointValue().

double BallTrackingHead::lastRefPan [private]
 

Definition at line 101 of file BallTrackingHead.h.

Referenced by SearchBall(), and TrackBall().

double BallTrackingHead::lastRefTilt [private]
 

Definition at line 102 of file BallTrackingHead.h.

Referenced by SearchBall(), and TrackBall().

const int BallTrackingHead::LOST_THRESHOLD = 5 [static, private]
 

Definition at line 69 of file BallTrackingHead.h.

const size_t BallTrackingHead::NUM_COMMAND_VECTOR = 4 [static, private]
 

Definition at line 61 of file BallTrackingHead.h.

const size_t BallTrackingHead::NUM_FRAMES = 5 [static, private]
 

Definition at line 64 of file BallTrackingHead.h.

Referenced by NewCommandVectorData(), and SetJointValue().

const size_t BallTrackingHead::NUM_JOINTS = 2 [static, private]
 

Definition at line 63 of file BallTrackingHead.h.

Referenced by NewCommandVectorData().

const size_t BallTrackingHead::NUM_SENSOR_VECTOR = 2 [static, private]
 

Definition at line 62 of file BallTrackingHead.h.

OObserver* BallTrackingHead::observer[numOfObserver]
 

Definition at line 47 of file BallTrackingHead.h.

Referenced by NotifyImage(), NotifyLostFoundSoundResult(), NotifyMovingHeadResult(), NotifyMovingLegsResult(), and NotifySensor().

const int BallTrackingHead::PAN_INDEX = 1 [static, private]
 

Definition at line 66 of file BallTrackingHead.h.

Referenced by GetPanTiltAngle(), and MoveHead().

RCRegion* BallTrackingHead::region[NUM_COMMAND_VECTOR] [private]
 

Definition at line 97 of file BallTrackingHead.h.

Referenced by BallTrackingHead(), FindFreeRegion(), and NewCommandVectorData().

int BallTrackingHead::sensoridx[NUM_JOINTS] [private]
 

Definition at line 99 of file BallTrackingHead.h.

Referenced by BallTrackingHead(), GetPanTiltAngle(), and InitSensorIndex().

list<RCRegion*> BallTrackingHead::sensorRegions [private]
 

Definition at line 100 of file BallTrackingHead.h.

Referenced by GetPanTiltAngle(), and NotifySensor().

OSubject* BallTrackingHead::subject[numOfSubject]
 

Definition at line 46 of file BallTrackingHead.h.

Referenced by DoStart(), MoveHead(), and PlaySound().

const int BallTrackingHead::TILT_INDEX = 0 [static, private]
 

Definition at line 65 of file BallTrackingHead.h.

Referenced by GetPanTiltAngle(), and MoveHead().


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 23:04:33 2007 for openSDK by  doxygen 1.3.9.1