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

ObstacleAvoiderOnGreenFieldERS7 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 <ObstacleAvoiderOnGreenFieldERS7.h>

Inheritance diagram for ObstacleAvoiderOnGreenFieldERS7:

Inheritance graph
[legend]
Collaboration diagram for ObstacleAvoiderOnGreenFieldERS7:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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


Constructor & Destructor Documentation

ObstacleAvoiderOnGreenFieldERS7::ObstacleAvoiderOnGreenFieldERS7 const SensorBehaviorControlInterfaces interfaces  ) 
 

Constructor.

Parameters:
interfaces The paramters of the SensorBehaviorControl module.

Definition at line 13 of file ObstacleAvoiderOnGreenFieldERS7.cpp.

References pi, and pi_4.


Member Function Documentation

void ObstacleAvoiderOnGreenFieldERS7::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 ObstacleAvoiderOnGreenFieldERS7.cpp.

void ObstacleAvoiderOnGreenFieldERS7::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 ObstacleAvoiderOnGreenFieldERS7.cpp.

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

Here is the call graph for this function:

void ObstacleAvoiderOnGreenFieldERS7::calibrate  ) 
 

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

Definition at line 215 of file ObstacleAvoiderOnGreenFieldERS7.cpp.

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

Here is the call graph for this function:

bool ObstacleAvoiderOnGreenFieldERS7::handleMessage InMessage message  )  [virtual]
 

currently no debug messages are handled

Reimplemented from Module.

Definition at line 236 of file ObstacleAvoiderOnGreenFieldERS7.cpp.

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

Here is the call graph for this function:

ObstacleAvoiderOnGreenFieldERS7::DECLARE_DEBUG_IMAGE classificationY   )  [private]
 


Member Data Documentation

double ObstacleAvoiderOnGreenFieldERS7::maxSpeedX [private]
 

Definition at line 44 of file ObstacleAvoiderOnGreenFieldERS7.h.

double ObstacleAvoiderOnGreenFieldERS7::distanceToGround [private]
 

Definition at line 44 of file ObstacleAvoiderOnGreenFieldERS7.h.

double ObstacleAvoiderOnGreenFieldERS7::distanceOffset [private]
 

Definition at line 44 of file ObstacleAvoiderOnGreenFieldERS7.h.

double ObstacleAvoiderOnGreenFieldERS7::distanceControlInterval [private]
 

Definition at line 44 of file ObstacleAvoiderOnGreenFieldERS7.h.

PIDsmoothedValue ObstacleAvoiderOnGreenFieldERS7::speedX [private]
 

Definition at line 45 of file ObstacleAvoiderOnGreenFieldERS7.h.

PIDsmoothedValue ObstacleAvoiderOnGreenFieldERS7::speedY [private]
 

Definition at line 45 of file ObstacleAvoiderOnGreenFieldERS7.h.

PIDsmoothedValue ObstacleAvoiderOnGreenFieldERS7::speedPhi [private]
 

Definition at line 45 of file ObstacleAvoiderOnGreenFieldERS7.h.

int ObstacleAvoiderOnGreenFieldERS7::gridSize [private]
 

Definition at line 46 of file ObstacleAvoiderOnGreenFieldERS7.h.

int ObstacleAvoiderOnGreenFieldERS7::greenOrLight [private]
 

Definition at line 46 of file ObstacleAvoiderOnGreenFieldERS7.h.

unsigned long ObstacleAvoiderOnGreenFieldERS7::timeOfLastExecute [private]
 

Definition at line 47 of file ObstacleAvoiderOnGreenFieldERS7.h.

unsigned long ObstacleAvoiderOnGreenFieldERS7::timeToCalibrate [private]
 

Definition at line 47 of file ObstacleAvoiderOnGreenFieldERS7.h.

ColorTable64 ObstacleAvoiderOnGreenFieldERS7::localColTable [private]
 

Definition at line 48 of file ObstacleAvoiderOnGreenFieldERS7.h.

bool ObstacleAvoiderOnGreenFieldERS7::localColTableInitialized [private]
 

Definition at line 49 of file ObstacleAvoiderOnGreenFieldERS7.h.


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