|
使用的是BP50代码,但是将基站修改成6标签代码,出现通讯成功,但是测距没有显示问题。图片一些字母是为了确定调试程序那一部分出现的问题。
static void compute_angle_send_to_anthor0(int distance1, int distance2,int distance3,int distance4,int distance5,int distance6)函数以及修改过了,最大的基站数量以及基站位置的初始化。程序在这一部分没有满足 if (status_reg & SYS_STATUS_RXFCG)
{
OLED_ShowString(0,6,"tiaook");
/* 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,"444ok");
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++;
}
}
}
}不知道是不是延迟问题,/* 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 2600
/* 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
/* Receive final timeout. See NOTE 5 below. */
#define FINAL_RX_TIMEOUT_UUS 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 3800 //2700 will fail
/* Receive response timeout. See NOTE 5 below. */
#define RESP_RX_TIMEOUT_UUS 2700
想问一下应该怎么修改呢
|
|