Aquila  2.0 prealpha
Cognitive Robotics Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Slots | Signals | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Interface Class Reference

#include <interface.h>

Inheritance diagram for Interface:
BlankInterface ESNInterface MTRNNInterface SOMInterface TrackerInterface XxxxxxxxxInterface

Classes

struct  Image
 

Public Slots

void sendAbortRequest ()
 Sends request to abort module.
 
void sendStartRequest ()
 Sends request to start module.
 
void sendStopRequest ()
 Sends request to stop module.
 
void sendSimulationMode (int simulationMode)
 Sends simulation module to module.
 

Signals

void gpuListReceived (QStringList gpuList)
 
void progressReceived (int progress)
 
void statusReceived (int statusID)
 

Public Member Functions

 Interface (GUI *pGUI)
 Constructor.
 
void sendGpuListRequest ()
 Sends request for list of GPU devices found on module server.
 
void sendCpuRequest ()
 Sends CPU request to module, which will updates its execution mode to CPU.
 
void sendParametersRequest ()
 Sends parameters request to module.
 
void sendQuitRequest ()
 Sends request to quit module.
 
void close ()
 Closes module.
 
void sendGpuID (int gpuID)
 Sends ID of selected GPU device to module.
 
void sendGpuIDs (QVector< int > gpuIDs)
 Sends ID of selected GPU devices to module.
 
 Interface ()
 Constructor.
 
void sendMessage (string message)
 Sends message to the output port.
 
void sendGpuList ()
 Sends a list of detected GPU devices to the output port.
 
void sendParameters ()
 Sends default parameters to the output port.
 
void sendStatus (int status)
 Sends module status to the output port.
 
bool configure (ResourceFinder &rf)
 Configures module.
 
 Interface ()
 
void sendMessage (string message)
 
void sendGpuList ()
 
void sendParameters ()
 
void sendStatus (int status)
 
bool configure (ResourceFinder &rf)
 
 Interface ()
 
void sendStatus (int status)
 
void sendMessage (string message)
 
void sendGpuList ()
 
void sendParameters ()
 
void sendActivity ()
 Sends activity.
 
bool configure (ResourceFinder &rf)
 
 Interface ()
 
void sendStatus (int status)
 
void sendMessage (string message)
 
void sendGpuList ()
 
void sendParameters (float learningRate, float momentum, float threshold, float weightRange, int iterations, int seed, int numFastNeurons, int numSlowNeurons, int ioDeltaT, int fastDeltaT, int slowDeltaT, int debuggingLevel, int portUpdateInterval)
 Sends parameters to the output port.
 
void sendError (int iteration, float error)
 Sends error at particular iteration to the output port.
 
void sendProgress (int progress)
 Sends training progress (in %) to the output port.
 
void sendNetwork ()
 Sends the weights of neural network to the output port.
 
void sendErrors ()
 Sends the final training errors the output port.
 
bool configure (ResourceFinder &rf)
 
 Interface ()
 
void sendParameters (float learningRate, int numSubIterations, int numOutputs, int iterationPause)
 Sends parameters to the output port.
 
void sendStatus (int status)
 
void sendMap ()
 Sends the weights of self-organising map to the output port.
 
void sendMessage (string message)
 
void sendGpuDeviceList ()
 Sends a list of detected GPU devices to the output port.
 
void sendNumInputs ()
 Sends number of inputs to the output port.
 
void sendTrainingTime ()
 Sends the total training time (in ms) to the output port.
 
void sendDataPointLimits ()
 Sends the original data min and max values to the output port.
 
void sendProgress (int progress)
 
bool configure (ResourceFinder &rf)
 
 Interface ()
 
void sendMessage (string message)
 
void sendGpuList ()
 
void sendParameters ()
 
void sendStatus (int status)
 
bool configure (ResourceFinder &rf)
 

Public Attributes

Image leftCam
 
Image rightCam
 
Image leftMotion
 
Image rightMotion
 

Protected Member Functions

