wwwaa 发表于 2024-12-17 11:37 32 Kbytes of Flash memory |
蓝点无限 发表于 2024-12-16 23:38 这个代码用电脑已经通过了,但是移植到这边就会导致通讯出现问题,所以想问一下是不是flash不足可能会导致发生这种情况呢 |
wwwaa 发表于 2024-12-16 11:01 我们没有这样的代码,没法给你评论。 建议这个部分代码先写一段C语音测试程序用电脑测试。测试通过后再移植到MCU上 |
蓝点无限 发表于 2024-12-14 20:46 Program Size: Code=14100 RO-data=3028 RW-data=928 ZI-data=1912 想问一下bp50的flash有多大呀,是不是flash不够大呢? |
蓝点无限 发表于 2024-12-14 20:46 您好,我的定位代码是这样的 int zuixiao3d(vec3d* report,int use4thAnchor,vec3d* anchorArray,int* distanceArray) { if (use4thAnchor == 1) { float Res[4]; float BS1[3] = { anchorArray[0].x, anchorArray[0].y, anchorArray[0].z}; float BS2[3] = { anchorArray[1].x, anchorArray[1].y, anchorArray[1].z }; float BS3[3] = { anchorArray[2].x, anchorArray[2].y, anchorArray[2].z }; float BS4[3] = { anchorArray[3].x, anchorArray[3].y, anchorArray[3].z}; float pack_r_measure[4]; float A[16] = { 1, -2 * BS1[0], -2 * BS1[1], -2 * BS1[2], 1, -2 * BS2[0], -2 * BS2[1], -2 * BS2[2], 1, -2 * BS3[0], -2 * BS3[1], -2 * BS3[2], 1, -2 * BS4[0], -2 * BS4[1], -2 * BS4[2] }; float B[4]; for (int i = 0; i < 4; i++) { pack_r_measure = distanceArray / 1000.0 ; } B[0] = pack_r_measure[0] * pack_r_measure[0] - BS1[0] * BS1[0] - BS1[1] * BS1[1] - BS1[2] * BS1[2]; B[1] = pack_r_measure[1] * pack_r_measure[1] - BS2[0] * BS2[0] - BS2[1] * BS2[1] - BS2[2] * BS2[2]; B[2] = pack_r_measure[2] * pack_r_measure[2] - BS3[0] * BS3[0] - BS3[1] * BS3[1] - BS3[2] * BS3[2]; B[3] = pack_r_measure[3] * pack_r_measure[3] - BS4[0] * BS4[0] - BS4[1] * BS4[1] - BS4[2] * BS4[2]; // ?????? At ??? float At[16]; // ?????? Ax ??? float Ax[16]; // ?????? A_ ??? float A_[16]; // ?????? Ac ??? float Ac[16]; // ?????? Res ??? //Res[4]= (float *)malloc(4 * sizeof(float)); MatrixTrans(A, At,4,4); MatrixMul(At, A, Ax,4, 4, 4 ); MatrixInv1(Ax, A_,4,4); MatrixMul(A_, At, Ac,4, 4, 4 ); MatrixMul( Ac, B, Res,4, 4, 1); report->x=Res[1]; report->y=Res[2]; report->z=Res[3]; } else { float Res[2]; float BS1[3] = { anchorArray[0].x, anchorArray[0].y}; float BS2[3] = { anchorArray[1].x, anchorArray[1].y}; float BS3[3] = { anchorArray[2].x, anchorArray[2].y}; //float BS4[3] = { anchorArray[3].x, anchorArray[3].y}; float pack_r_measure[3]; float B[2]; for (int i = 0; i < 3; i++) { pack_r_measure = distanceArray / 1000.0 ; } float A[4] = { 2 * (BS1[0] -BS2[0]), 2 * (BS1[1]-BS2[1]), 2 * (BS1[0] -BS3[0]), 2 * (BS1[1]-BS3[1]) }; B[0] = pack_r_measure[1] * pack_r_measure[1]-pack_r_measure[0] * pack_r_measure[0] - BS2[0] * BS2[0] - BS2[1] * BS2[1]+ BS1[0] * BS1[0] + BS1[1] * BS1[1]; B[1] = pack_r_measure[2] * pack_r_measure[2]-pack_r_measure[0] * pack_r_measure[0] - BS3[0] * BS3[0] - BS3[1] * BS3[1]+ BS1[0] * BS1[0] + BS1[1] * BS1[1]; // ?????? At ??? float At[4]; // ?????? Ax ??? float Ax[4]; // ?????? A_ ??? float A_[4]; // ?????? Ac ??? float Ac[4]; // ?????? Res ??? //Res[4]= (float *)malloc(4 * sizeof(float)); MatrixTrans(A, At,2,2); MatrixMul(At, A, Ax,2, 2, 2 ); MatrixInv1(Ax, A_,2,2); MatrixMul(A_, At, Ac,2, 2, 2 ); MatrixMul( Ac, B, Res,2, 2, 1); report->x=Res[0]; report->y=Res[1]; report->z=0; } return 1; } distance_mange有关的使用是这样的 zuixiao3d(&Res,i,AnchorList,Anthordistance); sprintf(dist_str, "x:%3.2f", (float)Res.x); OLED_ShowString(0, 2,dist_str); sprintf(dist_str, "y:%3.2f", (float)Res.y); OLED_ShowString(0, 4,dist_str); sprintf(dist_str, "z:%3.2f", (float)Res.z); OLED_ShowString(0, 6,dist_str); 但是不知道为什么总是连接不到标签,删除掉就没有问题,所以能不能帮忙看一下哪里有问题呀 |
wwwaa 发表于 2024-12-14 19:23 程序没有调试,不能使用。所以不要在模块解算定位坐标信息。不要调用getlocation |
蓝点无限 发表于 2024-12-13 08:39 想问一下需要怎么返回呢?不太懂需要加什么程序?我只加了一个定位函数,需要把定位信息返回到基站吗?还是什么意思呢 |
wwwaa 发表于 2024-12-12 16:54 1. 固件程序不支持坐标解算。你说每次加了这部分代码标签灯不亮,可能是程序没有返回,导致无法再执行到UWB程序 2. qt上位机提示错误,具体错误信息是什么? 看你开始截图,上位机正常工作。 可能错误是log报错位置问题,这个可以忽略 |
蓝点无限 发表于 2024-12-11 21:38 还想问一下qt上位机运行连接connect的时候总显示程序异常错误大概是因为什么情况呢 |
GMT+8, 2024-12-23 06:03 , Processed in 0.016511 second(s), 7 queries , File On.
Powered by Discuz! X3.3
© 2001-2017 Comsenz Inc. Template By 【未来科技】【 www.wekei.cn 】