Caddy
A 2005 Roborodentia entry with vision and path planning capability
 All Data Structures Files Functions Variables Typedefs Macros Pages
ball_tracking.h
Go to the documentation of this file.
1 /*
2  * This file is part of Caddy.
3  *
4  * Caddy 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 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Caddy 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.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Caddy. If not, see <http://www.gnu.org/licenses/>.
16  */
25 #ifndef TRACKCOLOR_H_
26 #define TRACKCOLOR_H_
27 
28 // avr-libc
29 #include <stdint.h>
30 #include <stdbool.h>
31 
32 #define LOOK_RIGHT 1
33 #define LOOK_LEFT -1
34 #define LOOK_UP 0
35 
36 #define MX_NDX 0
37 #define MY_NDX 1
38 #define X1_NDX 2
39 #define Y1_NDX 3
40 #define X2_NDX 4
41 #define Y2_NDX 5
42 #define PIXEL_CNT_NDX 6
43 #define CONFIDENCE_NDX 7
44 
45 #define NUM_COLOR_STATS 8
46 
47 #define PAN_SEEK_OFFSET 66
48 
49 // Global variables
50 extern volatile bool colorStatsProcessed;
51 extern bool inSeekPosition;
52 
53 void trackColorInit(int8_t dir);
54 uint8_t getBallY( void );
55 bool seeBall( void );
56 bool cameraSeekLeft( uint8_t uncheckedBalls[][2], uint8_t numUncheckedBalls );
57 bool cameraSeekRight( uint8_t uncheckedBalls[][2], uint8_t numUncheckedBalls );
58 
59 #endif // #ifndef TRACKCOLOR_H_