2 * Copyright Droids, Microb Technology (2010)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Revision : $Id: strat.c,v 1.6 2009-11-08 17:24:33 zer0 Exp $
20 * Olivier MATZ <zer0@droids-corp.org>
23 #ifndef _STRAT_AVOID_H_
24 #define _STRAT_AVOID_H_
25 #define MAX_CIRCUIT_WPLINE 15
38 int8_t browse_circuits(uint8_t i, uint8_t j,
39 const struct wp_coord **selected_circuit,
40 int8_t *selected_face);
42 /* try to unblock in any situation */
43 uint8_t strat_unblock(void);
45 /* harvest on the best circuit */
46 uint8_t strat_harvest_circuit(void);
48 /* get the neighbour of the point at specified dir, return -1 if
49 * there is no neighbor */
50 int8_t wp_get_neigh(uint8_t i, uint8_t j, uint8_t *ni, uint8_t *nj,
53 /* count the number of non-black corns which are neighbors of
55 uint8_t corn_count_neigh(uint8_t i, uint8_t j);
57 /* return true if a waypoint belongs to a line */
58 uint8_t wp_belongs_to_line(uint8_t i, uint8_t j, uint8_t linenum, uint8_t dir);
60 uint8_t is_60deg(uint8_t dir1, uint8_t dir2);
61 uint8_t is_120deg(uint8_t dir1, uint8_t dir2);
63 void strat_avoid_init(void);