Robotsystem of the Robot Group Leipzig: SineController Class Reference

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

- Search for |

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

# SineController Class Reference

class for robot control with sine and cosine More...

`#include <sinecontroller.h>`

Inherits AbstractController.

Inheritance diagram for SineController:

[legend]
Collaboration diagram for SineController:

[legend]
List of all members.

## Public Member Functions
| SineController (int number_controlled=-1)
virtual void | init (int sensornumber, int motornumber)
| 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 (includes learning).
virtual void | stepNoLearning (const sensor *, int number_sensors, motor *, int number_motors)
| performs one step without learning.
virtual std::list< iparamkey > | getInternalParamNames () const
| The list of the names of all internal parameters given by getInternalParams().
virtual std::list< iparamval > | getInternalParams () const
| The list of the names of all internal parameters given by getInternalParams().
virtual paramval | getParam (const paramkey &key) const
virtual bool | setParam (const paramkey &key, paramval val)
virtual paramlist | getParamList () const
| The list of all parameters with there value as allocated lists.
virtual bool | store (FILE *f) const
virtual bool | restore (FILE *f)
## Protected Attributes
int | t
std::string | name
int | number_sensors
int | number_motors
int | number_controlled
paramval | sineRate
paramval | phaseShift

## Detailed Description

class for robot control with sine and cosine

## Constructor & Destructor Documentation

SineController | ( | int | number_controlled = `-1` | ) |

## Member Function Documentation

virtual std::list<iparamkey> getInternalParamNames | ( |  | ) | const`[inline, virtual]`

The list of the names of all internal parameters given by getInternalParams().

Returns:
  list of names

Implements Inspectable.

virtual std::list<iparamval> getInternalParams | ( |  | ) | const`[inline, virtual]`

The list of the names of all internal parameters given by getInternalParams().

Implements Inspectable.

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

Returns:
  Number of motors the controller was initialised with or 0 if not initialised

Reimplemented from AbstractController.

Configurable::paramval getParam | ( | const paramkey & | key | ) | const`[virtual]`

Configurable::paramlist getParamList | ( |  | ) | const`[virtual]`

The list of all parameters with there value as allocated lists.

Returns:
  list of key-value pairs

Reimplemented from Configurable.

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

Returns:
  Number of sensors the controller was initialised with or 0 if not initialised

Reimplemented from AbstractController.

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

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

Reimplemented from AbstractController.

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

See also:
  Storable

Implements Storeable.

bool setParam | ( | const paramkey & | key,
|  | paramval | val |
| ) |  |  | `[virtual]`

void step | ( | const sensor * | sensors,
|  | int | sensornumber,
|  | motor * | motors,
|  | int | motornumber |
| ) |  |  | `[virtual]`

performs one step (includes learning).

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

Reimplemented from AbstractController.

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

performs one step without learning.

See also:
  step

Reimplemented from AbstractController.

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

See also:
  Storable

Implements Storeable.

## Member Data Documentation

std::string name`[protected]`

Reimplemented from Configurable.

int number_controlled`[protected]`

int number_motors`[protected]`

int number_sensors`[protected]`

paramval phaseShift`[protected]`

paramval sineRate`[protected]`

int t`[protected]`

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

- sinecontroller.h
- sinecontroller.cpp