#include <sinecontroller.h>
Inherits AbstractController.
Inheritance diagram for SineController:


Public Types | |
| Sine | |
| SawTooth | |
| Impulse | |
| enum | function { Sine, SawTooth, Impulse } |
Public Member Functions | |
| SineController (unsigned long int controlmask=(~0), function func=Sine) | |
| virtual void | init (int sensornumber, int motornumber, RandGen *randGen=0) |
| initialisation of the controller with the given sensor/ motornumber Must be called before use. | |
| virtual int | getSensorNumber () const |
| virtual int | getMotorNumber () const |
| virtual void | step (const sensor *sensors, int sensornumber, motor *motors, int motornumber) |
| performs one step ( the same as StepNoLearning). | |
| virtual void | stepNoLearning (const sensor *, int number_sensors, motor *, int number_motors) |
| performs one step. | |
| virtual bool | store (FILE *f) const |
| virtual bool | restore (FILE *f) |
Static Public Member Functions | |
| static double | sine (double x, double _unused) |
| sine | |
| static double | sawtooth (double x, double _unused) |
| saw tooth shape oscillator | |
| static double | impuls (double x, double impulsWidth) |
| impuls shaped oscillator (+-1 for impulsWidth part of the time) | |
Protected Attributes | |
| std::string | name |
| int | number_sensors |
| int | number_motors |
| unsigned long int | controlmask |
| paramval | period |
| paramval | phaseShift |
| paramval | impulsWidth |
| double | phase |
| paramval | amplitude |
| double(* | osci )(double x, double param) |
period is the length of the period in steps and phaseshift is the phase difference between channels given in Pi/2
| enum function |
| SineController | ( | unsigned long int | controlmask = (~0), |
|
| function | func = Sine | |||
| ) |
| controlmask | bitmask to select channels to control (default all) | |
| function | controller function to use |
| virtual int getMotorNumber | ( | ) | const [inline, virtual] |
Implements AbstractController.
| virtual int getSensorNumber | ( | ) | const [inline, virtual] |
Implements AbstractController.
| double impuls | ( | double | x, | |
| double | impulsWidth | |||
| ) | [static] |
impuls shaped oscillator (+-1 for impulsWidth part of the time)
| void init | ( | int | sensornumber, | |
| int | motornumber, | |||
| RandGen * | randGen = 0 | |||
| ) | [virtual] |
initialisation of the controller with the given sensor/ motornumber Must be called before use.
Implements AbstractController.
| virtual bool restore | ( | FILE * | f | ) | [inline, virtual] |
| double sawtooth | ( | double | x, | |
| double | _unused | |||
| ) | [static] |
saw tooth shape oscillator
| double sine | ( | double | x, | |
| double | _unused | |||
| ) | [static] |
sine
performs one step ( the same as StepNoLearning).
Calculates motor commands from sensor inputs.
| sensors | sensors inputs scaled to [-1,1] | |
| sensornumber | length of the sensor array | |
| motors | motors outputs. MUST have enough space for motor values! | |
| motornumber | length of the provided motor array |
Implements AbstractController.
| virtual bool store | ( | FILE * | f | ) | const [inline, virtual] |
unsigned long int controlmask [protected] |
paramval impulsWidth [protected] |
std::string name [protected] |
Reimplemented from Configurable.
int number_motors [protected] |
int number_sensors [protected] |
double(* osci)(double x, double param) [protected] |
double phase [protected] |
paramval phaseShift [protected] |
1.4.7