{"action":"created","comment":{"url":"https://api.github.com/repos/ethz-asl/voxblox/pulls/comments/209569951","pull_request_review_id":145606195,"id":209569951,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTU2OTk1MQ==","diff_hunk":"@@ -0,0 +1,181 @@\n+#ifndef VOXBLOX_UTILS_NEIGHBOR_TOOLS_H_\n+#define VOXBLOX_UTILS_NEIGHBOR_TOOLS_H_\n+\n+#include \"voxblox/core/common.h\"\n+#include \"voxblox/core/layer.h\"\n+\n+namespace voxblox {\n+\n+// Define what connectivity you want to have in the voxels.\n+enum Connectivity { kSix = 0, kEighteen, kTwentySix };\n+\n+template <typename VoxelType>\n+class NeighborTools {\n+ public:\n+  NeighborTools() : voxels_per_side_(0) {}\n+  NeighborTools(const Layer<VoxelType>* layer) : layer_(layer) {\n+    CHECK_NOTNULL(layer);\n+    voxels_per_side_ = layer_->voxels_per_side();\n+    CHECK_NE(voxels_per_side_, 0u);\n+  }\n+\n+  void setLayer(const Layer<VoxelType>* layer) {\n+    CHECK_NOTNULL(layer);\n+    layer_ = layer;\n+    voxels_per_side_ = layer_->voxels_per_side();\n+    CHECK_NE(voxels_per_side_, 0u);\n+  }\n+\n+  void getNeighborsAndDistances(\n+      const BlockIndex& block_index, const VoxelIndex& voxel_index,\n+      Connectivity connectivity, AlignedVector<VoxelKey>* neighbors,\n+      AlignedVector<float>* distances,\n+      AlignedVector<Eigen::Vector3i>* directions) const;\n+\n+  void getNeighbor(const BlockIndex& block_index, const VoxelIndex& voxel_index,\n+                   const SignedIndex& direction,\n+                   BlockIndex* neighbor_block_index,\n+                   VoxelIndex* neighbor_voxel_index) const;\n+\n+  SignedIndex getOffsetBetweenVoxels(const BlockIndex& start_block_index,\n+                                     const VoxelIndex& start_voxel_index,\n+                                     const BlockIndex& end_block_index,\n+                                     const VoxelIndex& end_voxel_index) const;\n+\n+ private:\n+  const Layer<VoxelType>* layer_;\n+\n+  size_t voxels_per_side_;\n+};\n+\n+// Uses 26-connectivity and quasi-Euclidean distances.\n+// Directions is the direction that the neighbor voxel lives in. If you\n+// need the direction FROM the neighbor voxel TO the current voxel, take\n+// negative of the given direction.\n+template <typename VoxelType>\n+void NeighborTools<VoxelType>::getNeighborsAndDistances(\n+    const BlockIndex& block_index, const VoxelIndex& voxel_index,\n+    Connectivity connectivity, AlignedVector<VoxelKey>* neighbors,\n+    AlignedVector<float>* distances,\n+    AlignedVector<SignedIndex>* directions) const {\n+  CHECK_NOTNULL(layer_);\n+  CHECK_NOTNULL(neighbors);\n+  CHECK_NOTNULL(distances);\n+  CHECK_NOTNULL(directions);\n+\n+  static const float kSqrt2 = std::sqrt(2);\n+  static const float kSqrt3 = std::sqrt(3);\n+\n+  neighbors->reserve(connectivity);","path":"voxblox/include/voxblox/utils/neighbor_tools.h","position":69,"original_position":69,"commit_id":"3f8b702724aa187652355306708caad03ab89ec7","original_commit_id":"3f8b702724aa187652355306708caad03ab89ec7","user":{"login":"helenol","id":5616392,"node_id":"MDQ6VXNlcjU2MTYzOTI=","avatar_url":"https://avatars3.githubusercontent.com/u/5616392?v=4","gravatar_id":"","url":"https://api.github.com/users/helenol","html_url":"https://github.com/helenol","followers_url":"https://api.github.com/users/helenol/followers","following_url":"https://api.github.com/users/helenol/following{/other_user}","gists_url":"https://api.github.com/users/helenol/gists{/gist_id}","starred_url":"https://api.github.com/users/helenol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helenol/subscriptions","organizations_url":"https://api.github.com/users/helenol/orgs","repos_url":"https://api.github.com/users/helenol/repos","events_url":"https://api.github.com/users/helenol/events{/privacy}","received_events_url":"https://api.github.com/users/helenol/received_events","type":"User","site_admin":false},"body":"Ah whooooops good catch. Yeah this is from before I switched the enums when connectivity was just an int.","created_at":"2018-08-13T11:07:14Z","updated_at":"2018-08-13T11:07:14Z","html_url":"https://github.com/ethz-asl/voxblox/pull/186#discussion_r209569951","pull_request_url":"https://api.github.com/repos/ethz-asl/voxblox/pulls/186","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ethz-asl/voxblox/pulls/comments/209569951"},"html":{"href":"https://github.com/ethz-asl/voxblox/pull/186#discussion_r209569951"},"pull_request":{"href":"https://api.github.com/repos/ethz-asl/voxblox/pulls/186"}},"in_reply_to_id":209520061},"pull_request":{"url":"https://api.github.com/repos/ethz-asl/voxblox/pulls/186","id":203892041,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzODkyMDQx","html_url":"https://github.com/ethz-asl/voxblox/pull/186","diff_url":"https://github.com/ethz-asl/voxblox/pull/186.diff","patch_url":"https://github.com/ethz-asl/voxblox/pull/186.patch","issue_url":"https://api.github.com/repos/ethz-asl/voxblox/issues/186","number":186,"state":"open","locked":false,"title":"Skeleton + Thermal + ARCHE changes","user":{"login":"helenol","id":5616392,"node_id":"MDQ6VXNlcjU2MTYzOTI=","avatar_url":"https://avatars3.githubusercontent.com/u/5616392?v=4","gravatar_id":"","url":"https://api.github.com/users/helenol","html_url":"https://github.com/helenol","followers_url":"https://api.github.com/users/helenol/followers","following_url":"https://api.github.com/users/helenol/following{/other_user}","gists_url":"https://api.github.com/users/helenol/gists{/gist_id}","starred_url":"https://api.github.com/users/helenol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helenol/subscriptions","organizations_url":"https://api.github.com/users/helenol/orgs","repos_url":"https://api.github.com/users/helenol/repos","events_url":"https://api.github.com/users/helenol/events{/privacy}","received_events_url":"https://api.github.com/users/helenol/received_events","type":"User","site_admin":false},"body":"This is an unfortunately massive PR, most of which doesn't affect the normal use-cases at all.\r\n\r\n* Changes to core stuff\r\n  * Add a const version of getVoxelPtrByCoordinates in the block\r\n  * Add getVoxelPtrByCoordinates to the layer (needed this for a long time...)\r\n  * Fix gray colormap\r\n  * Add more colormaps and allow lookup in them by setting min and max in the colormap object\r\n* New voxel types\r\n  * Skeleton voxel - stores information about the GVD/medial axis\r\n    * Skeleton generator - generates a skeleton diagram and a sparse graph from this diagram\r\n    * Skeleton planner - plans in either the skeleton diagram or sparse graph (A* path search)\r\n  * Thermal voxel - stores temperature\r\n    * Thermal integrator - uses existing geometry to project temperature on it\r\n* Utilities\r\n  * Add neighbor look-up tools\r\n  * Add distance look-up tools\r\n\r\nI strongly advise against looking too deep into the skeleton stuff, since uhhhh it's about 8 IEEE pages worth of incomprehensible digital topology method.\r\nMain operation should be unaffected except for what's written in the core stuff above.\r\n\r\n@mfehr @ZacharyTaylor @alexmillane I guess we should discuss where the stuff belongs (voxblox or separate packages?). Maybe the thermal stuff can go separate, but I think the skeleton stuff is just a side-effect of the structure of ESDFs really...","created_at":"2018-07-25T16:20:15Z","updated_at":"2018-08-13T11:07:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"164a3af548c38d4cdb75023fc4a6354d3019bda7","assignee":null,"assignees":[],"requested_reviewers":[{"login":"alexmillane","id":671701,"node_id":"MDQ6VXNlcjY3MTcwMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/671701?v=4","gravatar_id":"","url":"https://api.github.com/users/alexmillane","html_url":"https://github.com/alexmillane","followers_url":"https://api.github.com/users/alexmillane/followers","following_url":"https://api.github.com/users/alexmillane/following{/other_user}","gists_url":"https://api.github.com/users/alexmillane/gists{/gist_id}","starred_url":"https://api.github.com/users/alexmillane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexmillane/subscriptions","organizations_url":"https://api.github.com/users/alexmillane/orgs","repos_url":"https://api.github.com/users/alexmillane/repos","events_url":"https://api.github.com/users/alexmillane/events{/privacy}","received_events_url":"https://api.github.com/users/alexmillane/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ethz-asl/voxblox/pulls/186/commits","review_comments_url":"https://api.github.com/repos/ethz-asl/voxblox/pulls/186/comments","review_comment_url":"https://api.github.com/repos/ethz-asl/voxblox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethz-asl/voxblox/issues/186/comments","statuses_url":"https://api.github.com/repos/ethz-asl/voxblox/statuses/3f8b702724aa187652355306708caad03ab89ec7","head":{"label":"ethz-asl:feature/merge_arche","ref":"feature/merge_arche","sha":"3f8b702724aa187652355306708caad03ab89ec7","user":{"login":"ethz-asl","id":475362,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3NTM2Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/475362?v=4","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":56137228,"node_id":"MDEwOlJlcG9zaXRvcnk1NjEzNzIyOA==","name":"voxblox","full_name":"ethz-asl/voxblox","owner":{"login":"ethz-asl","id":475362,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3NTM2Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/475362?v=4","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/voxblox","description":"A library for flexible voxel-based mapping, mainly focusing on truncated and Euclidean signed distance fields.","fork":false,"url":"https://api.github.com/repos/ethz-asl/voxblox","forks_url":"https://api.github.com/repos/ethz-asl/voxblox/forks","keys_url":"https://api.github.com/repos/ethz-asl/voxblox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethz-asl/voxblox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethz-asl/voxblox/teams","hooks_url":"https://api.github.com/repos/ethz-asl/voxblox/hooks","issue_events_url":"https://api.github.com/repos/ethz-asl/voxblox/issues/events{/number}","events_url":"https://api.github.com/repos/ethz-asl/voxblox/events","assignees_url":"https://api.github.com/repos/ethz-asl/voxblox/assignees{/user}","branches_url":"https://api.github.com/repos/ethz-asl/voxblox/branches{/branch}","tags_url":"https://api.github.com/repos/ethz-asl/voxblox/tags","blobs_url":"https://api.github.com/repos/ethz-asl/voxblox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethz-asl/voxblox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethz-asl/voxblox/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethz-asl/voxblox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethz-asl/voxblox/statuses/{sha}","languages_url":"https://api.github.com/repos/ethz-asl/voxblox/languages","stargazers_url":"https://api.github.com/repos/ethz-asl/voxblox/stargazers","contributors_url":"https://api.github.com/repos/ethz-asl/voxblox/contributors","subscribers_url":"https://api.github.com/repos/ethz-asl/voxblox/subscribers","subscription_url":"https://api.github.com/repos/ethz-asl/voxblox/subscription","commits_url":"https://api.github.com/repos/ethz-asl/voxblox/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethz-asl/voxblox/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethz-asl/voxblox/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethz-asl/voxblox/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethz-asl/voxblox/contents/{+path}","compare_url":"https://api.github.com/repos/ethz-asl/voxblox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethz-asl/voxblox/merges","archive_url":"https://api.github.com/repos/ethz-asl/voxblox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethz-asl/voxblox/downloads","issues_url":"https://api.github.com/repos/ethz-asl/voxblox/issues{/number}","pulls_url":"https://api.github.com/repos/ethz-asl/voxblox/pulls{/number}","milestones_url":"https://api.github.com/repos/ethz-asl/voxblox/milestones{/number}","notifications_url":"https://api.github.com/repos/ethz-asl/voxblox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethz-asl/voxblox/labels{/name}","releases_url":"https://api.github.com/repos/ethz-asl/voxblox/releases{/id}","deployments_url":"https://api.github.com/repos/ethz-asl/voxblox/deployments","created_at":"2016-04-13T09:07:07Z","updated_at":"2018-08-08T17:57:56Z","pushed_at":"2018-08-13T09:31:55Z","git_url":"git://github.com/ethz-asl/voxblox.git","ssh_url":"git@github.com:ethz-asl/voxblox.git","clone_url":"https://github.com/ethz-asl/voxblox.git","svn_url":"https://github.com/ethz-asl/voxblox","homepage":"","size":79860,"stargazers_count":148,"watchers_count":148,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":50,"mirror_url":null,"archived":false,"open_issues_count":13,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":50,"open_issues":13,"watchers":148,"default_branch":"master"}},"base":{"label":"ethz-asl:master","ref":"master","sha":"68dbc610cc2c7eda72a08eb799af742fc333f2eb","user":{"login":"ethz-asl","id":475362,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3NTM2Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/475362?v=4","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":56137228,"node_id":"MDEwOlJlcG9zaXRvcnk1NjEzNzIyOA==","name":"voxblox","full_name":"ethz-asl/voxblox","owner":{"login":"ethz-asl","id":475362,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3NTM2Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/475362?v=4","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/voxblox","description":"A library for flexible voxel-based mapping, mainly focusing on truncated and Euclidean signed distance fields.","fork":false,"url":"https://api.github.com/repos/ethz-asl/voxblox","forks_url":"https://api.github.com/repos/ethz-asl/voxblox/forks","keys_url":"https://api.github.com/repos/ethz-asl/voxblox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethz-asl/voxblox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethz-asl/voxblox/teams","hooks_url":"https://api.github.com/repos/ethz-asl/voxblox/hooks","issue_events_url":"https://api.github.com/repos/ethz-asl/voxblox/issues/events{/number}","events_url":"https://api.github.com/repos/ethz-asl/voxblox/events","assignees_url":"https://api.github.com/repos/ethz-asl/voxblox/assignees{/user}","branches_url":"https://api.github.com/repos/ethz-asl/voxblox/branches{/branch}","tags_url":"https://api.github.com/repos/ethz-asl/voxblox/tags","blobs_url":"https://api.github.com/repos/ethz-asl/voxblox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethz-asl/voxblox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethz-asl/voxblox/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethz-asl/voxblox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethz-asl/voxblox/statuses/{sha}","languages_url":"https://api.github.com/repos/ethz-asl/voxblox/languages","stargazers_url":"https://api.github.com/repos/ethz-asl/voxblox/stargazers","contributors_url":"https://api.github.com/repos/ethz-asl/voxblox/contributors","subscribers_url":"https://api.github.com/repos/ethz-asl/voxblox/subscribers","subscription_url":"https://api.github.com/repos/ethz-asl/voxblox/subscription","commits_url":"https://api.github.com/repos/ethz-asl/voxblox/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethz-asl/voxblox/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethz-asl/voxblox/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethz-asl/voxblox/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethz-asl/voxblox/contents/{+path}","compare_url":"https://api.github.com/repos/ethz-asl/voxblox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethz-asl/voxblox/merges","archive_url":"https://api.github.com/repos/ethz-asl/voxblox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethz-asl/voxblox/downloads","issues_url":"https://api.github.com/repos/ethz-asl/voxblox/issues{/number}","pulls_url":"https://api.github.com/repos/ethz-asl/voxblox/pulls{/number}","milestones_url":"https://api.github.com/repos/ethz-asl/voxblox/milestones{/number}","notifications_url":"https://api.github.com/repos/ethz-asl/voxblox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethz-asl/voxblox/labels{/name}","releases_url":"https://api.github.com/repos/ethz-asl/voxblox/releases{/id}","deployments_url":"https://api.github.com/repos/ethz-asl/voxblox/deployments","created_at":"2016-04-13T09:07:07Z","updated_at":"2018-08-08T17:57:56Z","pushed_at":"2018-08-13T09:31:55Z","git_url":"git://github.com/ethz-asl/voxblox.git","ssh_url":"git@github.com:ethz-asl/voxblox.git","clone_url":"https://github.com/ethz-asl/voxblox.git","svn_url":"https://github.com/ethz-asl/voxblox","homepage":"","size":79860,"stargazers_count":148,"watchers_count":148,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":50,"mirror_url":null,"archived":false,"open_issues_count":13,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":50,"open_issues":13,"watchers":148,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ethz-asl/voxblox/pulls/186"},"html":{"href":"https://github.com/ethz-asl/voxblox/pull/186"},"issue":{"href":"https://api.github.com/repos/ethz-asl/voxblox/issues/186"},"comments":{"href":"https://api.github.com/repos/ethz-asl/voxblox/issues/186/comments"},"review_comments":{"href":"https://api.github.com/repos/ethz-asl/voxblox/pulls/186/comments"},"review_comment":{"href":"https://api.github.com/repos/ethz-asl/voxblox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethz-asl/voxblox/pulls/186/commits"},"statuses":{"href":"https://api.github.com/repos/ethz-asl/voxblox/statuses/3f8b702724aa187652355306708caad03ab89ec7"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"helenol"}}