brain.h File Reference

Definitions needed to use the mark brain thread. More...

#include <pthread.h>
#include <ncurses.h>
#include "sensordefs.h"
#include "config.h"
#include "scheduler.h"

Include dependency graph for brain.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  brainArgs
 Structure for thread's arguments. More...

Defines

#define DEFAULT_PARTNER_NAME   "jen"
 Default host name for the partner.
#define BRAIN_SLEEP   100*1000
 Pause between subsequent brain cycles (in [µs]).
#define BRAIN_PORT   5001
 Use this port for the brain.
#define NOOP_PAUSE   30
 Pause as many seconds between two NOOP messages to keep the TCP connection alive (in [s]).
#define READBUFFERSIZE   256
 Reserve memory [in B] for TCP connection read buffer.
#define SAFEMARKINGAREA   20.0
 Distance we have to go to assume we left a marking (in [mm]).

Functions

void * brain (void *arg)
 This thread is responsible for detecting markings on the ground.

Variables

char brainQuitReq
 Set to 1 to end the thread.
char markDetected
 Will be set to 1 if a mark is detected.


Detailed Description

Definitions needed to use the mark brain thread.

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.

Version:
Id
brain.h,v 1.15 2008/09/18 12:59:01 prokop Exp

Definition in file brain.h.


Define Documentation

#define BRAIN_PORT   5001

Use this port for the brain.

Definition at line 51 of file brain.h.

#define BRAIN_SLEEP   100*1000

Pause between subsequent brain cycles (in [µs]).

Definition at line 48 of file brain.h.

#define DEFAULT_PARTNER_NAME   "jen"

Default host name for the partner.

Definition at line 45 of file brain.h.

#define NOOP_PAUSE   30

Pause as many seconds between two NOOP messages to keep the TCP connection alive (in [s]).

Definition at line 54 of file brain.h.

#define READBUFFERSIZE   256

Reserve memory [in B] for TCP connection read buffer.

Definition at line 57 of file brain.h.

#define SAFEMARKINGAREA   20.0

Distance we have to go to assume we left a marking (in [mm]).

Definition at line 60 of file brain.h.


Function Documentation

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.

Parameters:
arg Arguments for this thread. Currently unused.

Definition at line 277 of file brain.c.


Variable Documentation

Set to 1 to end the thread.

Definition at line 46 of file brain.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.


Generated on Sun Sep 28 21:20:01 2008 for Guard by  doxygen 1.5.6