蓝点无限 发表于 2023-5-17 17:25 你好,想问一下我的6基站,根据原来的代码增加到6基站发送通信,然后通过增加延迟所有基站都可以成功发送和接受,但是屏幕没有输出距离,貌似卡在了 /* Increment frame sequence number after transmission of the poll message (modulo 256). */ if (status_reg & SYS_STATUS_RXFCG) { /* Clear good/fail RX frame event in the DW1000 status register. */ dwt_write32bitreg(SYS_STATUS_ID, SYS_STATUS_RXFCG | SYS_STATUS_TXFRS); /* A frame has been received, read it into the local buffer. */ frame_len = dwt_read32bitreg(RX_FINFO_ID) & RX_FINFO_RXFLEN_MASK; if (frame_len <= RX_BUF_LEN) { dwt_readrxdata(rx_buffer, frame_len, 0); } if(rx_buffer[ALL_MSG_TAG_IDX] != TAG_ID) continue; rx_buffer[ALL_MSG_TAG_IDX] = 0; /*As the sequence number field of the frame is not relevant, it is cleared to simplify the validation of the frame. */ rx_buffer[ALL_MSG_SN_IDX] = 0; OLED_ShowString(0,2,"ok"); if (memcmp(rx_buffer, distance_msg, ALL_MSG_COMMON_LEN) == 0) { // final_distance = rx_buffer[10] + (float)rx_buffer[11]/100; Anthordistance[rx_buffer[12]] +=(rx_buffer[10]*1000 + rx_buffer[11]*10); Anthordistance_count[rx_buffer[12]] ++; OLED_ShowString(0,4,"buff"); { int Anchor_Index = 0; while(Anchor_Index < ANCHOR_MAX_NUM) { OLED_ShowString(0,0," 444"); if(Anthordistance_count[Anchor_Index] >=ANCHOR_REFRESH_COUNT ) { distance_mange(); OLED_ShowString(0,6," 51UWB Node"); Anchor_Index = 0; //clear all while(Anchor_Index < ANCHOR_MAX_NUM) { Anthordistance_count[Anchor_Index] = 0; Anthordistance[Anchor_Index] = 0; Anchor_Index++; } break; } Anchor_Index++; } } } }这里,延迟是这样#define UUS_TO_DWT_TIME 65536 /* Delay between frames, in UWB microseconds. See NOTE 4 below. */ /* This is the delay from Frame RX timestamp to TX reply timestamp used for calculating/setting the DW1000's delayed TX function. This includes the * frame length of approximately 2.46 ms with above configuration. */ #define POLL_RX_TO_RESP_TX_DLY_UUS 3000 // /* This is the delay from the end of the frame transmission to the enable of the receiver, as programmed for the DW1000's wait for response feature. */ #define RESP_TX_TO_FINAL_RX_DLY_UUS 500 //500 /* Receive final timeout. See NOTE 5 below. */ #define FINAL_RX_TIMEOUT_UUS 3300 //3300 /* Delay between frames, in UWB microseconds. See NOTE 4 below. */ /* This is the delay from the end of the frame transmission to the enable of the receiver, as programmed for the DW1000's wait for response feature. */ #define POLL_TX_TO_RESP_RX_DLY_UUS 150//150 /* This is the delay from Frame RX timestamp to TX reply timestamp used for calculating/setting the DW1000's delayed TX function. This includes the * frame length of approximately 2.66 ms with above configuration. */ #define RESP_RX_TO_FINAL_TX_DLY_UUS 3500 //2700 will fail /* Receive response timeout. See NOTE 5 below. */ #define RESP_RX_TIMEOUT_UUS 2700 //2700 想问一下怎么改呢 |
你发现的状况符合预期,肯定是数据量越大越慢。而且每个基站都自己传串口数据出去,占用大量的时间,导致UWB测距的时间占用比降低 你已经实现了,为何说怎么修改代码? |
GMT+8, 2025-5-25 03:54 , Processed in 0.018622 second(s), 9 queries , File On.
Powered by Discuz! X3.3
© 2001-2017 Comsenz Inc. Template By 【未来科技】【 www.wekei.cn 】