WiredController Class Reference

The WiredController contains a controller and a wiring, which connects the controller with the robot. More...

#include <wiredcontroller.h>

Inherited by Agent.

Inheritance diagram for WiredController:

Inheritance graph
[legend]
Collaboration diagram for WiredController:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 WiredController (const PlotOption &plotOption=PlotOption(NoPlot), double noisefactor=1)
 constructor.
 WiredController (const std::list< PlotOption > &plotOptions, double noisefactor=1)
 constructor.
virtual ~WiredController ()
 destructor
bool init (AbstractController *controller, AbstractWiring *wiring, int robotsensornumber, int robotmotornumber, RandGen *randGen=0)
 initializes the object with the given controller and wiring and initializes the output options It is also possible to provide a random seed, if not given (0) rand() is used to create one
void step (const sensor *sensors, int sensornumber, motor *motors, int motornumber, double noise, double time=-1)
 Performs an step of the controller, which includes pushing sensor values through the wiring, controller step, pushing controller outputs (= motorcommands) back through the wiring.
virtual AbstractControllergetController ()
 Returns a pointer to the controller.
virtual AbstractWiringgetWiring ()
 Returns a pointer to the wiring.
virtual void addPlotOption (const PlotOption &plotoption)
 adds the PlotOptions to the list of plotoptions If a plotoption with the same Mode exists, then the old one is deleted first
virtual bool removePlotOption (PlotMode mode)
 removes the PlotOptions with the given type
virtual void writePlotComment (const char *cmt)
 write comment to output streams (PlotOptions).
virtual void addInspectable (const Inspectable *inspectable)
 adds an inspectable object for logging.
virtual void addCallbackable (Callbackable *callbackable)
 adds an Callbackable object for getting a callback every step.

Protected Member Functions

virtual void plot (const sensor *rx, int rsensornumber, const sensor *cx, int csensornumber, const motor *y, int motornumber, double time)
 Plots controller sensor- and motorvalues and internal controller parameters.
void internInit ()

Protected Attributes

AbstractControllercontroller
AbstractWiringwiring
int rsensornumber
 number of sensors of robot
int rmotornumber
 number of motors of robot
int csensornumber
 number of sensors of comntroller
int cmotornumber
 number of motors of comntroller
double noisefactor
 factor that is muliplied with noise stength
motorcmotors
sensorcsensors
long int t
std::list< PlotOptionplotOptions
std::list< const Inspectable * > inspectables
bool initialised
std::list< Callbackable * > callbackables

Detailed Description

The WiredController contains a controller and a wiring, which connects the controller with the robot.

Additionally there are some ways to keep track of internal information. You have the possibility to keep track of sensor values, motor values and internal parameters of the controller with PlotOptions. The name PlotOptions is a bit missleaded, it should be "OutputOptions", however you can write the data into a file or send it to visualisation tools like guilogger or neuronviz.


Constructor & Destructor Documentation

WiredController ( const PlotOption plotOption = PlotOption(NoPlot),
double  noisefactor = 1 
)

constructor.

PlotOption as output setting. noisefactor is used to set the relative noise strength of this agent

WiredController ( const std::list< PlotOption > &  plotOptions,
double  noisefactor = 1 
)

constructor.

A list of PlotOption can given. noisefactor is used to set the relative noise strength of this agent

~WiredController (  )  [virtual]

destructor


Member Function Documentation

void addCallbackable ( Callbackable callbackable  )  [virtual]

adds an Callbackable object for getting a callback every step.

void addInspectable ( const Inspectable inspectable  )  [virtual]

adds an inspectable object for logging.

Must be called before addPlotOption and before init!

void addPlotOption ( const PlotOption plotoption  )  [virtual]

adds the PlotOptions to the list of plotoptions If a plotoption with the same Mode exists, then the old one is deleted first

Reimplemented in Agent.

virtual AbstractController* getController (  )  [inline, virtual]

Returns a pointer to the controller.

virtual AbstractWiring* getWiring (  )  [inline, virtual]

Returns a pointer to the wiring.

bool init ( AbstractController controller,
AbstractWiring wiring,
int  robotsensornumber,
int  robotmotornumber,
RandGen randGen = 0 
)

initializes the object with the given controller and wiring and initializes the output options It is also possible to provide a random seed, if not given (0) rand() is used to create one

void internInit (  )  [protected]

Reimplemented in OdeAgent.

void plot ( const sensor rx,
int  rsensornumber,
const sensor cx,
int  csensornumber,
const motor y,
int  motornumber,
double  time 
) [protected, virtual]

Plots controller sensor- and motorvalues and internal controller parameters.

Parameters:
rx actual sensorvalues from robot (used for generation of motorcommand in actual timestep)
rsensornumber length of rx
cx actual sensorvalues which are passed to controller (used for generation of motorcommand in actual timestep)
csensornumber length of cx
y actual motorcommand (generated in the actual timestep)
motornumber length of y
time simulation time

bool removePlotOption ( PlotMode  mode  )  [virtual]

removes the PlotOptions with the given type

Returns:
true if sucessful, false otherwise

void step ( const sensor sensors,
int  sensornumber,
motor motors,
int  motornumber,
double  noise,
double  time = -1 
)

Performs an step of the controller, which includes pushing sensor values through the wiring, controller step, pushing controller outputs (= motorcommands) back through the wiring.

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
noise Noise strength.
time (optional) current simulation time (used for logging)

void writePlotComment ( const char *  cmt  )  [virtual]

write comment to output streams (PlotOptions).

For instance changes in parameters.


Member Data Documentation

std::list<Callbackable* > callbackables [protected]

int cmotornumber [protected]

number of motors of comntroller

motor* cmotors [protected]

AbstractController* controller [protected]

int csensornumber [protected]

number of sensors of comntroller

sensor* csensors [protected]

bool initialised [protected]

std::list<const Inspectable* > inspectables [protected]

double noisefactor [protected]

factor that is muliplied with noise stength

std::list<PlotOption> plotOptions [protected]

int rmotornumber [protected]

number of motors of robot

int rsensornumber [protected]

number of sensors of robot

long int t [protected]

Reimplemented in Agent.

AbstractWiring* wiring [protected]


The documentation for this class was generated from the following files:
Generated on Tue Sep 16 22:01:31 2008 for Robotsystem of the Robot Group Leipzig by  doxygen 1.4.7