virtual void processPortData ()
 Processes module specific data received from module.
 
virtual void processGpuList ()
 Processes data about GPU devices found on server running module.
 
virtual void printMessage ()
 Prints out or logs message received from module.
 

Protected Attributes

GUImodule
 
yarp::os::Port inputPort
 
yarp::os::Port outputPort
 
yarp::os::Bottle receivedBottle
 

Detailed Description

Base class for interfacing GUIs and modules

Constructor & Destructor Documentation

Interface::Interface ( GUI pGUI)

Constructor.

Parameters
[in]pGUI- pointer to GUI
Interface::Interface ( )

Constructor.

Interface::Interface ( )
Interface::Interface ( )
Interface::Interface ( )
Interface::Interface ( )
Interface::Interface ( )

Member Function Documentation

bool Interface::close ( )

Closes module.

Closes interface.

Returns
true if succeeded
Note
The interruption of the input port causes thread to exit.
bool Interface::configure ( ResourceFinder &  rf)
bool Interface::configure ( ResourceFinder &  rf)

Configures module.

Note
This function creates input and output ports with relevent names and IDs. It also sets parameters that were found
in the configuration file or passed from terminal, which would override configuration file parameter values.
If the module was initialised with '–ping' parameter then a ping port is temporarily created so that Aquila can
detect that this module was compiled and its working ok. This was implemented to support remote module launching.
Parameters
[in]rf- ResourceFinder object
Returns
true on success
bool Interface::configure ( ResourceFinder &  rf)
bool Interface::configure ( ResourceFinder &  rf)
bool Interface::configure ( ResourceFinder &  rf)
bool Interface::configure ( ResourceFinder &  rf)
void Interface::gpuListReceived ( QStringList  gpuList)
signal
void Interface::printMessage ( )
protectedvirtual

Prints out or logs message received from module.

void Interface::processGpuList ( )
protectedvirtual

Processes data about GPU devices found on server running module.

Note
Once the data was processed a signal with GPU list is emitted.
void Interface::processPortData ( )
protectedvirtual

Processes module specific data received from module.

Note
Inheriting classes need to override this function.

Reimplemented in SOMInterface, MTRNNInterface, ESNInterface, TrackerInterface, BlankInterface, and XxxxxxxxxInterface.

void Interface::progressReceived ( int  progress)
signal
void Interface::sendAbortRequest ( )
slot

Sends request to abort module.

void Interface::sendActivity ( )

Sends activity.

void Interface::sendCpuRequest ( )

Sends CPU request to module, which will updates its execution mode to CPU.

void Interface::sendDataPointLimits ( )

Sends the original data min and max values to the output port.

Note
These values (limits) are used to keep the reference about original data values
in case the outputs of a slef-organising map need to be scaled back to original values.
void Interface::sendError ( int  iteration,
float  error 
)

Sends error at particular iteration to the output port.

Parameters
[in]iteration- current itertaion
[in]error- current error
void Interface::sendErrors ( )

Sends the final training errors the output port.

void Interface::sendGpuDeviceList ( )

Sends a list of detected GPU devices to the output port.

Note
This list is read by Aquila, which then constructs a menu listing all devices.
void Interface::sendGpuID ( int  gpuID)

Sends ID of selected GPU device to module.

Parameters
[in]gpuID- GPU device identification number
Note
This function is used in single-GPU mode.
void Interface::sendGpuIDs ( QVector< int >  gpuIDs)

Sends ID of selected GPU devices to module.

Parameters
[in]gpuIDs- vetor of GPU device identification numbers
Note
This function is used in multi-GPU mode.
void Interface::sendGpuList ( )
void Interface::sendGpuList ( )
void Interface::sendGpuList ( )

Sends a list of detected GPU devices to the output port.

Note
This list is read by Aquila, which then constructs a menu listing all devices.
void Interface::sendGpuList ( )
void Interface::sendGpuList ( )
void Interface::sendGpuListRequest ( )

