#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 | |
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 |
sensor * | sensorbuffer [buffersize] |
current and old smoothed sensor values of robot | |
sensor * | first |
current first derivative | |
sensor * | second |
current second derivative | |
motor * | blindMotors |
array that stored the values of the blind motors | |
Static Protected Attributes | |
const int | buffersize = 40 |
|
constructor
|
|
destructor
|
|
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.
|
|
Calculate the secound derivative of the sensorvalues given by the robot f'(x) = f(x) - 2f(x-1) + f(x-2).
|
|
Providing default configuration for DerivativeWiring with first derivative. No smoothing and no scaling. ( as static method ) |
|
Providing default configuration for DerivativeWiring for only first derivative. smoothing over 4 steps and scale of 5. Use smaller noise! ( as static method ) |
|
initializes the internal numbers of sensors and motors on robot side, calculate number of sensors and motors on controller side
Implements AbstractWiring.
|
|
Realizes wiring from controller motor outputs to robot motors.
Implements AbstractWiring.
|
|
Realizes derivative wiring from robot sensors to controller sensors.
Implements AbstractWiring.
|
|
array that stored the values of the blind motors
|
|
|
|
used configuration
|
|
current first derivative
|
|
current second derivative
|
|
current and old smoothed sensor values of robot
|
|
|