Robot Simulator of the Robotics Group for Self-Organization of Control: SineController Class Reference

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

- Search for |

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

# SineController Class Reference

class for robot control with sine, sawtooth and impuls More...

`#include <sinecontroller.h>`

Inherits AbstractController.

Inheritance diagram for SineController:

[legend]
Collaboration diagram for SineController:

[legend]
List of all members.

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

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

enum function

Enumerator:

  Sine |
  SawTooth |
  Impulse |

## Constructor & Destructor Documentation

SineController | ( | unsigned long int | controlmask = `(~0)`,
|  | function | func = `Sine` |
| ) |  |  |

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]`

See also:
  Storable

Implements Storeable.

double sawtooth | ( | double | x,
|  | double | _unused |
| ) |  |  | `[static]`

saw tooth shape oscillator

double sine | ( | double | x,
|  | double | _unused |
| ) |  |  | `[static]`

sine

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 * | ,
|  | int | number_sensors,
|  | motor * | ,
|  | int | number_motors |
| ) |  |  | `[virtual]`

performs one step.

See also:
  step

Implements AbstractController.

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

See also:
  Storable

Implements Storeable.

## Member Data Documentation

paramval amplitude`[protected]`

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]`

paramval period`[protected]`

double phase`[protected]`

paramval phaseShift`[protected]`

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

- sinecontroller.h
- sinecontroller.cpp