Caddy
A 2005 Roborodentia entry with vision and path planning capability
 All Data Structures Files Functions Variables Typedefs Macros Pages
node_list.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  */
32 #ifndef NODELIST_H_
33 #define NODELIST_H_
34 
35 #include <stdint.h>
36 #include <stdbool.h>
37 
39 #define NUM_NODES 43
40 
42 #define START_NODE 0
43 
44 #define START_HEADING -64
45 
46 #define STOP_NODE 42
47 
49 #define BALL_NODE_MIN 1
50 
51 #define BALL_NODE_MAX 20
52 
53 #define JUNCTION_MIN 21
54 
55 #define JUNCTION_MAX 41
56 
57 #define NUM_BALL_NODES (BALL_NODE_MAX - BALL_NODE_MAX + 1)
58 
59 
61 #define MAX_ADJ_NODES 3
62 
63 #define N_WEST -41
64 
65 #define S_EAST 87
66 
68 #define BONUS_BALL_1 24
69 
70 #define BONUS_BALL_2 30
71 
72 #define SENSOR_NODE 37
73 
75 #define BB1_HEADING 32
76 
77 #define BB2_HEADING -96
78 
80 #define NUM_FIXED_GOALS 3
81 
82 #define NUM_RANDOM_GOALS 3
83 
84 #define NUM_GOALS NUM_FIXED_GOALS + NUM_RANDOM_GOALS
85 
91 typedef struct GraphNode
92 {
96  uint8_t numAdjNodes;
109 } GraphNodeType;
110 
111 
112 inline bool isJunction( uint8_t nodeNum );
113 uint8_t getCostToNode(GraphNodeType *node, uint8_t nodeNum);
114 uint8_t getNodeAtHeading(GraphNodeType *node, int8_t heading);
115 inline bool isBallNode( uint8_t nodeNum );
116 void getNode( uint8_t nodeNum, GraphNodeType *node );
117 
118 
119 #endif // #ifndef NODELIST_H_