diff options
author | 2024-06-22 22:36:45 +0800 | |
---|---|---|
committer | 2024-06-22 22:36:45 +0800 | |
commit | 692b77cc3b1bb030ed83416d76b561d11a57d1e0 (patch) | |
tree | 45689c5bef06e981a9674e1b6400f705c8fd7a6b /serial/serial.h | |
parent | 80b5d9e1c8fa0fec8f3806da492049b10dfc96f8 (diff) | |
download | WheelCtrl-692b77cc3b1bb030ed83416d76b561d11a57d1e0.tar.gz WheelCtrl-692b77cc3b1bb030ed83416d76b561d11a57d1e0.zip |
Fix bugs, now it can deal with curpose rightly
Diffstat (limited to 'serial/serial.h')
-rw-r--r-- | serial/serial.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/serial/serial.h b/serial/serial.h index 8061b24..7f09bf8 100644 --- a/serial/serial.h +++ b/serial/serial.h | |||
@@ -17,11 +17,14 @@ | |||
17 | #define MAX_BUFFER_SIZE 1024 | 17 | #define MAX_BUFFER_SIZE 1024 |
18 | #define DEFAULT_SPEED 0x15 // 默认速度,百分比 | 18 | #define DEFAULT_SPEED 0x15 // 默认速度,百分比 |
19 | // TODO: 两个待测数据 | 19 | // TODO: 两个待测数据 |
20 | #define RADIUS 0.3 // 两轮之间的距离的一半,米 | 20 | #define RADIUS 0.26 // 两轮之间的距离的一半,米 |
21 | #define FULLSPEED 1.5 // 轮子全速,m/s | 21 | #define FULLSPEED 1.5 // 轮子全速,m/s |
22 | #define fabs(x) ((x) > 0 ? (x) : -(x)) | 22 | #define fabs(x) ((x) > 0 ? (x) : -(x)) |
23 | typedef unsigned char byte; | 23 | typedef unsigned char byte; |
24 | 24 | ||
25 | int identify_device(const char *port); | ||
26 | const char *findUSBDev(const char *device_type); | ||
27 | |||
25 | bool whellInit(); | 28 | bool whellInit(); |
26 | bool wheelSend(byte a, byte a_v, byte b, byte b_v); | 29 | bool wheelSend(byte a, byte a_v, byte b, byte b_v); |
27 | void parseCmd(const lcm_recv_buf_t *rbuf, const char *channel, | 30 | void parseCmd(const lcm_recv_buf_t *rbuf, const char *channel, |
@@ -29,7 +32,7 @@ void parseCmd(const lcm_recv_buf_t *rbuf, const char *channel, | |||
29 | void parsePath(const lcm_recv_buf_t *rbuf, const char *channel, | 32 | void parsePath(const lcm_recv_buf_t *rbuf, const char *channel, |
30 | const path_t *msg, void *userdata); | 33 | const path_t *msg, void *userdata); |
31 | void setCurPose(const lcm_recv_buf_t *rbuf, const char *channel, | 34 | void setCurPose(const lcm_recv_buf_t *rbuf, const char *channel, |
32 | const pose_t *msg, void *userdata); | 35 | const pose_t *msg, void *userdata); |
33 | void renewCurPose(); | 36 | void renewCurPose(); |
34 | void sendCurPose(); | 37 | void sendCurPose(); |
35 | 38 | ||