amiro-os / devices / DiWheelDrive / amiro_map.hpp @ e1f1c4b5
History | View | Annotate | Download (671 Bytes)
1 |
#ifndef AMIRO_MAP
|
---|---|
2 |
#define AMIRO_MAP
|
3 |
|
4 |
#include <ch.hpp> |
5 |
#include "global.hpp" |
6 |
#include <amiroosconf.h> |
7 |
|
8 |
|
9 |
#define MAX_NODES 20 |
10 |
#define NODE_ATTRIBUTES 4 |
11 |
|
12 |
|
13 |
namespace amiro {
|
14 |
|
15 |
|
16 |
struct node{
|
17 |
uint8_t id; |
18 |
uint8_t flag; |
19 |
types::position pL; //Left
|
20 |
types::position pR; //Right
|
21 |
types::position pB; //Back
|
22 |
}; |
23 |
|
24 |
class AmiroMap{ |
25 |
public:
|
26 |
AmiroMap(Global *global):global{global}{} |
27 |
void initialize(int8_t (&config)[MAX_NODES][NODE_ATTRIBUTES]);
|
28 |
void update();
|
29 |
private:
|
30 |
Global *global; |
31 |
bool valid = false; |
32 |
node *nodeList = NULL;
|
33 |
node *current = NULL;
|
34 |
node *next = NULL;
|
35 |
void uninitialize();
|
36 |
}; |
37 |
}; |
38 |
|
39 |
|
40 |
#endif /* AMIRO_MAP */ |