X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=projects%2Fmicrob2010%2Fmainboard%2Fstrat_utils.h;h=020b7f1e2f4a0ee8c90e69504fad532211ea827d;hp=85997c2c0a8373ff02438cafcf7d7df06cda7baf;hb=a3ec2f79a4ed7b2148ede881e0685ddb6f141d82;hpb=1714f4ee916fca95ce24120ea6e698237913f947 diff --git a/projects/microb2010/mainboard/strat_utils.h b/projects/microb2010/mainboard/strat_utils.h index 85997c2..020b7f1 100644 --- a/projects/microb2010/mainboard/strat_utils.h +++ b/projects/microb2010/mainboard/strat_utils.h @@ -20,10 +20,6 @@ */ -#define DEG(x) (((double)(x)) * (180.0 / M_PI)) -#define RAD(x) (((double)(x)) * (M_PI / 180.0)) -#define M_2PI (2*M_PI) - struct xy_point { int16_t x; int16_t y; @@ -35,7 +31,7 @@ struct xy_point { ({ \ uint8_t __err = 0; \ while ( (! (cond)) && (__err == 0)) { \ - __err = test_traj_end(TRAJ_FLAGS_NO_NEAR); \ + __err = test_traj_end(mask); \ } \ __err; \ }) \ @@ -61,4 +57,8 @@ uint8_t get_opponent_color(void); int8_t get_opponent_xy(int16_t *x, int16_t *y); int8_t get_opponent_da(int16_t *d, int16_t *a); int8_t get_opponent_xyda(int16_t *x, int16_t *y, int16_t *d, int16_t *a); +int16_t distance_from_opponent(int16_t x, int16_t y); uint8_t opponent_is_behind(void); + +uint8_t get_ball_count(void); +uint8_t get_cob_count(void);