Robotsystem of the Robot Group Leipzig: InvertMotorNStep Class Reference

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

- Search for |

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

# InvertMotorNStep Class Reference

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

`#include <invertmotornstep.h>`

Inherits InvertMotorController.

Inherited by Deprivation.

Inheritance diagram for InvertMotorNStep:

[legend]
Collaboration diagram for InvertMotorNStep:

[legend]
List of all members.

## Public Member Functions
| InvertMotorNStep (const InvertMotorNStepConf &conf=getDefaultConf())
virtual void | init (int sensornumber, int motornumber)
| initialisation of the controller with the given sensor/ motornumber Must be called before use.
virtual | ~InvertMotorNStep ()
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 (FILE *f) const
| stores the controller values to a given file.
virtual bool | restore (FILE *f)
| loads the controller values from a given file.
virtual std::list< iparamkey > | getInternalParamNames () const
| The list of the names of all internal parameters given by getInternalParams().
virtual std::list< iparamval > | getInternalParams () const
virtual std::list< ILayer > | getStructuralLayers () const
| Specifies which parameter vector forms a structural layer (in terms of a neural network) The ordering is important.
virtual std::list< IConnection > | getStructuralConnections () const
| Specifies which parameter matrix forms a connection between layers (in terms of a neural network) The orderning is not important.
virtual void | setTeachingMode (bool onOff)
virtual bool | getTeachingMode ()
virtual void | setMotorTeachingSignal (const motor *teaching, int len)
void | calcCandHUpdatesTeaching (matrix::Matrix &C_update, matrix::Matrix &H_update, int y_delay)
| calculates the Update for C and H using the teaching signal
void | getLastMotors (motor *motors, int len)
## Static Public Member Functions
static InvertMotorNStepConf | getDefaultConf ()
## Protected Member Functions
virtual 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 | calcEtaAndBufferIt (int delay)
| calculates the first shift into the motor space useing delayed motor values.
virtual void | calcXsi (int delay)
| calculates xsi for the current time step using the delayed y values
virtual void | learnController ()
| learn H,C with motors y and corresponding sensors x
virtual void | calcCandHUpdates (matrix::Matrix &C_update, matrix::Matrix &H_update, int y_delay)
| calculates the Update for C and H
virtual void | updateCandH (const matrix::Matrix &C_update, const matrix::Matrix &H_update, double squashSize)
| updates the matrix C and H
virtual void | learnModel (int delay)
| learn A, (and S) using motors y and corresponding sensors x
virtual matrix::Matrix | calculateControllerValues (const matrix::Matrix &x_smooth)
| returns controller output for given sensor values
## Protected Attributes
unsigned short | number_sensors
unsigned short | number_motors
matrix::Matrix | A
matrix::Matrix | S
matrix::Matrix | C
matrix::Matrix | H
matrix::Matrix | B
NoiseGenerator * | BNoiseGen
matrix::Matrix | R
matrix::Matrix | SmallID
matrix::Matrix | xsi
double | xsi_norm
double | xsi_norm_avg
double | pain
matrix::Matrix * | x_buffer
matrix::Matrix * | y_buffer
matrix::Matrix * | eta_buffer
matrix::Matrix | zero_eta
matrix::Matrix | x_smooth
matrix::Matrix | y_teaching
InvertMotorNStepConf | conf

## 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

## Constructor & Destructor Documentation

InvertMotorNStep | ( | const InvertMotorNStepConf & | conf = `getDefaultConf()` | ) |

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

## Member Function Documentation

void calcCandHUpdates | ( | matrix::Matrix & | C_update,
|  | matrix::Matrix & | H_update,
|  | int | y_delay |
| ) |  |  | `[protected, virtual]`

calculates the Update for C and H

void calcCandHUpdatesTeaching | ( | matrix::Matrix & | C_update,
|  | matrix::Matrix & | H_update,
|  | int | y_delay |
| ) |  |  |

calculates the Update for C and H using the teaching signal

void calcEtaAndBufferIt | ( | int | delay | ) | `[protected, virtual]`

calculates the first shift into the motor space useing delayed motor values.

Matrix calculateControllerValues | ( | const matrix::Matrix & | x_smooth | ) | `[protected, virtual]`

returns controller output for given sensor values

Parameters:

  | x_smooth | smoothed sensors Matrix(number_channels,1)

void calcXsi | ( | int | delay | ) | `[protected, virtual]`

calculates xsi for the current time step using the delayed y values

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

puts the sensors in the ringbuffer, generate controller values and put them in the

static InvertMotorNStepConf getDefaultConf | ( |  | ) | `[inline, static]`

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.

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

Returns:
  : list of values

Implements Inspectable.

void getLastMotors | ( | motor * | motors,
|  | int | len |
| ) |  |  |

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

returns the mumber of motors the controller was initialised with or 0 if not initialised

Reimplemented from AbstractController.

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

return the name of the object (with version number) Hint: use insertCVSInfo from Configurable

Reimplemented from Configurable.

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

returns the number of sensors the controller was initialised with or 0 if not initialised

Reimplemented from AbstractController.

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.

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.

bool getTeachingMode | ( |  | ) | `[virtual]`

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

initialisation of the controller with the given sensor/ motornumber Must be called before use.

Reimplemented from AbstractController.

void learnController | ( |  | ) | `[protected, virtual]`

learn H,C with motors y and corresponding sensors x

Reimplemented in Deprivation.

void learnModel | ( | int | delay | ) | `[protected, virtual]`

learn A, (and S) using motors y and corresponding sensors x

bool restore | ( | FILE * | f | ) | `[virtual]`

loads the controller values from a given file.

Implements Storeable.

void setMotorTeachingSignal | ( | const motor * | teaching,
|  | int | len |
| ) |  |  | `[virtual]`

void setTeachingMode | ( | bool | onOff | ) | `[virtual]`

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.

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.

bool store | ( | FILE * | f | ) | const`[virtual]`

stores the controller values to a given file.

Implements Storeable.

void updateCandH | ( | const matrix::Matrix & | C_update,
|  | const matrix::Matrix & | H_update,
|  | double | squashSize |
| ) |  |  | `[protected, virtual]`

updates the matrix C and H

## Member Data Documentation

matrix::Matrix A`[protected]`

matrix::Matrix B`[protected]`

NoiseGenerator* BNoiseGen`[protected]`

matrix::Matrix C`[protected]`

InvertMotorNStepConf conf`[protected]`

matrix::Matrix* eta_buffer`[protected]`

matrix::Matrix H`[protected]`

unsigned short number_motors`[protected]`

unsigned short number_sensors`[protected]`

double pain`[protected]`

matrix::Matrix R`[protected]`

matrix::Matrix S`[protected]`

matrix::Matrix SmallID`[protected]`

matrix::Matrix* x_buffer`[protected]`

matrix::Matrix x_smooth`[protected]`

matrix::Matrix xsi`[protected]`

double xsi_norm`[protected]`

double xsi_norm_avg`[protected]`

matrix::Matrix* y_buffer`[protected]`

matrix::Matrix y_teaching`[protected]`

matrix::Matrix zero_eta`[protected]`

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

- invertmotornstep.h
- invertmotornstep.cpp