{"action":"created","comment":{"url":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls/comments/25381492","id":25381492,"diff_hunk":"@@ -0,0 +1,82 @@\n+/*\n+ * Software License Agreement (Apache License)\n+ *\n+ * Copyright (c) 2014, Southwest Research Institute\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+#include <descartes_trajectory/cartesian_interpolator.h>\n+#include <tf_conversions/tf_eigen.h>\n+#include \"descartes_trajectory_test/cartesian_robot.h\"\n+#include <gtest/gtest.h>\n+\n+using namespace descartes_core;\n+using namespace descartes_trajectory;\n+using namespace descartes_trajectory_test;\n+\n+const static double TOOL_SPEED = 0.01f; // m/s\n+const static double ZONE_RADIUS = 0.01f; // meters\n+const static double INTERPOLATION_INTERVAL = 0.1f; // secs\n+const static double POINT_DISTANCE = 0.1f;\n+const static int NUM_POINTS = 4;\n+const double POS_RANGE = 2.0;\n+const double ORIENT_RANGE = 1.0;\n+\n+\n+void createSimpleTrajectory(std::vector<CartTrajectoryPt>& traj)\n+{\n+\n+  double points = NUM_POINTS;\n+  double angular_z_step = M_PI/2;\n+  tf::Vector3 linear_step = tf::Vector3(0,POINT_DISTANCE,0);\n+  tf::Transform pose = tf::Transform::getIdentity();\n+  Eigen::Affine3d eigen_pose;\n+\n+  traj.resize(NUM_POINTS);\n+  for(int i = 0; i < points; i++)\n+  {\n+    pose = pose * tf::Transform(tf::Quaternion(tf::Vector3(0,0,1),i * angular_z_step))*\n+        tf::Transform(tf::Quaternion::getIdentity(),linear_step);\n+    tf::poseTFToEigen(pose,eigen_pose);\n+    traj[i] = CartTrajectoryPt(eigen_pose);\n+  }\n+}\n+\n+TEST(CartesianInterpolator,interpolate)\n+{\n+  descartes_trajectory::CartesianInterpolator c;\n+  std::vector<CartTrajectoryPt> coarse_traj;\n+  std::vector<descartes_core::TrajectoryPtPtr> interpolated_traj;\n+  RobotModelConstPtr robot(new CartesianRobot(POS_RANGE, ORIENT_RANGE,6));\n+\n+  // initializing interpolator\n+  EXPECT_TRUE(c.initialize(robot,TOOL_SPEED,INTERPOLATION_INTERVAL,ZONE_RADIUS));\n+\n+  // interpolating\n+  int expected_points = ((POINT_DISTANCE/TOOL_SPEED)/INTERPOLATION_INTERVAL)*(NUM_POINTS - 1) + 1 ;\n+  createSimpleTrajectory(coarse_traj);\n+  EXPECT_TRUE(c.interpolate(coarse_traj,interpolated_traj));\n+\n+  // expected point count\n+  EXPECT_TRUE(interpolated_traj.size() == expected_points);","path":"descartes_trajectory/test/cartesian_interpolator.cpp","position":72,"original_position":72,"commit_id":"bf207cd3409ae8db77246a3794e06dfca272fe80","original_commit_id":"dd37660490e95c32948adffbdc5db06e6e61380b","user":{"login":"shaun-edwards","id":2932571,"avatar_url":"https://avatars.githubusercontent.com/u/2932571?v=3","gravatar_id":"","url":"https://api.github.com/users/shaun-edwards","html_url":"https://github.com/shaun-edwards","followers_url":"https://api.github.com/users/shaun-edwards/followers","following_url":"https://api.github.com/users/shaun-edwards/following{/other_user}","gists_url":"https://api.github.com/users/shaun-edwards/gists{/gist_id}","starred_url":"https://api.github.com/users/shaun-edwards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaun-edwards/subscriptions","organizations_url":"https://api.github.com/users/shaun-edwards/orgs","repos_url":"https://api.github.com/users/shaun-edwards/repos","events_url":"https://api.github.com/users/shaun-edwards/events{/privacy}","received_events_url":"https://api.github.com/users/shaun-edwards/received_events","type":"User","site_admin":false},"body":"This is a good check, but we could still be missing something.  I did something similar for point sampling and that caused some problems, if you remember.","created_at":"2015-02-25T21:36:08Z","updated_at":"2015-02-25T21:36:08Z","html_url":"https://github.com/ros-industrial-consortium/descartes/pull/62#discussion_r25381492","pull_request_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls/62","_links":{"self":{"href":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls/comments/25381492"},"html":{"href":"https://github.com/ros-industrial-consortium/descartes/pull/62#discussion_r25381492"},"pull_request":{"href":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls/62","id":29775133,"html_url":"https://github.com/ros-industrial-consortium/descartes/pull/62","diff_url":"https://github.com/ros-industrial-consortium/descartes/pull/62.diff","patch_url":"https://github.com/ros-industrial-consortium/descartes/pull/62.patch","issue_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/issues/62","number":62,"state":"open","locked":false,"title":"Issue #51 interpolator","user":{"login":"jrgnicho","id":3279718,"avatar_url":"https://avatars.githubusercontent.com/u/3279718?v=3","gravatar_id":"","url":"https://api.github.com/users/jrgnicho","html_url":"https://github.com/jrgnicho","followers_url":"https://api.github.com/users/jrgnicho/followers","following_url":"https://api.github.com/users/jrgnicho/following{/other_user}","gists_url":"https://api.github.com/users/jrgnicho/gists{/gist_id}","starred_url":"https://api.github.com/users/jrgnicho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrgnicho/subscriptions","organizations_url":"https://api.github.com/users/jrgnicho/orgs","repos_url":"https://api.github.com/users/jrgnicho/repos","events_url":"https://api.github.com/users/jrgnicho/events{/privacy}","received_events_url":"https://api.github.com/users/jrgnicho/received_events","type":"User","site_admin":false},"body":"This PR adds the CartesianInterpolator class which addresses the following high level objectives:\r\n- Generates a dense trajectory by interpolating between the points of a dense trajectory in cartesian space.\r\n- It assumes that the tool moves at a constant linear speed through the entire trajectory.\r\n- It uses the user defined tool speed and time interval in order to determine the trajectory density (how close the points are to one another).\r\n- No parabolic blending or accelerations profiles are being generated at the moment.\r\n- This class should help guide designing a template for a future interpolator interfaces.","created_at":"2015-02-22T19:20:27Z","updated_at":"2015-02-25T21:36:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a3ac37c954d09ed4f9eb7d543ecc5de49d12852","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls/62/commits","review_comments_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls/62/comments","review_comment_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/issues/62/comments","statuses_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/statuses/bf207cd3409ae8db77246a3794e06dfca272fe80","head":{"label":"ros-industrial-consortium:issue_#51_interpolator","ref":"issue_#51_interpolator","sha":"bf207cd3409ae8db77246a3794e06dfca272fe80","user":{"login":"ros-industrial-consortium","id":6336074,"avatar_url":"https://avatars.githubusercontent.com/u/6336074?v=3","gravatar_id":"","url":"https://api.github.com/users/ros-industrial-consortium","html_url":"https://github.com/ros-industrial-consortium","followers_url":"https://api.github.com/users/ros-industrial-consortium/followers","following_url":"https://api.github.com/users/ros-industrial-consortium/following{/other_user}","gists_url":"https://api.github.com/users/ros-industrial-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/ros-industrial-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros-industrial-consortium/subscriptions","organizations_url":"https://api.github.com/users/ros-industrial-consortium/orgs","repos_url":"https://api.github.com/users/ros-industrial-consortium/repos","events_url":"https://api.github.com/users/ros-industrial-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/ros-industrial-consortium/received_events","type":"Organization","site_admin":false},"repo":{"id":19514912,"name":"descartes","full_name":"ros-industrial-consortium/descartes","owner":{"login":"ros-industrial-consortium","id":6336074,"avatar_url":"https://avatars.githubusercontent.com/u/6336074?v=3","gravatar_id":"","url":"https://api.github.com/users/ros-industrial-consortium","html_url":"https://github.com/ros-industrial-consortium","followers_url":"https://api.github.com/users/ros-industrial-consortium/followers","following_url":"https://api.github.com/users/ros-industrial-consortium/following{/other_user}","gists_url":"https://api.github.com/users/ros-industrial-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/ros-industrial-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros-industrial-consortium/subscriptions","organizations_url":"https://api.github.com/users/ros-industrial-consortium/orgs","repos_url":"https://api.github.com/users/ros-industrial-consortium/repos","events_url":"https://api.github.com/users/ros-industrial-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/ros-industrial-consortium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros-industrial-consortium/descartes","description":"ROS-Industrial Special Project: Cartesian Path Planner","fork":false,"url":"https://api.github.com/repos/ros-industrial-consortium/descartes","forks_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/forks","keys_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/teams","hooks_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/hooks","issue_events_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/issues/events{/number}","events_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/events","assignees_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/assignees{/user}","branches_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/branches{/branch}","tags_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/tags","blobs_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/statuses/{sha}","languages_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/languages","stargazers_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/stargazers","contributors_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/contributors","subscribers_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/subscribers","subscription_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/subscription","commits_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/contents/{+path}","compare_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/merges","archive_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/downloads","issues_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/issues{/number}","pulls_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls{/number}","milestones_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/milestones{/number}","notifications_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/labels{/name}","releases_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/releases{/id}","created_at":"2014-05-06T23:55:32Z","updated_at":"2015-02-18T16:15:15Z","pushed_at":"2015-02-24T21:23:19Z","git_url":"git://github.com/ros-industrial-consortium/descartes.git","ssh_url":"git@github.com:ros-industrial-consortium/descartes.git","clone_url":"https://github.com/ros-industrial-consortium/descartes.git","svn_url":"https://github.com/ros-industrial-consortium/descartes","homepage":"","size":1009,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":22,"forks":5,"open_issues":22,"watchers":3,"default_branch":"hydro-devel"}},"base":{"label":"ros-industrial-consortium:hydro-devel","ref":"hydro-devel","sha":"500fe713b6c590e60bb47ae7496183f62d256c1a","user":{"login":"ros-industrial-consortium","id":6336074,"avatar_url":"https://avatars.githubusercontent.com/u/6336074?v=3","gravatar_id":"","url":"https://api.github.com/users/ros-industrial-consortium","html_url":"https://github.com/ros-industrial-consortium","followers_url":"https://api.github.com/users/ros-industrial-consortium/followers","following_url":"https://api.github.com/users/ros-industrial-consortium/following{/other_user}","gists_url":"https://api.github.com/users/ros-industrial-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/ros-industrial-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros-industrial-consortium/subscriptions","organizations_url":"https://api.github.com/users/ros-industrial-consortium/orgs","repos_url":"https://api.github.com/users/ros-industrial-consortium/repos","events_url":"https://api.github.com/users/ros-industrial-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/ros-industrial-consortium/received_events","type":"Organization","site_admin":false},"repo":{"id":19514912,"name":"descartes","full_name":"ros-industrial-consortium/descartes","owner":{"login":"ros-industrial-consortium","id":6336074,"avatar_url":"https://avatars.githubusercontent.com/u/6336074?v=3","gravatar_id":"","url":"https://api.github.com/users/ros-industrial-consortium","html_url":"https://github.com/ros-industrial-consortium","followers_url":"https://api.github.com/users/ros-industrial-consortium/followers","following_url":"https://api.github.com/users/ros-industrial-consortium/following{/other_user}","gists_url":"https://api.github.com/users/ros-industrial-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/ros-industrial-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros-industrial-consortium/subscriptions","organizations_url":"https://api.github.com/users/ros-industrial-consortium/orgs","repos_url":"https://api.github.com/users/ros-industrial-consortium/repos","events_url":"https://api.github.com/users/ros-industrial-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/ros-industrial-consortium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros-industrial-consortium/descartes","description":"ROS-Industrial Special Project: Cartesian Path Planner","fork":false,"url":"https://api.github.com/repos/ros-industrial-consortium/descartes","forks_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/forks","keys_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/teams","hooks_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/hooks","issue_events_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/issues/events{/number}","events_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/events","assignees_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/assignees{/user}","branches_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/branches{/branch}","tags_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/tags","blobs_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/statuses/{sha}","languages_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/languages","stargazers_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/stargazers","contributors_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/contributors","subscribers_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/subscribers","subscription_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/subscription","commits_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/contents/{+path}","compare_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/merges","archive_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/downloads","issues_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/issues{/number}","pulls_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls{/number}","milestones_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/milestones{/number}","notifications_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/labels{/name}","releases_url":"https://api.github.com/repos/ros-industrial-consortium/descartes/releases{/id}","created_at":"2014-05-06T23:55:32Z","updated_at":"2015-02-18T16:15:15Z","pushed_at":"2015-02-24T21:23:19Z","git_url":"git://github.com/ros-industrial-consortium/descartes.git","ssh_url":"git@github.com:ros-industrial-consortium/descartes.git","clone_url":"https://github.com/ros-industrial-consortium/descartes.git","svn_url":"https://github.com/ros-industrial-consortium/descartes","homepage":"","size":1009,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":22,"forks":5,"open_issues":22,"watchers":3,"default_branch":"hydro-devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls/62"},"html":{"href":"https://github.com/ros-industrial-consortium/descartes/pull/62"},"issue":{"href":"https://api.github.com/repos/ros-industrial-consortium/descartes/issues/62"},"comments":{"href":"https://api.github.com/repos/ros-industrial-consortium/descartes/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros-industrial-consortium/descartes/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/ros-industrial-consortium/descartes/statuses/bf207cd3409ae8db77246a3794e06dfca272fe80"}}}}