(1)上位机TCP客户端通信连接失败
1)ping IP地址
2)telnet IP 端口号
https://blog.csdn.net/l370398095/article/details/70598632
https://www.cnblogs.com/kangkai-bky/p/4326473.html
3)ubuntu中TCP/UDP调试助手
(2)根据通信协议数据解算失败
1)确定高低位
2)浮点数与十六进制的转换
https://blog.csdn.net/cheatscat/article/details/78533349?utm_medium=distribute.pc_relevant.none-task-blog-baidujs-1
https://zhidao.baidu.com/question/168352142.html
https://blog.csdn.net/weixin_34391854/article/details/88905179
char a[4];
a[0] = 0xB8;
a[1] = 0x1e;
a[2] = 0xdd;
a[3] = 0x40;
float f = *((float*)a);
printf("%f\n",f);
// 将十六进制转换为float形式
unsigned char pMem[] = {0x66,0xE6,0xF0,0x42};
float p = *((float*)pMem);
printf("%f\n",p);
// 将float转换为16进制
float a1=120.45f;
unsigned char * b = (unsigned char*)&a1;
for(int i = 0; i<4; i++)
printf("%x ,", b[i]);
3)用助手测试发送十六进制
https://blog.csdn.net/weixin_34240520/article/details/94708612
下发速度指令
rostopic pub -r 10 /cmd_vel geometry_msgs/Twist – ‘[2.0, 0.0, 0.0]’ ‘[0.0, 0.0, 1.8]’
观察助手接收到的消息,(要又发送才有接收),把接收到的数据再发回去,看odom是否解算正确
USB与tty串口号绑定
使用多线程
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)