Robot Agent  1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
config.h
Go to the documentation of this file.
1 
11 #ifndef __CONFIG_H
12 #define __CONFIG_H
13 
14 /* -- Includes -- */
15 /* system libraries */
16 
17 /* project libraries */
18 
19 
20 /* -- Types -- */
21 
22 
26 typedef struct s_CONFIG_STRUCT
27 {
28  // serialport
31 
32  // enviroment
35 
36  // particle filter
37  int pf_particles_num; // Number of particles
38  int pf_noise_move; // Error created during forward or backward motion (mm)
39  int pf_noise_turn; // Error created during turning (degrees)
40  int pf_noise_tag; // Error of tag read (mm)
41  int pf_noise_wall; // Error of wall read (mm)
42 
43  // robot
44  int robot_id;
51 
52  // pheromones
59 
60  // UDP
61  int udp_port;
63  char udp_broadcast_ip[16];
64 
65  // scenario
68 
69  // network
70  int network_bitrate; // Network bit-rate
71  int network_tdma_slot_num; // Number of slots in TDMA period
72  int network_tdma_period; // TDMA period length in milliseconds
73 
74 
75 } config_t;
76 
77 
78 
79 /* -- Defines -- */
80 
81 /* RFID */
82 #define s_CONFIG_RFID_SENSE_RADIUS 50
83 #define s_CONFIG_RFID_EMPTY_TAG "0000000000\0"
84 /* PHEROMONE */
85 #define s_CONFIG_PHEROMONE_SECTOR_MAX_SIZE 200
86 /* VICTIM */
87 #define s_CONFIG_VICTIM_MAX_COUNT 10
88 /* STREAM */
89 #define s_CONFIG_STREAM_SIZE 20
90 #define s_CONFIG_STREAM_RATE 20 // How many packets in a second
91 /* GO AHEAD */
92 #define s_CONFIG_GO_AHEAD_TIME 2000 // Time in ms how long "go ahead" msg is valid
93 /* ALLOWED OPENINTERFACE REQUEST PERIOD */
94 #define s_CONFIG_OI_REQUEST_PERIOD 300 // Allowed period between requests
95 /* ACCURACY LIMIT */
96 #define s_CONFIG_ACCURACY_LIMIT 30
97 
98 
99 /* PARTICLE FILTER */
100 #define s_CONFIG_PF_DISTANCE_UNCERTANITY 200
101 #define s_CONFIG_PF_ANGLE_UNCERTANITY 10
102 
103 /* DEBUG */
104 //#define s_CONFIG_OUTPUT_ENABLE 1
105 //#define s_CONFIG_TEST_ENABLE 1
106 //#define s_CONFIG_DEBUG_ENABLE 1
107 
108 
109 
110  /* DEFAULT CONFIGURATION */
111 
112 // -- Serial port --
113 #define S_CONFIG_DEFAULT_SERIALPORT_RFID_PORT_PATH "/dev/ttyUSB0"
114 #define s_CONFIG_DEFAULT_SERIALPORT_OPENINTERFACE_PORT_PATH "/dev/ttyUSB1"
115 
116 // -- Environment --
117 #define s_CONFIG_DEFAULT_ENVIRONMENT_ROOM_DEF_PATH "./res/large_room.dat"
118 #define s_CONFIG_DEFAULT_ENVIRONMENT_TAGS_DEF_PATH "./res/large_tags.dat"
119 
120 // -- Particle filter --
121 #define s_CONFIG_DEFAULT_PF_PARTICLES_NUM 1000
122 #define s_CONFIG_DEFAULT_PF_NOISE_MOVE 20
123 #define s_CONFIG_DEFAULT_PF_NOISE_TURN 6
124 #define s_CONFIG_DEFAULT_PF_NOISE_TAG 80
125 #define s_CONFIG_DEFAULT_PF_NOISE_WALL 1
126 
127 // -- Robot --
128 #define s_CONFIG_DEFAULT_ROBOT_ID 1
129 #define s_CONFIG_DEFAULT_ROBOT_TEAM 1
130 #define s_CONFIG_DEFAULT_ROBOT_RADIUS 160
131 #define s_CONFIG_DEFAULT_ROBOT_INIT_X 160
132 #define s_CONFIG_DEFAULT_ROBOT_INIT_Y 160
133 #define s_CONFIG_DEFAULT_ROBOT_INIT_ANGLE 0
134 #define s_CONFIG_DEFAULT_ROBOT_SPEED 300
135 
136 // -- Pheromone --
137 #define s_CONFIG_DEFAULT_PHEROMONE_WIDTH 100
138 #define s_CONFIG_DEFAULT_PHEROMONE_LIFETIME 1
139 #define s_CONFIG_DEFAULT_PHEROMONE_PHEROMONE_RADIUS 100
140 #define s_CONFIG_DEFAULT_PHEROMONE_EVAL_RADIUS 300
141 #define s_CONFIG_DEFAULT_PHEROMONE_EVAL_DIST 400
142 #define s_CONFIG_DEFAULT_PHEROMONE_SECTOR_MAX_SIZE 100
143 
144 // -- UDP --
145 #define s_CONFIG_DEFAULT_UDP_BROADCAST_IP "255.255.255.255"
146 #define s_CONFIG_DEFAULT_UDP_PORT 454545
147 #define s_CONFIG_DEFAULT_UDP_PACKET_SIZE 512
148 
149 // -- Network --
150 #define s_CONFIG_DEFAULT_NETWORK_BITRATE 153600
151 #define s_CONFIG_DEFAULT_NETWORK_TDMA_SLOT_NUM 8
152 #define s_CONFIG_DEFAULT_NETWORK_TDMA_PERIOD 1000
153 
154 /* -- Shared Variables -- */
155 extern config_t g_config;
156 
157 /* -- Function Prototypes -- */
158 void config_load(void);
159 
160 #endif /* __CONFIG_H */
int scenario_victims_num
Definition: config.h:67
int pheromone_sector_max_size
Definition: config.h:58
int robot_init_x
Definition: config.h:47
int robot_radius
Definition: config.h:46
int network_bitrate
Definition: config.h:70
char serialport_rfid_port_path[256]
Definition: config.h:29
char enviroment_tags_def_path[256]
Definition: config.h:34
int robot_init_angle
Definition: config.h:49
int scenario_victims_max
Definition: config.h:66
config_t g_config
Definition: config.c:22
int network_tdma_slot_num
Definition: config.h:71
int udp_packet_size
Definition: config.h:62
int pf_noise_move
Definition: config.h:38
Configuration structure.
Definition: config.h:26
int pf_particles_num
Definition: config.h:37
struct s_CONFIG_STRUCT config_t
Configuration structure.
int pheromone_width
Definition: config.h:53
char serialport_openinterface_port_path[256]
Definition: config.h:30
int pf_noise_tag
Definition: config.h:40
int network_tdma_period
Definition: config.h:72
int pheromone_eval_dist
Definition: config.h:57
int robot_team
Definition: config.h:45
int pf_noise_wall
Definition: config.h:41
char udp_broadcast_ip[16]
Definition: config.h:63
int robot_init_y
Definition: config.h:48
int robot_id
Definition: config.h:44
int robot_speed
Definition: config.h:50
int pheromone_eval_radius
Definition: config.h:56
char enviroment_room_def_path[256]
Definition: config.h:33
void config_load(void)
Definition: config.c:26
int pheromone_pheromone_radius
Definition: config.h:55
int udp_port
Definition: config.h:61
int pf_noise_turn
Definition: config.h:39
int pheromone_lifetime
Definition: config.h:54