Robotsystem of the Robot Group Leipzig: AbstractWiring Class Reference

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

- Search for |

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

# AbstractWiring Class Reference

Abstract wiring-object between controller and robot. More...

`#include <abstractwiring.h>`

Inherits Inspectable.

Inherited by DerivativeWiring, and One2OneWiring.

Inheritance diagram for AbstractWiring:

[legend]
Collaboration diagram for AbstractWiring:

[legend]
List of all members.

## Public Member Functions
| AbstractWiring (NoiseGenerator *noise)
| constructor
virtual | ~AbstractWiring ()
| destructor
virtual bool | init (int robotsensornumber, int robotmotornumber)=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)=0
| Realizes wiring from robot sensors to controller sensors.
virtual bool | wireMotors (motor *rmotors, int rmotornumber, const motor *cmotors, int cmotornumber)=0
| Realizes wiring from controller motor outputs to robot motors.
virtual int | getRobotSensornumber ()
| Returns the number of sensors on robot side.
virtual int | getRobotMotornumber ()
| Returns the number of motors on robot side.
virtual int | getControllerSensornumber ()
| Returns the number of sensors on controller side.
virtual int | getControllerMotornumber ()
| Returns the number of motors on controller side.
virtual std::list< iparamkey > | getInternalParamNames () const
| Returns the list of the names of all internal parameters.
virtual std::list< iparamval > | getInternalParams () const
| Returns a list of the values of all internal parameters (in the order given by getInternalParamNames()).
## Protected Attributes
int | rsensornumber
| number of sensors at robot side
int | rmotornumber
| number of motors at robot side
int | csensornumber
| number of sensors at controller side
int | cmotornumber
| number of motors at controller side
NoiseGenerator * | noiseGenerator

## Detailed Description

Abstract wiring-object between controller and robot.

Implements wiring of robot sensors to inputs of the controller and controller outputs to robot motors.

Examples:

  integration/main.cpp, and main.cpp.

## Constructor & Destructor Documentation

AbstractWiring | ( | NoiseGenerator * | noise | ) | `[inline]`

constructor

Parameters:

  | noise | NoiseGenerator that is used for adding noise to sensor values

virtual ~AbstractWiring | ( |  | ) | `[inline, virtual]`

destructor

## Member Function Documentation

virtual int getControllerMotornumber | ( |  | ) | `[inline, virtual]`

Returns the number of motors on controller side.

virtual int getControllerSensornumber | ( |  | ) | `[inline, virtual]`

Returns the number of sensors on controller side.

virtual std::list<iparamkey> getInternalParamNames | ( |  | ) | const`[inline, virtual]`

Returns the list of the names of all internal parameters.

Implements Inspectable.

Reimplemented in One2OneWiring.

virtual std::list<iparamval> getInternalParams | ( |  | ) | const`[inline, virtual]`

Returns a list of the values of all internal parameters (in the order given by getInternalParamNames()).

Implements Inspectable.

Reimplemented in One2OneWiring.

virtual int getRobotMotornumber | ( |  | ) | `[inline, virtual]`

Returns the number of motors on robot side.

virtual int getRobotSensornumber | ( |  | ) | `[inline, virtual]`

Returns the number of sensors on robot side.

virtual bool init | ( | int | robotsensornumber,
|  | int | robotmotornumber |
| ) |  |  | `[pure 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),

Returns:
  returns false if error, else true

Implemented in DerivativeWiring, One2OneWiring, and SelectiveOne2OneWiring.

virtual bool wireMotors | ( | motor * | rmotors,
|  | int | rmotornumber,
|  | const motor * | cmotors,
|  | int | cmotornumber |
| ) |  |  | `[pure 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

Implemented in DerivativeWiring, and One2OneWiring.

virtual bool wireSensors | ( | const sensor * | rsensors,
|  | int | rsensornumber,
|  | sensor * | csensors,
|  | int | csensornumber,
|  | double | noise |
| ) |  |  | `[pure 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 if error, else true

Implemented in DerivativeWiring, One2OneWiring, and SelectiveOne2OneWiring.

## Member Data Documentation

int cmotornumber`[protected]`

number of motors at controller side

int csensornumber`[protected]`

number of sensors at controller side

NoiseGenerator* noiseGenerator`[protected]`

int rmotornumber`[protected]`

number of motors at robot side

int rsensornumber`[protected]`

number of sensors at robot side

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

- abstractwiring.h