Robot Simulator of the Robotics Group for Self-Organization of Control: CopyWiring Class Reference

# CopyWiring Class Reference

Implements a wiring where the motors are copied to several motors and the sensors are fusioned. More...

`#include <copywiring.h>`

Inherits AbstractWiring, and Configurable.

Collaboration diagram for CopyWiring:
[legend]

List of all members.

## Public Types
typedef std::vector< std::list < int > > | Assignment
## Public Member Functions
| CopyWiring (const Assignment &sensor_assignment, const Assignment &motor_assignment, NoiseGenerator *noise, int plotMode=Controller|Robot, const std::string &name="CopyWiring")
| constructor
virtual | ~CopyWiring ()
| destructor
virtual void | reset ()
| reset internal state
## Static Public Member Functions
static Assignment | motorFromSensorAssignment (const Assignment &sensor_assignment)
| returns the inverse Assignment of the given sensor assignemnt (typically the right thing)
## Protected Member Functions
virtual bool | initIntern ()
| initializes the number of sensors and motors on robot side, calculate number of sensors and motors on controller side
virtual bool | wireSensorsIntern (const sensor *rsensors, int rsensornumber, sensor *csensors, int csensornumber, double noise)
| Realizes one to one wiring from robot sensors to controller sensors.
virtual bool | wireMotorsIntern (motor *rmotors, int rmotornumber, const motor *cmotors, int cmotornumber)
| Realizes one to one wiring from controller motor outputs to robot motors.
## Protected Attributes
Assignment | s_assign
Assignment | m_assign

## Detailed Description

Implements a wiring where the motors are copied to several motors and the sensors are fusioned.

## Member Typedef Documentation

typedef std::vector< std::list<int> > Assignment

## Constructor & Destructor Documentation

CopyWiring | ( | const Assignment & | sensor_assignment,
|  | const Assignment & | motor_assignment,
|  | NoiseGenerator * | noise,
|  | int | plotMode = `Controller|Robot`,
|  | const std::string & | name = `"CopyWiring"` |
| ) |  |  |

constructor

Parameters:

  | sensor_assignment | for each controller sensor a list of robot sensor it is averaged over
  | motor_assignment | for each robot motor a list of controller motors it is averaged over
  | noise | NoiseGenerator that is used for adding noise to sensor values
  | plotMode | see AbstractWiring

~CopyWiring | ( |  | ) | `[virtual]`

destructor

## Member Function Documentation

bool initIntern | ( |  | ) | `[protected, virtual]`

initializes the number of sensors and motors on robot side, calculate number of sensors and motors on controller side

Implements AbstractWiring.

CopyWiring::Assignment motorFromSensorAssignment | ( | const Assignment & | sensor_assignment | ) | `[static]`

returns the inverse Assignment of the given sensor assignemnt (typically the right thing)

void reset | ( |  | ) | `[virtual]`

reset internal state

Reimplemented from AbstractWiring.

bool wireMotorsIntern | ( | motor * | rmotors,
|  | int | rmotornumber,
|  | const motor * | cmotors,
|  | int | cmotornumber |
| ) |  |  | `[protected, virtual]`

Realizes one to one wiring from controller motor outputs to robot motors.

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

Implements AbstractWiring.

bool wireSensorsIntern | ( | const sensor * | rsensors,
|  | int | rsensornumber,
|  | sensor * | csensors,
|  | int | csensornumber,
|  | double | noise |
| ) |  |  | `[protected, virtual]`

Realizes one to one wiring from robot sensors to controller sensors.

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

Implements AbstractWiring.

## Member Data Documentation

Assignment m_assign`[protected]`

Assignment s_assign`[protected]`

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

- copywiring.h
- copywiring.cpp