{"id":726,"date":"2016-12-01T16:30:48","date_gmt":"2016-12-02T01:30:48","guid":{"rendered":"\/blog\/?p=726"},"modified":"2023-09-21T09:37:51","modified_gmt":"2023-09-21T00:37:51","slug":"kalman-filter-%ec%98%88%ec%a0%9c-%ec%86%8c%ec%8a%a4%ec%bd%94%eb%93%9c","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=726","title":{"rendered":"Kalman Filter \uc608\uc81c \uc18c\uc2a4\ucf54\ub4dc"},"content":{"rendered":"\n<p><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;;\">\ucd9c\ucc98 :&nbsp;<a href=\"http:\/\/blog.naver.com\/housemoon\/96039559\" target=\"_blank\" rel=\"noopener\">http:\/\/blog.naver.com\/housemoon\/96039559<\/a><\/span><\/p>\r\n<span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;;\">\r\n<\/span><p><br \/><\/p>\r\n<span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;;\">\r\n<\/span><pre style=\"margin-top: 0px; margin-bottom: 0px; padding: 4px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(255, 255, 255); color: rgb(59, 59, 59);\"><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc81c \ubaa9: RS232 \ud1b5\uc2e0 \ud504\ub85c\uadf8\ub7a8<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc9c1\ub82c\ud3ec\ud2b8\ub97c \uc774\uc6a9\ud558\uc5ec \ub370\uc774\ud0c0 \ud1b5\uc2e0\ud558\ub294<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc77c\ubc18\uc801\uc778 \uc21c\uc11c<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ (1) \uc9c1\ub82c\ud3ec\ud2b8\ub97c \uc5f0\ub2e4(open)<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ (2) \uc9c1\ub82c\ud3ec\ud2b8\uc758 \uac01\uc885 \uc124\uc815\uac12\uc744 \ubcc0\uacbd\ud55c\ub2e4<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ (3) \uc77d\uae30\uc640 \uc4f0\uae30 \ud0c0\uc784\uc544\uc6c3\uc744 \uc124\uc815\ud55c\ub2e4<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ (4) \uc9c1\ub82c\ud3ec\ud2b8\ub85c\ubd80\ud130 \ub370\uc774\ud0c0\ub97c \uc77d\uac70(read)\ub098 \uc4f4\ub2e4(write)<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ (5) \uc9c1\ub82c\ud3ec\ud2b8\ub97c \ub2eb\ub294\ub2e4(close)<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ * (1),(4),(5)\ub294 \ud30c\uc77c \uc785\ucd9c\ub825 \ubaa8\ub378\uacfc \uac1c\ub150\uc801\uc744 \ub3d9\uc77c\ud558\uba70,<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/   \ud30c\uc77c\uc785\ucd9c\ub825 \ud568\uc218\ub97c \uadf8\ub300\ub85c \uc0ac\uc6a9\ud568<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ * (2),(3)\uc740 \uc9c1\ub82c\ud1b5\uc2e0\uc5d0\ub9cc \ud574\ub2f9\ud558\uba70, \uc9c1\ub82c\ud1b5\uc2e0\uc744 \uc704\ud55c \uc804\uc6a9\ud568\uc218\ub97c \uc0ac\uc6a9\ud568<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n\r\n\r\n#<\/span><span style=\"color: rgb(0, 102, 153); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">include<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(102, 102, 102); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">&lt;windows.h&gt;<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n#<\/span><span style=\"color: rgb(0, 102, 153); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">include<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(102, 102, 102); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">&lt;stdlib.h&gt;<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n#<\/span><span style=\"color: rgb(0, 102, 153); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">include<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(102, 102, 102); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">&lt;stdio.h&gt;<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n#<\/span><span style=\"color: rgb(0, 102, 153); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">include<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(102, 102, 102); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">&lt;math.h&gt;<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n#<\/span><span style=\"color: rgb(0, 102, 153); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">include<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(102, 102, 102); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">&lt;iostream&gt;<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n#<\/span><span style=\"color: rgb(0, 102, 153); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">include<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(102, 102, 102); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">&lt;time.h&gt;<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/\ub79c\ub364 \ud568\uc218\ub97c \uc704\ud574.<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n#<\/span><span style=\"color: rgb(0, 102, 153); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">include<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(102, 102, 102); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">&lt;GL\/glut.h&gt;<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n#<\/span><span style=\"color: rgb(0, 102, 153); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">include<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(102, 102, 102); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">&lt;GL\/glu.h&gt;<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n#<\/span><span style=\"color: rgb(0, 102, 153); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">include<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(102, 102, 102); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">&lt;GL\/glaux.h&gt;<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/---[ pi \uac12 \uc124\uc815 ]<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n#<\/span><span style=\"color: rgb(0, 102, 153); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">define<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">PI<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> 3.141592\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/---[ \ubc84\ud37c\uc0ac\uc774\uc988 \uc124\uc815 ]<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n#<\/span><span style=\"color: rgb(0, 102, 153); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">define<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">BUFSIZE<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> 22\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc804\uc5f0\ubcc0\uc218 \uc120\uc5b8\ubd80<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ main<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">int<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> counter = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">1<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">int<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> TenSec = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">0<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;                 <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ 120Hz\uc774\ubbc0\ub85c 10\ucd08\uc778 1200\ud68c\ub97c \uc218\ud589\ud558\ub3c4\ub85d \ud558\uae30 \uc704\ud55c \uc778\ub371\uc2a4 \ubcc0\uc218<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> Voltage = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">3.3<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;           <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub2e8\uc704 : V<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> Resolution = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">1024<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;       <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ubd84\ud574\ub2a5 = 2^10<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> dt = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">1<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> \/ <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">20<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;             <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc2dc\uac04 \uac04\uaca9.<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> Final_Pitch = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">0<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> Final_Roll = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">0<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ Gyro<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> Gyro_sens = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">0.002<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;                               <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub2e8\uc704 : V\/degrees\/sec<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> Scalefactor = Voltage \/ Resolution \/ Gyro_sens;  <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub300\ub7b5 1.611328<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ For Accel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> Accel_sens = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">0.8<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;                <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub2e8\uc704 : V\/g   \/\/ 1.5g \uc774\uae30 \ub54c\ubb38\uc5d0<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> unit = Voltage \/ Resolution;     <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub300\ub7b5 3.222656mV\/bit<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/---[ \ub370\uc774\ud130 \ud1b5\uc2e0\uc5d0 \uc0ac\uc6a9\ud560 \ubcc0\uc218 ]<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">unsigned<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">char<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> buf[BUFSIZE + <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">1<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">];\r\nDWORD BytesRead;\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">int<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> retval;\r\nHANDLE hComm;\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ OpenGL\uc6a9 \ubcc0\uc218<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\nGLfloat xrot = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">0.9f<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">, yrot = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">0.8f<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">, zrot = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">1.0f<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">unsigned<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">int<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> MyTextureObject[<\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">1<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">];\r\nAUX_RGBImageRec *pTextureImage[<\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">1<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">];                      <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/\ud14d\uc2a4\uccd0 \uc800\uc7a5 \uacf5\uac04\uc744 \uac00\ub9ac\ud0a4\ub294 \ud3ec\uc778\ud130<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\nGLdouble theta[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };    <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ud68c\uc804\uc744 \uc704\ud55c \ubc30\uc5f4, \ucd08\uae30\ud654 \uac01\uac01(x, y, z\ucd95\uc744 \ub098\ud0c0\ub0c4)<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">static<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> GLint SpinCon = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">0<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;                               <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/  \ud68c\uc804\uc2dc\uc5d0 \ud68c\uc804 \uac12\uc744 \ubc1b\ub294 \ubc30\uc5f4\uc548\uc758 \uac12\uc774 float \uac12\uc744 \ub118\ub294\uac83\uc744 \ubc29\uc9c0 \ud558\ub294 \ubcc0\uc218<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uad6c\uc870\uccb4<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/IMU struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> {\r\n    int packet[10];             \/\/ main\uc5d0\uc11c \uc13c\uc11c\uc5d0\uc11c \uac12 \ubc1b\uc544\uc624\ub294 \ubc30\uc5f4 \ubcc0\uc218\r\n\r\n    int Gyro_offset_sum[3];     \/\/ Gyro\uc758 offset\uc758 10\ucd08\uac04\uc758 ADC \uac12\uc758 \ud569\uc744 \uc800\uc7a5\ud558\uae30 \uc704\ud55c \ubcc0\uc218\r\n    int Accel_offset_sum[3];    \/\/ Accel\uc758 offset\uc758 10\ucd08\uac04\uc758 ADC \uac12\uc758 \ud569\uc744 \uc800\uc7a5\ud558\uae30 \uc704\ud55c \ubcc0\uc218\r\n\r\n    double  Gyro_offset_avg[3];     \/\/ Gyro\uc758 offset\uc758 \ud3c9\uade0\uac12\r\n    double  Accel_offset_avg[3];    \/\/ Accel\uc758 offset\uc758 \ud3c9\uade0\uac12\r\n\r\n    double  pitch_vel[4];           \/\/ velocity = \uac01\uc18d\ub3c4\r\n    double  roll_vel[4];            \/\/ pitch, roll, yaw\uc758 \uc801\ubd84\uc744 \ud558\uae30 \uc704\ud574 \ucd5c\uadfc 4\uac1c \uac12\uc744 \uc800\uc7a5\ud558\uae30 \uc704\ud55c \ubc30\uc5f4\r\n    double  yaw_vel[4];\r\n\r\n    double  G_pitch;        \/\/ \uc790\uc774\ub85c \uc13c\uc11c\ub97c \uc774\uc6a9\ud574 \uad6c\ud55c \uac01\uc18d\ub3c4\ub97c \uc801\ubd84\ud558\uc5ec \uc5bb\uc740 \uac01\ub3c4 (degree)\r\n    double  G_roll;\r\n    double  G_yaw;\r\n\r\n    double  A_pitch;        \/\/ \uac00\uc18d\ub3c4 \uc13c\uc11c\ub97c \uc774\uc6a9\ud574 \uc5bb\uc740 \uac01\ub3c4 (degree)\r\n    double  A_roll;\r\n    double  A_yaw;\r\n\r\n    double  LK_pitch;       \/\/ \uce7c\ub9cc \ud544\ud130 \ud6c4 \ucd5c\uc885 \ubcf4\uc815\ub41c \uac01\ub3c4 (degree)\r\n    double  LK_roll;\r\n    double  LK_yaw;\r\n};\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ Kalman Struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">Gyro1DKalman<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> {\r\n    \/\/ matrix x\uc758 \uc0c1\ud0dc\ub97c \ub098\ud0c0\ub0b8\ub2e4.\r\n    double  x_angle;        \/\/ x_angle : \ucd5c\uc885 \ubcf4\uc815 \uac01\r\n    double  x_bias;         \/\/ x_bias : \ubc14\uc774\uc5b4\uc2a4\r\n\r\n    \/\/ \uc624\ucc28 \uacf5\ubd84\uc0b0\r\n    double  P_00, P_01, P_10, P_11;\r\n\r\n    \/\/ Q \uc7a1\uc74c\r\n    double  Q_angle, Q_gyro;\r\n\r\n    \/\/ R \uc7a1\uc74c\r\n    double  R_angle;\r\n};\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/---\ub9ac\ub2c8\uc5b4 \uce7c\ub9cc\ud544\ud130\ub97c \uc704\ud55c \ucd08\uae30\ud654<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ Filter_roll_1 = IMU1 \/ Filter_roll_2 = IMU2 \/ Filter_roll_3 = IMU3 \uacfc \uc5f0\uc0b0<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/\uc21c\uc11c : x_angle, x_bias, P_00, P_01, P_10, P_11, Q_angle, Q_gyro, R_angle<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">Gyro1DKalman<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> filter_roll_1 = { 0, 0, 1, 0, 0, 1, 0.0001, 0.0003, 0.01 };\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">Gyro1DKalman<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> filter_roll_2 = { 0, 0, 1, 0, 0, 1, 0.0001, 0.0003, 0.01 };\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">Gyro1DKalman<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> filter_roll_3 = { 0, 0, 1, 0, 0, 1, 0.0001, 0.0003, 0.01 };\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ IMU \uad6c\uc870\uccb4 3\uac1c \ucd08\uae30\ud654<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> IMU1 = { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0 };\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> IMU2 = { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0 };\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> IMU3 = { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0 };\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ FUNC : OpenGL\uc6a9 \ud568\uc218<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ud568\uc218\uc124\uba85 : \ud654\uba74\uc5d0 Draw\ud558\ub294 \ud568\uc218\ub4e4<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc778 \uc218 \uac12 : \uba54\uc138\uc9c0\uc708\ub3c4\uc6b0\uc758 \ud0c0\uc774\ud2c0 \ubb38\uc790\uc5f4 \ud3ec\uc778\ud130<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub9ac \ud134 \uac12 : \uc5c6 \uc74c<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">void<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">InitVisibility<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">( )\r\n{\r\n    glEnable(GL_CULL_FACE);     \/\/ \ud6c4\uba74\uc81c\uac70\r\n    glFrontFace(GL_CW);\r\n    glCullFace(GL_BACK);\r\n    glEnable(GL_DEPTH_TEST);    \/\/ \uc740\uba74\uc81c\uac70\r\n}\r\n\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">void<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">MyReshape<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(int w, int h)\r\n{\r\n    glViewport(0, 0, w, h);\r\n    glMatrixMode(GL_PROJECTION);\r\n    glLoadIdentity();\r\n    gluPerspective(40.0, (GLfloat)w \/ (GLfloat)h, 1.0, 100.0);\r\n    glMatrixMode(GL_MODELVIEW);\r\n    glLoadIdentity();\r\n    gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);\r\n}\r\n\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">void<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">MyDisplay<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">( )\r\n{\r\n    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);\r\n    glBindTexture(GL_TEXTURE_2D, MyTextureObject[0]);\r\n    glBegin(GL_QUADS);\r\n    glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.2f);   \/\/\uc55e\uba74\r\n    glTexCoord2f(1.0f, 0.0f); glVertex3f(1.0f, -1.0f, 0.2f);\r\n    glTexCoord2f(1.0f, 1.0f); glVertex3f(1.0f, 1.0f, 0.2f);\r\n    glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 0.2f);\r\n    glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, -0.2f);  \/\/\ub4b7\uba74\r\n    glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -0.2f);\r\n    glTexCoord2f(0.0f, 1.0f); glVertex3f(1.0f, 1.0f, -0.2f);\r\n    glTexCoord2f(0.0f, 0.0f); glVertex3f(1.0f, -1.0f, -0.2f);\r\n    glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -0.2f);   \/\/\uc717\uba74\r\n    glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, 1.0f, 0.2f);\r\n    glTexCoord2f(1.0f, 0.0f); glVertex3f(1.0f, 1.0f, 0.2f);\r\n    glTexCoord2f(1.0f, 1.0f); glVertex3f(1.0f, 1.0f, -0.2f);\r\n    glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, -1.0f, -0.2f);  \/\/\uc544\ub7ab\uba74\r\n    glTexCoord2f(0.0f, 1.0f); glVertex3f(1.0f, -1.0f, -0.2f);\r\n    glTexCoord2f(0.0f, 0.0f); glVertex3f(1.0f, -1.0f, 0.2f);\r\n    glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.2f);\r\n    glTexCoord2f(1.0f, 0.0f); glVertex3f(1.0f, -1.0f, -0.2f);   \/\/\uc6b0\uce21\uba74\r\n    glTexCoord2f(1.0f, 1.0f); glVertex3f(1.0f, 1.0f, -0.2f);\r\n    glTexCoord2f(0.0f, 1.0f); glVertex3f(1.0f, 1.0f, 0.2f);\r\n    glTexCoord2f(0.0f, 0.0f); glVertex3f(1.0f, -1.0f, 0.2f);\r\n    glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, -0.2f);  \/\/\uc88c\uce21\uba74\r\n    glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.2f);\r\n    glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 0.2f);\r\n    glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -0.2f);\r\n    \/*\r\n     *  glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -0.2f,  1.0f);  \/\/\uc55e\uba74\r\n     *  glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -0.2f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f,  0.2f,  1.0f);\r\n     *  glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f,  0.2f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -0.2f, -1.0f);  \/\/\ub4b7\uba74\r\n     *  glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f,  0.2f, -1.0f);\r\n     *  glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f,  0.2f, -1.0f);\r\n     *  glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -0.2f, -1.0f);\r\n     *  glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f,  0.2f, -1.0f);  \/\/\uc717\uba74\r\n     *  glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,  0.2f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,  0.2f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f,  0.2f, -1.0f);\r\n     *  glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, -0.2f, -1.0f);  \/\/\uc544\ub7ab\uba74\r\n     *  glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, -0.2f, -1.0f);\r\n     *  glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -0.2f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -0.2f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -0.2f, -1.0f);  \/\/\uc6b0\uce21\uba74\r\n     *  glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f,  0.2f, -1.0f);\r\n     *  glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f,  0.2f,  1.0f);\r\n     *  glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -0.2f,  1.0f);\r\n     *  glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -0.2f, -1.0f);  \/\/\uc88c\uce21\uba74\r\n     *  glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -0.2f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f,  0.2f,  1.0f);\r\n     *  glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f,  0.2f, -1.0f);\r\n     *\r\n     *\r\n     *  glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f,  1.0f);  \/\/\uc55e\uba74\r\n     *  glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f,  1.0f,  1.0f);\r\n     *  glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f,  1.0f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, -1.0f);  \/\/\ub4b7\uba74\r\n     *  glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f,  1.0f, -1.0f);\r\n     *  glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f,  1.0f, -1.0f);\r\n     *  glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f, -1.0f);\r\n     *  glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f,  1.0f, -1.0f);  \/\/\uc717\uba74\r\n     *  glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,  1.0f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,  1.0f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f,  1.0f, -1.0f);\r\n     *  glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, -1.0f, -1.0f);  \/\/\uc544\ub7ab\uba74\r\n     *  glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, -1.0f, -1.0f);\r\n     *  glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, -1.0f);  \/\/\uc6b0\uce21\uba74\r\n     *  glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f,  1.0f, -1.0f);\r\n     *  glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f,  1.0f,  1.0f);\r\n     *  glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f,  1.0f);\r\n     *  glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, -1.0f);  \/\/\uc88c\uce21\uba74\r\n     *  glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f,  1.0f);\r\n     *  glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f,  1.0f,  1.0f);\r\n     *  glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f,  1.0f, -1.0f);\r\n     *\/\r\n    glEnd();\r\n    glutSwapBuffers();\r\n}\r\n\r\nAUX_RGBImageRec *<\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">LoadBMP<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(char *szFilename)\r\n{\r\n    FILE *pFile = NULL;\r\n\r\n    if (!szFilename)\r\n        return NULL;\r\n    pFile = fopen(szFilename, \"r\");\r\n\r\n    if (pFile) {\r\n        fclose(pFile);\r\n        return auxDIBImageLoad(szFilename); \/\/\ud30c\uc77c\ub85c\ubd80\ud130 \uba54\ubaa8\ub9ac\ub85c\r\n    }\r\n    return NULL;\r\n}\r\n\r\n\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">int<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">LoadGLTextures<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(char *szFilePath)         <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/\ud30c\uc77c\uc744 \ub85c\ub4dc\ud558\uace0 \ud14d\uc2a4\uccd0\ub85c \ubcc0\ud658<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n{\r\n    int Status = FALSE;\r\n\r\n    glClearColor(0.0, 0.0, 0.0, 0.5);\r\n    memset(pTextureImage, 0, sizeof(void *) * 1);  \/\/\ud3ec\uc778\ud130\ub97c \ub110\ub85c\r\n    \/\/\ube44\ud2b8\ub9f5\uc744 \ub85c\ub4dc\ud558\uace0 \uc624\ub958\ud655\uc778\r\n    if (pTextureImage[0] = LoadBMP(szFilePath)) {\r\n        Status = TRUE;                          \/\/\uc0c1\ud0dc \ud50c\ub799\uc744 True\ub85c\r\n        glGenTextures(1, &amp;MyTextureObject[0]);  \/\/\ud14d\uc2a4\uccd0 \uc0dd\uc131\r\n        glBindTexture(GL_TEXTURE_2D, MyTextureObject[0]);\r\n        glTexImage2D(GL_TEXTURE_2D, 0, 3, pTextureImage[0]-&gt;sizeX, pTextureImage[0]-&gt;sizeY,\r\n                 0, GL_RGB, GL_UNSIGNED_BYTE, pTextureImage[0]-&gt;data);\r\n        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);\r\n        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);\r\n        glEnable(GL_TEXTURE_2D);\r\n    }\r\n    if (pTextureImage[0]) {                         \/\/\ud14d\uc2a4\uccd0\uac00 \uc874\uc7ac\ud558\uba74\r\n        if (pTextureImage[0]-&gt;data)             \/\/\ud14d\uc2a4\uccd0 \uc601\uc0c1\uc774 \uc874\uc7ac\ud558\uba74\r\n            free(pTextureImage[0]-&gt;data);   \/\/\ud14d\uc2a4\uccd0 \uc601\uc0c1\uacf5\uac04 \ubc18\ub0a9\r\n        free(pTextureImage[0]);                 \/\/\ud14d\uc2a4\uccd0 \ubc18\ub0a9\r\n    }\r\n    return Status;\r\n}\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ FUNC : err_quit()<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ud568\uc218\uc124\uba85 : \uc5d0\ub7ec \ubc1c\uc0dd\uc2dc \uba54\uc138\uc9c0\ub85c \uc54c\ub824\uc90c<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc778 \uc218 \uac12 : \uba54\uc138\uc9c0\uc708\ub3c4\uc6b0\uc758 \ud0c0\uc774\ud2c0 \ubb38\uc790\uc5f4 \ud3ec\uc778\ud130<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub9ac \ud134 \uac12 : \uc5c6 \uc74c<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">void<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">err_quit<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(char *msg)\r\n{\r\n    LPVOID lpMsgBuf;\r\n\r\n    FormatMessage(\r\n        FORMAT_MESSAGE_ALLOCATE_BUFFER |\r\n        FORMAT_MESSAGE_FROM_SYSTEM,\r\n        NULL, GetLastError(),\r\n        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),\r\n        (LPTSTR)&amp;lpMsgBuf, 0, NULL);\r\n    MessageBox(NULL, (LPCTSTR)lpMsgBuf, msg, MB_ICONERROR);\r\n    LocalFree(lpMsgBuf);\r\n    exit(-1);\r\n}\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ FUNC : Accel()<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ud568\uc218\uc124\uba85 : Accelometer x,y,z \uac12\uc73c\ub85c \uac01\ub3c4\ub97c \uc5bb\uc5b4\ub0c4<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc778 \uc218 \uac12 : Accelometer \uc13c\uc11c\ub97c \ud1b5\ud558\uc5ec x,y,z \uac01\uac01\uc758 \uac00\uc18d\ub3c4 \uac12<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub9ac \ud134 \uac12 : IMU \uad6c\uc870\uccb4<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> Accel(<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> temp)\r\n{\r\n    double Ax = (temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[4] - temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Accel_offset_avg<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[0]) \/ Accel_sens;\r\n    double Ay = (temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[5] - temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Accel_offset_avg<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[1]) \/ Accel_sens;\r\n    double Az = (temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[6] - temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Accel_offset_avg<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[2]) \/ Accel_sens;\r\n\r\n\/\/    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_pitch<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> =<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">atan2<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(-Az , Ax) * (180 \/ PI) * 2;\r\n\/\/    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = atan2(-Az , Ay) * (180 \/ PI) * 2;\r\n\r\n\/\/    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_pitch<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = atan(-Az\/Ax) * (180 \/ PI) * 2;\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = atan(-Az \/ Ay) * (180 \/ PI) * 2;\r\n\r\n    \/\/ \uc5ec\uae30\uae4c\uc9c0 \ud558\uba74 0~360\uc758 \ubc94\uc704\ub85c \ucd9c\ub825\ub418\uc9c0\ub9cc Gyro\uc13c\uc11c\uc640 \ud1b5\uc77c\ud558\uae30 \uc704\ud574 \uc57d\uac04\uc758 \uc870\uc815\r\n\r\n    if (temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_pitch<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> &gt; 180 &amp;&amp; temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_pitch<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> &lt;= 360)\r\n        temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_pitch<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = -(360 - temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_pitch<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">);\r\n\r\n    if (temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> &gt; 180 &amp;&amp; temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> &lt;= 360)\r\n        temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = -(360 - temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">);\r\n\r\n    printf(\"Accel_Roll : %f \\n\", temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">);\r\n\r\n    return temp;\r\n}\r\n\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ FUNC : Gyro()<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ud568\uc218\uc124\uba85 : Gyro pitch, roll, yaw \uac12\uc73c\ub85c \uac01\ub3c4\ub97c \uc5bb\uc5b4\ub0c4<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc778 \uc218 \uac12 : Gyro \uc13c\uc11c\ub97c \ud1b5\ud558\uc5ec pitch, roll yaw \uac01\uac01\uc758 \uc774\uc804\uac12\uacfc \ud604\uc7ac\uac12<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub9ac \ud134 \uac12 : IMU \uad6c\uc870\uccb4<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> Gyro(<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> temp)\r\n{\r\n    \/\/ \ub791\uac8c\ucfe0\ud0c0 \uc801\ubd84\uc744 \uc801\uc6a9\ud558\uae30 \uc704\ud574 \ucd5c\uadfc,\uc774\uc8043\uac1c \uac12\uc744 \ubc30\uc5f4\uc5d0 \uc800\uc7a5\ud558\uae30 \uc704\ud55c for\ubb38\r\n    for (int i = 0; i &lt; 3; i++) {\r\n        temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.pitch_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[i] = temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.pitch_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[i + 1];\r\n        temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.roll_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[i] = temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.roll_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[i + 1];\r\n        temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.yaw_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[i] = temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.yaw_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[i + 1];\r\n    }\r\n    \/\/ pitch, roll, yaw\uc758 \uac01\uc18d\ub3c4 \ubf51\uc544\ub0b4\uc11c \uac01 velocity [3]\uc5d0 \uc800\uc7a5\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.pitch_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[3] = ((double)temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[7] - temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Gyro_offset_avg<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[0]) * Scalefactor;   \/\/ scalefactor = 1.611328 deg\/~\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.roll_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[3] = ((double)temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[8] - temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Gyro_offset_avg<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[1]) * Scalefactor;    \/\/ (3300mV\/1024bit) \/ (2.0mV\/degrees\/second)\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.yaw_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[3] = ((double)temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[9] - temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Gyro_offset_avg<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[2]) * Scalefactor;\r\n\r\n    \/\/ \uac01\uc18d\ub3c4\ub4e4\uc744 \uc801\ubd84 (\ub791\uac8c\ucfe0\ud0c0 \uc801\ubd84\ubc95 \uc0ac\uc6a9)\r\n    \/\/ pitch\uc640 roll\uc758 \uac12\uc774 \ubc14\ub00c\uae30 \ub54c\ubb38\uc5d0 \uc5ec\uae30\uc11c \ub450\uac1c\ub97c \ubc14\uafd4\uc11c \uc801\uc6a9\r\n    \/\/ +\uc640 -\ub97c \ubc29\ud5a5\uc744 \ub4a4\uc9d1\uae30 \uc704\ud574 \ub354\ud574\uc8fc\ub294 \uac83\uc774 \uc544\ub2c8\ub77c -= \uc73c\ub85c \uc801\uc6a9\r\n\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.G_pitch<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> -= ((temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.roll_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[0] + 2 * temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.roll_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[1] + 2 * temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.roll_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[2] + temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.roll_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[3]) \/ 6) \/ 20;\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.G_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> -= ((temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.pitch_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[0] + 2 * temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.pitch_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[1] + 2 * temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.pitch_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[2] + temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.pitch_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[3]) \/ 6) \/ 20;\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.G_yaw<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> -= ((temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.yaw_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[0] + 2 * temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.yaw_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[1] + 2 * temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.yaw_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[2] + temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.yaw_vel<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[3]) \/ 6) \/ 20;\r\n\r\n    printf(\"Gyro_Roll : %f \\n\", temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.G_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">);\r\n\r\n    return temp;\r\n}\r\n\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ FUNC : Update1()<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ud568\uc218\uc124\uba85 : \uc2dc\uac04 \uac31\uc2e0(Predict), \uc790\uc774\ub85c \uc13c\uc11c \uac12 \uc0ac\uc6a9<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc778 \uc218 \uac12 : Kalman \uad6c\uc870\uccb4\uc640 dotAngle(\uc790\uc774\ub85c \uc13c\uc11c\ub85c \uc5bb\uc740 \uac01-pitch or roll)<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub9ac \ud134 \uac12 : \uc5c6 \uc74c<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">void<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">Update1<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(struct Gyro1DKalman filterdata, const double dotAngle, const double dt)\r\n{\r\n    filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.x_angle<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> += dt * (dotAngle - filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.x_bias<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">);\r\n    filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.x_bias<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> += 0.014;\r\n\r\n    filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_00<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> += -dt * (filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_10<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> + filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_01<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">) + filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Q_angle<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> * dt;\r\n    filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_01<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> += -dt * filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_11<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n    filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_10<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> += -dt * filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_11<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n    filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_11<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> += +filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Q_gyro<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> * dt;\r\n}\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ FUNC : Update2()<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ud568\uc218\uc124\uba85 : Measurement Update - \uce7c\ub9cc\uc774\ub4dd \uacc4\uc0b0 \ud6c4 \uacf5\ubd84\uc0b0 \uc5c5\ub370\uc774\ud2b8<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc778 \uc218 \uac12 : Kalman \uad6c\uc870\uccb4\uc640 dotAngle(\uac00\uc18d\ub3c4 \uc13c\uc11c\ub85c \uc5bb\uc740 \uac01-pitch or roll)<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub9ac \ud134 \uac12 : \ubcf4\uc815 \ud6c4\uc758 \uac01\uc744 \ub9ac\ud134<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">Update2<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(struct Gyro1DKalman filterdata, const double Accel_x_y_z)\r\n{\r\n    const double y = Accel_x_y_z - filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.x_angle<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n    const double S = filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_00<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> + filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.R_angle<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n    const double K_0 = filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_00<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> \/ S;\r\n    const double K_1 = filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_10<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> \/ S;\r\n\r\n    filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.x_angle<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> += K_0 * y;\r\n    filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.x_bias<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> += K_1 * y;\r\n\r\n    filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_00<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> -= K_0 * filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_00<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n    filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_01<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> -= K_0 * filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_01<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n    filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_10<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> -= K_1 * filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_00<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n    filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_11<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> -= K_0 * filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.P_01<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n\r\n    return filterdata<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.x_angle<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n}\r\n\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ FUNC : NoiseFunc()<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ud568\uc218\uc124\uba85 : \ubc1b\uc740 \uac12\uc5d0 \ub178\uc774\uc988 \uc81c\uacf5 ( \ub178\uc774\uc988 \ucd5c\ub300: +10 \ucd5c\uc800:-10)<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc778 \uc218 \uac12 : \uc6d0\ubcf8\uc778 IMU1\uc5d0\uc11c \uc5bb\uc740 \uac12, \ubcc0\ud658\ub420 IMU2 or IMU3<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub9ac \ud134 \uac12 : IMU2 or IMU3 \uad6c\uc870\uccb4 \uc804\uccb4\ub97c \ub9ac\ud134<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> NoiseFunc(<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">int<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> *originalP, <\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> temp)\r\n{\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[0] = originalP[0];                          \/\/counter\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[1] = originalP[1] + ((<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">rand<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">() % 20) - 10);   \/\/mag\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[2] = originalP[2] + ((<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">rand<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">() % 20) - 10);\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[3] = originalP[3] + ((<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">rand<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">() % 20) - 10);\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[4] = originalP[4] + ((<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">rand<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">() % 4) - 2);\/\/acc\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[5] = originalP[5] + ((<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">rand<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">() % 4) - 2);\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[6] = originalP[6] + ((<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">rand<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">() % 4) - 2);\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[7] = originalP[7] + ((<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">rand<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">() % 10) - 5);\/\/gyro\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[8] = originalP[8] + ((<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">rand<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">() % 10) - 5);\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[9] = originalP[9] + ((<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">rand<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">() % 10) - 5);\r\n\r\n    return temp;\r\n}\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ FUNC : Get_offset_sum()<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ud568\uc218\uc124\uba85 : \uac01 IMU\uc758 10\ucd08\uac04\uc758 offset\uc758 \ud569\uc744 \uc5bb\uc5b4\ub0c4<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc778 \uc218 \uac12 : IMU \uad6c\uc870\uccb4<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub9ac \ud134 \uac12 : \uc5f0\uc0b0 \ud6c4 IMU \uad6c\uc870\uccb4 \uadf8\ub300\ub85c \ub9ac\ud134<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> Get_offset_sum(<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> temp)\r\n{\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Gyro_offset_sum<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[0] += temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[7];      \/\/ Gyro pitch\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Gyro_offset_sum<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[1] += temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[8];      \/\/ Gyro roll\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Gyro_offset_sum<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[2] += temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[9];      \/\/ Gyro yaw\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Accel_offset_sum<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[0] += temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[4];     \/\/ accel x\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Accel_offset_sum<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[1] += temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[5];     \/\/ accel y\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Accel_offset_sum<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[2] += temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[6];     \/\/ accel z\r\n\r\n    return temp;\r\n}\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ FUNC : Get_offset_avg()<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ud568\uc218\uc124\uba85 : \uac01 IMU\uc758 10\ucd08\uac04\uc758 offset\uc758 \ud569\uc744 \ud3c9\uade0\ub0c4<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc778 \uc218 \uac12 : IMU \uad6c\uc870\uccb4<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub9ac \ud134 \uac12 : \uc5f0\uc0b0 \ud6c4 IMU \uad6c\uc870\uccb4 \uadf8\ub300\ub85c \ub9ac\ud134<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> Get_offset_avg(<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">struct<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">IMU<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> temp)\r\n{\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Gyro_offset_avg<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[0] = (double)temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Gyro_offset_sum<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[0] \/ 200;\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Gyro_offset_avg<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[1] = (double)temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Gyro_offset_sum<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[1] \/ 200;\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Gyro_offset_avg<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[2] = (double)temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Gyro_offset_sum<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[2] \/ 200;\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Accel_offset_avg<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[0] = (double)temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Accel_offset_sum<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[0] \/ 200;\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Accel_offset_avg<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[1] = (double)temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Accel_offset_sum<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[1] \/ 200;\r\n    temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Accel_offset_avg<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[2] = (double)temp<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Accel_offset_sum<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[2] \/ 200;\r\n\r\n    return temp;\r\n}\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ FUNC : \uc774\ud558 Voting System<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ IMU\uc5d0\uc11c \uc624\ub294 input\uac12\uc758 \ubc94\uc704\ub97c \uccb4\ud06c\ud558\uc5ec \uc5d0\ub7ec\uc778\uc9c0 \ud655\uc778\ud55c\ub2e4.<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">bool<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">ReleaseErr<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(double d)\r\n{\r\n    if (d &lt;= 180 &amp;&amp; d &gt;= -180)\r\n        return true;\r\n    else\r\n        return false;\r\n}\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/\uac01 \uac12\ub4e4\uc758 \ucc28\uc774\ub97c \uce21\uc815\ud55c\ub2e4. \uac00\uc7a5 \uc791\uc740 \ucc28\uc774\uc758 \ub450\uac12\uc744 \uc5bb\uc5b4\ub0b4\uae30 \uc704\ud568<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">FormalMajorityVoter<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(double e, double f)\r\n{\r\n    double g;\r\n\r\n    g = e - f;\r\n    return abs(g);\r\n}\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub370\uc774\ud130 \uac12\uc758 \ucc28\uc774\uac00 \uac00\uc7a5 \uc791\uc740 \uac83\uc744 \uc120\ud0dd\ud55c\ub2e4.<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">SelData<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(double a, double b, double c)\r\n{\r\n    double tempAA;\r\n\r\n\/\/  tempAA = min(a, b, c);\r\n    if (a &lt;= b) {\r\n        if (a &lt;= c) tempAA = a;\r\n        else tempAA = c;\r\n    } else if (b &lt;= c) {\r\n        if (b &lt;= a) tempAA = b;\r\n        else tempAA = a;\r\n    } else if (c &lt;= a) {\r\n        if (c &lt;= b) tempAA = c;\r\n        else tempAA = b;\r\n    }\r\n    return tempAA;\r\n}\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc120\ud0dd\ub41c 2\uac1c\uc758 input\uac12\uc758 \ud3c9\uade0\uc744 \uc5bb\ub294\ub2e4.<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">MeanVoter<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(double a, double b)\r\n{\r\n    return (a + b) \/ 2.0;\r\n}\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ Voting System\ud568\uc218<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">double<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">UavVoter<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(double a, double b, double c)   <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ IMU\uc5d0\uc11c 3\uac1c\uc758 input\uac12\uc744 \ubc1b\ub294\ub2e4.<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n{\r\n    double tempA, tempB, tempC;             \/\/ IMU\uc5d0\uc11c \uc5bb\uc5b4\uc628 \uac12\ub4e4\uac04\uc758 \ucc28\uc774 \uac12\uc744 \uc800\uc7a5\ud560 \uc784\uc2dc \ubcc0\uc218\r\n    double selData;                         \/\/ \uac01 \uac12\ub4e4\uc758 \ucc28\uc774\uac12 \uc911 \uac00\uc7a5 \uc791\uc740 \ucc28\uc774\uac12\uc744 \uc800\uc7a5\ud560 \ubcc0\uc218\r\n    double result;                          \/\/ voting system\uc758 \ucd5c\uc885 \uacb0\uacfc\uac12\uc744 \uc800\uc7a5\r\n\r\n    ReleaseErr(a);                          \/\/ \uc5d0\ub7ec\uccb4\ud06c\r\n    ReleaseErr(b);\r\n    ReleaseErr(c);\r\n    tempA = FormalMajorityVoter(a, b); \/\/ IMU\uc5d0\uc11c \uc5bb\uc5b4\uc628 \uac12\uc758 \ucc28\uc774\uac12(\uc808\ub300\uac12)\uc744 \uc800\uc7a5\r\n    tempB = FormalMajorityVoter(a, c);\r\n    tempC = FormalMajorityVoter(b, c);\r\n\r\n    selData = SelData(tempA, tempB, tempC); \/\/ \uac00\uc7a5 \uc791\uc740 \ucc28\uc774\uac12\uc744 \uc120\ud0dd\r\n\r\n    \/\/ \uac00\uc7a5 \uc791\uc740 \uac12\uc758 \ucc28\uc774\ub97c \ubcf4\uc774\ub294 2\uac1c\uc758 IMU input\uac12\ub4e4\uc758 \ud3c9\uade0\uc744 \uad6c\ud55c\ub2e4.\r\n    if (tempA == selData)\r\n        result = MeanVoter(a, b);\r\n    else if (tempB == selData)\r\n        result = MeanVoter(a, c);\r\n    else if (tempC == selData)\r\n        result = MeanVoter(b, c);\r\n\r\n    return result;\r\n}\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc5ec\uae30\uae4c\uc9c0 Voting System Functions.<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ FUNC : ControlImage()<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ud568\uc218\uc124\uba85 : IMU\uc5d0\uc11c \uc785\ub825 \ubc1b\uc740 \uac12\uc744 \ud1b5\ud574\uc11c \uc774\ubbf8\uc9c0\ud30c\uc77c\uc744 \ucee8\ud2b8\ub864 \ud558\ub294 \ud568\uc218<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc778 \uc218 \uac12 : x\ub294 pitch, y\ub294 roll, yaw(\uc544\uc9c1 \ubbf8\uc815)<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub9ac \ud134 \uac12 : \uc5c6 \uc74c<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">void<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">ControlImage<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(double x, double y, double z)  <\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ x\ub294 pitch, y\ub294 roll, yaw(\uc544\uc9c1 \ubbf8\uc815)<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n{\r\n    theta[3] = theta[0];\r\n    theta[4] = theta[1];\r\n    theta[5] = theta[2];\r\n    \/\/ \uc0c8\ub86d\uac8c \uc5bb\uc5b4\uc628 \uac12\uacfc \ud604\uc7ac \uc88c\ud45c\uacc4\uc758 \uac01\ub3c4\uc640\uc758 \ucc28\ub9cc\ud07c \uc804\uc5ed\uc88c\ud45c\uacc4 z\ucd95\uc744 \ud68c\uc804 \uc2dc\ud0a8\ub2e4.\r\n    theta[0] = (-theta[3]) + x;\r\n\/\/      theta[1] = (-theta[4]) + y;\r\n\/\/      theta[2] = (-theta[5]) + z;\r\n\/\/      theta[0] = x;\r\n\/\/      theta[1] = y;\r\n    theta[2] = z;\r\n\r\n    glRotatef(theta[0], 1.0, 0.0, 0.0);     \/\/ z\ucd95 \ubc29\ud5a5\uc73c\ub85c \ud68c\uc804 theta[1]\ub9cc\ud07c \ud68c\uc804\r\n    glRotatef(theta[1], 0.0, 1.0, 0.0);     \/\/ z\ucd95 \ubc29\ud5a5\uc73c\ub85c \ud68c\uc804 theta[1]\ub9cc\ud07c \ud68c\uc804\r\n    glRotatef(theta[2], 0.0, 0.0, 1.0);     \/\/ z\ucd95 \ubc29\ud5a5\uc73c\ub85c \ud68c\uc804 theta[1]\ub9cc\ud07c \ud68c\uc804\r\n\r\n    glutPostRedisplay();\r\n\r\n    \/\/ z\ucd95 \ubc18\ub300\ubc29\ud5a5\uc73c\ub85c \ud68c\uc804 theta[1]\ub9cc\ud07c \ud68c\uc804, \uc804\uc5ed\uc88c\ud45c\uacc4\ub97c \ud68c\uc804\ud558\uae30 \uc804 \uc0c1\ud0dc\ub85c \ub3cc\ub9ac\uae30 \uc704\ud574\r\n    glRotatef(theta[3], -1.0, 0.0, 0.0);\r\n    glRotatef(theta[4], 0.0, -1.0, 0.0);\r\n    glRotatef(theta[5], 0.0, 0.0, -1.0);\r\n}\r\n\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ FUNC : SpinControl()<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ud568\uc218\uc124\uba85 : \ubb34\ud55c\uc73c\ub85c \ubc18\ubcf5\ub418\uba74\uc11c IMU\uc5d0\uc11c \uac12\uc744 \uc5bb\uc5b4 ControlImage\ud568\uc218\ub85c \uac12\uc744 \ubcf4\ub0c4<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \uc778 \uc218 \uac12 : \uc758\ubbf8 \uc5c6\uc74c<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ub9ac \ud134 \uac12 : \uc5c6 \uc74c<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \ud68c\uc804\uac12\uc774 360\ub3c4\ub97c \ub118\uc5b4\uac00\uc9c0 \uc54a\ub3c4\ub85d \ud558\ub294 \ud568\uc218 (float\uc758 \ucd5c\ub300,\ucd5c\uc18c\uac12\uc744 \ub118\uae30\ub294\uac83\uc744 \ubc29\uc9c0)<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">int<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> a = <\/span><span style=\"color: rgb(168, 1, 126); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">1<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">;\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">void<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">SpinControl<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(int Value)\r\n{\r\n    \/\/---[ \uba54\ubaa8\ub9ac \ube14\ub7ed\uc744 0\uc73c\ub85c \ub9cc\ub4ec ]\r\n    ZeroMemory(buf, sizeof(buf));\r\n    retval = ReadFile(hComm, buf, BUFSIZE, &amp;BytesRead, NULL);\r\n    if (retval == 0) err_quit(\"<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">ReadFile<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">()\");\r\n    if (BytesRead == 0)\r\n        printf(\"[\uc624\ub958] \uc751\ub2f5\uc774 \uc5c6\uc2b5\ub2c8\ub2e4!\\n\");\r\n        \/\/         continue;\r\n    \/\/---[ \ubc1b\uc740 \ub370\uc774\ud130 \ucd9c\ub825 ]\r\n    buf[BytesRead] = '\\0';\r\n\r\n    \/\/ ---[ \ud55c \ud328\ud0b7 \ub2e8\uc704\ub85c \ub370\uc774\ud130\ub97c \ud30c\uc2f1\ud574\uc11c \ubcc0\ud658\ud558\uc5ec \uc800\uc7a5 ]\r\n    \/\/ Count = 0\r\n    \/\/ Magnetic x=1, y=2, z=3\r\n    \/\/ Accelometer x=4, y=5, z=6\r\n    \/\/ Zyro pitch=7, roll=8, yaw=9\r\n    IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[0] = (int)buf[1] * 256 + (int)buf[2];\r\n    IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[1] = (int)buf[3] * 256 + (int)buf[4];\r\n    IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[2] = (int)buf[5] * 256 + (int)buf[6];\r\n    IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[3] = (int)buf[7] * 256 + (int)buf[8];\r\n    IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[4] = (int)buf[9] * 256 + (int)buf[10];\r\n    IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[5] = (int)buf[11] * 256 + (int)buf[12];\r\n    IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[6] = (int)buf[13] * 256 + (int)buf[14];\r\n    IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[7] = (int)buf[15] * 256 + (int)buf[16];\r\n    IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[8] = (int)buf[17] * 256 + (int)buf[18];\r\n    IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[9] = (int)buf[19] * 256 + (int)buf[20];\r\n\r\n\r\n    \/\/\ub178\uc774\uc988 \uc0dd\uc131 - IMU2, IMU3\r\n    IMU2 = NoiseFunc(IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">, IMU2);\r\n    IMU3 = NoiseFunc(IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">, IMU3);\r\n\r\n    \/\/ -- [is_start\uac00 \uc544\uc9c1 0\uc774\uace0, 10\ucd08\uac00 \uc544\uc9c1 \uc548 \uc9c0\ub0ac\ub2e4\uba74 \uc218\ud589]\r\n    if (TenSec &lt; 200) {\r\n        IMU1 = Get_offset_sum(IMU1);\r\n        IMU2 = Get_offset_sum(IMU2);\r\n        IMU3 = Get_offset_sum(IMU3);\r\n        TenSec++;\r\n        if (TenSec == 199) {\r\n            IMU1 = Get_offset_avg(IMU1);\r\n            IMU2 = Get_offset_avg(IMU2);\r\n            IMU3 = Get_offset_avg(IMU3);\r\n        }\r\n    } else { \/\/ 10\uac1c\uc758 \uac12\uc744 \ud14c\uc2a4\ud2b8\uc6a9\uc73c\ub85c \ucd9c\ub825\r\n        printf(\"===================================\\n\");\r\n        printf(\"            count  mag_x  mag_y  mag_z  acc_x  acc_y  acc_z  pitch  roll  yaw\\n\");\r\n        printf(\" Packet : \");\r\n        for (int k = 0; k &lt; 10; k++)\r\n            printf(\"%5d  \", IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.packet<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">[k]);\r\n        printf(\"\\n\\n\");\r\n        printf(\"--- IMU1 ---\\n\");\r\n        \/\/\ucd5c\uc885 Gyro, Accel, KalmanFilter\uc5d0 \ub123\uc5b4\ubcf4\uae30\r\n        IMU1 = Gyro(IMU1);\r\n        IMU1 = Accel(IMU1);\r\n        Update1(filter_roll_1, IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.G_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">, dt);\r\n        IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.LK_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = Update2(filter_roll_1, IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">);\r\n        printf(\"Kalman_Roll : %f \\n\\n\", IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.LK_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">);\r\n\r\n        printf(\"--- IMU2 ---\\n\");\r\n        IMU2 = Gyro(IMU2);\r\n        IMU2 = Accel(IMU2);\r\n        Update1(filter_roll_2, IMU2<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.G_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">, dt);\r\n        IMU2<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.LK_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = Update2(filter_roll_2, IMU2<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">);\r\n        printf(\"Kalman_Roll : %f \\n\\n\", IMU2<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.LK_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">);\r\n\r\n        printf(\"--- IMU3 ---\\n\");\r\n        IMU3 = Gyro(IMU3);\r\n        IMU3 = Accel(IMU3);\r\n        Update1(filter_roll_3, IMU3<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.G_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">, dt);\r\n        IMU3<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.LK_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = Update2(filter_roll_3, IMU3<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.A_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">);\r\n        printf(\"Kalman_Roll : %f \\n\\n\", IMU3<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.LK_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">);\r\n\r\n        Final_Roll = UavVoter(IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.LK_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">, IMU2<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.LK_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">, IMU3<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.LK_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">);\r\n        printf(\"Final Roll is !!!! %f \\n\", Final_Roll);\r\n        printf(\"===================================\\n\\n\\n\");\r\n    }\r\n\r\n\r\n    ControlImage(0, 0, IMU1<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.G_roll<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">);\r\n    glutTimerFunc(9, SpinControl, 1); \/\/ 120hz \uc774\ubbc0\ub85c \uc57d0.008\ucd08\r\n}\r\n\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/================================================<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ FUNC : main()<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/------------------------------------------------<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n<\/span><span style=\"color: rgb(175, 130, 212); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\/\/ \ud568\uc218\uc124\uba85 : \ud504\ub85c\uadf8\ub7a8 \uc2dc\uc791\ud568\uc218<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">\r\n\r\n<\/span><span style=\"color: rgb(255, 86, 0); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">void<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> <\/span><span style=\"color: rgb(33, 67, 156); font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">main<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(int argc, char *argv[])\r\n{\r\n    \/\/---&lt; STEP 1 : \ud3ec\ud2b8 \uc5f4\uae30 &gt;-----------------------\r\n    \/\/ : \ud3ec\ud2b8\uc5f4\uae30 \ud568\uc218 - CreateFile()\r\n    \/\/ : \uc778\uc2181 - \ud3ec\ud2b8\uc774\ub984 \ubb38\uc790\uc5f4\r\n    \/\/ : \uadf8\ubc16\uc758 \uc778\uc218 - \uc9c1\ub82c \ud3ec\ud2b8\ub97c \ub2e4\ub8f0\ub54c\ub294 \uc544\ub798\uc640\r\n    \/\/     \ub3d9\uc77c\ud558\uac8c \uc124\uc815\ud568\r\n    \/\/ : \ub9ac\ud134\uac12 - \ud30c\uc77c\uc5f4\uae30 \uc131\uacf5\ud558\uba74 \ud578\ub4e4\uac12 \ub9ac\ud134\r\n    \/\/    \uc2e4\ud328\ud558\uba74 INVALID_HANDIL_VALUE\uac12 \ub9ac\ud134\r\n    \/\/    GetLastError()\uc5d0 \uc5d0\ub7ec\uba54\uc138\uc9c0 \ubcf4\ub0c4\r\n    \/\/------------------------------------------------\r\n\r\n    hComm = CreateFile(\"COM2\", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);\r\n    if (hComm == INVALID_HANDLE_VALUE) err_quit(\"<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">CreateFile<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">()\");\r\n\r\n    \/\/---&lt; STEP 2 : \ud3ec\ud2b8 \uc124\uc815\uac12 \ubcc0\uacbd &gt;----------------\r\n    \/\/ : \ud3ec\ud2b8\uc124\uc815\uac12 \uc5bb\uae30\ud568\uc218 - GetCommState()\r\n    \/\/ : \ud3ec\ud2b8\uc124\uc815\uac12 \ubcc0\uacbd\ud568\uc218 - SetCommState()\r\n    \/\/ : \uc131\uacf5-&gt;0\uc774 \uc544\ub2cc\uac12, \uc2e4\ud328-&gt;0\r\n    \/\/------------------------------------------------\r\n    DCB dcb;\r\n    if (!<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">GetCommState<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(hComm, &amp;dcb)) err_quit(\"<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">GetCommState<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">()\");\r\n\r\n    \/\/---[ \ud3ec\ud2b8 \uc124\uc815\uac12 \ubcc0\uacbd ]\r\n    \/\/ : 115200bps, no <\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">parity<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(\ud328\ub9ac\ud2f0), 8bit(\ub370\uc774\ud0c0\ube44\ud2b8), 1 stop <\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">bit<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(\uc815\uc9c0\ube44\ud2b8)\r\n    dcb<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.BaudRate<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = CBR_115200;\r\n    dcb<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.fParity<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = FALSE;\r\n    dcb<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.fNull<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = FALSE;\r\n    dcb<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.ByteSize<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = 8;\r\n    dcb<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.Parity<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = NOPARITY;\r\n    dcb<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.StopBits<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = ONESTOPBIT;\r\n    if (!<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">SetCommState<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(hComm, &amp;dcb)) err_quit(\"<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">SetCommState<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">()\");\r\n\r\n    \/\/---&lt; STEP 3 : \uc77d\uae30\uc640 \uc4f0\uae30 \ud0c0\uc784\uc544\uc6c3 \uc124\uc815 &gt;-------\r\n    \/\/ : \uc774 \ud568\uc218\ub294 \uc77d\uac70\ub098 \uc4f0\uae30\uc704\ud574 \ubb34\ud55c\uc815 \ub300\uae30\ud558\ub294 \uac83\uc744 \ubc29\uc9c0\ud568\r\n    \/\/   \ud0c0\uc784\uc544\uc6c3\uc774 \uacbd\uacfc\ub418\uba74 \ud568\uc218\uac00 \ubb34\uc870\uac74 \ub9ac\ud134\ud568\r\n    \/\/ : \ud0c0\uc784\uc544\uc6c3 \uc5bb\uae30\ud568\uc218 - GetTimeouts()\r\n    \/\/ : \ud0c0\uc784\uc544\uc6c3 \ubcc0\uacbd\ud568\uc218 - SetTimeouts()\r\n    \/\/ : \uc131\uacf5-&gt;0\uc774 \uc544\ub2cc\uac12, \uc2e4\ud328-&gt; 0\r\n    \/\/ : -Multiplier, -Constant\uac12\uc774 \ub458\ub2e4 0\uc774\uba74\r\n    \/\/   \uc815\ud574\uc9c4 \ubc14\uc774\ud2b8\ub97c \uc4f0\uac70\ub098 \uc77d\uc744 \ub54c\uae4c\uc9c0 \ubb34\ud55c\uc815 \ub300\uae30\ud568\r\n    \/\/ : \uc124\uc815\ub2e8\uc704\ub294 ms\uc784\r\n    \/\/ : \uc77d\uae30 \ud0c0\uc784\uc544\uc6c3 -&gt; n*ReadTotalTimeoutMultiplier + ReadTotalTimeoutConstant\r\n    \/\/ : \uc4f0\uae30 \ud0c0\uc784\uc544\uc6c3 -&gt; n*WriteTotalTimeoutMultiplier + WriteTotlaTimeoutConstant\r\n    \/\/------------------------------------------------\r\n    COMMTIMEOUTS timeouts;\r\n    timeouts<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.ReadIntervalTimeout<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = 0;\r\n\r\n    \/\/---[ \uc5ec\uae30\uc11c\ub294 512\ubc14\uc774\ud2b8 \ubcf4\ub0b4\ubbc0\ub85c \uc77d\uae30 \ud0c0\uc784\uc544\uc6c3\uc740 512ms\uc784 ]\r\n    timeouts<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.ReadTotalTimeoutMultiplier<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = 22;\r\n    timeouts<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.ReadTotalTimeoutConstant<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = 0;\r\n    timeouts<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.WriteTotalTimeoutMultiplier<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = 0;\r\n    timeouts<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.WriteTotalTimeoutConstant<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> = 0;\r\n    if (!<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">SetCommTimeouts<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(hComm, &amp;timeouts)) err_quit(\"<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">SetCommTimeouts<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">()\");\r\n\r\n    \/\/<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">srand<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">: \ub09c\uc218 \uc0dd\uc131\uc744 \uc704\ud574.\r\n    srand((unsigned)<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">time<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(NULL));\r\n\r\n    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/======== \uc624\ud508\uc9c0\uc5d8\r\n    if (argc &lt;= 1) {\r\n        printf(\"\\n%s\\n\\n\", \"Usage : TextureDLG3_Consol<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.exe<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\"> [BMPFileName<\/span><span style=\"color: rgb(0, 83, 255); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">.bmp<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">]\");\r\n        exit(1);\r\n    } else if (argc &gt; 2) {\r\n        printf(\"\\nToo Many Arguments!\\nArgument is Only one\\n\");\r\n        exit(1);\r\n    } else {\r\n        glutInit(&amp;argc, argv);\r\n        glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);\r\n        glutInitWindowSize(1250, 750);\r\n        glutInitWindowPosition(0, 0);\r\n        glClearColor(1.0, 1.0, 1.0, 1.0);\r\n        InitVisibility();\r\n        glutCreateWindow(\"Linear Kalman Filter\");\r\n        glutReshapeFunc(MyReshape);\r\n        glutDisplayFunc(MyDisplay);\r\n\r\n        if (<\/span><span style=\"color: rgb(69, 174, 52); font-weight: 700; font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">LoadGLTextures<\/span><span style=\"font-family: \uad74\ub9bc\uccb4, &quot;Courier New&quot;, &quot;Lucida Console&quot;; font-size: 12px;\">(argv[1])) {\r\n            glEnable(GL_TEXTURE_2D);\r\n            glShadeModel(GL_SMOOTH);\r\n            glClearDepth(1.0);\r\n            glEnable(GL_DEPTH_TEST);\r\n            glDepthFunc(GL_LEQUAL);\r\n            glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);\r\n            glutTimerFunc(50, SpinControl, 1);\r\n        } \/\/ end of if\r\n\r\n        glutMainLoop( );\r\n    } \/\/ end of else\r\n}<\/span><\/pre>\n\n\n<div class=\"wp-block-file\"><a href=\"\/blog\/wp-content\/uploads\/cms_xe\/bin0094\">\ucd5c\uc885\uc5f0\uad6c\uacfc\uc81c\ub17c\ubb38.pdf<\/a><a href=\"\/blog\/wp-content\/uploads\/cms_xe\/bin0094\" class=\"wp-block-file__button\" download>\ub2e4\uc6b4\ub85c\ub4dc<\/a><\/div>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[29],"tags":[],"class_list":["post-726","post","type-post","status-publish","format-standard","hentry","category-multi_copter_base"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=726"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/726\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}