-
Notifications
You must be signed in to change notification settings - Fork 0
/
robot_state.h
executable file
·44 lines (35 loc) · 920 Bytes
/
robot_state.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef _ROBOT_STATE_H_
#define _ROBOT_STATE_H_
#include <robot_link.h>
#include <stopwatch.h>
#include <queue>
#include "line_following.h"
struct vertex;
struct edge;
struct world_map;
struct robot_state {
robot_link *link;
// Sensor values are updated by sensor routine at max rate.
static const int N_LINE_SENSORS = 4;
bool line_sens[N_LINE_SENSORS];
bool bump_left, bump_right;
bool claw_closed;
float light_sensor;
// State variables are updated at path endpoints (pickup and drop off)
// If a fake egg is detected at pickup, have_egg will be true and the others false
bool have_egg;
bool have_chick;
bool have_white;
int eggs_processed;
stopwatch watch;
float integral;
bool at_junction;
float current_dirx, current_diry;
vertex *current, *target;
std::vector<edge*> current_path;
line_state_t line_state;
world_map *map;
robot_state();
~robot_state();
};
#endif // _ROBOT_STATE_H_