SineController Class Reference
class for robot control with sine, sawtooth and impuls
More...
#include <sinecontroller.h>
Inherits AbstractController.
List of all members.
Public Types |
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) |
Detailed Description
class for robot control with sine, sawtooth and impuls
period is the length of the period in steps and phaseshift is the phase difference between channels given in Pi/2
Member Enumeration Documentation
Constructor & Destructor Documentation
- Parameters:
-
| controlmask | bitmask to select channels to control (default all) |
| function | controller function to use |
Member Function Documentation
virtual int getMotorNumber |
( |
|
) |
const [inline, virtual] |
- Returns:
- Number of motors the controller was initialised with or 0 if not initialised
Implements AbstractController.
virtual int getSensorNumber |
( |
|
) |
const [inline, virtual] |
- Returns:
- Number of sensors the controller was initialised with or 0 if not initialised
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] |
void step |
( |
const sensor * |
sensors, |
|
|
int |
sensornumber, |
|
|
motor * |
motors, |
|
|
int |
motornumber | |
|
) |
| | [virtual] |
performs one step ( the same as StepNoLearning).
Calculates motor commands from sensor inputs.
- Parameters:
-
| 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.
void stepNoLearning |
( |
const sensor * |
sensors, |
|
|
int |
number_sensors, |
|
|
motor * |
motors, |
|
|
int |
number_motors | |
|
) |
| | [virtual] |
virtual bool store |
( |
FILE * |
f |
) |
const [inline, virtual] |
Member Data Documentation
std::string name [protected] |
double(* osci)(double x, double param) [protected] |
The documentation for this class was generated from the following files: