|Structure for thread's arguments. More...|
|Default host name for the partner. |
|Pause between subsequent brain cycles (in [µs]). |
|Use this port for the brain. |
|Pause as many seconds between two NOOP messages to keep the TCP connection alive (in [s]). |
|Reserve memory [in B] for TCP connection read buffer. |
|Distance we have to go to assume we left a marking (in [mm]). |
|void *||brain (void *arg)|
|This thread is responsible for detecting markings on the ground. |
|Set to 1 to end the thread. |
|Will be set to 1 if a mark is detected. |
In general the brain is responsible for keeping track of the robot's way. It must detect edges (by help of bottom markings), keep track of the way left behind and communicate with the other robot to tell it when to go. Bottom markings can be used to mark edges of the polygon, since robot movements do not always allow exact position prediction. Previously this thread should be responsible only for bottom markings, but it would rise the need to implement more threads for communication etc. and this would most probably lead to massive sychronization problems between those threads. That is why I decided to keep it all here.
Definition in file brain.h.
|#define BRAIN_SLEEP 100*1000|
|#define DEFAULT_PARTNER_NAME "jen"|
|#define NOOP_PAUSE 30|
|#define READBUFFERSIZE 256|
|#define SAFEMARKINGAREA 20.0|
|void* brain||(||void *||arg||)|
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.|