X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=projects%2Fmicrob2010%2Fmainboard%2Fstrat_avoid.h;h=4afe0320bff98737701a549473590cd2e4f8e12d;hp=0978fd74a0047e95725a1d1bdfbae2f0b61c54ae;hb=17aadc4c8c3e60c2b5e6bbba91c8542849addbd7;hpb=5918edd6f4f713ef3c8b0b0020dd30a4fb8222ae diff --git a/projects/microb2010/mainboard/strat_avoid.h b/projects/microb2010/mainboard/strat_avoid.h index 0978fd7..4afe032 100644 --- a/projects/microb2010/mainboard/strat_avoid.h +++ b/projects/microb2010/mainboard/strat_avoid.h @@ -1,6 +1,6 @@ -/* - * Copyright Droids Corporation, Microb Technology (2009) - * +/* + * Copyright Droids, Microb Technology (2010) + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -15,16 +15,33 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Revision : $Id: strat_avoid.h,v 1.5 2009-11-08 17:24:33 zer0 Exp $ + * Revision : $Id: strat.c,v 1.6 2009-11-08 17:24:33 zer0 Exp $ * + * Olivier MATZ */ -void set_opponent_poly(poly_t *pol, int16_t w, int16_t l); -int8_t goto_and_avoid(int16_t x, int16_t y, uint8_t flags_intermediate, - uint8_t flags_final); -int8_t goto_and_avoid_backward(int16_t x, int16_t y, - uint8_t flags_intermediate, - uint8_t flags_final); -int8_t goto_and_avoid_forward(int16_t x, int16_t y, - uint8_t flags_intermediate, - uint8_t flags_final); +#ifndef _STRAT_AVOID_H_ +#define _STRAT_AVOID_H_ +#define MAX_CIRCUIT_WPLINE 15 + +struct wp_coord { + uint8_t i:4; + uint8_t j:3; + uint8_t end:1; +}; + +struct wp_line { + uint8_t line_num:4; + uint8_t dir:4; +}; + +int8_t browse_circuits(uint8_t i, uint8_t j, + const struct wp_coord **selected_circuit, + int8_t *selected_face); + +/* harvest on the best circuit */ +uint8_t strat_harvest_circuit(void); + +void test_strat_avoid(void); + +#endif