Robot Agent  1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
enviroment.h
Go to the documentation of this file.
1 
12 #ifndef __ENVIROMENT_H
13 #define __ENVIROMENT_H
14 
15 /* -- Includes -- */
16 
17 /* -- Types -- */
18 
23 {
24  struct
25  {
26  int x; // X
27  int y; // Y
28  };
29 
30  int point[2]; // Array with x and y coordinates (alternative way to acces x and y)
31 
33 
38 {
39  int x; // X
40  int y; // Y
41  char id[11]; // ID of tag 10 chars + '\0'
42  unsigned char enable;
43 
45 
49 typedef struct s_ENVIROMENT_STRUCT
50 {
51  enviroment_room_point_t *room; // Array of room point structures
52  enviroment_tag_t *tags; // Array of RFID tag structures
53 
54  int room_num; // Number of room points
55  int tags_num; // Number of tags
56 
57  int room_max_width; // Max room width
58  int room_max_height; // Max room height
59 
60 } enviroment_t;
61 
62 /* -- Constants -- */
63 #define s_ENVIROMENT_TAG_ZEROS -1
64 #define s_ENVIROMENT_TAG_UNKNOWN -2
65 #define s_ENVIROMENT_TAG_DISABLED -3
66 
67 /* -- Function Prototypes -- */
68 enviroment_t *enviroment_load(char *room_def_path, char *tags_def_path); // Load enviroment definitions
69 void enviroment_destroy(enviroment_t *env); // Free dynamicly allocated memory
70 int enviroment_room_load(enviroment_room_point_t **room, const char *filename); // Load room definition
71 int enviroment_tags_load(enviroment_tag_t **tags, const char *filename); // Load tags
72 void enviroment_calc_room_dimensions(enviroment_t *env); // Calculate room dimensions
73 int enviroment_tag_check(enviroment_t *env, char tag_id[11]); // Check weather RFID tag exists in enviroment
74 
75  #endif /* __ENVIROMENT_H */
unsigned char enable
Definition: enviroment.h:42
int enviroment_tags_load(enviroment_tag_t **tags, const char *filename)
Definition: enviroment.c:123
Room point definition - x, y.
Definition: enviroment.h:22
void enviroment_calc_room_dimensions(enviroment_t *env)
Definition: enviroment.c:190
int enviroment_room_load(enviroment_room_point_t **room, const char *filename)
Definition: enviroment.c:66
int enviroment_tag_check(enviroment_t *env, char tag_id[11])
Definition: enviroment.c:219
struct s_ENVIROMENT_STRUCT enviroment_t
Enviroment Structure - room points, tags, room point number, tag number.
enviroment_tag_t * tags
Definition: enviroment.h:52
struct s_ENVIROMENT_TAG_STRUCT enviroment_tag_t
Tag definition - x, y, id.
void enviroment_destroy(enviroment_t *env)
Definition: enviroment.c:50
enviroment_t * enviroment_load(char *room_def_path, char *tags_def_path)
Definition: enviroment.c:31
Tag definition - x, y, id.
Definition: enviroment.h:37
enviroment_room_point_t * room
Definition: enviroment.h:51
union s_ENVIROMENT_ROOM_POINT_UNION enviroment_room_point_t
Room point definition - x, y.
Enviroment Structure - room points, tags, room point number, tag number.
Definition: enviroment.h:49