{"action":"closed","number":41,"pull_request":{"url":"https://api.github.com/repos/ethz-asl/grid_map/pulls/41","id":60055273,"html_url":"https://github.com/ethz-asl/grid_map/pull/41","diff_url":"https://github.com/ethz-asl/grid_map/pull/41.diff","patch_url":"https://github.com/ethz-asl/grid_map/pull/41.patch","issue_url":"https://api.github.com/repos/ethz-asl/grid_map/issues/41","number":41,"state":"closed","locked":false,"title":"getIndexFromPosition() should not return index larger than bufferSize","user":{"login":"czalidis","id":1313541,"avatar_url":"https://avatars.githubusercontent.com/u/1313541?v=3","gravatar_id":"","url":"https://api.github.com/users/czalidis","html_url":"https://github.com/czalidis","followers_url":"https://api.github.com/users/czalidis/followers","following_url":"https://api.github.com/users/czalidis/following{/other_user}","gists_url":"https://api.github.com/users/czalidis/gists{/gist_id}","starred_url":"https://api.github.com/users/czalidis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czalidis/subscriptions","organizations_url":"https://api.github.com/users/czalidis/orgs","repos_url":"https://api.github.com/users/czalidis/repos","events_url":"https://api.github.com/users/czalidis/events{/privacy}","received_events_url":"https://api.github.com/users/czalidis/received_events","type":"User","site_admin":false},"body":"In my first commit I added a test case that tests the return value of `getIndexFromPosition()` when a position right on the edge is given. Turns out that the function returns `true` and the returned index is invalid (index is equal to bufferSize). I noticed that `checkIfPositionWithinMap()` accepts positions that are exactly on the edge of the map but when the index is generated there is no check to validate that the index is still in range.\r\n\r\nMy solution was to modify `checkIfPositionWithinMap()` and not accept positions on the edge of the map. It seems that this change doesn't affect anything else.\r\n\r\nAnother solution (if it is desired to accept edge positions) would be to make sure that the returned index will be in-bounds, in similar fashion as the `limitPositionToRange()` does. In this case, the test that I added in my first commit should pass.\r\n\r\nSince I am not sure about the desired behavior of `checkIfPositionWithinMap()` regarding edge cases, let me know if something else is indeed affected by this change.","created_at":"2016-02-20T18:02:22Z","updated_at":"2016-02-22T09:25:33Z","closed_at":"2016-02-22T09:25:33Z","merged_at":"2016-02-22T09:25:33Z","merge_commit_sha":"6790b98b7735489597ff2d8c555ef3350b1df0f1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ethz-asl/grid_map/pulls/41/commits","review_comments_url":"https://api.github.com/repos/ethz-asl/grid_map/pulls/41/comments","review_comment_url":"https://api.github.com/repos/ethz-asl/grid_map/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethz-asl/grid_map/issues/41/comments","statuses_url":"https://api.github.com/repos/ethz-asl/grid_map/statuses/f8813633b40787cf0a0953eb8f915adf81d3730d","head":{"label":"czalidis:index_from_position","ref":"index_from_position","sha":"f8813633b40787cf0a0953eb8f915adf81d3730d","user":{"login":"czalidis","id":1313541,"avatar_url":"https://avatars.githubusercontent.com/u/1313541?v=3","gravatar_id":"","url":"https://api.github.com/users/czalidis","html_url":"https://github.com/czalidis","followers_url":"https://api.github.com/users/czalidis/followers","following_url":"https://api.github.com/users/czalidis/following{/other_user}","gists_url":"https://api.github.com/users/czalidis/gists{/gist_id}","starred_url":"https://api.github.com/users/czalidis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czalidis/subscriptions","organizations_url":"https://api.github.com/users/czalidis/orgs","repos_url":"https://api.github.com/users/czalidis/repos","events_url":"https://api.github.com/users/czalidis/events{/privacy}","received_events_url":"https://api.github.com/users/czalidis/received_events","type":"User","site_admin":false},"repo":{"id":51541053,"name":"grid_map","full_name":"czalidis/grid_map","owner":{"login":"czalidis","id":1313541,"avatar_url":"https://avatars.githubusercontent.com/u/1313541?v=3","gravatar_id":"","url":"https://api.github.com/users/czalidis","html_url":"https://github.com/czalidis","followers_url":"https://api.github.com/users/czalidis/followers","following_url":"https://api.github.com/users/czalidis/following{/other_user}","gists_url":"https://api.github.com/users/czalidis/gists{/gist_id}","starred_url":"https://api.github.com/users/czalidis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czalidis/subscriptions","organizations_url":"https://api.github.com/users/czalidis/orgs","repos_url":"https://api.github.com/users/czalidis/repos","events_url":"https://api.github.com/users/czalidis/events{/privacy}","received_events_url":"https://api.github.com/users/czalidis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/czalidis/grid_map","description":"Universal grid map library for mobile robotic mapping","fork":true,"url":"https://api.github.com/repos/czalidis/grid_map","forks_url":"https://api.github.com/repos/czalidis/grid_map/forks","keys_url":"https://api.github.com/repos/czalidis/grid_map/keys{/key_id}","collaborators_url":"https://api.github.com/repos/czalidis/grid_map/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/czalidis/grid_map/teams","hooks_url":"https://api.github.com/repos/czalidis/grid_map/hooks","issue_events_url":"https://api.github.com/repos/czalidis/grid_map/issues/events{/number}","events_url":"https://api.github.com/repos/czalidis/grid_map/events","assignees_url":"https://api.github.com/repos/czalidis/grid_map/assignees{/user}","branches_url":"https://api.github.com/repos/czalidis/grid_map/branches{/branch}","tags_url":"https://api.github.com/repos/czalidis/grid_map/tags","blobs_url":"https://api.github.com/repos/czalidis/grid_map/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/czalidis/grid_map/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/czalidis/grid_map/git/refs{/sha}","trees_url":"https://api.github.com/repos/czalidis/grid_map/git/trees{/sha}","statuses_url":"https://api.github.com/repos/czalidis/grid_map/statuses/{sha}","languages_url":"https://api.github.com/repos/czalidis/grid_map/languages","stargazers_url":"https://api.github.com/repos/czalidis/grid_map/stargazers","contributors_url":"https://api.github.com/repos/czalidis/grid_map/contributors","subscribers_url":"https://api.github.com/repos/czalidis/grid_map/subscribers","subscription_url":"https://api.github.com/repos/czalidis/grid_map/subscription","commits_url":"https://api.github.com/repos/czalidis/grid_map/commits{/sha}","git_commits_url":"https://api.github.com/repos/czalidis/grid_map/git/commits{/sha}","comments_url":"https://api.github.com/repos/czalidis/grid_map/comments{/number}","issue_comment_url":"https://api.github.com/repos/czalidis/grid_map/issues/comments{/number}","contents_url":"https://api.github.com/repos/czalidis/grid_map/contents/{+path}","compare_url":"https://api.github.com/repos/czalidis/grid_map/compare/{base}...{head}","merges_url":"https://api.github.com/repos/czalidis/grid_map/merges","archive_url":"https://api.github.com/repos/czalidis/grid_map/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/czalidis/grid_map/downloads","issues_url":"https://api.github.com/repos/czalidis/grid_map/issues{/number}","pulls_url":"https://api.github.com/repos/czalidis/grid_map/pulls{/number}","milestones_url":"https://api.github.com/repos/czalidis/grid_map/milestones{/number}","notifications_url":"https://api.github.com/repos/czalidis/grid_map/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/czalidis/grid_map/labels{/name}","releases_url":"https://api.github.com/repos/czalidis/grid_map/releases{/id}","deployments_url":"https://api.github.com/repos/czalidis/grid_map/deployments","created_at":"2016-02-11T19:33:52Z","updated_at":"2016-02-11T19:33:52Z","pushed_at":"2016-02-20T17:39:15Z","git_url":"git://github.com/czalidis/grid_map.git","ssh_url":"git@github.com:czalidis/grid_map.git","clone_url":"https://github.com/czalidis/grid_map.git","svn_url":"https://github.com/czalidis/grid_map","homepage":"","size":2486,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ethz-asl:master","ref":"master","sha":"e3d28024588958f513c8efba82a008d456228517","user":{"login":"ethz-asl","id":475362,"avatar_url":"https://avatars.githubusercontent.com/u/475362?v=3","gravatar_id":"","url":"https://api.github.com/users/ethz-asl","html_url":"https://github.com/ethz-asl","followers_url":"https://api.github.com/users/ethz-asl/followers","following_url":"https://api.github.com/users/ethz-asl/following{/other_user}","gists_url":"https://api.github.com/users/ethz-asl/gists{/gist_id}","starred_url":"https://api.github.com/users/ethz-asl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethz-asl/subscriptions","organizations_url":"https://api.github.com/users/ethz-asl/orgs","repos_url":"https://api.github.com/users/ethz-asl/repos","events_url":"https://api.github.com/users/ethz-asl/events{/privacy}","received_events_url":"https://api.github.com/users/ethz-asl/received_events","type":"Organization","site_admin":false},"repo":{"id":23927994,"name":"grid_map","full_name":"ethz-asl/grid_map","owner":{"login":"ethz-asl","id":475362,"avatar_url":"https://avatars.githubusercontent.com/u/475362?v=3","gravatar_id":"","url":"https://api.github.com/users/ethz-asl","html_url":"https://github.com/ethz-asl","followers_url":"https://api.github.com/users/ethz-asl/followers","following_url":"https://api.github.com/users/ethz-asl/following{/other_user}","gists_url":"https://api.github.com/users/ethz-asl/gists{/gist_id}","starred_url":"https://api.github.com/users/ethz-asl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethz-asl/subscriptions","organizations_url":"https://api.github.com/users/ethz-asl/orgs","repos_url":"https://api.github.com/users/ethz-asl/repos","events_url":"https://api.github.com/users/ethz-asl/events{/privacy}","received_events_url":"https://api.github.com/users/ethz-asl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethz-asl/grid_map","description":"Universal grid map library for mobile robotic mapping","fork":false,"url":"https://api.github.com/repos/ethz-asl/grid_map","forks_url":"https://api.github.com/repos/ethz-asl/grid_map/forks","keys_url":"https://api.github.com/repos/ethz-asl/grid_map/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethz-asl/grid_map/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethz-asl/grid_map/teams","hooks_url":"https://api.github.com/repos/ethz-asl/grid_map/hooks","issue_events_url":"https://api.github.com/repos/ethz-asl/grid_map/issues/events{/number}","events_url":"https://api.github.com/repos/ethz-asl/grid_map/events","assignees_url":"https://api.github.com/repos/ethz-asl/grid_map/assignees{/user}","branches_url":"https://api.github.com/repos/ethz-asl/grid_map/branches{/branch}","tags_url":"https://api.github.com/repos/ethz-asl/grid_map/tags","blobs_url":"https://api.github.com/repos/ethz-asl/grid_map/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethz-asl/grid_map/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethz-asl/grid_map/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethz-asl/grid_map/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethz-asl/grid_map/statuses/{sha}","languages_url":"https://api.github.com/repos/ethz-asl/grid_map/languages","stargazers_url":"https://api.github.com/repos/ethz-asl/grid_map/stargazers","contributors_url":"https://api.github.com/repos/ethz-asl/grid_map/contributors","subscribers_url":"https://api.github.com/repos/ethz-asl/grid_map/subscribers","subscription_url":"https://api.github.com/repos/ethz-asl/grid_map/subscription","commits_url":"https://api.github.com/repos/ethz-asl/grid_map/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethz-asl/grid_map/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethz-asl/grid_map/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethz-asl/grid_map/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethz-asl/grid_map/contents/{+path}","compare_url":"https://api.github.com/repos/ethz-asl/grid_map/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethz-asl/grid_map/merges","archive_url":"https://api.github.com/repos/ethz-asl/grid_map/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethz-asl/grid_map/downloads","issues_url":"https://api.github.com/repos/ethz-asl/grid_map/issues{/number}","pulls_url":"https://api.github.com/repos/ethz-asl/grid_map/pulls{/number}","milestones_url":"https://api.github.com/repos/ethz-asl/grid_map/milestones{/number}","notifications_url":"https://api.github.com/repos/ethz-asl/grid_map/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethz-asl/grid_map/labels{/name}","releases_url":"https://api.github.com/repos/ethz-asl/grid_map/releases{/id}","deployments_url":"https://api.github.com/repos/ethz-asl/grid_map/deployments","created_at":"2014-09-11T17:17:59Z","updated_at":"2016-02-16T15:25:22Z","pushed_at":"2016-02-22T09:25:33Z","git_url":"git://github.com/ethz-asl/grid_map.git","ssh_url":"git@github.com:ethz-asl/grid_map.git","clone_url":"https://github.com/ethz-asl/grid_map.git","svn_url":"https://github.com/ethz-asl/grid_map","homepage":"","size":2477,"stargazers_count":21,"watchers_count":21,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":2,"forks":21,"open_issues":2,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ethz-asl/grid_map/pulls/41"},"html":{"href":"https://github.com/ethz-asl/grid_map/pull/41"},"issue":{"href":"https://api.github.com/repos/ethz-asl/grid_map/issues/41"},"comments":{"href":"https://api.github.com/repos/ethz-asl/grid_map/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/ethz-asl/grid_map/pulls/41/comments"},"review_comment":{"href":"https://api.github.com/repos/ethz-asl/grid_map/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethz-asl/grid_map/pulls/41/commits"},"statuses":{"href":"https://api.github.com/repos/ethz-asl/grid_map/statuses/f8813633b40787cf0a0953eb8f915adf81d3730d"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"pfankhauser","id":2306025,"avatar_url":"https://avatars.githubusercontent.com/u/2306025?v=3","gravatar_id":"","url":"https://api.github.com/users/pfankhauser","html_url":"https://github.com/pfankhauser","followers_url":"https://api.github.com/users/pfankhauser/followers","following_url":"https://api.github.com/users/pfankhauser/following{/other_user}","gists_url":"https://api.github.com/users/pfankhauser/gists{/gist_id}","starred_url":"https://api.github.com/users/pfankhauser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfankhauser/subscriptions","organizations_url":"https://api.github.com/users/pfankhauser/orgs","repos_url":"https://api.github.com/users/pfankhauser/repos","events_url":"https://api.github.com/users/pfankhauser/events{/privacy}","received_events_url":"https://api.github.com/users/pfankhauser/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":2,"additions":5,"deletions":3,"changed_files":2}}