X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=projects%2Fmicrob2010%2Fmainboard%2Fstrat.h;h=9fa720af8714094cc04c873535fd1f469a7a0d41;hp=0a31073f9f227af7be09628dea5edad2279c1e2b;hb=9d056416278ae5d772a0fc1f7d2d11a4461fb673;hpb=b022f257a5ee568737e1a684a83d0154397fffcb diff --git a/projects/microb2010/mainboard/strat.h b/projects/microb2010/mainboard/strat.h index 0a31073..9fa720a 100644 --- a/projects/microb2010/mainboard/strat.h +++ b/projects/microb2010/mainboard/strat.h @@ -42,24 +42,84 @@ #define CORNER_X 3000 #define CORNER_Y COLOR_Y(2100) +/* XXX these offset are not related to corn, but to waypoints */ +#define OFFSET_CORN_X 150 +#define OFFSET_CORN_Y 222 +#define STEP_CORN_X 225 +#define STEP_CORN_Y 250 + +#define CORN_NB 18 +#define TOMATO_NB 14 + +#define WAYPOINTS_NBX 13 +#define WAYPOINTS_NBY 8 + /* - * + * Corn position and lines, valid for YELLOW. * * 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 - * | | | | - * | | | | + * | c5 c9 c14 | + * | c2 c7 c11 c17 | diag + * | c4 c8 c13 | lines + * 0/ c1 c6 c10 c16 \0 + * y | c3 c12 | + * 1/ c0 c15 \1 + * |-----+ +-----| + * 2/ | | \2 + * | Yellow Blue | * 0 +-----+-----------------------------+-----+ * 0 x 3000 + * + * Ball (tomato) and i,j coords (for waypoints) + * + * 2100 +--0--1--2--3--4--5--6--7--8--9-10-11-12--+ + * 7 t5 t9 | + * 6 t3 t7 t11 | + * 5 t1 t4 t8 t13 | + * 4 t2 t6 t10 | + * y 3 t0 t12 | + * 2 | + * 1-----+ +-----| + * 0 | | | + * | Yellow Blue | + * 0 +-----+-----------------------------+-----+ + * 0 x 3000 + * + * + * Corn position and lines, valid for BLUE. + * + * vertical lines + * 5 4 3 2 1 0 + * 0 +-----|-----|-----|-----|-----|-----|-----+ + * | c14 c9 c5 | + * | c17 c11 c7 c2 | diag + * | c13 c8 c4 | lines + * 0/ c16 c10 c6 c1 \0 + * y | c12 c3 | + * 1/ c15 c0 \1 + * |-----+ +-----| + * 2/ | | \2 + * | Yellow Blue | + * 2100 +-----+-----------------------------+-----+ + * 3000 x 0 + * + * Ball (tomato) and i,j coords (for waypoints) + * + * 0 +-12-11-10--9--8--7--6--5--4--3--2--1--0--+ + * 7 t9 t5 | + * 6 t11 t7 t3 | + * 5 t13 t8 t4 t1 | + * 4 t10 t6 t2 | + * y 3 t12 t0 | + * 2 | + * 1-----+ +-----| + * 0 | | | + * | Yellow Blue | + * 2100 +-----+-----------------------------+-----+ + * 3000 x 0 + * */ /* useful traj flags */ @@ -71,8 +131,8 @@ #define TRAJ_FLAGS_SMALL_DIST (END_TRAJ|END_BLOCKING|END_INTR) /* default acc */ -#define ACC_DIST 10. -#define ACC_ANGLE 10. +#define ACC_DIST 15. +#define ACC_ANGLE 15. /* default speeds */ #define SPEED_DIST_FAST 2500. @@ -83,38 +143,17 @@ #define SPEED_ANGLE_VERY_SLOW 400. /* strat infos structures */ - -struct strat_bbox { - int32_t x1; - int32_t y1; - int32_t x2; - int32_t y2; -}; - struct strat_conf { -#define STRAT_CONF_XXX 0x01 - uint8_t flags; -}; + uint8_t dump_enabled; -struct strat_status { -#define STRAT_STATUS_LHARVEST 0x01 -#define STRAT_STATUS_RHARVEST 0x02 +#define STRAT_CONF_XXX 0x01 uint8_t flags; }; -/* all infos related to strat */ -struct strat_infos { - uint8_t dump_enabled; - struct strat_conf conf; - struct strat_bbox area_bbox; - struct strat_status status; -}; -extern struct strat_infos strat_infos; +extern struct strat_conf strat_conf; /* in strat.c */ -void strat_dump_infos(const char *caller); /* show current known state - of area */ -void strat_dump_conf(void); +void strat_conf_dump(const char *caller); void strat_reset_infos(void); /* reset current known state */ void strat_preinit(void); void strat_init(void);