Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
#include <WalkCalibration.h>
Inheritance diagram for WalkCalibration:
In retrospect, this might have been a little easier to do as a ControlBase/StateNode multiple inheritance instead of ControlBase/EventListener... oh well.
Definition at line 17 of file WalkCalibration.h.
Public Member Functions | |
WalkCalibration () | |
constructor | |
~WalkCalibration () | |
destructor | |
virtual ControlBase * | activate (MotionManager::MC_ID disp_id, Socket *gui) |
Called when the control is activated (or the control system is reactivating). | |
virtual void | refresh () |
called when the child has died and this control should refresh its display, or some other event (such as the user pressing the refresh button) has happened to cause a refresh to be needed | |
virtual void | deactivate () |
called when this control is being popped from the control stack | |
virtual ControlBase * | doSelect () |
when the user has trigger an "open selection" - default is to return the hilighted control | |
virtual void | processEvent (const EventBase &e) |
listens for locomotion events so we know when to stop recording | |
virtual ControlBase * | takeInput (const std::string &msg) |
called when the user has supplied a text string (may not have been prompted by doReadStdIn()!) | |
virtual void | setHilights (const std::vector< unsigned int > &hi) |
sets the hilighted slots | |
virtual void | hilightFirst () |
sets the hilight to the first non-null slot | |
Protected Types | |
enum | { ROOT, CHOOSE, READY, MOVING, READING_1, READING_2, CLEAR } |
enum | dataSource { fs, fr, sr, br, bs, r, NUM_SRC } |
allows representation of the current sample type More... | |
Protected Member Functions | |
void | setupRoot () |
sets state to root menu | |
void | setupChoose () |
sets state to choose type menu | |
void | setupReady () |
sets state to ready menu | |
void | setupMoving () |
sets state to moving menu | |
void | setupReading1 () |
sets state to enter first measurement menu | |
void | setupReading2 () |
sets state to enter second measurement menu | |
void | setupClear () |
sets state to clear confirmation menu | |
unsigned int | getType () |
returns current sample type | |
unsigned int | getFirstIndex (dataSource t) |
returns a name index for the first measurement type | |
unsigned int | getSecondIndex (dataSource t) |
returns a name index for the second measurement type | |
char * | getIndexName (unsigned int t) |
returns name for measurement type | |
char * | getFirstMeasure (dataSource t) |
returns name for first measurement type | |
char * | getSecondMeasure (dataSource t) |
returns name for second measurement type | |
float | arclen (float d, float a, float sign) |
calculates arc distance corresponding to a displacement and angle, negated if necessary to match sign | |
void | addSample () |
adds data point corresponding to measurements stored in firstIn and secondIn | |
void | addSample (std::vector< float * > &dat, unsigned int row, float sol) |
adds data point to dat at row with solution (deprecated) | |
void | addSample (std::vector< float * > &dat, float x, float y, float a) |
adds data point to dat for a given x,y,a (and old_x, old_y, old_a) | |
Static Protected Member Functions | |
void | loadData (const std::string &name, std::vector< float * > &data) |
does the work of loading data sets | |
void | saveData (const std::string &name, const std::vector< float * > &data) |
does the work of saving data sets | |
void | clearData (std::vector< float * > &data) |
clears current data | |
void | report (unsigned int row, float cmd, float actual) |
reports data as they are being taken | |
void | err (const std::string &str) |
pops up an error message on the controller and also displays it on the console | |
Protected Attributes | |
enum WalkCalibration:: { ... } | st |
the currently active state | |
enum WalkCalibration::dataSource | curType |
allows representation of the current sample type | |
float | old_x |
the x velocity recorded when we started moving | |
float | old_y |
the y velocity recorded when we started moving | |
float | old_a |
the a velocity recorded when we started moving | |
unsigned int | startTime |
the time recording started | |
unsigned int | stopTime |
the time recording stopped | |
ControlBase * | help |
control holding help info | |
FileInputControl * | load |
control for loading data | |
StringInputControl * | save |
control for saving data | |
ControlBase * | measure |
control for taking measurements | |
ControlBase * | clear |
control for clearing data | |
ToggleControl * | polar |
control for selecting polar measurements for fs/bs | |
ToggleControl * | rect |
control for selecting cartesian measurements for fs/bs | |
bool | isPolar |
true if polar measurements is selected | |
std::string | lastLoad |
name last data file selected (so we know if a new has been selected | |
float | firstIn |
the input given for the first measurement | |
float | secondIn |
the input given for the second measurement | |
std::vector< float * > | data [NUM_SRC] |
an array of vectors of sample points (one veotor for each of the sample types) | |
unsigned int | cnts [NUM_SRC] |
count of samples for each sample type (cnts[i] should equal data[i].size()) | |
std::string | status |
string to send for ControllerGUI status message (current count of each sample type) | |
Static Protected Attributes | |
char * | datanames [NUM_SRC] = { "fs","fr","sr","br","bs","rr" } |
name for each sample type | |
Private Member Functions | |
WalkCalibration (const WalkCalibration &) | |
don't call | |
WalkCalibration & | operator= (const WalkCalibration &) |
don't call |
|
Definition at line 46 of file WalkCalibration.h. |
|
allows representation of the current sample type
Definition at line 57 of file WalkCalibration.h. Referenced by setupChoose(). |
|
constructor
Definition at line 14 of file WalkCalibration.cc. |
|
destructor
Definition at line 171 of file WalkCalibration.cc. |
|
don't call
|
|
Called when the control is activated (or the control system is reactivating). Takes the id number of a LedMC which the control should use, maintained by Controller. Controls share the display which is passed, and may use the socket gui to communicate with the GUI controller, if it is connected.
Reimplemented from ControlBase. Definition at line 180 of file WalkCalibration.cc. |
|
adds data point to dat for a given x,y,a (and old_x, old_y, old_a)
Definition at line 891 of file WalkCalibration.cc. |
|
adds data point to dat at row with solution (deprecated)
Definition at line 874 of file WalkCalibration.cc. |
|
adds data point corresponding to measurements stored in firstIn and secondIn
Definition at line 791 of file WalkCalibration.cc. Referenced by takeInput(). |
|
calculates arc distance corresponding to a displacement and angle, negated if necessary to match sign
Definition at line 733 of file WalkCalibration.cc. Referenced by addSample(). |
|
clears current data
Definition at line 404 of file WalkCalibration.cc. Referenced by doSelect(), and loadData(). |
|
called when this control is being popped from the control stack
Reimplemented from ControlBase. Definition at line 29 of file WalkCalibration.h. |
|
when the user has trigger an "open selection" - default is to return the hilighted control
Reimplemented from ControlBase. Definition at line 211 of file WalkCalibration.cc. |
|
pops up an error message on the controller and also displays it on the console
Definition at line 863 of file WalkCalibration.cc. Referenced by loadData(), saveData(), setupMoving(), and takeInput(). |
|
returns a name index for the first measurement type
Definition at line 643 of file WalkCalibration.cc. Referenced by setupChoose(), setupMoving(), and setupReady(). |
|
returns name for first measurement type
Definition at line 690 of file WalkCalibration.cc. Referenced by processEvent(), setupReading1(), and takeInput(). |
|
returns name for measurement type
Definition at line 676 of file WalkCalibration.cc. Referenced by setupChoose(), setupMoving(), and setupReady(). |
|
returns a name index for the second measurement type
Definition at line 660 of file WalkCalibration.cc. Referenced by setupChoose(), setupMoving(), and setupReady(). |
|
returns name for second measurement type
Definition at line 714 of file WalkCalibration.cc. Referenced by processEvent(), setupReading2(), and takeInput(). |
|
returns current sample type
|
|
sets the hilight to the first non-null slot
Reimplemented from ControlBase. Definition at line 344 of file WalkCalibration.cc. Referenced by setupClear(). |
|
does the work of loading data sets
Definition at line 358 of file WalkCalibration.cc. Referenced by refresh(). |
|
don't call
|
|
listens for locomotion events so we know when to stop recording
Implements EventListener. Definition at line 279 of file WalkCalibration.cc. |
|
called when the child has died and this control should refresh its display, or some other event (such as the user pressing the refresh button) has happened to cause a refresh to be needed
Reimplemented from ControlBase. Definition at line 186 of file WalkCalibration.cc. Referenced by doSelect(), processEvent(), and takeInput(). |
|
reports data as they are being taken
Definition at line 852 of file WalkCalibration.cc. Referenced by addSample(). |
|
does the work of saving data sets
Definition at line 382 of file WalkCalibration.cc. Referenced by refresh(). |
|
sets the hilighted slots
Reimplemented from ControlBase. Definition at line 331 of file WalkCalibration.cc. |
|
sets state to choose type menu
Definition at line 422 of file WalkCalibration.cc. Referenced by doSelect(). |
|
sets state to clear confirmation menu
Definition at line 631 of file WalkCalibration.cc. Referenced by doSelect(). |
|
sets state to moving menu
Definition at line 536 of file WalkCalibration.cc. Referenced by doSelect(). |
|
sets state to enter first measurement menu
Definition at line 596 of file WalkCalibration.cc. Referenced by processEvent(). |
|
sets state to enter second measurement menu
Definition at line 613 of file WalkCalibration.cc. Referenced by setupReading1(), and takeInput(). |
|
sets state to ready menu
Definition at line 446 of file WalkCalibration.cc. Referenced by doSelect(), and takeInput(). |
|
sets state to root menu
Definition at line 410 of file WalkCalibration.cc. Referenced by doSelect(), and WalkCalibration(). |
|
called when the user has supplied a text string (may not have been prompted by doReadStdIn()!)
Reimplemented from ControlBase. Definition at line 294 of file WalkCalibration.cc. |
|
control for clearing data
Definition at line 103 of file WalkCalibration.h. Referenced by doSelect(), setupRoot(), WalkCalibration(), and ~WalkCalibration(). |
|
count of samples for each sample type (cnts[i] should equal data[i].size())
Definition at line 112 of file WalkCalibration.h. Referenced by addSample(), doSelect(), refresh(), setupClear(), and WalkCalibration(). |
|
allows representation of the current sample type
Referenced by addSample(), doSelect(), processEvent(), refresh(), setupMoving(), setupReading1(), setupReading2(), setupReady(), and takeInput(). |
|
an array of vectors of sample points (one veotor for each of the sample types)
Definition at line 111 of file WalkCalibration.h. Referenced by addSample(), doSelect(), and refresh(). |
|
name for each sample type
Definition at line 11 of file WalkCalibration.cc. Referenced by refresh(). |
|
the input given for the first measurement
Definition at line 109 of file WalkCalibration.h. Referenced by addSample(), and takeInput(). |
|
control holding help info
Definition at line 99 of file WalkCalibration.h. Referenced by setupRoot(), WalkCalibration(), and ~WalkCalibration(). |
|
true if polar measurements is selected
Definition at line 106 of file WalkCalibration.h. Referenced by addSample(), getFirstMeasure(), getSecondMeasure(), refresh(), and setupReady(). |
|
name last data file selected (so we know if a new has been selected
Definition at line 107 of file WalkCalibration.h. Referenced by refresh(). |
|
control for loading data
Definition at line 100 of file WalkCalibration.h. Referenced by refresh(), setupRoot(), WalkCalibration(), and ~WalkCalibration(). |
|
control for taking measurements
Definition at line 102 of file WalkCalibration.h. Referenced by doSelect(), setupRoot(), WalkCalibration(), and ~WalkCalibration(). |
|
the a velocity recorded when we started moving
Definition at line 95 of file WalkCalibration.h. Referenced by addSample(), and setupMoving(). |
|
the x velocity recorded when we started moving
Definition at line 93 of file WalkCalibration.h. Referenced by addSample(), and setupMoving(). |
|
the y velocity recorded when we started moving
Definition at line 94 of file WalkCalibration.h. Referenced by addSample(), and setupMoving(). |
|
control for selecting polar measurements for fs/bs
Definition at line 104 of file WalkCalibration.h. Referenced by doSelect(), refresh(), setHilights(), and setupReady(). |
|
control for selecting cartesian measurements for fs/bs
Definition at line 105 of file WalkCalibration.h. Referenced by doSelect(), setHilights(), and setupReady(). |
|
control for saving data
Definition at line 101 of file WalkCalibration.h. Referenced by refresh(), setupRoot(), WalkCalibration(), and ~WalkCalibration(). |
|
the input given for the second measurement
Definition at line 110 of file WalkCalibration.h. Referenced by addSample(), and takeInput(). |
|
the currently active state
Referenced by doSelect(), hilightFirst(), processEvent(), refresh(), setHilights(), setupChoose(), setupClear(), setupMoving(), setupReading1(), setupReading2(), setupReady(), setupRoot(), and takeInput(). |
|
the time recording started
Definition at line 96 of file WalkCalibration.h. Referenced by addSample(), processEvent(), and setupMoving(). |
|
string to send for ControllerGUI status message (current count of each sample type)
Definition at line 115 of file WalkCalibration.h. Referenced by refresh(), setupClear(), and setupRoot(). |
|
the time recording stopped
Definition at line 97 of file WalkCalibration.h. Referenced by addSample(), and processEvent(). |
Tekkotsu v2.0 |
Generated Wed Jan 21 03:23:32 2004 by Doxygen 1.3.4 |