From 1355d019cafedbb3d6b191156b80a857c6a618d1 Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Sun, 4 Mar 2012 01:32:10 +0100 Subject: digital/beacon/simu: beacon simulator v2 -> Multi Obstacles management --- digital/beacon/simu/position.h | 49 ++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 16 deletions(-) (limited to 'digital/beacon/simu/position.h') diff --git a/digital/beacon/simu/position.h b/digital/beacon/simu/position.h index de962e5a..9010e705 100644 --- a/digital/beacon/simu/position.h +++ b/digital/beacon/simu/position.h @@ -26,34 +26,51 @@ #ifndef _POSITION_H #define _POSITION_H -#define LARGEUR_TABLE 2000 -#define LONGUEUR_TABLE 3000 -#define LARGEUR_DEMI_TABLE LARGEUR_TABLE/2 -#define M_PI 3.14 +#define MAX_OBSTACLE 2 +#define MAX_BEACON 3 +#define MAX_TEMP_POSITION MAX_OBSTACLE * 2 +#define OBSTACLE_RADIUS 100 +#define IGNORE_ANGLE 1000 +/* Status returns */ +typedef enum{ + POSITION_NO_ERROR, + POSITION_IGNORE_ANGLE +} TPositionStatus; + +/* Structures definition */ + +/* Beacon Structure */ typedef struct { - float angle[4]; - int last_updated_beacon; - int before_last_updated_beacon; - -}beacon_value_s; + int angleNumber; + float angle[MAX_OBSTACLE+1]; +}beacon_s; +/* Obstacle structure */ typedef struct { int x; int y; - int old_x; - int old_y; + int trust }opponent_s; - + +/* Coordinates structure */ +typedef struct +{ + int x; + int y; +}coord_s; + +/* Recovery Structure */ typedef struct { - int lost_beacon; -}status_s; + int x; + int y; + int occurence; +}recovery_s; +/* This function is used to initialize all needed structures */ void init_struct(void); -void update_position(int beacon_number,double angle); -void distance_filter(void); #endif \ No newline at end of file -- cgit v1.2.3