From 815ea18d897111c4bf70861277acf94201ccf60a Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期五, 14 十月 2022 16:25:59 +0800 Subject: [PATCH] V1.72 增加滤波器 增加频率可调 --- 源码/核心板/Src/application/dw_app.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" index 7858417..72fcfc2 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" @@ -939,6 +939,7 @@ u8 misdist_num[TAG_NUM_IN_SYS],seize_anchor,getrange_success=0; int32_t filter_dist,filter_speed; u8 newmeasure,recpoll_len; +float fiter_p; u8 Anchor_RecNearPoll(u8 ancrec_nearbasepos) //0 mainbase 1 first near_base { u8 motorstate; @@ -1079,7 +1080,12 @@ //filter_speed = vel_predict[taglist_pos]; newmeasure = 1; #else - filter_dist=hex_dist/10; + if(tagdist_list[taglist_pos]>0&&tagdist_list[taglist_pos]<50000) + { + filter_dist=(hex_dist/10)*fiter_p+(1-fiter_p)*tagdist_list[taglist_pos]; + }else{ + filter_dist = hex_dist/10; + } #endif misdist_num[taglist_pos]=0; tagdist_list[taglist_pos] = filter_dist; -- Gitblit v1.9.3