#include <wiringsequence.h>
Inherits AbstractWiring.
Inheritance diagram for WiringSequence:
Public Member Functions | |
WiringSequence (std::list< AbstractWiring * >) | |
constructor: The wirings given in the list are applied in the sequence. | |
WiringSequence (AbstractWiring *w1, AbstractWiring *w2) | |
constructor provided for convinience, essentially calls addWiring(w1);addWiring(w2) | |
virtual | ~WiringSequence () |
virtual bool | init (int robotsensornumber, int robotmotornumber, RandGen *randGen=0) |
Initializes the number of sensors and motors from robot (to be precise the internal parameters rsensornumber and rmotornumber!), calculates the number of sensors and motors on controller side. | |
virtual bool | wireSensors (const sensor *rsensors, int rsensornumber, sensor *csensors, int csensornumber, double noise) |
Realizes 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. | |
virtual void | addWiring (AbstractWiring *wiring) |
adds a wiring to the list of wirings | |
Protected Attributes | |
std::vector< AbstractWiring * > | wirings |
bool | initialised |
WiringSequence | ( | std::list< AbstractWiring * > | ) |
constructor: The wirings given in the list are applied in the sequence.
For the sensors in normal order and for the motors in reverse order
WiringSequence | ( | AbstractWiring * | w1, | |
AbstractWiring * | w2 | |||
) |
constructor provided for convinience, essentially calls addWiring(w1);addWiring(w2)
~WiringSequence | ( | ) | [virtual] |
void addWiring | ( | AbstractWiring * | wiring | ) | [virtual] |
adds a wiring to the list of wirings
bool init | ( | int | robotsensornumber, | |
int | robotmotornumber, | |||
RandGen * | randGen = 0 | |||
) | [virtual] |
Initializes the number of sensors and motors from robot (to be precise the internal parameters rsensornumber and rmotornumber!), calculates the number of sensors and motors on controller side.
Must be overloaded to calculate and provide the appropriate numbers controllersensornumber (csensornumber), controllermotornumber (cmotornumber), robotsensornumber (rsensornumber) and robotmotornumber (rmotornumber),
randGen | pointer to random generator, if not given then a new one is created |
Implements AbstractWiring.
bool wireMotors | ( | motor * | rmotors, | |
int | rmotornumber, | |||
const motor * | cmotors, | |||
int | cmotornumber | |||
) | [virtual] |
Realizes wiring from controller motor outputs to robot motors.
Must be overloaded in order to implement the appropriate mapping.
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 wiring from robot sensors to controller sensors.
Must be overloaded in order to implement the appropriate mapping.
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.
bool initialised [protected] |
std::vector<AbstractWiring*> wirings [protected] |