24 #ifndef __USE_JAVA_CONTROLLER_H
25 #define __USE_JAVA_CONTROLLER_H
36 #include <sys/types.h>
37 #include <sys/socket.h>
39 #include <netinet/in.h>
40 #include <arpa/inet.h>
46 #define BUFFER_SIZE 1024
47 #define MAX_CONFIG_PARAM 50
48 #define MAX_INTERNAL_PARAM 50
51 double atof (
const char * );
52 int ctoi (
const char * );
75 use_java_controller (
const char* port_controller =
"4444",
const char* port_internalParams = NULL,
const char* name =
"defaultRobot" );
86 virtual void init (
int sensornumber,
int motornumber,
RandGen* randgen = 0);
104 virtual void step (
const sensor* sensors,
int sensornumber,
105 motor* motors,
int motornumber );
109 virtual void stepNoLearning (
const sensor* ,
int number_sensors,
110 motor* ,
int number_motors );
115 void sendToJava (
const char* message,
bool abbruch,
const char* meldung=
"Fehler beim Senden der Daten zum Java-Controller\n" );
117 void closeJavaController();
124 virtual std::list<iparamkey> getInternalParamNames()
const;
130 virtual std::list<iparamval> getInternalParams()
const;
135 virtual paramlist getParamList()
const ;
139 virtual bool store ( FILE* f )
const {
return true;};
140 virtual bool restore ( FILE* f ) {
return true;};
161 struct sockaddr_in server_controller_addr;
162 struct sockaddr_in server_internalParams_addr;
163 struct sockaddr_in client_controller_addr;
164 struct sockaddr_in client_internalParams_addr;
iparamkeylist internal_keylist
Definition: use_java_controller.h:170
int server_internalParams
Definition: use_java_controller.h:154
int anz_internal_param
Definition: use_java_controller.h:173
Abstract class for robot controller (with some basic functionality).
Definition: abstractcontroller.h:46
int server_controller
Definition: use_java_controller.h:153
int anz_config_param
Definition: use_java_controller.h:168
charArray paramkey
Definition: avrtypes.h:36
matrix::Matrix t(const std::vector< matrix::Matrix > &data, int time)
Definition: datafunc.h:102
std::list< std::pair< paramkey, paramval > > paramlist
Definition: configurable.h:89
bool isClosed
Definition: use_java_controller.h:177
double sensor
Definition: types.h:29
bool serverOK
Definition: use_java_controller.h:151
int client_controller
Definition: use_java_controller.h:155
random generator with 48bit integer arithmentic
Definition: randomgenerator.h:34
int client_internalParams
Definition: use_java_controller.h:156
paramlist config_param_list
Definition: use_java_controller.h:167
double * motor_values_alt
Definition: use_java_controller.h:183
bool can_send
Definition: use_java_controller.h:175
int number_controlled
Definition: use_java_controller.h:149
socklen_t client_internalParams_size
Definition: use_java_controller.h:159
socklen_t client_controller_size
Definition: use_java_controller.h:158
double paramval
Definition: avrtypes.h:37
virtual bool store(FILE *f) const
stores the object to the given file stream (ASCII preferred).
Definition: use_java_controller.h:139
bool server_guilogger_isClosed
Definition: use_java_controller.h:178
double motor
Definition: types.h:30
int number_motors
Definition: use_java_controller.h:148
virtual int getMotorNumber() const
Definition: use_java_controller.h:95
virtual int getSensorNumber() const
Definition: use_java_controller.h:90
class for robot control with sine and cosine
Definition: use_java_controller.h:62
static void addController()
Definition: use_java_controller.h:78
bool server_controller_isClosed
Definition: use_java_controller.h:179
static int anzahl_Java_controller
Definition: use_java_controller.h:72
const char * name
Definition: use_java_controller.h:146
std::list< iparamkey > iparamkeylist
Definition: inspectable.h:59
std::list< iparamval > iparamvallist
Definition: inspectable.h:61
int anzahl_closed_Server
Definition: use_java_controller.h:181
iparamvallist internal_vallist_alt
Definition: use_java_controller.h:172
iparamvallist internal_vallist
Definition: use_java_controller.h:171
int number_sensors
Definition: use_java_controller.h:147
bool isFirst
Definition: use_java_controller.h:176
double atof(const char *)