AbstractController Class Reference

#include <abstractcontroller.h>

Inheritance diagram for AbstractController:

Inheritance graph
[legend]
Collaboration diagram for AbstractController:

Collaboration graph
[legend]
List of all members.

Detailed Description

Abstract class (interface) for robot controller.

The controller gets a number of input sensor values each timestep and has to generate a number of output motor values.

Interface assumes the following usage:

Examples:

main.cpp.

Definition at line 68 of file abstractcontroller.h.

Public Member Functions

virtual void init (int sensornumber, int motornumber) ABSTRACT
 initialisation of the controller with the given sensor/ motornumber Must be called before use.
virtual int getSensorNumber () const ABSTRACT
virtual int getMotorNumber () const ABSTRACT
virtual void step (const sensor *sensors, int sensornumber, motor *motors, int motornumber) ABSTRACT
 performs one step (includes learning).
virtual void stepNoLearning (const sensor *, int number_sensors, motor *, int number_motors) ABSTRACT
 performs one step without learning.
virtual bool store (const char *filename) ABSTRACT
 stores the controller values to a given file.
virtual bool restore (const char *filename) ABSTRACT
 loads the controller values from a given file.


Member Function Documentation

virtual int getMotorNumber  )  const [virtual]
 

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

Reimplemented in InvertMotorSpace, InvertNChannelController, and SineController.

virtual int getSensorNumber  )  const [virtual]
 

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

Reimplemented in InvertMotorSpace, InvertNChannelController, and SineController.

virtual void init int  sensornumber,
int  motornumber
[virtual]
 

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

Reimplemented in DInvert3ChannelController, InvertMotorSpace, InvertNChannelController, and SineController.

virtual bool restore const char *  filename  )  [virtual]
 

loads the controller values from a given file.

This should include internal parameters

Reimplemented in InvertMotorSpace, InvertNChannelController, and SineController.

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 in DInvert3ChannelController, Invert3ChannelController, InvertMotorSpace, InvertNChannelController, InvertNChannelController_Gnu, and SineController.

virtual void stepNoLearning const sensor ,
int  number_sensors,
motor ,
int  number_motors
[virtual]
 

performs one step without learning.

See also:
step

Reimplemented in DInvert3ChannelController, Invert3ChannelController, InvertMotorSpace, InvertNChannelController, InvertNChannelController_Gnu, and SineController.

virtual bool store const char *  filename  )  [virtual]
 

stores the controller values to a given file.

This should include internal parameters.

Reimplemented in InvertMotorSpace, InvertNChannelController, and SineController.


Generated on Tue Apr 4 19:05:05 2006 for Robotsystem from Robot Group Leipzig by  doxygen 1.4.5