{"action":"created","comment":{"url":"https://api.github.com/repos/swri-robotics/mapviz/pulls/comments/66314349","id":66314349,"diff_hunk":"@@ -254,6 +286,53 @@ namespace mapviz_plugins\n     }\n   }\n \n+  /**\n+   * Gives a MarkerData that represents an arrow and a transform, this function\n+   * will generate the points involved in drawing the arrow and then transform\n+   * all of them into the target frame.\n+   * @param[inout] markerData A marker that represents an arrow.\n+   * @param[in] transform The tf that should be applied to the arrow's points.\n+   */\n+  void MarkerPlugin::transformArrow(MarkerData& markerData,\n+                      const swri_transform_util::Transform& transform)\n+  {\n+    // The firstpoint in the markerData.points array always represents the\n+    // base of the arrow.\n+    StampedPoint& point = markerData.points.front();\n+    tf::Point arrowOffset;\n+    if (markerData.points.size() == 1)\n+    {\n+      // If the markerData only has a single point, that means its \"point\" is\n+      // the base of the arrow and the arrow's angle and length are determined\n+      // by the orientation and scale_x.\n+      point.transformed_point = transform * (markerData.local_transform * point.point);\n+      tf::Transform arrow_tf(tf::Transform(\n+          transform.GetOrientation()) * point.orientation,\n+          tf::Point(0.0, 0.0, 0.0));\n+      point.transformed_arrow_point = point.transformed_point +\n+          arrow_tf * point.arrow_point * markerData.scale_x;\n+      arrowOffset = tf::Point(0.25, 0.0, 0.0);\n+    }\n+    else\n+    {\n+      // If the markerData has two points, that means that the start and end points\n+      // of the arrow were explicitly specified in the original message, so the\n+      // length and angle are determined by them.\n+      point.transformed_point = transform * point.point;\n+      point.transformed_arrow_point = transform * point.arrow_point;\n+      // Also, in those mode, scale_y is the diameter of the arrow's head.\n+      arrowOffset = tf::Point(0.25 * markerData.scale_y, 0.0, 0.0);\n+    }\n+\n+    tfScalar angle = tf::Point(1.0, 0.0, 0.0).angle(point.transformed_arrow_point - point.transformed_point);","path":"mapviz_plugins/src/marker_plugin.cpp","position":92,"original_position":92,"commit_id":"5cb87dba82a2f41a4cb1a3cb2271330665ce6ad5","original_commit_id":"5cb87dba82a2f41a4cb1a3cb2271330665ce6ad5","user":{"login":"pjreed","id":12546134,"avatar_url":"https://avatars.githubusercontent.com/u/12546134?v=3","gravatar_id":"","url":"https://api.github.com/users/pjreed","html_url":"https://github.com/pjreed","followers_url":"https://api.github.com/users/pjreed/followers","following_url":"https://api.github.com/users/pjreed/following{/other_user}","gists_url":"https://api.github.com/users/pjreed/gists{/gist_id}","starred_url":"https://api.github.com/users/pjreed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjreed/subscriptions","organizations_url":"https://api.github.com/users/pjreed/orgs","repos_url":"https://api.github.com/users/pjreed/repos","events_url":"https://api.github.com/users/pjreed/events{/privacy}","received_events_url":"https://api.github.com/users/pjreed/received_events","type":"User","site_admin":false},"body":"This seems kind of ugly to me, but I didn't find an obviously better way to find the angle of a line that passes through both points; tf::Point::angle returns the difference between the angles of two points relative to the origin.  Am I missing the right way to do this?","created_at":"2016-06-08T18:39:25Z","updated_at":"2016-06-08T18:39:25Z","html_url":"https://github.com/swri-robotics/mapviz/pull/370#discussion_r66314349","pull_request_url":"https://api.github.com/repos/swri-robotics/mapviz/pulls/370","_links":{"self":{"href":"https://api.github.com/repos/swri-robotics/mapviz/pulls/comments/66314349"},"html":{"href":"https://github.com/swri-robotics/mapviz/pull/370#discussion_r66314349"},"pull_request":{"href":"https://api.github.com/repos/swri-robotics/mapviz/pulls/370"}}},"pull_request":{"url":"https://api.github.com/repos/swri-robotics/mapviz/pulls/370","id":73097981,"html_url":"https://github.com/swri-robotics/mapviz/pull/370","diff_url":"https://github.com/swri-robotics/mapviz/pull/370.diff","patch_url":"https://github.com/swri-robotics/mapviz/pull/370.patch","issue_url":"https://api.github.com/repos/swri-robotics/mapviz/issues/370","number":370,"state":"open","locked":false,"title":"Implementing support for the ARROW marker type (Indigo)","user":{"login":"pjreed","id":12546134,"avatar_url":"https://avatars.githubusercontent.com/u/12546134?v=3","gravatar_id":"","url":"https://api.github.com/users/pjreed","html_url":"https://github.com/pjreed","followers_url":"https://api.github.com/users/pjreed/followers","following_url":"https://api.github.com/users/pjreed/following{/other_user}","gists_url":"https://api.github.com/users/pjreed/gists{/gist_id}","starred_url":"https://api.github.com/users/pjreed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjreed/subscriptions","organizations_url":"https://api.github.com/users/pjreed/orgs","repos_url":"https://api.github.com/users/pjreed/repos","events_url":"https://api.github.com/users/pjreed/events{/privacy}","received_events_url":"https://api.github.com/users/pjreed/received_events","type":"User","site_admin":false},"body":"Resolves #365","created_at":"2016-06-08T18:37:21Z","updated_at":"2016-06-08T18:39:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a443e6b8bbb34e13a0687eee0e60dc2cd7392ec","assignee":{"login":"evenator","id":567836,"avatar_url":"https://avatars.githubusercontent.com/u/567836?v=3","gravatar_id":"","url":"https://api.github.com/users/evenator","html_url":"https://github.com/evenator","followers_url":"https://api.github.com/users/evenator/followers","following_url":"https://api.github.com/users/evenator/following{/other_user}","gists_url":"https://api.github.com/users/evenator/gists{/gist_id}","starred_url":"https://api.github.com/users/evenator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evenator/subscriptions","organizations_url":"https://api.github.com/users/evenator/orgs","repos_url":"https://api.github.com/users/evenator/repos","events_url":"https://api.github.com/users/evenator/events{/privacy}","received_events_url":"https://api.github.com/users/evenator/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/swri-robotics/mapviz/pulls/370/commits","review_comments_url":"https://api.github.com/repos/swri-robotics/mapviz/pulls/370/comments","review_comment_url":"https://api.github.com/repos/swri-robotics/mapviz/pulls/comments{/number}","comments_url":"https://api.github.com/repos/swri-robotics/mapviz/issues/370/comments","statuses_url":"https://api.github.com/repos/swri-robotics/mapviz/statuses/5cb87dba82a2f41a4cb1a3cb2271330665ce6ad5","head":{"label":"pjreed:365/arrow-marker-support","ref":"365/arrow-marker-support","sha":"5cb87dba82a2f41a4cb1a3cb2271330665ce6ad5","user":{"login":"pjreed","id":12546134,"avatar_url":"https://avatars.githubusercontent.com/u/12546134?v=3","gravatar_id":"","url":"https://api.github.com/users/pjreed","html_url":"https://github.com/pjreed","followers_url":"https://api.github.com/users/pjreed/followers","following_url":"https://api.github.com/users/pjreed/following{/other_user}","gists_url":"https://api.github.com/users/pjreed/gists{/gist_id}","starred_url":"https://api.github.com/users/pjreed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjreed/subscriptions","organizations_url":"https://api.github.com/users/pjreed/orgs","repos_url":"https://api.github.com/users/pjreed/repos","events_url":"https://api.github.com/users/pjreed/events{/privacy}","received_events_url":"https://api.github.com/users/pjreed/received_events","type":"User","site_admin":false},"repo":{"id":36075183,"name":"mapviz","full_name":"pjreed/mapviz","owner":{"login":"pjreed","id":12546134,"avatar_url":"https://avatars.githubusercontent.com/u/12546134?v=3","gravatar_id":"","url":"https://api.github.com/users/pjreed","html_url":"https://github.com/pjreed","followers_url":"https://api.github.com/users/pjreed/followers","following_url":"https://api.github.com/users/pjreed/following{/other_user}","gists_url":"https://api.github.com/users/pjreed/gists{/gist_id}","starred_url":"https://api.github.com/users/pjreed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjreed/subscriptions","organizations_url":"https://api.github.com/users/pjreed/orgs","repos_url":"https://api.github.com/users/pjreed/repos","events_url":"https://api.github.com/users/pjreed/events{/privacy}","received_events_url":"https://api.github.com/users/pjreed/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pjreed/mapviz","description":"Modular ROS visualization tool for 2D data.","fork":true,"url":"https://api.github.com/repos/pjreed/mapviz","forks_url":"https://api.github.com/repos/pjreed/mapviz/forks","keys_url":"https://api.github.com/repos/pjreed/mapviz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pjreed/mapviz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pjreed/mapviz/teams","hooks_url":"https://api.github.com/repos/pjreed/mapviz/hooks","issue_events_url":"https://api.github.com/repos/pjreed/mapviz/issues/events{/number}","events_url":"https://api.github.com/repos/pjreed/mapviz/events","assignees_url":"https://api.github.com/repos/pjreed/mapviz/assignees{/user}","branches_url":"https://api.github.com/repos/pjreed/mapviz/branches{/branch}","tags_url":"https://api.github.com/repos/pjreed/mapviz/tags","blobs_url":"https://api.github.com/repos/pjreed/mapviz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pjreed/mapviz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pjreed/mapviz/git/refs{/sha}","trees_url":"https://api.github.com/repos/pjreed/mapviz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pjreed/mapviz/statuses/{sha}","languages_url":"https://api.github.com/repos/pjreed/mapviz/languages","stargazers_url":"https://api.github.com/repos/pjreed/mapviz/stargazers","contributors_url":"https://api.github.com/repos/pjreed/mapviz/contributors","subscribers_url":"https://api.github.com/repos/pjreed/mapviz/subscribers","subscription_url":"https://api.github.com/repos/pjreed/mapviz/subscription","commits_url":"https://api.github.com/repos/pjreed/mapviz/commits{/sha}","git_commits_url":"https://api.github.com/repos/pjreed/mapviz/git/commits{/sha}","comments_url":"https://api.github.com/repos/pjreed/mapviz/comments{/number}","issue_comment_url":"https://api.github.com/repos/pjreed/mapviz/issues/comments{/number}","contents_url":"https://api.github.com/repos/pjreed/mapviz/contents/{+path}","compare_url":"https://api.github.com/repos/pjreed/mapviz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pjreed/mapviz/merges","archive_url":"https://api.github.com/repos/pjreed/mapviz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pjreed/mapviz/downloads","issues_url":"https://api.github.com/repos/pjreed/mapviz/issues{/number}","pulls_url":"https://api.github.com/repos/pjreed/mapviz/pulls{/number}","milestones_url":"https://api.github.com/repos/pjreed/mapviz/milestones{/number}","notifications_url":"https://api.github.com/repos/pjreed/mapviz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pjreed/mapviz/labels{/name}","releases_url":"https://api.github.com/repos/pjreed/mapviz/releases{/id}","deployments_url":"https://api.github.com/repos/pjreed/mapviz/deployments","created_at":"2015-05-22T14:00:22Z","updated_at":"2015-05-22T14:00:23Z","pushed_at":"2016-06-08T18:36:54Z","git_url":"git://github.com/pjreed/mapviz.git","ssh_url":"git@github.com:pjreed/mapviz.git","clone_url":"https://github.com/pjreed/mapviz.git","svn_url":"https://github.com/pjreed/mapviz","homepage":null,"size":737,"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":"master"}},"base":{"label":"swri-robotics:indigo-devel","ref":"indigo-devel","sha":"7a814bf664d6a1a321808936eff07978d1431384","user":{"login":"swri-robotics","id":8541585,"avatar_url":"https://avatars.githubusercontent.com/u/8541585?v=3","gravatar_id":"","url":"https://api.github.com/users/swri-robotics","html_url":"https://github.com/swri-robotics","followers_url":"https://api.github.com/users/swri-robotics/followers","following_url":"https://api.github.com/users/swri-robotics/following{/other_user}","gists_url":"https://api.github.com/users/swri-robotics/gists{/gist_id}","starred_url":"https://api.github.com/users/swri-robotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swri-robotics/subscriptions","organizations_url":"https://api.github.com/users/swri-robotics/orgs","repos_url":"https://api.github.com/users/swri-robotics/repos","events_url":"https://api.github.com/users/swri-robotics/events{/privacy}","received_events_url":"https://api.github.com/users/swri-robotics/received_events","type":"Organization","site_admin":false},"repo":{"id":27551673,"name":"mapviz","full_name":"swri-robotics/mapviz","owner":{"login":"swri-robotics","id":8541585,"avatar_url":"https://avatars.githubusercontent.com/u/8541585?v=3","gravatar_id":"","url":"https://api.github.com/users/swri-robotics","html_url":"https://github.com/swri-robotics","followers_url":"https://api.github.com/users/swri-robotics/followers","following_url":"https://api.github.com/users/swri-robotics/following{/other_user}","gists_url":"https://api.github.com/users/swri-robotics/gists{/gist_id}","starred_url":"https://api.github.com/users/swri-robotics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swri-robotics/subscriptions","organizations_url":"https://api.github.com/users/swri-robotics/orgs","repos_url":"https://api.github.com/users/swri-robotics/repos","events_url":"https://api.github.com/users/swri-robotics/events{/privacy}","received_events_url":"https://api.github.com/users/swri-robotics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/swri-robotics/mapviz","description":"Modular ROS visualization tool for 2D data.","fork":false,"url":"https://api.github.com/repos/swri-robotics/mapviz","forks_url":"https://api.github.com/repos/swri-robotics/mapviz/forks","keys_url":"https://api.github.com/repos/swri-robotics/mapviz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swri-robotics/mapviz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swri-robotics/mapviz/teams","hooks_url":"https://api.github.com/repos/swri-robotics/mapviz/hooks","issue_events_url":"https://api.github.com/repos/swri-robotics/mapviz/issues/events{/number}","events_url":"https://api.github.com/repos/swri-robotics/mapviz/events","assignees_url":"https://api.github.com/repos/swri-robotics/mapviz/assignees{/user}","branches_url":"https://api.github.com/repos/swri-robotics/mapviz/branches{/branch}","tags_url":"https://api.github.com/repos/swri-robotics/mapviz/tags","blobs_url":"https://api.github.com/repos/swri-robotics/mapviz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swri-robotics/mapviz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swri-robotics/mapviz/git/refs{/sha}","trees_url":"https://api.github.com/repos/swri-robotics/mapviz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swri-robotics/mapviz/statuses/{sha}","languages_url":"https://api.github.com/repos/swri-robotics/mapviz/languages","stargazers_url":"https://api.github.com/repos/swri-robotics/mapviz/stargazers","contributors_url":"https://api.github.com/repos/swri-robotics/mapviz/contributors","subscribers_url":"https://api.github.com/repos/swri-robotics/mapviz/subscribers","subscription_url":"https://api.github.com/repos/swri-robotics/mapviz/subscription","commits_url":"https://api.github.com/repos/swri-robotics/mapviz/commits{/sha}","git_commits_url":"https://api.github.com/repos/swri-robotics/mapviz/git/commits{/sha}","comments_url":"https://api.github.com/repos/swri-robotics/mapviz/comments{/number}","issue_comment_url":"https://api.github.com/repos/swri-robotics/mapviz/issues/comments{/number}","contents_url":"https://api.github.com/repos/swri-robotics/mapviz/contents/{+path}","compare_url":"https://api.github.com/repos/swri-robotics/mapviz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swri-robotics/mapviz/merges","archive_url":"https://api.github.com/repos/swri-robotics/mapviz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swri-robotics/mapviz/downloads","issues_url":"https://api.github.com/repos/swri-robotics/mapviz/issues{/number}","pulls_url":"https://api.github.com/repos/swri-robotics/mapviz/pulls{/number}","milestones_url":"https://api.github.com/repos/swri-robotics/mapviz/milestones{/number}","notifications_url":"https://api.github.com/repos/swri-robotics/mapviz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swri-robotics/mapviz/labels{/name}","releases_url":"https://api.github.com/repos/swri-robotics/mapviz/releases{/id}","deployments_url":"https://api.github.com/repos/swri-robotics/mapviz/deployments","created_at":"2014-12-04T17:29:22Z","updated_at":"2016-06-06T17:46:22Z","pushed_at":"2016-06-08T18:37:21Z","git_url":"git://github.com/swri-robotics/mapviz.git","ssh_url":"git@github.com:swri-robotics/mapviz.git","clone_url":"https://github.com/swri-robotics/mapviz.git","svn_url":"https://github.com/swri-robotics/mapviz","homepage":null,"size":1062,"stargazers_count":33,"watchers_count":33,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":13,"forks":16,"open_issues":13,"watchers":33,"default_branch":"indigo-devel"}},"_links":{"self":{"href":"https://api.github.com/repos/swri-robotics/mapviz/pulls/370"},"html":{"href":"https://github.com/swri-robotics/mapviz/pull/370"},"issue":{"href":"https://api.github.com/repos/swri-robotics/mapviz/issues/370"},"comments":{"href":"https://api.github.com/repos/swri-robotics/mapviz/issues/370/comments"},"review_comments":{"href":"https://api.github.com/repos/swri-robotics/mapviz/pulls/370/comments"},"review_comment":{"href":"https://api.github.com/repos/swri-robotics/mapviz/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/swri-robotics/mapviz/pulls/370/commits"},"statuses":{"href":"https://api.github.com/repos/swri-robotics/mapviz/statuses/5cb87dba82a2f41a4cb1a3cb2271330665ce6ad5"}}}}
{"actor":{"display_login":"pjreed"}}