Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

GT2004RobotStateDetector Class Reference

#include <GT2004RobotStateDetector.h>

Inheritance diagram for GT2004RobotStateDetector:

Inheritance graph
[legend]
Collaboration diagram for GT2004RobotStateDetector:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GT2004RobotStateDetector (const RobotStateDetectorInterfaces &interfaces)
 Constructor.

virtual void execute ()
 Executes the module.


Private Types

enum  {
  middle = 0, left, right,
  robotSides
}
enum  { maxFrameHistory = 200 }

Private Member Functions

void calculateCollisionState ()
void setNewButtonStatus ()
int getCollisionSide ()
 Did collision occur at front left leg.

void setCollisionOnLeftSide (bool collision)
void setCollisionOnRightSide (bool collision)

Private Attributes

bool switchDown [BodyPercept::numOfSwitches]
long switchDownTime [BodyPercept::numOfSwitches]
long timeSinceLastCollision [6]
long consecutiveCollisionTime [6]
long remindCollision
bool numOfCollisions [maxFrameHistory][robotSides]
bool buttonPressed [BodyPercept::numOfSwitches]
long buttonTime [BodyPercept::numOfSwitches]
long buttonPressedTime [BodyPercept::numOfSwitches]
long buttonDuration [BodyPercept::numOfSwitches]
bool anyBackButtonPressed
long anyBackButtonTime
long anyBackButtonPressedTime
long anyBackButtonDuration

Member Enumeration Documentation

anonymous enum [private]
 

Enumeration values:
middle 
left 
right 
robotSides 

Definition at line 50 of file GT2004RobotStateDetector.h.

anonymous enum [private]
 

Enumeration values:
maxFrameHistory 

Definition at line 55 of file GT2004RobotStateDetector.h.


Constructor & Destructor Documentation

GT2004RobotStateDetector::GT2004RobotStateDetector const RobotStateDetectorInterfaces interfaces  ) 
 

Constructor.

Parameters:
interfaces The paramters of the RobotStateDetector module.

Definition at line 12 of file GT2004RobotStateDetector.cpp.

References consecutiveCollisionTime, maxFrameHistory, numOfCollisions, remindCollision, robotSides, setNewButtonStatus(), switchDown, and timeSinceLastCollision.

Here is the call graph for this function:


Member Function Documentation

void GT2004RobotStateDetector::execute  )  [virtual]
 

Executes the module.

Implements Module.

Definition at line 51 of file GT2004RobotStateDetector.cpp.

References BodyPercept::acceleration, RobotState::acceleration, calculateCollisionState(), BodyPercept::frameNumber, BodyPercept::getBodyPSDDistance(), BodyPercept::getBodyPSDHighValue(), SystemCall::getCurrentSystemTime(), BodyPercept::getMouthState(), BodyPercept::getState(), BodyPercept::getSwitches(), SystemCall::getTimeSince(), RobotState::setDistanceToSIFOC(), RobotState::setFrameNumber(), RobotState::setMouthState(), setNewButtonStatus(), RobotState::setSomethingInFrontOfChest(), RobotState::setState(), RobotState::setTimeWhenSomethingWasInFrontOfChestLast(), switchDown, and switchDownTime.

Here is the call graph for this function:

void GT2004RobotStateDetector::calculateCollisionState  )  [private]
 

Definition at line 169 of file GT2004RobotStateDetector.cpp.

References consecutiveCollisionTime, CollisionPercept::getCollisionAggregate(), CollisionPercept::getCollisionFrontLeft(), CollisionPercept::getCollisionFrontRight(), CollisionPercept::getCollisionHead(), CollisionPercept::getCollisionHindLeft(), CollisionPercept::getCollisionHindRight(), getCollisionSide(), SystemCall::getCurrentSystemTime(), remindCollision, RobotState::setCollisionAggregate(), RobotState::setCollisionFrontLeft(), RobotState::setCollisionFrontRight(), RobotState::setCollisionHead(), RobotState::setCollisionHindLeft(), RobotState::setCollisionHindRight(), setCollisionOnLeftSide(), setCollisionOnRightSide(), RobotState::setCollisionSide(), RobotState::setConsecutiveCollisionTimeAggregate(), RobotState::setConsecutiveCollisionTimeFrontLeft(), RobotState::setConsecutiveCollisionTimeFrontRight(), RobotState::setConsecutiveCollisionTimeHead(), RobotState::setConsecutiveCollisionTimeHindLeft(), RobotState::setConsecutiveCollisionTimeHindRight(), and timeSinceLastCollision.

