| | |
| | | |
| | | static double tof; |
| | | |
| | | uint32_t anchor_dist_last_frm[TAG_NUM_IN_SYS],his_dist[TAG_NUM_IN_SYS]; ; |
| | | int32_t anchor_dist_last_frm[TAG_NUM_IN_SYS],his_dist[TAG_NUM_IN_SYS]; ; |
| | | uint32_t tag_id = 0; |
| | | uint32_t tag_id_recv = 0; |
| | | uint8_t random_delay_tim = 0; |
| | |
| | | int8_t tag_delaytime; |
| | | extern uint16_t sync_timer; |
| | | u16 tmp_time; |
| | | int32_t temp_dist; |
| | | void Tag_App(void)//å鿍¡å¼(TAGæ ç¾) |
| | | { |
| | | uint32_t frame_len; |
| | |
| | | tag_succ_times++; |
| | | |
| | | LED0_BLINK; |
| | | |
| | | // temp_dist=anchor_dist_last_frm[0]; |
| | | // if(anchor_dist_last_frm[0]>1000000) |
| | | // { |
| | | // temp_dist=anchor_dist_last_frm[0]-0xffffffff; |
| | | // temp_dist+=0xffff; |
| | | // anchor_dist_last_frm[0]=temp_dist; |
| | | // } |
| | | |
| | | |
| | | usart_send[2] = 1;//æ£å¸¸æ¨¡å¼ |
| | | usart_send[3] = 17;//æ°æ®æ®µé¿åº¦ |
| | |
| | | // dist[TAG_ID] = LP(dis, TAG_ID); //LP 为ä½é滤波å¨ï¼è®©æ°æ®æ´ç¨³å® |
| | | |
| | | /*--------------------------以ä¸ä¸ºéæµè·é»è¾------------------------*/ |
| | | //dist_cm=33000; |
| | | |
| | | LED0_BLINK; //æ¯æå䏿¬¡é讯åéªç䏿¬¡ |
| | | g_UWB_com_interval = 0; |
| | | dis_after_filter=dist_cm; |
| | | hex_dist = (int16_t)(dist_cm+g_com_map[DIST_OFFSET]); |
| | | hex_dist = dist_cm+(int16_t)g_com_map[DIST_OFFSET]; |
| | | if(tag_id_recv-TAG_ID_START<=TAG_NUM_IN_SYS) |
| | | if(abs(hex_dist-his_dist[tag_id_recv-TAG_ID_START])<1000) |
| | | { |