Robotsystem from Robot Group Leipzig: InvertMotorSpace Class Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Alphabetical List
- Class Hierarchy
- Class Members

# InvertMotorSpace Class Reference

`#include <invertmotorspace.h>`

Inheritance diagram for InvertMotorSpace:

[legend]
Collaboration diagram for InvertMotorSpace:

[legend]
List of all members.

## Detailed Description

class for robot controller that uses the georg's matrixlib for direct matrix inversion for n channels (simple one layer networks)

Implements standart parameters: eps, rho, mu, stepnumber4avg, stepnumber4delay

Examples:

  main.cpp.

Definition at line 87 of file invertmotorspace.h.

## Public Member Functions
| InvertMotorSpace (int buffersize, double cInit=0.1, bool someInternalParams=true)
virtual void | init (int sensornumber, int motornumber)
| initialisation of the controller with the given sensor/ motornumber Must be called before use.
virtual | ~InvertMotorSpace ()
virtual paramkey | getName () const
| return the name of the object (with version number) Hint: use insertCVSInfo from Configurable
virtual int | getSensorNumber () const
| returns the number of sensors the controller was initialised with or 0 if not initialised
virtual int | getMotorNumber () const
| returns the mumber of motors the controller was initialised with or 0 if not initialised
virtual void | step (const sensor *, int number_sensors, motor *, int number_motors)
| performs one step (includes learning).
virtual void | stepNoLearning (const sensor *, int number_sensors, motor *, int number_motors)
| performs one step without learning. Calulates motor commands from sensor inputs.
virtual bool | store (const char *filename)
| stores the controller values to a given file.
virtual bool | restore (const char *filename)
| loads the controller values from a given file.
virtual list< iparamkey > | getInternalParamNames () const
| The list of the names of all internal parameters given by getInternalParams().
virtual list< iparamval > | getInternalParams () const
virtual list< ILayer > | getStructuralLayers () const
| Specifies which parameter vector forms a structural layer (in terms of a neural network) The ordering is important.
virtual list< IConnection > | getStructuralConnections () const
| Specifies which parameter matrix forms a connection between layers (in terms of a neural network) The orderning is not important.
## Protected Member Functions
void | fillBuffersAndControl (const sensor *x_, int number_sensors, motor *y_, int number_motors)
| puts the sensors in the ringbuffer, generate controller values and put them in the
virtual void | learnController (const Matrix &x, const Matrix &x_smooth, int delay)
| learn h,C, delayed motors y and corresponding sensors x
virtual void | learnModel (const Matrix &x, const Matrix &y)
| learn A, using motors y and corresponding sensors x
virtual Matrix | calculateDelayedValues (const Matrix *buffer, int number_steps_of_delay_)
| calculate delayed values
virtual Matrix | calculateSmoothValues (const Matrix *buffer, int number_steps_for_averaging_)
Matrix | calculateControllerValues (const Matrix &x_smooth)
| calculate controller outputs
## Protected Attributes
unsigned short | number_sensors
unsigned short | number_motors
Matrix | A
Matrix | C
Matrix | R
Matrix | H
Matrix | B
NoiseGenerator * | BNoiseGen
Matrix * | x_buffer
Matrix * | y_buffer
Matrix | x_smooth
bool | someInternalParams
double | cInit

## Constructor & Destructor Documentation

InvertMotorSpace | ( | int | buffersize,
|  | double | cInit = `0.1`,
|  | bool | someInternalParams = `true`
| ) |

| Definition at line 102 of file invertmotorspace.cpp.

~InvertMotorSpace | ( |  | ) | `[virtual]`

| Definition at line 114 of file invertmotorspace.cpp.

## Member Function Documentation

Matrix calculateControllerValues | ( | const Matrix & | x_smooth | ) | `[protected]`

  | calculate controller outputs Parameters:
  | x_smooth | smoothed sensors Matrix(number_channels,1)
Definition at line 292 of file invertmotorspace.cpp.

Matrix calculateDelayedValues | ( | const Matrix * | buffer,
|  | int | number_steps_of_delay_
| ) | `[protected, virtual]`

| calculate delayed values Definition at line 297 of file invertmotorspace.cpp.

Matrix calculateSmoothValues | ( | const Matrix * | buffer,
|  | int | number_steps_for_averaging_
| ) | `[protected, virtual]`

| Definition at line 304 of file invertmotorspace.cpp.

void fillBuffersAndControl | ( | const sensor * | x_,
|  | int | number_sensors,
|  | motor * | y_,
|  | int | number_motors
| ) | `[protected]`

| puts the sensors in the ringbuffer, generate controller values and put them in the Definition at line 178 of file invertmotorspace.cpp.

list< Inspectable::iparamkey > getInternalParamNames | ( |  | ) | const`[virtual]`

