Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

WallTestBehavior Class Reference

#include <WallTestBehavior.h>

Inheritance diagram for WallTestBehavior:

Inheritance graph
[legend]
List of all members.

Detailed Description

measures the relative angle of any walls to the front, left, or right

Making a special cameo appearance in solve1() and solve2(), linear least squares solution using newmat library

Definition at line 15 of file WallTestBehavior.h.

Public Member Functions

 WallTestBehavior ()
 constructor
virtual void DoStart ()
 By default, merely adds to the reference counter (through AddReference()); Note you should still call this from your overriding methods.
virtual void DoStop ()
 By default, subtracts from the reference counter (RemoveReference()), and thus may deletex if zero; Don't forget to still call this when you override this; Warning: call this at the end of your DoStop(), not beginning (it might delete this ).
virtual void processEvent (const EventBase &e)
 By defining here, allows you to get away with not supplying a processEvent() function for the EventListener interface. By default, does nothing.
void solve1 (const std::vector< float > &x, const std::vector< float > &y, float &x0, float &x1)
 Takes a series of measurements, returns slope and intercept of linear least square fit (use QR).
void solve2 (const std::vector< float > &x, const std::vector< float > &y, float &x0, float &x1)
 Takes a series of measurements, returns slope and intercept of linear least square fit (uses SVD).
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

std::vector< float > d
 log of distance measurement for each sample
std::vector< float > a
 log of head angle for each sample
std::vector< bool > usedNear
 only used with ERS-7, records whether the sample is from near or far IR sensor

Static Protected Attributes

static const unsigned int reposTime = 750
 time to stand up
static const unsigned int panTime = 3000
 time for actual panning
static const unsigned int lagTime = 128
 time between when the panning is supposed to get to extremes and when it actually does


Constructor & Destructor Documentation

WallTestBehavior::WallTestBehavior  )  [inline]
 

constructor

Definition at line 18 of file WallTestBehavior.h.


Member Function Documentation

void WallTestBehavior::DoStart  )  [virtual]
 

By default, merely adds to the reference counter (through AddReference()); Note you should still call this from your overriding methods.

Reimplemented from BehaviorBase.

Definition at line 13 of file WallTestBehavior.cc.

void WallTestBehavior::DoStop  )  [virtual]
 

By default, subtracts from the reference counter (RemoveReference()), and thus may deletex if zero; Don't forget to still call this when you override this; Warning: call this at the end of your DoStop(), not beginning (it might delete this ).

Reimplemented from BehaviorBase.

Definition at line 54 of file WallTestBehavior.cc.

static std::string WallTestBehavior::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 31 of file WallTestBehavior.h.

Referenced by getDescription().

virtual std::string WallTestBehavior::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 32 of file WallTestBehavior.h.

void WallTestBehavior::processEvent const EventBase e  )  [virtual]
 

By defining here, allows you to get away with not supplying a processEvent() function for the EventListener interface. By default, does nothing.

Reimplemented from BehaviorBase.

Definition at line 60 of file WallTestBehavior.cc.

void WallTestBehavior::solve1 const std::vector< float > &  x,
const std::vector< float > &  y,
float &  x0,
float &  x1
 

Takes a series of measurements, returns slope and intercept of linear least square fit (use QR).

Uses QR factorization to solve $ax+b=y$ where we know x and y, and solve for a and b

Definition at line 248 of file WallTestBehavior.cc.

Referenced by processEvent().

void WallTestBehavior::solve2 const std::vector< float > &  x,
const std::vector< float > &  y,
float &  x0,
float &  x1
 

Takes a series of measurements, returns slope and intercept of linear least square fit (uses SVD).

Uses SVD factorization to solve $ax+by=1$ where we know x and y, and solve for a and b

Definition at line 269 of file WallTestBehavior.cc.

Referenced by processEvent().


Member Data Documentation

std::vector<float> WallTestBehavior::a [protected]
 

log of head angle for each sample

Definition at line 36 of file WallTestBehavior.h.

Referenced by processEvent().

std::vector<float> WallTestBehavior::d [protected]
 

log of distance measurement for each sample

Definition at line 35 of file WallTestBehavior.h.

Referenced by processEvent().

const unsigned int WallTestBehavior::lagTime = 128 [static, protected]
 

time between when the panning is supposed to get to extremes and when it actually does

Definition at line 41 of file WallTestBehavior.h.

Referenced by DoStart().

const unsigned int WallTestBehavior::panTime = 3000 [static, protected]
 

time for actual panning

Definition at line 40 of file WallTestBehavior.h.

Referenced by DoStart().

const unsigned int WallTestBehavior::reposTime = 750 [static, protected]
 

time to stand up

Definition at line 39 of file WallTestBehavior.h.

Referenced by DoStart().

std::vector<bool> WallTestBehavior::usedNear [protected]
 

only used with ERS-7, records whether the sample is from near or far IR sensor

Definition at line 37 of file WallTestBehavior.h.

Referenced by processEvent().


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

Tekkotsu v2.4.1
Generated Tue Aug 16 16:35:12 2005 by Doxygen 1.4.4