{"action":"created","comment":{"url":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls/comments/89052882","pull_request_review_id":9603173,"id":89052882,"diff_hunk":"@@ -0,0 +1,196 @@\n+#include \"arc_header/kalman_filter.h\"\n+\n+KalmanFilter::KalmanFilter(){\n+\n+  initialized_ = false;\n+}\n+\n+bool KalmanFilter::init(const Eigen::VectorXd& x0){\n+\n+  dimension_ = A_.rows();\n+\n+  x_ = x0;\n+  xbar_ = Eigen::VectorXd::Zero(dimension_);\n+  u_ = Eigen::VectorXd::Zero(B_.cols());\n+\n+  P_ = Eigen::MatrixXd::Zero(dimension_,dimension_);\n+  Pbar_ = Eigen::MatrixXd::Zero(dimension_,dimension_);\n+  I_ = Eigen::MatrixXd::Identity(A_.rows(),A_.cols());\n+\n+  initialized_ = true;\n+  first_step_ = true;\n+\n+  clock_t getting_time;\n+\n+  return initialized_;\n+}\n+\n+bool KalmanFilter::init(const Eigen::VectorXd& x0,\n+                        const Eigen::MatrixXd& A,\n+                        const Eigen::MatrixXd& B,\n+                        const Eigen::MatrixXd& H,\n+                        const Eigen::MatrixXd& Q,\n+                        const Eigen::MatrixXd& R){\n+\n+  A_ = A;\n+  B_ = B;\n+  H_ = H;\n+  Q_ = Q;\n+  R_ = R;\n+\n+  return init(x0);\n+}\n+\n+bool KalmanFilter::isinit(){\n+\n+  return initialized_;\n+}\n+\n+bool KalmanFilter::kalmanCore(const double dt,\n+                              const Eigen::MatrixXd& A, const Eigen::MatrixXd& B, const Eigen::MatrixXd& H, \n+                              const Eigen::MatrixXd& R, const Eigen::MatrixXd& Q,\n+                              const Eigen::VectorXd& z){\n+\n+  //Filter already initialised ?\n+  if (initialized_ == false && dt < 0) return initialized_;\n+\n+  //Core Kalman Algorithm\n+  xbar_ = A * x_ + B_ * u_;\n+  Pbar_ = A * P_ * A.transpose() + Q;\n+  K_ = Pbar_ * H.transpose() * (H * Pbar_ * H.transpose() + R).inverse();\n+  x_ = xbar_ + K_ * (z - H * xbar_);\n+  P_ = (I_ - K_ * H) * Pbar_;\n+\n+  return true;\n+}\n+\n+\n+Eigen::VectorXd KalmanFilter::state(){\n+","path":"implementation/kalman_filter.cpp","position":69,"original_position":69,"commit_id":"9012a89ca9bd42c7003b61e27bc566f2d1641039","original_commit_id":"9012a89ca9bd42c7003b61e27bc566f2d1641039","user":{"login":"rdube","id":7094165,"avatar_url":"https://avatars.githubusercontent.com/u/7094165?v=3","gravatar_id":"","url":"https://api.github.com/users/rdube","html_url":"https://github.com/rdube","followers_url":"https://api.github.com/users/rdube/followers","following_url":"https://api.github.com/users/rdube/following{/other_user}","gists_url":"https://api.github.com/users/rdube/gists{/gist_id}","starred_url":"https://api.github.com/users/rdube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdube/subscriptions","organizations_url":"https://api.github.com/users/rdube/orgs","repos_url":"https://api.github.com/users/rdube/repos","events_url":"https://api.github.com/users/rdube/events{/privacy}","received_events_url":"https://api.github.com/users/rdube/received_events","type":"User","site_admin":false},"body":"rm vs","created_at":"2016-11-22T07:01:52Z","updated_at":"2016-11-22T07:01:52Z","html_url":"https://github.com/ProjectARCeth/arc_header/pull/1#discussion_r89052882","pull_request_url":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls/comments/89052882"},"html":{"href":"https://github.com/ProjectARCeth/arc_header/pull/1#discussion_r89052882"},"pull_request":{"href":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls/1","id":94698342,"html_url":"https://github.com/ProjectARCeth/arc_header/pull/1","diff_url":"https://github.com/ProjectARCeth/arc_header/pull/1.diff","patch_url":"https://github.com/ProjectARCeth/arc_header/pull/1.patch","issue_url":"https://api.github.com/repos/ProjectARCeth/arc_header/issues/1","number":1,"state":"open","locked":false,"title":"Work","user":{"login":"SeleSchaefer","id":22253127,"avatar_url":"https://avatars.githubusercontent.com/u/22253127?v=3","gravatar_id":"","url":"https://api.github.com/users/SeleSchaefer","html_url":"https://github.com/SeleSchaefer","followers_url":"https://api.github.com/users/SeleSchaefer/followers","following_url":"https://api.github.com/users/SeleSchaefer/following{/other_user}","gists_url":"https://api.github.com/users/SeleSchaefer/gists{/gist_id}","starred_url":"https://api.github.com/users/SeleSchaefer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeleSchaefer/subscriptions","organizations_url":"https://api.github.com/users/SeleSchaefer/orgs","repos_url":"https://api.github.com/users/SeleSchaefer/repos","events_url":"https://api.github.com/users/SeleSchaefer/events{/privacy}","received_events_url":"https://api.github.com/users/SeleSchaefer/received_events","type":"User","site_admin":false},"body":"@rdube @foehnph ","created_at":"2016-11-21T21:17:18Z","updated_at":"2016-11-22T07:07:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c49b218ab4a16d2d54f42a9bdc90d2fcbf9cea9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ProjectARCeth/arc_header/issues/1/comments","statuses_url":"https://api.github.com/repos/ProjectARCeth/arc_header/statuses/9012a89ca9bd42c7003b61e27bc566f2d1641039","head":{"label":"ProjectARCeth:work","ref":"work","sha":"9012a89ca9bd42c7003b61e27bc566f2d1641039","user":{"login":"ProjectARCeth","id":23221621,"avatar_url":"https://avatars.githubusercontent.com/u/23221621?v=3","gravatar_id":"","url":"https://api.github.com/users/ProjectARCeth","html_url":"https://github.com/ProjectARCeth","followers_url":"https://api.github.com/users/ProjectARCeth/followers","following_url":"https://api.github.com/users/ProjectARCeth/following{/other_user}","gists_url":"https://api.github.com/users/ProjectARCeth/gists{/gist_id}","starred_url":"https://api.github.com/users/ProjectARCeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProjectARCeth/subscriptions","organizations_url":"https://api.github.com/users/ProjectARCeth/orgs","repos_url":"https://api.github.com/users/ProjectARCeth/repos","events_url":"https://api.github.com/users/ProjectARCeth/events{/privacy}","received_events_url":"https://api.github.com/users/ProjectARCeth/received_events","type":"Organization","site_admin":false},"repo":{"id":74125264,"name":"arc_header","full_name":"ProjectARCeth/arc_header","owner":{"login":"ProjectARCeth","id":23221621,"avatar_url":"https://avatars.githubusercontent.com/u/23221621?v=3","gravatar_id":"","url":"https://api.github.com/users/ProjectARCeth","html_url":"https://github.com/ProjectARCeth","followers_url":"https://api.github.com/users/ProjectARCeth/followers","following_url":"https://api.github.com/users/ProjectARCeth/following{/other_user}","gists_url":"https://api.github.com/users/ProjectARCeth/gists{/gist_id}","starred_url":"https://api.github.com/users/ProjectARCeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProjectARCeth/subscriptions","organizations_url":"https://api.github.com/users/ProjectARCeth/orgs","repos_url":"https://api.github.com/users/ProjectARCeth/repos","events_url":"https://api.github.com/users/ProjectARCeth/events{/privacy}","received_events_url":"https://api.github.com/users/ProjectARCeth/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ProjectARCeth/arc_header","description":null,"fork":false,"url":"https://api.github.com/repos/ProjectARCeth/arc_header","forks_url":"https://api.github.com/repos/ProjectARCeth/arc_header/forks","keys_url":"https://api.github.com/repos/ProjectARCeth/arc_header/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ProjectARCeth/arc_header/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ProjectARCeth/arc_header/teams","hooks_url":"https://api.github.com/repos/ProjectARCeth/arc_header/hooks","issue_events_url":"https://api.github.com/repos/ProjectARCeth/arc_header/issues/events{/number}","events_url":"https://api.github.com/repos/ProjectARCeth/arc_header/events","assignees_url":"https://api.github.com/repos/ProjectARCeth/arc_header/assignees{/user}","branches_url":"https://api.github.com/repos/ProjectARCeth/arc_header/branches{/branch}","tags_url":"https://api.github.com/repos/ProjectARCeth/arc_header/tags","blobs_url":"https://api.github.com/repos/ProjectARCeth/arc_header/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ProjectARCeth/arc_header/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ProjectARCeth/arc_header/git/refs{/sha}","trees_url":"https://api.github.com/repos/ProjectARCeth/arc_header/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ProjectARCeth/arc_header/statuses/{sha}","languages_url":"https://api.github.com/repos/ProjectARCeth/arc_header/languages","stargazers_url":"https://api.github.com/repos/ProjectARCeth/arc_header/stargazers","contributors_url":"https://api.github.com/repos/ProjectARCeth/arc_header/contributors","subscribers_url":"https://api.github.com/repos/ProjectARCeth/arc_header/subscribers","subscription_url":"https://api.github.com/repos/ProjectARCeth/arc_header/subscription","commits_url":"https://api.github.com/repos/ProjectARCeth/arc_header/commits{/sha}","git_commits_url":"https://api.github.com/repos/ProjectARCeth/arc_header/git/commits{/sha}","comments_url":"https://api.github.com/repos/ProjectARCeth/arc_header/comments{/number}","issue_comment_url":"https://api.github.com/repos/ProjectARCeth/arc_header/issues/comments{/number}","contents_url":"https://api.github.com/repos/ProjectARCeth/arc_header/contents/{+path}","compare_url":"https://api.github.com/repos/ProjectARCeth/arc_header/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ProjectARCeth/arc_header/merges","archive_url":"https://api.github.com/repos/ProjectARCeth/arc_header/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ProjectARCeth/arc_header/downloads","issues_url":"https://api.github.com/repos/ProjectARCeth/arc_header/issues{/number}","pulls_url":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls{/number}","milestones_url":"https://api.github.com/repos/ProjectARCeth/arc_header/milestones{/number}","notifications_url":"https://api.github.com/repos/ProjectARCeth/arc_header/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ProjectARCeth/arc_header/labels{/name}","releases_url":"https://api.github.com/repos/ProjectARCeth/arc_header/releases{/id}","deployments_url":"https://api.github.com/repos/ProjectARCeth/arc_header/deployments","created_at":"2016-11-18T11:49:41Z","updated_at":"2016-11-18T11:55:08Z","pushed_at":"2016-11-21T21:17:18Z","git_url":"git://github.com/ProjectARCeth/arc_header.git","ssh_url":"git@github.com:ProjectARCeth/arc_header.git","clone_url":"https://github.com/ProjectARCeth/arc_header.git","svn_url":"https://github.com/ProjectARCeth/arc_header","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ProjectARCeth:master","ref":"master","sha":"c5d03f7bcb764df080f040fdb78b7e35ed26cf07","user":{"login":"ProjectARCeth","id":23221621,"avatar_url":"https://avatars.githubusercontent.com/u/23221621?v=3","gravatar_id":"","url":"https://api.github.com/users/ProjectARCeth","html_url":"https://github.com/ProjectARCeth","followers_url":"https://api.github.com/users/ProjectARCeth/followers","following_url":"https://api.github.com/users/ProjectARCeth/following{/other_user}","gists_url":"https://api.github.com/users/ProjectARCeth/gists{/gist_id}","starred_url":"https://api.github.com/users/ProjectARCeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProjectARCeth/subscriptions","organizations_url":"https://api.github.com/users/ProjectARCeth/orgs","repos_url":"https://api.github.com/users/ProjectARCeth/repos","events_url":"https://api.github.com/users/ProjectARCeth/events{/privacy}","received_events_url":"https://api.github.com/users/ProjectARCeth/received_events","type":"Organization","site_admin":false},"repo":{"id":74125264,"name":"arc_header","full_name":"ProjectARCeth/arc_header","owner":{"login":"ProjectARCeth","id":23221621,"avatar_url":"https://avatars.githubusercontent.com/u/23221621?v=3","gravatar_id":"","url":"https://api.github.com/users/ProjectARCeth","html_url":"https://github.com/ProjectARCeth","followers_url":"https://api.github.com/users/ProjectARCeth/followers","following_url":"https://api.github.com/users/ProjectARCeth/following{/other_user}","gists_url":"https://api.github.com/users/ProjectARCeth/gists{/gist_id}","starred_url":"https://api.github.com/users/ProjectARCeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProjectARCeth/subscriptions","organizations_url":"https://api.github.com/users/ProjectARCeth/orgs","repos_url":"https://api.github.com/users/ProjectARCeth/repos","events_url":"https://api.github.com/users/ProjectARCeth/events{/privacy}","received_events_url":"https://api.github.com/users/ProjectARCeth/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ProjectARCeth/arc_header","description":null,"fork":false,"url":"https://api.github.com/repos/ProjectARCeth/arc_header","forks_url":"https://api.github.com/repos/ProjectARCeth/arc_header/forks","keys_url":"https://api.github.com/repos/ProjectARCeth/arc_header/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ProjectARCeth/arc_header/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ProjectARCeth/arc_header/teams","hooks_url":"https://api.github.com/repos/ProjectARCeth/arc_header/hooks","issue_events_url":"https://api.github.com/repos/ProjectARCeth/arc_header/issues/events{/number}","events_url":"https://api.github.com/repos/ProjectARCeth/arc_header/events","assignees_url":"https://api.github.com/repos/ProjectARCeth/arc_header/assignees{/user}","branches_url":"https://api.github.com/repos/ProjectARCeth/arc_header/branches{/branch}","tags_url":"https://api.github.com/repos/ProjectARCeth/arc_header/tags","blobs_url":"https://api.github.com/repos/ProjectARCeth/arc_header/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ProjectARCeth/arc_header/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ProjectARCeth/arc_header/git/refs{/sha}","trees_url":"https://api.github.com/repos/ProjectARCeth/arc_header/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ProjectARCeth/arc_header/statuses/{sha}","languages_url":"https://api.github.com/repos/ProjectARCeth/arc_header/languages","stargazers_url":"https://api.github.com/repos/ProjectARCeth/arc_header/stargazers","contributors_url":"https://api.github.com/repos/ProjectARCeth/arc_header/contributors","subscribers_url":"https://api.github.com/repos/ProjectARCeth/arc_header/subscribers","subscription_url":"https://api.github.com/repos/ProjectARCeth/arc_header/subscription","commits_url":"https://api.github.com/repos/ProjectARCeth/arc_header/commits{/sha}","git_commits_url":"https://api.github.com/repos/ProjectARCeth/arc_header/git/commits{/sha}","comments_url":"https://api.github.com/repos/ProjectARCeth/arc_header/comments{/number}","issue_comment_url":"https://api.github.com/repos/ProjectARCeth/arc_header/issues/comments{/number}","contents_url":"https://api.github.com/repos/ProjectARCeth/arc_header/contents/{+path}","compare_url":"https://api.github.com/repos/ProjectARCeth/arc_header/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ProjectARCeth/arc_header/merges","archive_url":"https://api.github.com/repos/ProjectARCeth/arc_header/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ProjectARCeth/arc_header/downloads","issues_url":"https://api.github.com/repos/ProjectARCeth/arc_header/issues{/number}","pulls_url":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls{/number}","milestones_url":"https://api.github.com/repos/ProjectARCeth/arc_header/milestones{/number}","notifications_url":"https://api.github.com/repos/ProjectARCeth/arc_header/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ProjectARCeth/arc_header/labels{/name}","releases_url":"https://api.github.com/repos/ProjectARCeth/arc_header/releases{/id}","deployments_url":"https://api.github.com/repos/ProjectARCeth/arc_header/deployments","created_at":"2016-11-18T11:49:41Z","updated_at":"2016-11-18T11:55:08Z","pushed_at":"2016-11-21T21:17:18Z","git_url":"git://github.com/ProjectARCeth/arc_header.git","ssh_url":"git@github.com:ProjectARCeth/arc_header.git","clone_url":"https://github.com/ProjectARCeth/arc_header.git","svn_url":"https://github.com/ProjectARCeth/arc_header","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls/1"},"html":{"href":"https://github.com/ProjectARCeth/arc_header/pull/1"},"issue":{"href":"https://api.github.com/repos/ProjectARCeth/arc_header/issues/1"},"comments":{"href":"https://api.github.com/repos/ProjectARCeth/arc_header/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ProjectARCeth/arc_header/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ProjectARCeth/arc_header/statuses/9012a89ca9bd42c7003b61e27bc566f2d1641039"}}}}
{"actor":{"display_login":"rdube"}}