WallTestBehavior Class Reference#include <WallTestBehavior.h>
Inheritance diagram for WallTestBehavior:
[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] |
|
Member Function Documentation
void WallTestBehavior::DoStart |
( |
|
) |
[virtual] |
|
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] |
|
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] |
|
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 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 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
|
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(). |
The documentation for this class was generated from the following files:
|