| The list of the names of all internal parameters given by getInternalParams(). The naming convention is "v[i]" for vectors and "A[i][j]" for matrices, where i, j start at 0. Returns: : list of keys Implements Inspectable. Definition at line 346 of file invertmotorspace.cpp.

list< Inspectable::iparamval > getInternalParams | ( |  | ) | const`[virtual]`

| Returns: : list of values Implements Inspectable. Definition at line 362 of file invertmotorspace.cpp.

virtual int getMotorNumber | ( |  | ) | const`[inline, virtual]`

| returns the mumber of motors the controller was initialised with or 0 if not initialised Reimplemented from AbstractController. Definition at line 101 of file invertmotorspace.h.

virtual paramkey getName | ( |  | ) | const`[inline, virtual]`

| return the name of the object (with version number) Hint: use insertCVSInfo from Configurable Reimplemented from Configurable. Definition at line 96 of file invertmotorspace.h.

virtual int getSensorNumber | ( |  | ) | const`[inline, virtual]`

| returns the number of sensors the controller was initialised with or 0 if not initialised Reimplemented from AbstractController. Definition at line 99 of file invertmotorspace.h.

list< Inspectable::IConnection > getStructuralConnections | ( |  | ) | const`[virtual]`

| Specifies which parameter matrix forms a connection between layers (in terms of a neural network) The orderning is not important. Returns: : list of layer names with dimension Reimplemented from Inspectable. Definition at line 386 of file invertmotorspace.cpp.

list< Inspectable::ILayer > getStructuralLayers | ( |  | ) | const`[virtual]`

| Specifies which parameter vector forms a structural layer (in terms of a neural network) The ordering is important. The first entry is the input layer and so on. Returns: : list of layer names with dimension Reimplemented from Inspectable. Definition at line 378 of file invertmotorspace.cpp.

void init | ( | int | sensornumber,
|  | int | motornumber
| ) | `[virtual]`

| initialisation of the controller with the given sensor/ motornumber Must be called before use. Reimplemented from AbstractController. Definition at line 120 of file invertmotorspace.cpp.

void learnController | ( | const Matrix & | x,
|  | const Matrix & | x_smooth,
|  | int | delay
| ) | `[protected, virtual]`

| learn h,C, delayed motors y and corresponding sensors x Definition at line 203 of file invertmotorspace.cpp.

void learnModel | ( | const Matrix & | x,
|  | const Matrix & | y
| ) | `[protected, virtual]`

| learn A, using motors y and corresponding sensors x Definition at line 263 of file invertmotorspace.cpp.

bool restore | ( | const char * | filename | ) | `[virtual]`

| loads the controller values from a given file. Reimplemented from AbstractController. Definition at line 332 of file invertmotorspace.cpp.

void step | ( | const sensor * | ,
|  | int | number_sensors,
|  | motor * | ,
|  | int | number_motors
| ) | `[virtual]`

| performs one step (includes learning). Calulates motor commands from sensor inputs. Reimplemented from AbstractController. Definition at line 152 of file invertmotorspace.cpp.

void stepNoLearning | ( | const sensor * | ,
|  | int | number_sensors,
|  | motor * | ,
|  | int | number_motors
| ) | `[virtual]`

| performs one step without learning. Calulates motor commands from sensor inputs. Reimplemented from AbstractController. Definition at line 171 of file invertmotorspace.cpp.

bool store | ( | const char * | filename | ) | `[virtual]`

| stores the controller values to a given file. Reimplemented from AbstractController. Definition at line 319 of file invertmotorspace.cpp.

## Member Data Documentation

Matrix A`[protected]`

| Definition at line 127 of file invertmotorspace.h.

Matrix B`[protected]`

| Definition at line 131 of file invertmotorspace.h.

NoiseGenerator* BNoiseGen`[protected]`

| Definition at line 132 of file invertmotorspace.h.

Matrix C`[protected]`

| Definition at line 128 of file invertmotorspace.h.

double cInit`[protected]`

| Definition at line 138 of file invertmotorspace.h.

Matrix H`[protected]`

| Definition at line 130 of file invertmotorspace.h.

unsigned short number_motors`[protected]`

| Definition at line 125 of file invertmotorspace.h.

unsigned short number_sensors`[protected]`

| Definition at line 124 of file invertmotorspace.h.

Matrix R`[protected]`

| Definition at line 129 of file invertmotorspace.h.

bool someInternalParams`[protected]`

| Definition at line 137 of file invertmotorspace.h.

Matrix* x_buffer`[protected]`

| Definition at line 133 of file invertmotorspace.h.

Matrix x_smooth`[protected]`

| Definition at line 135 of file invertmotorspace.h.

Matrix* y_buffer`[protected]`

| Definition at line 134 of file invertmotorspace.h.