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

ObstacleAvoiderOnGreenField Class Reference

Class that generates Motion requests in a fashion similar to the Braitenberg but also uses the PSD sensor to not run into things. More...

#include <ObstacleAvoiderOnGreenField.h>

Inheritance diagram for ObstacleAvoiderOnGreenField:

Inheritance graph
[legend]
Collaboration diagram for ObstacleAvoiderOnGreenField:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ObstacleAvoiderOnGreenField (const SensorBehaviorControlInterfaces &interfaces)
 Constructor.

void init ()
 some init's that are only done when the module is called for the first time (or it it hasn't been called for a while) such as setting the headcontrol-mode

virtual void execute ()
 the "main" module where all the magic is happening

void calibrate ()
 calibrate the psd (while standing still) to the minimum value it measures

virtual bool handleMessage (InMessage &message)
 currently no debug messages are handled


Private Member Functions

 DECLARE_DEBUG_IMAGE (classificationY)

Private Attributes

double maxSpeedX
double distanceToGround
double distanceOffset
double distanceControlInterval
PIDsmoothedValue speedX
PIDsmoothedValue speedY
PIDsmoothedValue speedPhi
int gridSize
int greenOrLight
unsigned long timeOfLastExecute
unsigned long timeToCalibrate
ColorTable64 localColTable
bool localColTableInitialized

Detailed Description

Class that generates Motion requests in a fashion similar to the Braitenberg but also uses the PSD sensor to not run into things.

Definition at line 21 of file ObstacleAvoiderOnGreenField.h.


Constructor & Destructor Documentation

ObstacleAvoiderOnGreenField::ObstacleAvoiderOnGreenField const SensorBehaviorControlInterfaces interfaces  ) 
 

Constructor.

Parameters:
interfaces The paramters of the SensorBehaviorControl module.

Definition at line 13 of file ObstacleAvoiderOnGreenField.cpp.

References pi, and pi_4.


Member Function Documentation

void ObstacleAvoiderOnGreenField::init  ) 
 

some init's that are only done when the module is called for the first time (or it it hasn't been called for a while) such as setting the headcontrol-mode

Definition at line 28 of file ObstacleAvoiderOnGreenField.cpp.

void ObstacleAvoiderOnGreenField::execute  )  [virtual]
 

the "main" module where all the magic is happening

calc how much green is in both halves

if robot is moving forward, turn where there's more green

if robot is too close to something, stick to the direction it last turned to until obstacle is no longer in front of robot

Implements Module.

Definition at line 30 of file ObstacleAvoiderOnGreenField.cpp.

References PIDsmoothedValue::approximateVal(), Image::cameraInfo, SensorData::data, distanceControlInterval, distanceOffset, distanceToGround, Image::getClassifiedColor(), SystemCall::getCurrentSystemTime(), SystemCall::getTimeSince(), PIDsmoothedValue::getVal(), gridSize, HeadControlMode::headControlMode, idText, SensorDataBuffer::lastFrame(), localColTable, localColTableInitialized, maxSpeedX, MotionRequest::motionType, OUTPUT, pi, LEDRequest::redBottomLEDs, LEDRequest::redTopLEDs, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Pose2D::rotation, Image::setColorTable(), SoundRequest::soundID, speedPhi, MotionRequest::tailRequest, TailRequest::tailRequestID, timeToCalibrate, Pose2D::translation, WalkRequest::walkParams, MotionRequest::walkRequest, WalkRequest::walkType, Vector2< double >::x, and Vector2< double >::y.

Here is the call graph for this function:

void ObstacleAvoiderOnGreenField::calibrate  ) 
 

calibrate the psd (while standing still) to the minimum value it measures

Definition at line 208 of file ObstacleAvoiderOnGreenField.cpp.

References ColorTable64::addColorClass(), Image::cameraInfo, ColorTable64::clear(), gridSize, Image::image, localColTable, localColTableInitialized, CameraInfo::resolutionHeight, and CameraInfo::resolutionWidth.

Here is the call graph for this function:

bool ObstacleAvoiderOnGreenField::handleMessage InMessage message  )  [virtual]
 

currently no debug messages are handled

Reimplemented from Module.

Definition at line 229 of file ObstacleAvoiderOnGreenField.cpp.

References InMessage::bin, GenericDebugData::data, distanceControlInterval, distanceOffset, distanceToGround, InMessage::getMessageID(), GenericDebugData::id, idGenericDebugData, idText, OUTPUT, PIDsmoothedValue::setWeightD(), PIDsmoothedValue::setWeightI(), PIDsmoothedValue::setWeightP(), and speedPhi.

Here is the call graph for this function:

ObstacleAvoiderOnGreenField::DECLARE_DEBUG_IMAGE classificationY   )  [private]
 


Member Data Documentation

double ObstacleAvoiderOnGreenField::maxSpeedX [private]
 

Definition at line 44 of file ObstacleAvoiderOnGreenField.h.

Referenced by execute().

double ObstacleAvoiderOnGreenField::distanceToGround [private]
 

Definition at line 44 of file ObstacleAvoiderOnGreenField.h.

Referenced by execute(), and handleMessage().

double ObstacleAvoiderOnGreenField::distanceOffset [private]
 

Definition at line 44 of file ObstacleAvoiderOnGreenField.h.

Referenced by execute(), and handleMessage().

double ObstacleAvoiderOnGreenField::distanceControlInterval [private]
 

Definition at line 44 of file ObstacleAvoiderOnGreenField.h.

Referenced by execute(), and handleMessage().

PIDsmoothedValue ObstacleAvoiderOnGreenField::speedX [private]
 

Definition at line 45 of file ObstacleAvoiderOnGreenField.h.

PIDsmoothedValue ObstacleAvoiderOnGreenField::speedY [private]
 

Definition at line 45 of file ObstacleAvoiderOnGreenField.h.

PIDsmoothedValue ObstacleAvoiderOnGreenField::speedPhi [private]
 

Definition at line 45 of file ObstacleAvoiderOnGreenField.h.

Referenced by execute(), and handleMessage().

int ObstacleAvoiderOnGreenField::gridSize [private]
 

Definition at line 46 of file ObstacleAvoiderOnGreenField.h.

Referenced by calibrate(), and execute().

int ObstacleAvoiderOnGreenField::greenOrLight [private]
 

Definition at line 46 of file ObstacleAvoiderOnGreenField.h.

unsigned long ObstacleAvoiderOnGreenField::timeOfLastExecute [private]
 

Definition at line 47 of file ObstacleAvoiderOnGreenField.h.

unsigned long ObstacleAvoiderOnGreenField::timeToCalibrate [private]
 

Definition at line 47 of file ObstacleAvoiderOnGreenField.h.

Referenced by execute().

ColorTable64 ObstacleAvoiderOnGreenField::localColTable [private]
 

Definition at line 48 of file ObstacleAvoiderOnGreenField.h.

Referenced by calibrate(), and execute().

bool ObstacleAvoiderOnGreenField::localColTableInitialized [private]
 

Definition at line 49 of file ObstacleAvoiderOnGreenField.h.

Referenced by calibrate(), and execute().


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