use_java_controller Class Reference

class for robot control with sine and cosine More...

#include <use_java_controller.h>

Inherits AbstractController.

Inheritance diagram for use_java_controller:

Inheritance graph
[legend]
Collaboration diagram for use_java_controller:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 use_java_controller (const char *port_controller="4444", const char *port_internalParams=NULL, const char *name="defaultRobot")
 Konstruktor: Initialisiert die Serververbindungen zu Java.
virtual ~use_java_controller ()
virtual void init (int sensornumber, int motornumber, RandGen *randgen=0)
 initialisation of the controller with the given sensor/ motornumber Must be called before use.
virtual int getSensorNumber () const
virtual int getMotorNumber () const
virtual void step (const sensor *sensors, int sensornumber, motor *motors, int motornumber)
 performs one step (includes learning).
virtual void stepNoLearning (const sensor *, int number_sensors, motor *, int number_motors)
 performs one step without learning.
void sendToJava (const char *message, bool abbruch, const char *meldung="Fehler beim Senden der Daten zum Java-Controller\n")
 Methode verschickt message an Java-controller.
void closeJavaController ()
 Methode verschickt Protokolle nach Java.
virtual std::list< iparamkeygetInternalParamNames () const
 executed once when guilogger or neuronvis or file logger is started to get the names of the inspectable parameters (names should be sent from java-controller and returned)
virtual std::list< iparamvalgetInternalParams () const
 executed every step when guilogger or neuronvis or file logger is active to get the values of the inspectable parameters (values should be sent from java-controller and returned)
virtual paramval getParam (const paramkey &key) const
 executed when a parameter is asked from the console (value should be sent from java-controller and returned)
virtual bool setParam (const paramkey &key, paramval val)
 executed when a parameter is set on the console (new value should be sent to java-controller)
virtual paramlist getParamList () const
 executed once from simulation for asking the parameter names (parameter names should be sent from java-controller and returned)
virtual bool store (FILE *f) const
 stores the object to the given file stream (binary).
virtual bool restore (FILE *f)
 loads the object from the given file stream (binary).

Static Public Member Functions

static void addController ()

Static Public Attributes

static int anzahl_Java_controller = 0

Protected Attributes

int t
const char * name
int number_sensors
int number_motors
int number_controlled
bool serverOK
int server_controller
int server_internalParams
int client_controller
int client_internalParams
socklen_t client_controller_size
socklen_t client_internalParams_size
sockaddr_in server_controller_addr
sockaddr_in server_internalParams_addr
sockaddr_in client_controller_addr
sockaddr_in client_internalParams_addr
paramlist config_param_list
int anz_config_param
iparamkeylist internal_keylist
iparamvallist internal_vallist
iparamvallist internal_vallist_alt
int anz_internal_param
bool can_send
bool isFirst
bool isClosed
bool server_guilogger_isClosed
bool server_controller_isClosed
int anzahl_closed_Server
double * motor_values_alt

Detailed Description

class for robot control with sine and cosine


Constructor & Destructor Documentation

use_java_controller ( const char *  port_controller = "4444",
const char *  port_internalParams = NULL,
const char *  name = "defaultRobot" 
)

Konstruktor: Initialisiert die Serververbindungen zu Java.

Parameters:
port_controller Portnummer für die Kommunikation des Controllers
port_internalParams Portnummer für die Kommunikation des Guiloggers

~use_java_controller (  )  [virtual]


Member Function Documentation

static void addController (  )  [inline, static]

void closeJavaController (  ) 

Methode verschickt Protokolle nach Java.

list< Inspectable::iparamkey > getInternalParamNames (  )  const [virtual]

executed once when guilogger or neuronvis or file logger is started to get the names of the inspectable parameters (names should be sent from java-controller and returned)

Reimplemented from Inspectable.

list< Inspectable::iparamval > getInternalParams (  )  const [virtual]

executed every step when guilogger or neuronvis or file logger is active to get the values of the inspectable parameters (values should be sent from java-controller and returned)

Reimplemented from Inspectable.

virtual int getMotorNumber (  )  const [inline, virtual]

Returns:
Number of motors the controller was initialised with or 0 if not initialised

Implements AbstractController.

Configurable::paramval getParam ( const paramkey key  )  const [virtual]

executed when a parameter is asked from the console (value should be sent from java-controller and returned)

Configurable::paramlist getParamList (  )  const [virtual]

executed once from simulation for asking the parameter names (parameter names should be sent from java-controller and returned)

Reimplemented from Configurable.

virtual int getSensorNumber (  )  const [inline, virtual]

Returns:
Number of sensors the controller was initialised with or 0 if not initialised

Implements AbstractController.

void init ( int  sensornumber,
int  motornumber,
RandGen randgen = 0 
) [virtual]

initialisation of the controller with the given sensor/ motornumber Must be called before use.

Implements AbstractController.

virtual bool restore ( FILE *  f  )  [inline, virtual]

loads the object from the given file stream (binary).

Implements Storeable.

void sendToJava ( const char *  message,
bool  abbruch,
const char *  meldung = "Fehler beim Senden der Daten zum Java-Controller\n" 
)

Methode verschickt message an Java-controller.

bool setParam ( const paramkey key,
paramval  val 
) [virtual]

executed when a parameter is set on the console (new value should be sent to java-controller)

void step ( const sensor sensors,
int  sensornumber,
motor motors,
int  motornumber 
) [virtual]

performs one step (includes learning).

Calculates motor commands from sensor inputs.

Parameters:
sensors sensors inputs scaled to [-1,1]
sensornumber length of the sensor array
motors motors outputs. MUST have enough space for motor values!
motornumber length of the provided motor array

Implements AbstractController.

void stepNoLearning ( const sensor ,
int  number_sensors,
motor ,
int  number_motors 
) [virtual]

performs one step without learning.

See also:
step

Implements AbstractController.

virtual bool store ( FILE *  f  )  const [inline, virtual]

stores the object to the given file stream (binary).

Implements Storeable.


Member Data Documentation

int anz_config_param [protected]

int anz_internal_param [protected]

int anzahl_closed_Server [protected]

int anzahl_Java_controller = 0 [static]

bool can_send [protected]

int client_controller [protected]

struct sockaddr_in client_controller_addr [protected]

socklen_t client_controller_size [protected]

int client_internalParams [protected]

struct sockaddr_in client_internalParams_addr [protected]

socklen_t client_internalParams_size [protected]

paramlist config_param_list [protected]

iparamkeylist internal_keylist [protected]

iparamvallist internal_vallist [protected]

iparamvallist internal_vallist_alt [protected]

bool isClosed [protected]

bool isFirst [protected]

double* motor_values_alt [protected]

const char* name [protected]

Reimplemented from Configurable.

int number_controlled [protected]

int number_motors [protected]

int number_sensors [protected]

int server_controller [protected]

struct sockaddr_in server_controller_addr [protected]

bool server_controller_isClosed [protected]

bool server_guilogger_isClosed [protected]

int server_internalParams [protected]

struct sockaddr_in server_internalParams_addr [protected]

bool serverOK [protected]

int t [protected]


The documentation for this class was generated from the following files:
Generated on Fri Oct 30 16:29:03 2009 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.4.7