Sends request for list of GPU devices found on module server.

void Interface::sendMap ( )

Sends the weights of self-organising map to the output port.

void Interface::sendMessage ( string  message)
void Interface::sendMessage ( string  message)
void Interface::sendMessage ( string  message)

Sends message to the output port.

Note
Normally, a message is generated when this module received a command from the input port,
which typically originates from Aquila. Every such message is then sent to the output port
so that Aquila can stay synchrnoised with this module.
Parameters
[in]message- a message to be sent to the output port
void Interface::sendMessage ( string  message)
void Interface::sendMessage ( string  message)
void Interface::sendMessage ( string  message)
void Interface::sendNetwork ( )

Sends the weights of neural network to the output port.

void Interface::sendNumInputs ( )

Sends number of inputs to the output port.

void Interface::sendParameters ( float  learningRate,
int  numSubIterations,
int  numOutputs,
int  iterationPause 
)

Sends parameters to the output port.

Parameters
[in]learningRate- initial learning rate
[in]numSubIterations- number of sub-iterations
[in]numOutputs- number of outputs
[in]iterationPause- iteration pause
void Interface::sendParameters ( float  learningRate,
float  momentum,
float  weightRange,
float  threshold,
int  iterations,
int  seed,
int  numFastNeurons,
int  numSlowNeurons,
int  ioDeltaT,
int  fastDeltaT,
int  slowDeltaT,
int  debuggingLevel,
int  portUpdateInterval 
)

Sends parameters to the output port.

Parameters
[in]learningRate- learning rate
[in]momentum- momentum
[in]weightRange- initial range of weights
[in]threshold- error threshold
[in]iterations- number of iterations
[in]seed- random number generator seed
[in]numFastNeurons- number of fast neurons
[in]numSlowNeurons- number of slow neurons
[in]ioDeltaT- input-output delta-t value
[in]fastDeltaT- fast delta-t value
[in]slowDeltaT- slow delta-t value
[in]debuggingLevel- debugging level
[in]portUpdateInterval- port update interval (Aquila plotting data)
void Interface::sendParameters ( )
void Interface::sendParameters ( )

Sends default parameters to the output port.

void Interface::sendParameters ( )
void Interface::sendParameters ( )
void Interface::sendParametersRequest ( )

Sends parameters request to module.

Note
Module responds back with the list of parameters.
void Interface::sendProgress ( int  progress)

Sends training progress (in %) to the output port.

Sends current training progress (in %) to the output port.

Parameters
[in]progress- current progress
void Interface::sendProgress ( int  progress)
void Interface::sendQuitRequest ( )

Sends request to quit module.

void Interface::sendSimulationMode ( int  simulationMode)
slot

Sends simulation module to module.

Parameters
[in]simulationMode- simulation mode
Note
Module will use iCub simulator is simulationMode=1 otherswise it will user iCub robot.
void Interface::sendStartRequest ( )
slot

Sends request to start module.

void Interface::sendStatus ( int  status)
void Interface::sendStatus ( int  status)
void Interface::sendStatus ( int  status)
void Interface::sendStatus ( int  status)
void Interface::sendStatus ( int  status)

Sends module status to the output port.

Sends module state to the output port.

Note
This status determines the current status of the module (e.g. currently training, finished, etc.).
This state determines the current state of the module (e.g. currently training, finished, etc.).
Parameters
[in]status- current status
void Interface::sendStatus ( int  status)
void Interface::sendStopRequest ( )
slot

Sends request to stop module.

void Interface::sendTrainingTime ( )

Sends the total training time (in ms) to the output port.

void Interface::statusReceived ( int  statusID)
signal

Member Data Documentation

Port Interface::inputPort
protected
Image Interface::leftCam
Image Interface::leftMotion
GUI* Interface::module
protected
Port Interface::outputPort
protected
yarp::os::Bottle Interface::receivedBottle
protected
Image Interface::rightCam
Image Interface::rightMotion

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