From 9bb3f8c668f09d5a075a8d62584187203719388a Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 23 Oct 2023 12:30:37 -0400 Subject: [PATCH] kalmanfilter: genx symlinks -> canned baseline data --- utest/CMakeLists.txt | 5 +- utest/KalmanFilter.test.cpp | 3 - utest/utestdata/filter/kalman-revert1 | 100 ++++++++++++++++++++++++++ 3 files changed, 104 insertions(+), 4 deletions(-) create mode 100644 utest/utestdata/filter/kalman-revert1 diff --git a/utest/CMakeLists.txt b/utest/CMakeLists.txt index 9f21bfa4..a118b8a7 100644 --- a/utest/CMakeLists.txt +++ b/utest/CMakeLists.txt @@ -13,9 +13,12 @@ add_test(NAME ${SELF_EXE} COMMAND ${SELF_EXE}) target_code_coverage(${SELF_EXE} AUTO ALL) # ---------------------------------------------------------------- -# create convenience symlink to canned data +# create convenience symlink from build dir back to canned data. +# This is ok since we don't implement install for unit tests #create_symlink("${CMAKE_SOURCE_DIR}/utestdata/" "src/filter/utest/utestdata") +file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/utest/utestdata) +file(CREATE_LINK ${PROJECT_SOURCE_DIR}/utest/utestdata/filter ${PROJECT_BINARY_DIR}/utest/utestdata/filter SYMBOLIC) # ---------------------------------------------------------------- # generic project dependency diff --git a/utest/KalmanFilter.test.cpp b/utest/KalmanFilter.test.cpp index 679f461f..c0b35601 100644 --- a/utest/KalmanFilter.test.cpp +++ b/utest/KalmanFilter.test.cpp @@ -29,9 +29,6 @@ namespace xo { using xo::ref::rp; using xo::log_level; using logutil::matrix; - //using logutil::scope; - //using logutil::tostr; - //using logutil::xtag; using xo::print::ccs; using Eigen::MatrixXd; using Eigen::VectorXd; diff --git a/utest/utestdata/filter/kalman-revert1 b/utest/utestdata/filter/kalman-revert1 new file mode 100644 index 00000000..343af232 --- /dev/null +++ b/utest/utestdata/filter/kalman-revert1 @@ -0,0 +1,100 @@ +step z0 x0 P00 K0 +1 1.33055 1.28103 0.195775 0.783099 +2 1.26559 1.2664 0.103557 0.414227 +3 0.790814 1.1272 0.0680813 0.272325 +4 0.173362 0.933668 0.0493859 0.197543 +5 2.12197 1.11662 0.0378989 0.151595 +6 1.00197 1.09766 0.0301647 0.120659 +7 -0.312247 0.954347 0.0246315 0.0985261 +8 1.76439 1.02286 0.020499 0.081996 +9 0.518422 0.986867 0.0173123 0.0692491 +10 0.756683 0.973864 0.0147938 0.0591754 +11 -0.609708 0.894249 0.0127646 0.0510585 +12 0.330435 0.874259 0.011104 0.0444159 +13 1.03713 0.886639 0.00972751 0.03891 +14 -0.994029 0.827609 0.00857454 0.0342982 +15 1.58353 0.858947 0.00760022 0.0304009 +16 0.494725 0.855945 0.00677073 0.0270829 +17 1.0205 0.866962 0.00606004 0.0242401 +18 1.98651 0.897865 0.00544782 0.0217913 +19 1.70559 0.918761 0.00491797 0.0196719 +20 1.44881 0.932201 0.00445755 0.0178302 +21 2.16318 0.955508 0.00405605 0.0162242 +22 0.353787 0.948782 0.00370485 0.0148194 +23 1.72676 0.961879 0.00339684 0.0135874 +24 -1.55312 0.932313 0.00312606 0.0125043 +25 -0.523229 0.918847 0.00288753 0.0115501 +26 1.81676 0.932476 0.00267702 0.0107081 +27 1.65387 0.943006 0.00249094 0.00996377 +28 -0.766534 0.929922 0.00232623 0.00930491 +29 1.1143 0.935004 0.00218024 0.00872095 +30 0.908743 0.938011 0.0020507 0.00820282 +31 1.80832 0.947825 0.00193566 0.00774263 +32 1.61306 0.955293 0.00183339 0.00733354 +33 1.10591 0.958563 0.0017424 0.00696961 +34 1.54404 0.964512 0.0016614 0.00664561 +35 1.47595 0.969526 0.00158925 0.00635699 +36 -1.16643 0.958012 0.00152494 0.00609975 +37 2.772 0.970748 0.00146759 0.00587036 +38 0.0147533 0.966786 0.00141643 0.00566572 +39 1.5648 0.971716 0.00137077 0.00548308 +40 0.758209 0.971987 0.00133001 0.00532003 +41 0.602221 0.971467 0.0012936 0.00517441 +42 1.02795 0.973171 0.00126108 0.00504433 +43 1.61126 0.977651 0.00123203 0.0049281 +44 3.23237 0.98964 0.00120606 0.00482423 +45 -1.20629 0.979766 0.00118284 0.00473137 +46 2.34054 0.987098 0.00116209 0.00464835 +47 1.886 0.991852 0.00114353 0.00457412 +48 1.62241 0.9951 0.00112693 0.00450773 +49 0.10733 0.991395 0.00111209 0.00444835 +50 0.111089 0.987954 0.00109881 0.00439523 +51 -0.045289 0.984062 0.00108693 0.00434771 +52 0.339478 0.98208 0.0010763 0.0043052 +53 -0.109018 0.978316 0.00106679 0.00426715 +54 -1.15684 0.970358 0.00105828 0.00423311 +55 -0.289587 0.966538 0.00105066 0.00420265 +56 1.04772 0.968543 0.00104385 0.00417538 +57 -0.0931435 0.965703 0.00103774 0.00415098 +58 2.56415 0.974011 0.00103228 0.00412914 +59 0.352559 0.972751 0.0010274 0.00410959 +60 0.173725 0.970838 0.00102302 0.00409209 +61 0.80765 0.971625 0.00101911 0.00407643 +62 2.41789 0.978913 0.0010156 0.0040624 +63 2.63322 0.986663 0.00101246 0.00404985 +64 2.59753 0.993833 0.00100965 0.00403861 +65 0.530642 0.992274 0.00100714 0.00402855 +66 1.24782 0.993686 0.00100489 0.00401955 +67 0.695031 0.992802 0.00100287 0.00401149 +68 2.80672 1.00042 0.00100107 0.00400427 +69 0.122651 0.996894 0.000999451 0.0039978 +70 1.22154 0.997945 0.000998005 0.00399202 +71 0.269797 0.995145 0.00099671 0.00398684 +72 1.78662 0.998538 0.00099555 0.0039822 +73 0.4817 0.996555 0.000994512 0.00397805 +74 1.05221 0.996948 0.000993582 0.00397433 +75 1.75822 1.00012 0.00099275 0.003971 +76 1.31536 1.00137 0.000992005 0.00396802 +77 1.29006 1.00244 0.000991338 0.00396535 +78 0.857458 1.00175 0.000990741 0.00396296 +79 0.269498 0.998761 0.000990206 0.00396082 +80 0.131184 0.995388 0.000989727 0.00395891 +81 0.736283 0.994592 0.000989298 0.00395719 +82 -0.32478 0.989642 0.000988914 0.00395566 +83 1.3352 0.991525 0.00098857 0.00395428 +84 0.279734 0.989133 0.000988263 0.00395305 +85 1.74807 0.992673 0.000987987 0.00395195 +86 1.82522 0.996328 0.00098774 0.00395096 +87 -0.281213 0.991464 0.000987519 0.00395008 +88 1.61161 0.994338 0.000987322 0.00394929 +89 2.63571 1.0011 0.000987144 0.00394858 +90 -0.139888 0.996542 0.000986986 0.00394794 +91 3.48906 1.00655 0.000986844 0.00394738 +92 2.01113 1.01019 0.000986717 0.00394687 +93 1.84914 1.01299 0.000986603 0.00394641 +94 0.480262 1.01025 0.000986501 0.003946 +95 1.45288 1.01148 0.00098641 0.00394564 +96 -0.0838873 1.00659 0.000986328 0.00394531 +97 -0.570744 1.00004 0.000986255 0.00394502 +98 -0.214659 0.995244 0.000986189 0.00394476 +99 1.7904 0.998618 0.000986131 0.00394452