DerivativeWiring Class Reference

Implements a wiring (between controller and robot) which includes the first and second derivative of the original robot sensor values. More...

#include <derivativewiring.h>

Inherits AbstractWiring.

Inheritance diagram for DerivativeWiring:

Inheritance graph
[legend]
Collaboration diagram for DerivativeWiring:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DerivativeWiring (const DerivativeWiringConf &conf, NoiseGenerator *noise)
 constructor
virtual ~DerivativeWiring ()
 destructor
virtual bool init (int robotsensornumber, int robotmotornumber)
 initializes the internal numbers of sensors and motors on robot side, calculate number of sensors and motors on controller side
virtual bool wireSensors (const sensor *rsensors, int rsensornumber, sensor *csensors, int csensornumber, double noise)
 Realizes derivative wiring from robot sensors to controller sensors.
virtual bool wireMotors (motor *rmotors, int rmotornumber, const motor *cmotors, int cmotornumber)
 Realizes wiring from controller motor outputs to robot motors.

Static Public Member Functions

DerivativeWiringConf getDefaultConf ()
 Providing default configuration for DerivativeWiring with first derivative.
DerivativeWiringConf getDefaultConf1 ()
 Providing default configuration for DerivativeWiring for only first derivative.

Protected Member Functions

void calcFirstDerivative ()
 Calculate the first derivative of the sensorvalues given by the robot f'(x) = (f(x+1) - f(x-1)) / 2 since we do not have f(x+1) we go one timestep in the past.
void calcSecondDerivative ()
 Calculate the secound derivative of the sensorvalues given by the robot f'(x) = f(x) - 2f(x-1) + f(x-2).

Protected Attributes

DerivativeWiringConf conf
 used configuration
int time
sensorsensorbuffer [buffersize]
 current and old smoothed sensor values of robot
sensorfirst
 current first derivative
sensorsecond
 current second derivative
motorblindMotors
 array that stored the values of the blind motors

Static Protected Attributes

const int buffersize = 40

Detailed Description

Implements a wiring (between controller and robot) which includes the first and second derivative of the original robot sensor values.


Constructor & Destructor Documentation

DerivativeWiring const DerivativeWiringConf conf,
NoiseGenerator noise
 

constructor

Parameters:
conf for giving the wished configuration of DerivativeWiring via DerivativeWiringConf
noise NoiseGenerator that is used for adding noise to sensor values

~DerivativeWiring  )  [virtual]
 

destructor


Member Function Documentation

void calcFirstDerivative  )  [protected]
 

Calculate the first derivative of the sensorvalues given by the robot f'(x) = (f(x+1) - f(x-1)) / 2 since we do not have f(x+1) we go one timestep in the past.

void calcSecondDerivative  )  [protected]
 

Calculate the secound derivative of the sensorvalues given by the robot f'(x) = f(x) - 2f(x-1) + f(x-2).

DerivativeWiringConf getDefaultConf  )  [inline, static]
 

Providing default configuration for DerivativeWiring with first derivative.

No smoothing and no scaling. ( as static method )

DerivativeWiringConf getDefaultConf1  )  [inline, static]
 

Providing default configuration for DerivativeWiring for only first derivative.

smoothing over 4 steps and scale of 5. Use smaller noise! ( as static method )

bool init int  robotsensornumber,
int  robotmotornumber
[virtual]
 

initializes the internal numbers of sensors and motors on robot side, calculate number of sensors and motors on controller side

Implements AbstractWiring.

bool wireMotors motor rmotors,
int  rmotornumber,
const motor cmotors,
int  cmotornumber
[virtual]
 

Realizes wiring from controller motor outputs to robot motors.

Parameters:
rmotors pointer to array of motorvalues for robot
rmotornumber number of robot motors
cmotors pointer to array of motorvalues from controller
cmotornumber number of motorvalues from controller

Implements AbstractWiring.

bool wireSensors const sensor rsensors,
int  rsensornumber,
sensor csensors,
int  csensornumber,
double  noise
[virtual]
 

Realizes derivative wiring from robot sensors to controller sensors.

Parameters:
rsensors pointer to array of sensorvalues from robot
rsensornumber number of sensors from robot
csensors pointer to array of sensorvalues for controller
csensornumber number of sensors to controller
noise size of the noise added to the sensors

Implements AbstractWiring.


Member Data Documentation

motor* blindMotors [protected]
 

array that stored the values of the blind motors

const int buffersize = 40 [static, protected]
 

DerivativeWiringConf conf [protected]
 

used configuration

sensor* first [protected]
 

current first derivative

sensor* second [protected]
 

current second derivative

sensor* sensorbuffer[buffersize] [protected]
 

current and old smoothed sensor values of robot

int time [protected]
 


The documentation for this class was generated from the following files:
Generated on Tue Jan 16 02:14:46 2007 for Robotsystem of the Robot Group Leipzig by doxygen 1.3.8