aboutsummaryrefslogtreecommitdiffstats
path: root/serial/serial.h
diff options
context:
space:
mode:
Diffstat (limited to 'serial/serial.h')
-rw-r--r--serial/serial.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/serial/serial.h b/serial/serial.h
new file mode 100644
index 0000000..8061b24
--- /dev/null
+++ b/serial/serial.h
@@ -0,0 +1,36 @@
1#ifndef SERIAL_H
2#define SERIAL_H
3
4#include "path_ctrl_t.h"
5#include "path_t.h"
6#include "pose_t.h"
7#include <errno.h>
8#include <fcntl.h>
9#include <pthread.h>
10#include <stdbool.h>
11#include <stdio.h>
12#include <stdlib.h>
13#include <string.h>
14#include <termios.h>
15#include <unistd.h>
16
17#define MAX_BUFFER_SIZE 1024
18#define DEFAULT_SPEED 0x15 // 默认速度,百分比
19// TODO: 两个待测数据
20#define RADIUS 0.3 // 两轮之间的距离的一半,米
21#define FULLSPEED 1.5 // 轮子全速,m/s
22#define fabs(x) ((x) > 0 ? (x) : -(x))
23typedef unsigned char byte;
24
25bool whellInit();
26bool wheelSend(byte a, byte a_v, byte b, byte b_v);
27void parseCmd(const lcm_recv_buf_t *rbuf, const char *channel,
28 const path_ctrl_t *msg, void *userdata);
29void parsePath(const lcm_recv_buf_t *rbuf, const char *channel,
30 const path_t *msg, void *userdata);
31void setCurPose(const lcm_recv_buf_t *rbuf, const char *channel,
32 const pose_t *msg, void *userdata);
33void renewCurPose();
34void sendCurPose();
35
36#endif \ No newline at end of file