{"action":"created","comment":{"url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/comments/56280917","id":56280917,"diff_hunk":"@@ -0,0 +1,74 @@\n+function [ mode ] = collision_pred( t, X, x_vel, y_vel, map)\n+% This function can judge whether the robot will hit the map boundaries or\n+% obstacles and returens a strategy (the output \"mode\") to avoid the\n+% collision.\n+\n+% Encode each hitting situation into a binary code [a,b,c,d], in which \n+% the element \"a\" represents the coordinate to the left of the predicted robot position,\n+% the element \"b\" represents the coordinate above the predicted robot position,\n+% the element \"c\" represents the coordinate to the right of the predicted robot position,\n+% the element \"d\" represents the coordinate under of the predictied robot position,\n+\n+% Size of the real map\n+[M N] = size(map);\n+% Predition of robot positions\n+    pred_x = X(1,t-1) + x_vel; % X-axis position at next time step (t)\n+    pred_y = X(2,t-1) + y_vel; % Y-axis position at next time step (t)\n+\n+% Combination of comparision vector (coordinate)\n+    if ((pred_x == 1) || (pred_x == N)) % If the robot hit the vertical boundaries\n+        if x_vel<0\n+          coordinate = [ 1, map( pred_x,pred_y+1), map( pred_x+1, pred_y), map( pred_x, pred_y-1) ]; % Left boundary\n+        else x_vel>0","path":"matlab_simulation/04-sensor/scanner_bresenham/collision_pred.m","position":22,"original_position":22,"commit_id":"e38b3536eb6dd2972bf4751e526ae616cb4e4211","original_commit_id":"e38b3536eb6dd2972bf4751e526ae616cb4e4211","user":{"login":"icolwell","id":16585141,"avatar_url":"https://avatars.githubusercontent.com/u/16585141?v=3","gravatar_id":"","url":"https://api.github.com/users/icolwell","html_url":"https://github.com/icolwell","followers_url":"https://api.github.com/users/icolwell/followers","following_url":"https://api.github.com/users/icolwell/following{/other_user}","gists_url":"https://api.github.com/users/icolwell/gists{/gist_id}","starred_url":"https://api.github.com/users/icolwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icolwell/subscriptions","organizations_url":"https://api.github.com/users/icolwell/orgs","repos_url":"https://api.github.com/users/icolwell/repos","events_url":"https://api.github.com/users/icolwell/events{/privacy}","received_events_url":"https://api.github.com/users/icolwell/received_events","type":"User","site_admin":false},"body":"Should this line and line 30 be elseif rather than else? The code seemed to work which is weird.....","created_at":"2016-03-16T04:38:56Z","updated_at":"2016-03-16T04:38:56Z","html_url":"https://github.com/WaterlooRobotics/mobilerobotics/pull/45#discussion_r56280917","pull_request_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/comments/56280917"},"html":{"href":"https://github.com/WaterlooRobotics/mobilerobotics/pull/45#discussion_r56280917"},"pull_request":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/45","id":61869576,"html_url":"https://github.com/WaterlooRobotics/mobilerobotics/pull/45","diff_url":"https://github.com/WaterlooRobotics/mobilerobotics/pull/45.diff","patch_url":"https://github.com/WaterlooRobotics/mobilerobotics/pull/45.patch","issue_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/45","number":45,"state":"open","locked":false,"title":"i04-Scanner ","user":{"login":"Rujie92","id":17360766,"avatar_url":"https://avatars.githubusercontent.com/u/17360766?v=3","gravatar_id":"","url":"https://api.github.com/users/Rujie92","html_url":"https://github.com/Rujie92","followers_url":"https://api.github.com/users/Rujie92/followers","following_url":"https://api.github.com/users/Rujie92/following{/other_user}","gists_url":"https://api.github.com/users/Rujie92/gists{/gist_id}","starred_url":"https://api.github.com/users/Rujie92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rujie92/subscriptions","organizations_url":"https://api.github.com/users/Rujie92/orgs","repos_url":"https://api.github.com/users/Rujie92/repos","events_url":"https://api.github.com/users/Rujie92/events{/privacy}","received_events_url":"https://api.github.com/users/Rujie92/received_events","type":"User","site_admin":false},"body":"Contains an example using Bresenham algorithm to draw a line when scanning","created_at":"2016-03-07T03:43:39Z","updated_at":"2016-03-16T04:38:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bcf1dab0bb4684638bbfd5a61599ea87db87e71d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/45/commits","review_comments_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/45/comments","review_comment_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/45/comments","statuses_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/statuses/e38b3536eb6dd2972bf4751e526ae616cb4e4211","head":{"label":"WaterlooRobotics:i04-Scanner-and-inversescanner-model-refinement","ref":"i04-Scanner-and-inversescanner-model-refinement","sha":"e38b3536eb6dd2972bf4751e526ae616cb4e4211","user":{"login":"WaterlooRobotics","id":17301733,"avatar_url":"https://avatars.githubusercontent.com/u/17301733?v=3","gravatar_id":"","url":"https://api.github.com/users/WaterlooRobotics","html_url":"https://github.com/WaterlooRobotics","followers_url":"https://api.github.com/users/WaterlooRobotics/followers","following_url":"https://api.github.com/users/WaterlooRobotics/following{/other_user}","gists_url":"https://api.github.com/users/WaterlooRobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/WaterlooRobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WaterlooRobotics/subscriptions","organizations_url":"https://api.github.com/users/WaterlooRobotics/orgs","repos_url":"https://api.github.com/users/WaterlooRobotics/repos","events_url":"https://api.github.com/users/WaterlooRobotics/events{/privacy}","received_events_url":"https://api.github.com/users/WaterlooRobotics/received_events","type":"Organization","site_admin":false},"repo":{"id":47763011,"name":"mobilerobotics","full_name":"WaterlooRobotics/mobilerobotics","owner":{"login":"WaterlooRobotics","id":17301733,"avatar_url":"https://avatars.githubusercontent.com/u/17301733?v=3","gravatar_id":"","url":"https://api.github.com/users/WaterlooRobotics","html_url":"https://github.com/WaterlooRobotics","followers_url":"https://api.github.com/users/WaterlooRobotics/followers","following_url":"https://api.github.com/users/WaterlooRobotics/following{/other_user}","gists_url":"https://api.github.com/users/WaterlooRobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/WaterlooRobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WaterlooRobotics/subscriptions","organizations_url":"https://api.github.com/users/WaterlooRobotics/orgs","repos_url":"https://api.github.com/users/WaterlooRobotics/repos","events_url":"https://api.github.com/users/WaterlooRobotics/events{/privacy}","received_events_url":"https://api.github.com/users/WaterlooRobotics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WaterlooRobotics/mobilerobotics","description":"Matlab and Robot code for ME 597: Autonomous Mobile Robotics at the University of Waterloo","fork":false,"url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics","forks_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/forks","keys_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/teams","hooks_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/hooks","issue_events_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/events{/number}","events_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/events","assignees_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/assignees{/user}","branches_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/branches{/branch}","tags_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/tags","blobs_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/refs{/sha}","trees_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/statuses/{sha}","languages_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/languages","stargazers_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/stargazers","contributors_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/contributors","subscribers_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/subscribers","subscription_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/subscription","commits_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/commits{/sha}","git_commits_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/commits{/sha}","comments_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/comments{/number}","issue_comment_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/comments{/number}","contents_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/contents/{+path}","compare_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/merges","archive_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/downloads","issues_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues{/number}","pulls_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls{/number}","milestones_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/milestones{/number}","notifications_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/labels{/name}","releases_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/releases{/id}","deployments_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/deployments","created_at":"2015-12-10T13:19:41Z","updated_at":"2016-03-03T00:09:24Z","pushed_at":"2016-03-16T01:31:06Z","git_url":"git://github.com/WaterlooRobotics/mobilerobotics.git","ssh_url":"git@github.com:WaterlooRobotics/mobilerobotics.git","clone_url":"https://github.com/WaterlooRobotics/mobilerobotics.git","svn_url":"https://github.com/WaterlooRobotics/mobilerobotics","homepage":null,"size":1087,"stargazers_count":6,"watchers_count":6,"language":"Matlab","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":46,"forks":6,"open_issues":46,"watchers":6,"default_branch":"master"}},"base":{"label":"WaterlooRobotics:master","ref":"master","sha":"b7dca812285a293b547f74957dafb98c1881b231","user":{"login":"WaterlooRobotics","id":17301733,"avatar_url":"https://avatars.githubusercontent.com/u/17301733?v=3","gravatar_id":"","url":"https://api.github.com/users/WaterlooRobotics","html_url":"https://github.com/WaterlooRobotics","followers_url":"https://api.github.com/users/WaterlooRobotics/followers","following_url":"https://api.github.com/users/WaterlooRobotics/following{/other_user}","gists_url":"https://api.github.com/users/WaterlooRobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/WaterlooRobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WaterlooRobotics/subscriptions","organizations_url":"https://api.github.com/users/WaterlooRobotics/orgs","repos_url":"https://api.github.com/users/WaterlooRobotics/repos","events_url":"https://api.github.com/users/WaterlooRobotics/events{/privacy}","received_events_url":"https://api.github.com/users/WaterlooRobotics/received_events","type":"Organization","site_admin":false},"repo":{"id":47763011,"name":"mobilerobotics","full_name":"WaterlooRobotics/mobilerobotics","owner":{"login":"WaterlooRobotics","id":17301733,"avatar_url":"https://avatars.githubusercontent.com/u/17301733?v=3","gravatar_id":"","url":"https://api.github.com/users/WaterlooRobotics","html_url":"https://github.com/WaterlooRobotics","followers_url":"https://api.github.com/users/WaterlooRobotics/followers","following_url":"https://api.github.com/users/WaterlooRobotics/following{/other_user}","gists_url":"https://api.github.com/users/WaterlooRobotics/gists{/gist_id}","starred_url":"https://api.github.com/users/WaterlooRobotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WaterlooRobotics/subscriptions","organizations_url":"https://api.github.com/users/WaterlooRobotics/orgs","repos_url":"https://api.github.com/users/WaterlooRobotics/repos","events_url":"https://api.github.com/users/WaterlooRobotics/events{/privacy}","received_events_url":"https://api.github.com/users/WaterlooRobotics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WaterlooRobotics/mobilerobotics","description":"Matlab and Robot code for ME 597: Autonomous Mobile Robotics at the University of Waterloo","fork":false,"url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics","forks_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/forks","keys_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/teams","hooks_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/hooks","issue_events_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/events{/number}","events_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/events","assignees_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/assignees{/user}","branches_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/branches{/branch}","tags_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/tags","blobs_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/refs{/sha}","trees_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/statuses/{sha}","languages_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/languages","stargazers_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/stargazers","contributors_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/contributors","subscribers_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/subscribers","subscription_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/subscription","commits_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/commits{/sha}","git_commits_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/git/commits{/sha}","comments_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/comments{/number}","issue_comment_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/comments{/number}","contents_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/contents/{+path}","compare_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/merges","archive_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/downloads","issues_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues{/number}","pulls_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls{/number}","milestones_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/milestones{/number}","notifications_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/labels{/name}","releases_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/releases{/id}","deployments_url":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/deployments","created_at":"2015-12-10T13:19:41Z","updated_at":"2016-03-03T00:09:24Z","pushed_at":"2016-03-16T01:31:06Z","git_url":"git://github.com/WaterlooRobotics/mobilerobotics.git","ssh_url":"git@github.com:WaterlooRobotics/mobilerobotics.git","clone_url":"https://github.com/WaterlooRobotics/mobilerobotics.git","svn_url":"https://github.com/WaterlooRobotics/mobilerobotics","homepage":null,"size":1087,"stargazers_count":6,"watchers_count":6,"language":"Matlab","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":46,"forks":6,"open_issues":46,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/45"},"html":{"href":"https://github.com/WaterlooRobotics/mobilerobotics/pull/45"},"issue":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/45"},"comments":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/WaterlooRobotics/mobilerobotics/statuses/e38b3536eb6dd2972bf4751e526ae616cb4e4211"}}}}