-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
67 lines (43 loc) · 1.52 KB
/
main.cpp
File metadata and controls
67 lines (43 loc) · 1.52 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
the main control system for flyer bot
will need to split this between a python-based main control program and c++ moter controler.
this program will have comments to represent yet to be defined inputs and functions.
note: 250 will be full throttle, 0 will be full stop.
note: use accelstepper for moters
*/
// Header Files
#pragma once
#include "Object.h"
#include "Flyer.h"
#include "placeholders.h" // a temporary file
#include <thread>
#include <AccelStepper.h> // may need to download this
int main()
{
// - varibles -
bool isRunning = true;
// object lists
// priority object list (for moving objects, i.e. humans)
Object* objects = new Object[10]; // 10 is a temp value
// stationary object list
Object* stationary = new Object[20]; // 20 is a temp value
// - setup thread proccesses -
proccesses[0] = new std::thread(updateObjectsThread());
// object update loop (thread)
std::thread objectUpdate(updateObjectsThread(objects, stationary, isRunning));
// retreives object data from AI cammera
// then, update object lists
// iterate though each list, first updating objects, then adding new objects.
// - main loops -
// primary loop
while(isRunning)
{
// check ground pointed sensors for change
// stop if a deviation is detected
if (/*any sensor value is outside than distance to ground range of values or becomes undefined*/)
{
// Stop
}
//
}
}