Robotsystem of the Robot Group Leipzig: WiringSequence Class Reference

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages
- Examples

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# WiringSequence Class Reference

Implements a sequence of wirings. More...

`#include <wiringsequence.h>`

Inherits AbstractWiring.

Inheritance diagram for WiringSequence:

[legend]
Collaboration diagram for WiringSequence:

[legend]
List of all members.

## 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

## Detailed Description

Implements a sequence of wirings.

## Constructor & Destructor Documentation

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]`

## Member Function Documentation

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),

Parameters:

  | randGen | pointer to random generator, if not given then a new one is created

Returns:
  returns false on error, otherwise true

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.

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

Returns:
  returns false if error, else true

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.

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

Returns:
  returns false on error, otherwise true

Implements AbstractWiring.

## Member Data Documentation

bool initialised`[protected]`

std::vector<AbstractWiring*> wirings`[protected]`

The documentation for this class was generated from the following files:

- wiringsequence.h
- wiringsequence.cpp