{"action":"created","comment":{"url":"https://api.github.com/repos/stonier/cost_map/pulls/comments/87143745","pull_request_review_id":7766751,"id":87143745,"diff_hunk":"@@ -357,33 +357,46 @@ CostMapPtr fromROSCostMap2D(costmap_2d::Costmap2DROS& ros_costmap, cost_map::Len\n   // TODO check the result\n   cost_map::Position position;\n   position << tf_pose.getOrigin().x() , tf_pose.getOrigin().y();\n-  float resolution = ros_costmap.getCostmap()->getResolution();\n+  double resolution = ros_costmap.getCostmap()->getResolution();\n   cost_map->setFrameId(ros_costmap.getGlobalFrameID());\n   cost_map->setGeometry(geometry, resolution, position);\n   cost_map->setTimestamp(tf_pose.stamp_.toNSec());\n \n-  float subwindow_bottom_left_x = position.x() - geometry.x() / 2.0;\n-  float subwindow_bottom_left_y = position.y() - geometry.y() / 2.0;\n+  double subwindow_bottom_left_x = (position.x() - geometry.x()) * 0.5;\n+  double subwindow_bottom_left_y = (position.y() - geometry.y()) * 0.5;\n+\n+  double original_size_x = ros_costmap.getCostmap()->getSizeInMetersX();\n+  double original_size_y = ros_costmap.getCostmap()->getSizeInMetersX();\n \n //  std::cout << \"From ROS Costmap2D\" << std::endl;\n //  std::cout << \"  Robot Pose        : \" << position.x() << \",\" << position.y() << std::endl;\n //  std::cout << \"  Bottom Left Corner: \" << subwindow_bottom_left_x << \",\" << subwindow_bottom_left_y << std::endl;\n //  std::cout << \"  Resolution        : \" << resolution << std::endl;\n //  std::cout << \"  Size              : \" << geometry.x() << \"x\" << geometry.y() << std::endl;\n+//  std::cout << \"  Original Size     : \" << original_size_x << \"x\" << original_size_y << std::endl;\n+\n   bool is_subwindow = false;\n   // why do we need to lock - why don't they lock for us?\n   {\n     boost::lock_guard<costmap_2d::Costmap2D::mutex_t> lock(*(ros_costmap.getCostmap()->getMutex()));\n-    is_subwindow = costmap_subwindow.copyCostmapWindow(\n+\n+    if((geometry.x() == original_size_x && geometry.y() == original_size_y)\n+        || geometry.x() == 0.0 || geometry.y() == 0.0) {\n+      is_subwindow = true;\n+      costmap_subwindow = costmap_2d::Costmap2D(*(ros_costmap.getCostmap())); //be aware of some black magic in here","path":"cost_map/src/lib/converter.cpp","position":34,"original_position":34,"commit_id":"add2a428bc9bb1f351d7c80b206f171405a1f776","original_commit_id":"add2a428bc9bb1f351d7c80b206f171405a1f776","user":{"login":"stonier","id":687378,"avatar_url":"https://avatars.githubusercontent.com/u/687378?v=3","gravatar_id":"","url":"https://api.github.com/users/stonier","html_url":"https://github.com/stonier","followers_url":"https://api.github.com/users/stonier/followers","following_url":"https://api.github.com/users/stonier/following{/other_user}","gists_url":"https://api.github.com/users/stonier/gists{/gist_id}","starred_url":"https://api.github.com/users/stonier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stonier/subscriptions","organizations_url":"https://api.github.com/users/stonier/orgs","repos_url":"https://api.github.com/users/stonier/repos","events_url":"https://api.github.com/users/stonier/events{/privacy}","received_events_url":"https://api.github.com/users/stonier/received_events","type":"User","site_admin":false},"body":"Is it actually necessary to do a copy in this case?","created_at":"2016-11-09T07:33:29Z","updated_at":"2016-11-09T07:33:29Z","html_url":"https://github.com/stonier/cost_map/pull/19#discussion_r87143745","pull_request_url":"https://api.github.com/repos/stonier/cost_map/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/stonier/cost_map/pulls/comments/87143745"},"html":{"href":"https://github.com/stonier/cost_map/pull/19#discussion_r87143745"},"pull_request":{"href":"https://api.github.com/repos/stonier/cost_map/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/stonier/cost_map/pulls/19","id":92729760,"html_url":"https://github.com/stonier/cost_map/pull/19","diff_url":"https://github.com/stonier/cost_map/pull/19.diff","patch_url":"https://github.com/stonier/cost_map/pull/19.patch","issue_url":"https://api.github.com/repos/stonier/cost_map/issues/19","number":19,"state":"open","locked":false,"title":"Request with zero size return full costmap","user":{"login":"AlexReimann","id":7090417,"avatar_url":"https://avatars.githubusercontent.com/u/7090417?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexReimann","html_url":"https://github.com/AlexReimann","followers_url":"https://api.github.com/users/AlexReimann/followers","following_url":"https://api.github.com/users/AlexReimann/following{/other_user}","gists_url":"https://api.github.com/users/AlexReimann/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexReimann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexReimann/subscriptions","organizations_url":"https://api.github.com/users/AlexReimann/orgs","repos_url":"https://api.github.com/users/AlexReimann/repos","events_url":"https://api.github.com/users/AlexReimann/events{/privacy}","received_events_url":"https://api.github.com/users/AlexReimann/received_events","type":"User","site_admin":false},"body":"Partly fixes issue #15.","created_at":"2016-11-08T07:48:22Z","updated_at":"2016-11-09T07:33:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fa6d7519ed7e339f7119c05b18501e23fc9fa8f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/stonier/cost_map/pulls/19/commits","review_comments_url":"https://api.github.com/repos/stonier/cost_map/pulls/19/comments","review_comment_url":"https://api.github.com/repos/stonier/cost_map/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stonier/cost_map/issues/19/comments","statuses_url":"https://api.github.com/repos/stonier/cost_map/statuses/add2a428bc9bb1f351d7c80b206f171405a1f776","head":{"label":"AlexReimann:fix_max_resolution_request","ref":"fix_max_resolution_request","sha":"add2a428bc9bb1f351d7c80b206f171405a1f776","user":{"login":"AlexReimann","id":7090417,"avatar_url":"https://avatars.githubusercontent.com/u/7090417?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexReimann","html_url":"https://github.com/AlexReimann","followers_url":"https://api.github.com/users/AlexReimann/followers","following_url":"https://api.github.com/users/AlexReimann/following{/other_user}","gists_url":"https://api.github.com/users/AlexReimann/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexReimann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexReimann/subscriptions","organizations_url":"https://api.github.com/users/AlexReimann/orgs","repos_url":"https://api.github.com/users/AlexReimann/repos","events_url":"https://api.github.com/users/AlexReimann/events{/privacy}","received_events_url":"https://api.github.com/users/AlexReimann/received_events","type":"User","site_admin":false},"repo":{"id":73161812,"name":"cost_map","full_name":"AlexReimann/cost_map","owner":{"login":"AlexReimann","id":7090417,"avatar_url":"https://avatars.githubusercontent.com/u/7090417?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexReimann","html_url":"https://github.com/AlexReimann","followers_url":"https://api.github.com/users/AlexReimann/followers","following_url":"https://api.github.com/users/AlexReimann/following{/other_user}","gists_url":"https://api.github.com/users/AlexReimann/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexReimann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexReimann/subscriptions","organizations_url":"https://api.github.com/users/AlexReimann/orgs","repos_url":"https://api.github.com/users/AlexReimann/repos","events_url":"https://api.github.com/users/AlexReimann/events{/privacy}","received_events_url":"https://api.github.com/users/AlexReimann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexReimann/cost_map","description":"Costmaps, directly analogous to ethz-asl's grid_map library.","fork":true,"url":"https://api.github.com/repos/AlexReimann/cost_map","forks_url":"https://api.github.com/repos/AlexReimann/cost_map/forks","keys_url":"https://api.github.com/repos/AlexReimann/cost_map/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexReimann/cost_map/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexReimann/cost_map/teams","hooks_url":"https://api.github.com/repos/AlexReimann/cost_map/hooks","issue_events_url":"https://api.github.com/repos/AlexReimann/cost_map/issues/events{/number}","events_url":"https://api.github.com/repos/AlexReimann/cost_map/events","assignees_url":"https://api.github.com/repos/AlexReimann/cost_map/assignees{/user}","branches_url":"https://api.github.com/repos/AlexReimann/cost_map/branches{/branch}","tags_url":"https://api.github.com/repos/AlexReimann/cost_map/tags","blobs_url":"https://api.github.com/repos/AlexReimann/cost_map/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexReimann/cost_map/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexReimann/cost_map/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexReimann/cost_map/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexReimann/cost_map/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexReimann/cost_map/languages","stargazers_url":"https://api.github.com/repos/AlexReimann/cost_map/stargazers","contributors_url":"https://api.github.com/repos/AlexReimann/cost_map/contributors","subscribers_url":"https://api.github.com/repos/AlexReimann/cost_map/subscribers","subscription_url":"https://api.github.com/repos/AlexReimann/cost_map/subscription","commits_url":"https://api.github.com/repos/AlexReimann/cost_map/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexReimann/cost_map/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexReimann/cost_map/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexReimann/cost_map/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexReimann/cost_map/contents/{+path}","compare_url":"https://api.github.com/repos/AlexReimann/cost_map/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexReimann/cost_map/merges","archive_url":"https://api.github.com/repos/AlexReimann/cost_map/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexReimann/cost_map/downloads","issues_url":"https://api.github.com/repos/AlexReimann/cost_map/issues{/number}","pulls_url":"https://api.github.com/repos/AlexReimann/cost_map/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexReimann/cost_map/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexReimann/cost_map/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexReimann/cost_map/labels{/name}","releases_url":"https://api.github.com/repos/AlexReimann/cost_map/releases{/id}","deployments_url":"https://api.github.com/repos/AlexReimann/cost_map/deployments","created_at":"2016-11-08T07:46:42Z","updated_at":"2016-11-08T07:46:43Z","pushed_at":"2016-11-08T07:47:34Z","git_url":"git://github.com/AlexReimann/cost_map.git","ssh_url":"git@github.com:AlexReimann/cost_map.git","clone_url":"https://github.com/AlexReimann/cost_map.git","svn_url":"https://github.com/AlexReimann/cost_map","homepage":null,"size":707,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"stonier:devel","ref":"devel","sha":"284f241c9ec7742ee8d278a2683f2f1dedb528ab","user":{"login":"stonier","id":687378,"avatar_url":"https://avatars.githubusercontent.com/u/687378?v=3","gravatar_id":"","url":"https://api.github.com/users/stonier","html_url":"https://github.com/stonier","followers_url":"https://api.github.com/users/stonier/followers","following_url":"https://api.github.com/users/stonier/following{/other_user}","gists_url":"https://api.github.com/users/stonier/gists{/gist_id}","starred_url":"https://api.github.com/users/stonier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stonier/subscriptions","organizations_url":"https://api.github.com/users/stonier/orgs","repos_url":"https://api.github.com/users/stonier/repos","events_url":"https://api.github.com/users/stonier/events{/privacy}","received_events_url":"https://api.github.com/users/stonier/received_events","type":"User","site_admin":false},"repo":{"id":50812247,"name":"cost_map","full_name":"stonier/cost_map","owner":{"login":"stonier","id":687378,"avatar_url":"https://avatars.githubusercontent.com/u/687378?v=3","gravatar_id":"","url":"https://api.github.com/users/stonier","html_url":"https://github.com/stonier","followers_url":"https://api.github.com/users/stonier/followers","following_url":"https://api.github.com/users/stonier/following{/other_user}","gists_url":"https://api.github.com/users/stonier/gists{/gist_id}","starred_url":"https://api.github.com/users/stonier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stonier/subscriptions","organizations_url":"https://api.github.com/users/stonier/orgs","repos_url":"https://api.github.com/users/stonier/repos","events_url":"https://api.github.com/users/stonier/events{/privacy}","received_events_url":"https://api.github.com/users/stonier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stonier/cost_map","description":"Costmaps, directly analogous to ethz-asl's grid_map library.","fork":false,"url":"https://api.github.com/repos/stonier/cost_map","forks_url":"https://api.github.com/repos/stonier/cost_map/forks","keys_url":"https://api.github.com/repos/stonier/cost_map/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stonier/cost_map/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stonier/cost_map/teams","hooks_url":"https://api.github.com/repos/stonier/cost_map/hooks","issue_events_url":"https://api.github.com/repos/stonier/cost_map/issues/events{/number}","events_url":"https://api.github.com/repos/stonier/cost_map/events","assignees_url":"https://api.github.com/repos/stonier/cost_map/assignees{/user}","branches_url":"https://api.github.com/repos/stonier/cost_map/branches{/branch}","tags_url":"https://api.github.com/repos/stonier/cost_map/tags","blobs_url":"https://api.github.com/repos/stonier/cost_map/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stonier/cost_map/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stonier/cost_map/git/refs{/sha}","trees_url":"https://api.github.com/repos/stonier/cost_map/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stonier/cost_map/statuses/{sha}","languages_url":"https://api.github.com/repos/stonier/cost_map/languages","stargazers_url":"https://api.github.com/repos/stonier/cost_map/stargazers","contributors_url":"https://api.github.com/repos/stonier/cost_map/contributors","subscribers_url":"https://api.github.com/repos/stonier/cost_map/subscribers","subscription_url":"https://api.github.com/repos/stonier/cost_map/subscription","commits_url":"https://api.github.com/repos/stonier/cost_map/commits{/sha}","git_commits_url":"https://api.github.com/repos/stonier/cost_map/git/commits{/sha}","comments_url":"https://api.github.com/repos/stonier/cost_map/comments{/number}","issue_comment_url":"https://api.github.com/repos/stonier/cost_map/issues/comments{/number}","contents_url":"https://api.github.com/repos/stonier/cost_map/contents/{+path}","compare_url":"https://api.github.com/repos/stonier/cost_map/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stonier/cost_map/merges","archive_url":"https://api.github.com/repos/stonier/cost_map/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stonier/cost_map/downloads","issues_url":"https://api.github.com/repos/stonier/cost_map/issues{/number}","pulls_url":"https://api.github.com/repos/stonier/cost_map/pulls{/number}","milestones_url":"https://api.github.com/repos/stonier/cost_map/milestones{/number}","notifications_url":"https://api.github.com/repos/stonier/cost_map/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stonier/cost_map/labels{/name}","releases_url":"https://api.github.com/repos/stonier/cost_map/releases{/id}","deployments_url":"https://api.github.com/repos/stonier/cost_map/deployments","created_at":"2016-02-01T03:50:15Z","updated_at":"2016-02-01T04:57:45Z","pushed_at":"2016-11-08T07:48:22Z","git_url":"git://github.com/stonier/cost_map.git","ssh_url":"git@github.com:stonier/cost_map.git","clone_url":"https://github.com/stonier/cost_map.git","svn_url":"https://github.com/stonier/cost_map","homepage":null,"size":708,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":0,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/stonier/cost_map/pulls/19"},"html":{"href":"https://github.com/stonier/cost_map/pull/19"},"issue":{"href":"https://api.github.com/repos/stonier/cost_map/issues/19"},"comments":{"href":"https://api.github.com/repos/stonier/cost_map/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/stonier/cost_map/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/stonier/cost_map/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stonier/cost_map/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/stonier/cost_map/statuses/add2a428bc9bb1f351d7c80b206f171405a1f776"}}}}
{"actor":{"display_login":"stonier"}}