aboutsummaryrefslogtreecommitdiffstats
path: root/serial/serial.h
diff options
context:
space:
mode:
authorWe-unite <3205135446@qq.com>2024-06-22 22:36:45 +0800
committerWe-unite <3205135446@qq.com>2024-06-22 22:36:45 +0800
commit692b77cc3b1bb030ed83416d76b561d11a57d1e0 (patch)
tree45689c5bef06e981a9674e1b6400f705c8fd7a6b /serial/serial.h
parent80b5d9e1c8fa0fec8f3806da492049b10dfc96f8 (diff)
downloadWheelCtrl-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.h7
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))
23typedef unsigned char byte; 23typedef unsigned char byte;
24 24
25int identify_device(const char *port);
26const char *findUSBDev(const char *device_type);
27
25bool whellInit(); 28bool whellInit();
26bool wheelSend(byte a, byte a_v, byte b, byte b_v); 29bool wheelSend(byte a, byte a_v, byte b, byte b_v);
27void parseCmd(const lcm_recv_buf_t *rbuf, const char *channel, 30void 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,
29void parsePath(const lcm_recv_buf_t *rbuf, const char *channel, 32void parsePath(const lcm_recv_buf_t *rbuf, const char *channel,
30 const path_t *msg, void *userdata); 33 const path_t *msg, void *userdata);
31void setCurPose(const lcm_recv_buf_t *rbuf, const char *channel, 34void setCurPose(const lcm_recv_buf_t *rbuf, const char *channel,
32 const pose_t *msg, void *userdata); 35 const pose_t *msg, void *userdata);
33void renewCurPose(); 36void renewCurPose();
34void sendCurPose(); 37void sendCurPose();
35 38