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

GT2005RobotStateDetector Class Reference

#include <GT2005RobotStateDetector.h>

Inheritance diagram for GT2005RobotStateDetector:

Inheritance graph
[legend]
Collaboration diagram for GT2005RobotStateDetector:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GT2005RobotStateDetector (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 GT2005RobotStateDetector.h.

anonymous enum [private]
 

Enumeration values:
maxFrameHistory 

Definition at line 55 of file GT2005RobotStateDetector.h.


Constructor & Destructor Documentation

GT2005RobotStateDetector::GT2005RobotStateDetector const RobotStateDetectorInterfaces interfaces  ) 
 

Constructor.

Parameters:
interfaces The paramters of the RobotStateDetector module.

Definition at line 12 of file GT2005RobotStateDetector.cpp.

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

Here is the call graph for this function:


Member Function Documentation

void GT2005RobotStateDetector::execute  )  [virtual]
 

Executes the module.

Reimplemented from Module.

Definition at line 51 of file GT2005RobotStateDetector.cpp.

References BodyPercept::acceleration, RobotState::acceleration, calculateCollisionState(), DEBUG_RESPONSE, BodyPercept::frameNumber, RobotState::getAnyBackButtonDuration(), RobotState::getAnyBackButtonPressed(), BodyPercept::getBodyPSDDistance(), BodyPercept::getBodyPSDHighValue(), RobotState::getButtonDuration(), RobotState::getButtonPressed(), SystemCall::getCurrentSystemTime(), BodyPercept::getMouthState(), BodyPercept::getState(), BodyPercept::getSwitches(), SystemCall::getTimeSince(), idText, OUTPUT, 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 GT2005RobotStateDetector::calculateCollisionState  )  [private]
 

Definition at line 187 of file GT2005RobotStateDetector.cpp.

References consecutiveCollisionTime, CollisionPercept::getCollisionAggregate(), CollisionPercept::getCollisionFrontLeft(), CollisionPercept::getCollisionFrontRight(), CollisionPercept::getCollisionHead(), CollisionPercept::getCollisionHindLeft(), CollisionPercept::getCollisionHindRight(), getCollisionSide(), SystemCall::getCurrentSystemTime(), CollisionPercept::getOdometryDisturbance(), 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(), RobotState::setOdometryDisturbance(), and timeSinceLastCollision.

Referenced by execute().

Here is the call graph for this function:

void GT2005RobotStateDetector::setNewButtonStatus  )  [private]
 

Definition at line 175 of file GT2005RobotStateDetector.cpp.

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

Referenced by execute(), and GT2005RobotStateDetector().

Here is the call graph for this function:

int GT2005RobotStateDetector::getCollisionSide  )  [private]
 

Did collision occur at front left leg.

Definition at line 331 of file GT2005RobotStateDetector.cpp.

References maxFrameHistory, middle, and numOfCollisions.

Referenced by calculateCollisionState().

void GT2005RobotStateDetector::setCollisionOnLeftSide bool  collision  )  [private]
 

Definition at line 347 of file GT2005RobotStateDetector.cpp.

References CollisionPercept::frameNumber, maxFrameHistory, and numOfCollisions.

Referenced by calculateCollisionState().

void GT2005RobotStateDetector::setCollisionOnRightSide bool  collision  )  [private]
 

Definition at line 352 of file GT2005RobotStateDetector.cpp.

References CollisionPercept::frameNumber, maxFrameHistory, and numOfCollisions.

Referenced by calculateCollisionState().


Member Data Documentation

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

Definition at line 41 of file GT2005RobotStateDetector.h.

Referenced by execute(), and GT2005RobotStateDetector().

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

Definition at line 42 of file GT2005RobotStateDetector.h.

Referenced by execute().

long GT2005RobotStateDetector::timeSinceLastCollision[6] [private]
 

Definition at line 43 of file GT2005RobotStateDetector.h.

Referenced by calculateCollisionState(), and GT2005RobotStateDetector().

long GT2005RobotStateDetector::consecutiveCollisionTime[6] [private]
 

Definition at line 44 of file GT2005RobotStateDetector.h.

Referenced by calculateCollisionState(), and GT2005RobotStateDetector().

long GT2005RobotStateDetector::remindCollision [private]
 

Definition at line 45 of file GT2005RobotStateDetector.h.

Referenced by calculateCollisionState(), and GT2005RobotStateDetector().

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

Definition at line 57 of file GT2005RobotStateDetector.h.

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

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

Definition at line 61 of file GT2005RobotStateDetector.h.

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

Definition at line 62 of file GT2005RobotStateDetector.h.

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

Definition at line 63 of file GT2005RobotStateDetector.h.

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

Definition at line 64 of file GT2005RobotStateDetector.h.

bool GT2005RobotStateDetector::anyBackButtonPressed [private]
 

Definition at line 65 of file GT2005RobotStateDetector.h.

long GT2005RobotStateDetector::anyBackButtonTime [private]
 

Definition at line 66 of file GT2005RobotStateDetector.h.

long GT2005RobotStateDetector::anyBackButtonPressedTime [private]
 

Definition at line 67 of file GT2005RobotStateDetector.h.

long GT2005RobotStateDetector::anyBackButtonDuration [private]
 

Definition at line 68 of file GT2005RobotStateDetector.h.


The documentation for this class was generated from the following files:
Generated on Mon Mar 20 22:14:58 2006 for GT2005 by doxygen 1.3.6