X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=projects%2Fmicrob2010%2Fmainboard%2Fstrat.h;h=0a31073f9f227af7be09628dea5edad2279c1e2b;hp=add640a7100633998f1fe3eadfea37084e1cb608;hb=b022f257a5ee568737e1a684a83d0154397fffcb;hpb=1714f4ee916fca95ce24120ea6e698237913f947 diff --git a/projects/microb2010/mainboard/strat.h b/projects/microb2010/mainboard/strat.h index add640a..0a31073 100644 --- a/projects/microb2010/mainboard/strat.h +++ b/projects/microb2010/mainboard/strat.h @@ -23,10 +23,10 @@ #define _STRAT_H_ /* convert coords according to our color */ -#define COLOR_Y(y) ((mainboard.our_color==I2C_COLOR_RED)? (y) : (AREA_Y-(y))) -#define COLOR_A(a) ((mainboard.our_color==I2C_COLOR_RED)? (a) : (-a)) -#define COLOR_SIGN(x) ((mainboard.our_color==I2C_COLOR_RED)? (x) : (-x)) -#define COLOR_INVERT(x) ((mainboard.our_color==I2C_COLOR_RED)? (x) : (!x)) +#define COLOR_Y(y) ((mainboard.our_color==I2C_COLOR_YELLOW)? (y) : (AREA_Y-(y))) +#define COLOR_A(a) ((mainboard.our_color==I2C_COLOR_YELLOW)? (a) : (-a)) +#define COLOR_SIGN(x) ((mainboard.our_color==I2C_COLOR_YELLOW)? (x) : (-x)) +#define COLOR_INVERT(x) ((mainboard.our_color==I2C_COLOR_YELLOW)? (x) : (!x)) /* area */ #define AREA_X 3000 @@ -45,20 +45,21 @@ /* * * - * - * - * +------------------------------------+ - * | | - * | | - * | | - * | | - * y | | - * | | - * |------ ------| - * | | | | - * | | | | - * +-----+------------------------+-----+ - * x + * vertical lines + * O 1 2 3 4 5 + * 2100 +-----|-----|-----|-----|-----|-----|-----+ + * | o o o | + * | o o o o | diag + * | o o o | lines + * 0/ o o o o \0 + * y | o o | + * 1/ o o \1 + * | | + * 2/------ ------\2 + * | | | | + * | | | | + * 0 +-----+-----------------------------+-----+ + * 0 x 3000 */ /* useful traj flags */ @@ -69,33 +70,44 @@ #define TRAJ_FLAGS_NO_NEAR_NO_TIMER (END_TRAJ|END_BLOCKING|END_OBSTACLE|END_INTR) #define TRAJ_FLAGS_SMALL_DIST (END_TRAJ|END_BLOCKING|END_INTR) +/* default acc */ +#define ACC_DIST 10. +#define ACC_ANGLE 10. + /* default speeds */ -#define SPEED_DIST_FAST 2500 -#define SPEED_ANGLE_FAST 2000 -#define SPEED_DIST_SLOW 1000 -#define SPEED_ANGLE_SLOW 1000 -#define SPEED_DIST_VERY_SLOW 400 -#define SPEED_ANGLE_VERY_SLOW 400 +#define SPEED_DIST_FAST 2500. +#define SPEED_ANGLE_FAST 2000. +#define SPEED_DIST_SLOW 1000. +#define SPEED_ANGLE_SLOW 1000. +#define SPEED_DIST_VERY_SLOW 400. +#define SPEED_ANGLE_VERY_SLOW 400. /* strat infos structures */ -struct bbox { +struct strat_bbox { int32_t x1; int32_t y1; int32_t x2; int32_t y2; }; -struct conf { +struct strat_conf { #define STRAT_CONF_XXX 0x01 uint8_t flags; }; +struct strat_status { +#define STRAT_STATUS_LHARVEST 0x01 +#define STRAT_STATUS_RHARVEST 0x02 + uint8_t flags; +}; + /* all infos related to strat */ struct strat_infos { uint8_t dump_enabled; - struct conf conf; - struct bbox area_bbox; + struct strat_conf conf; + struct strat_bbox area_bbox; + struct strat_status status; }; extern struct strat_infos strat_infos;