global.h

Go to the documentation of this file.
00001 #ifndef __GLOBAL_H__
00002 #define __GLOBAL_H__
00003 
00004 #include <avr/io.h>
00005 #include <avr/interrupt.h>
00006 #include <math.h>
00007 #include <stdlib.h>
00008 
00009 
00010 //#define TESTMODE 1
00011 
00012 
00013 
00014 /********************
00015  * global constants *
00016  ********************/
00020 //#define F_CPU     11059200UL
00021 #define F_CPU       16000000UL
00022 
00023 #include <avr/delay.h>
00024 
00028 #define MAX_STATES 200
00029 
00033 //#define DELAY_TIME 1500L
00034 #define DELAY_TIME 300L
00035 
00039 enum ActionSet {UP, DOWN, LEFT, RIGHT, NONE};
00040 #define NUM_ACTIONS 0x04
00041 
00045 enum SoftwareMode{SENSOR_MODE, ROBOT_STANDALONE};
00046 
00050 typedef struct State {
00051      float value;
00052      //unsigned char best_action;
00053      char feedback_up;
00054      char feedback_down;
00055      char feedback_left;
00056      char feedback_right;
00057 } STATE;
00061 #define STATESIZE sizeof(State)
00062 
00066 #define EXPLORATION_EGREEDY 0
00067 #define EXPLORATION_VALUE_BASED 1
00068 
00069 
00073 enum mainModes {
00074      MAIN_MODE_WALK_POLICY,
00075      MAIN_MODE_EXPLORE_FEEDBACK,
00076      MAIN_MODE_LEARN,
00077      MAIN_MODE_STOP,
00078      MAIN_MODE_UNCHANGED
00079 };
00080 
00084 typedef struct envPosition {
00085      unsigned int x;
00086      unsigned int y;
00087 
00088      envPosition(unsigned int _x, unsigned int _y) {
00089           this->x = _x;
00090           this->y = _y;
00091      }
00092      envPosition(){};
00093 } ENV_POS;
00094 
00095 
00099 void * operator new(size_t size);
00100 void operator delete(void * ptr); 
00101 void * operator new[](size_t size);
00102 void operator delete[](void * ptr); 
00103 
00104 
00105 #endif
00106 

Generated on Wed Nov 25 11:27:41 2009 for Crawling Robot Microcontroller Software by  doxygen 1.5.5