-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (24 loc) · 714 Bytes
/
main.cpp
File metadata and controls
35 lines (24 loc) · 714 Bytes
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
#include "setting.h"
#include <thread>
#include "RoboMasterProcess.h"
#include "RemoteControl.h"
#include "can.h"
using namespace std;
using namespace cv;
int main(int argc, char*argv[]) {
Setting setting;
/// can init
char portname[20] = "can0";
int fd2car = CanOpen(portname);
//process frame and send angle to car
RoboMasterProcess roboProcess(&setting, fd2car);
std::thread t1(&RoboMasterProcess::Process, &roboProcess);
//receive car command
RemoteControl remoteProcess(&setting, fd2car);
std::thread t2(&RemoteControl::Receiver, remoteProcess);
t1.join();
t2.join();
std::cout << "Hello, World!" << std::endl;
close(fd2car);
return 0;
}