#include <derivativewiring.h>
Inherits AbstractWiring.
Inheritance diagram for DerivativeWiring:


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 | |
| static DerivativeWiringConf | getDefaultConf () |
| Providing default configuration for DerivativeWiring as static method. | |
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 |
| int | delay |
| number timesteps the sensor values are delayed for calculation of the derivative | |
| sensor * | sensorbuffer [buffersize] |
| current and old smoothed sensor values of robot | |
| sensor * | id |
| current sensors (with noise) | |
| sensor * | first |
| current first derivative | |
| sensor * | second |
| current second derivative | |
| motor * | blindMotors |
| array that stored the values of the blind motors | |
| unsigned int | blindMotorNumber |
| number of blind motors used | |
Static Protected Attributes | |
| static const int | buffersize = 40 |
| DerivativeWiring | ( | const DerivativeWiringConf & | conf, | |
| NoiseGenerator * | noise | |||
| ) |
constructor
| conf | for giving the wished configuration of DerivativeWiring via DerivativeWiringConf | |
| noise | NoiseGenerator that is used for adding noise to sensor values |
| ~DerivativeWiring | ( | ) | [virtual] |
destructor
| 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).
| static DerivativeWiringConf getDefaultConf | ( | ) | [inline, static] |
Providing default configuration for DerivativeWiring 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.
| 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.
| 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.
unsigned int blindMotorNumber [protected] |
number of blind motors used
motor* blindMotors [protected] |
array that stored the values of the blind motors
const int buffersize = 40 [static, protected] |
DerivativeWiringConf conf [protected] |
used configuration
int delay [protected] |
number timesteps the sensor values are delayed for calculation of the derivative
sensor* sensorbuffer[buffersize] [protected] |
current and old smoothed sensor values of robot
int time [protected] |
1.4.7