Referenced by execute().

Here is the call graph for this function:

void GT2004RobotStateDetector::setNewButtonStatus  )  [private]
 

Definition at line 157 of file GT2004RobotStateDetector.cpp.

References RobotState::setAnyBackButtonDuration(), RobotState::setAnyBackButtonPressed(), RobotState::setAnyBackButtonPressedTime(), RobotState::setAnyBackButtonTime(), RobotState::setButtonDuration(), RobotState::setButtonPressed(), RobotState::setButtonPressedTime(), and RobotState::setButtonTime().

Referenced by execute(), and GT2004RobotStateDetector().

Here is the call graph for this function:

int GT2004RobotStateDetector::getCollisionSide  )  [private]
 

Did collision occur at front left leg.

Definition at line 311 of file GT2004RobotStateDetector.cpp.

References maxFrameHistory, middle, and numOfCollisions.

Referenced by calculateCollisionState().

void GT2004RobotStateDetector::setCollisionOnLeftSide bool  collision  )  [private]
 

Definition at line 327 of file GT2004RobotStateDetector.cpp.

References CollisionPercept::frameNumber, maxFrameHistory, and numOfCollisions.

Referenced by calculateCollisionState().

void GT2004RobotStateDetector::setCollisionOnRightSide bool  collision  )  [private]
 

Definition at line 332 of file GT2004RobotStateDetector.cpp.

References CollisionPercept::frameNumber, maxFrameHistory, and numOfCollisions.

Referenced by calculateCollisionState().


Member Data Documentation

bool GT2004RobotStateDetector::switchDown[BodyPercept::numOfSwitches] [private]
 

Definition at line 41 of file GT2004RobotStateDetector.h.

Referenced by execute(), and GT2004RobotStateDetector().

long GT2004RobotStateDetector::switchDownTime[BodyPercept::numOfSwitches] [private]
 

Definition at line 42 of file GT2004RobotStateDetector.h.

Referenced by execute().

long GT2004RobotStateDetector::timeSinceLastCollision[6] [private]
 

Definition at line 43 of file GT2004RobotStateDetector.h.

Referenced by calculateCollisionState(), and GT2004RobotStateDetector().

long GT2004RobotStateDetector::consecutiveCollisionTime[6] [private]
 

Definition at line 44 of file GT2004RobotStateDetector.h.

Referenced by calculateCollisionState(), and GT2004RobotStateDetector().

long GT2004RobotStateDetector::remindCollision [private]
 

Definition at line 45 of file GT2004RobotStateDetector.h.

Referenced by calculateCollisionState(), and GT2004RobotStateDetector().

bool GT2004RobotStateDetector::numOfCollisions[maxFrameHistory][robotSides] [private]
 

Definition at line 57 of file GT2004RobotStateDetector.h.

Referenced by getCollisionSide(), GT2004RobotStateDetector(), setCollisionOnLeftSide(), and setCollisionOnRightSide().

bool GT2004RobotStateDetector::buttonPressed[BodyPercept::numOfSwitches] [private]
 

Definition at line 61 of file GT2004RobotStateDetector.h.

long GT2004RobotStateDetector::buttonTime[BodyPercept::numOfSwitches] [private]
 

Definition at line 62 of file GT2004RobotStateDetector.h.

long GT2004RobotStateDetector::buttonPressedTime[BodyPercept::numOfSwitches] [private]
 

Definition at line 63 of file GT2004RobotStateDetector.h.

long GT2004RobotStateDetector::buttonDuration[BodyPercept::numOfSwitches] [private]
 

Definition at line 64 of file GT2004RobotStateDetector.h.

bool GT2004RobotStateDetector::anyBackButtonPressed [private]
 

Definition at line 65 of file GT2004RobotStateDetector.h.

long GT2004RobotStateDetector::anyBackButtonTime [private]
 

Definition at line 66 of file GT2004RobotStateDetector.h.

long GT2004RobotStateDetector::anyBackButtonPressedTime [private]
 

Definition at line 67 of file GT2004RobotStateDetector.h.

long GT2004RobotStateDetector::anyBackButtonDuration [private]
 

Definition at line 68 of file GT2004RobotStateDetector.h.


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:07:57 2004 for GT2004 by doxygen 1.3.6