Homepage Demos Overview Downloads Tutorials Reference
Credits

StareAtBallBehavior Class Reference

#include <StareAtBallBehavior.h>

Inheritance diagram for StareAtBallBehavior:

Inheritance graph
[legend]
List of all members.

Detailed Description

A simple behavior to chase after any objects seen by the vision system.

Definition at line 9 of file StareAtBallBehavior.h.

Public Member Functions

 StareAtBallBehavior ()
 constructor
virtual ~StareAtBallBehavior ()
 destructor
virtual void DoStart ()
 adds a headpointer and a listens for vision events
virtual void DoStop ()
 removes motion commands and stops listening
virtual void processEvent (const EventBase &event)
 sets the head to point at the object and sets the body to move where the head points
virtual std::string getDescription () const
 Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).

Static Public Member Functions

static std::string getClassDescription ()
 Gives a short description of what this class of behaviors does... you should override this (but don't have to).

Protected Attributes

MotionManager::MC_ID headpointer_id
 a HeadPointerMC object


Constructor & Destructor Documentation

StareAtBallBehavior::StareAtBallBehavior  )  [inline]
 

constructor

Definition at line 12 of file StareAtBallBehavior.h.

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

destructor

Definition at line 16 of file StareAtBallBehavior.h.


Member Function Documentation

void StareAtBallBehavior::DoStart  )  [virtual]
 

adds a headpointer and a listens for vision events

Reimplemented from BehaviorBase.

Definition at line 11 of file StareAtBallBehavior.cc.

Referenced by BanditMachine::DoStart().

void StareAtBallBehavior::DoStop  )  [virtual]
 

removes motion commands and stops listening

Reimplemented from BehaviorBase.

Definition at line 17 of file StareAtBallBehavior.cc.

Referenced by BanditMachine::DoStop().

static std::string StareAtBallBehavior::getClassDescription  )  [inline, static]
 

Gives a short description of what this class of behaviors does... you should override this (but don't have to).

If you do override this, also consider overriding getDescription() to return it

Reimplemented from BehaviorBase.

Definition at line 27 of file StareAtBallBehavior.h.

Referenced by getDescription().

virtual std::string StareAtBallBehavior::getDescription  )  const [inline, virtual]
 

Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).

By default simply returns getName(), because any calls from a BehaviorBase function to getClassDescription() are going to call BehaviorBase::getClassDescription(), not ~YourSubClass~::getClassDescription(), because static functions can't be virtual in C++ (doh!)

This means that getDescription called on a pointer to a BehaviorBase of unknown subtype would always return an empty string, which is pretty useless. So instead we return the name in this situation. If you want getDescription to return getClassDescription, you'll have to override it in your subclass to do so.

Reimplemented from BehaviorBase.

Definition at line 28 of file StareAtBallBehavior.h.

void StareAtBallBehavior::processEvent const EventBase event  )  [virtual]
 

sets the head to point at the object and sets the body to move where the head points

Reimplemented from BehaviorBase.

Definition at line 24 of file StareAtBallBehavior.cc.


Member Data Documentation

MotionManager::MC_ID StareAtBallBehavior::headpointer_id [protected]
 

a HeadPointerMC object

Definition at line 31 of file StareAtBallBehavior.h.

Referenced by DoStart(), DoStop(), processEvent(), and StareAtBallBehavior().


The documentation for this class was generated from the following files:

Tekkotsu v2.2.2
Generated Tue Jan 4 15:45:33 2005 by Doxygen 1.4.0