brain.c File Reference
This file implements brain definitions. More...
Go to the source code of this file.
| ||Definition of possible commands robots can send to each other. More...|
|char ||onMark (char inverseBottomMarkings)|
| ||Reads the bottom sensors and tells if we are over a mark or not. |
|int ||sendCommand (char command)|
| ||Sends a command to the other robot. |
|int ||reconnect (void)|
| ||Reconnects on broken TCP connection. |
|void ||closeConnections (void)|
|int ||performBottomMarkDetection (char inversBottomMarkings)|
| ||Capsules bottom mark detection. |
|void * ||brain (void *arg)|
| ||This thread is responsible for detecting markings on the ground. |
|knet_dev_t * ||dsPic|
| ||Khepera's status information device. |
| ||The guard's mode: running or watching. |
| ||Tells if the guard is running along the left or right wall. |
|WINDOW * ||bLogWindow = NULL|
| ||ncurses window, where the logging output will go to. |
|char ||brainQuitReq = 0|
| ||Set to 1 to end the thread. |
|char ||markDetected = 0|
| ||Will be set to 1 if a mark is detected. |
|char ||guardNetMode = GUARD_MODE_UNDEF|
| ||Network mode of this guard - is it a client or server? For possible values see Robots' Network Modes. |
|char * ||partnerName = DEFAULT_PARTNER_NAME|
|char * ||scheduleFileName = DEFAULT_SCHEDULE_FILE_NAME|
|int ||servSock = -1|
| ||Server socket. |
|int ||partner = -1|
| ||Connection socket to our partner. |
|short ||blackMarkTresh = 2900|
| ||Invensity treshhold for black markings (in sensor values). |
|short ||whiteMarkTresh = 2500|
| ||Invensity treshhold for white markings (in sensor values). |
|struct commands_s ||commands|
| ||Definition of possible commands robots can send to each other. |
This file implements brain definitions.
It is intended to be run as a thread.
- brain.c,v 1.24 2008/09/18 12:59:01 prokop Exp
Definition in file brain.c.
This thread is responsible for detecting markings on the ground.
Each mark could mean a vertex of our polygon. It will set the variable markDetected once for every marking it just encountered and will not set it again unless the robot has left the marked area.
|arg ||Arguments for this thread. Currently unused. |
Definition at line 277 of file brain.c.
Reads the bottom sensors and tells if we are over a mark or not.
- 1 if over a mark, 0 otherwise
Definition at line 80 of file brain.c.
Capsules bottom mark detection.
- 1 if a new mark was detected, 0 otherwise.
Definition at line 246 of file brain.c.
Reconnects on broken TCP connection.
The reconnection method will block until a connection has been established or brainQuitReq has been set.
- 1 on success or 0 if no connection could be established before the quit requst.
Definition at line 127 of file brain.c.
Sends a command to the other robot.
If the command cannot be send this function will try to reconnect until it succeeds or brainQuitReq is set - in other words it will block.
|command ||one byte command to send to the other robot |
- 1 on success or 0 on failure.
Definition at line 110 of file brain.c.
Invensity treshhold for black markings (in sensor values).
Definition at line 65 of file brain.c.
ncurses window, where the logging output will go to.
Definition at line 44 of file brain.c.
Set to 1 to end the thread.
Definition at line 46 of file brain.c.
Definition of possible commands robots can send to each other.
Khepera's status information device.
- See also:
- kh3moves.c */
Khepera status device.
Definition at line 58 of file kh3moves.c.
Will be set to 1 if a mark is detected.
Must be externally reset to 0 after the "mark event" has been proceeded. The markDetector will not set this variable unless the robot has left the last marking
Definition at line 47 of file brain.c.
Connection socket to our partner.
Definition at line 62 of file brain.c.
Definition at line 60 of file brain.c.
Invensity treshhold for white markings (in sensor values).
Definition at line 67 of file brain.c.