{"action":"created","comment":{"url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/pulls/comments/37756634","id":37756634,"diff_hunk":"@@ -0,0 +1,133 @@\n+#ifndef HYBRID_PLANNER_H\n+#define HYBRID_PLANNER_H\n+\n+#include <ros/ros.h>\n+#include <actionlib/client/simple_action_client.h>\n+#include <control_msgs/FollowJointTrajectoryAction.h>\n+#include <descartes_moveit/moveit_state_adapter.h>\n+#include <descartes_planner/dense_planner.h>\n+#include <descartes_planner/sparse_planner.h>\n+#include <descartes_trajectory/axial_symmetric_pt.h>\n+#include <descartes_trajectory/cart_trajectory_pt.h>\n+#include <moveit/move_group_interface/move_group.h>\n+#include <moveit/robot_model_loader/robot_model_loader.h>\n+#include <moveit/robot_state/conversions.h>\n+#include <moveit/robot_trajectory/robot_trajectory.h>\n+#include <moveit/trajectory_processing/iterative_time_parameterization.h>\n+#include <moveit_msgs/DisplayTrajectory.h>\n+\n+namespace Hamilton\n+{\n+  using namespace descartes_core;\n+  using namespace descartes_trajectory;\n+\n+  /* ===== utilities ===== */\n+  typedef std::vector<descartes_core::TrajectoryPtPtr> TrajectoryVec;\n+  typedef TrajectoryVec::const_iterator TrajectoryIter; //TODO redundant use auto. \n+  enum TrajectorySegmentType {FREE_MOTION, PROCESS_PATH, FREE_MOTION_START_END_ONLY};\n+  \n+  /*  =============================== Hybrid Configuration Struct ===============================\n+  * Is a member of HybridPlanner class and allows to define a few parameters required by MoveIt! and Descartes*/\n+\n+  struct HybridConfiguration\n+  {\n+    std::string group_name;        // = \"manipulator\";               /* Name of the manipulation group containing the relevant links in the robot, which is what you define when running MoveitSetupAssistant */\n+    std::string robot_description; // = \"robot_description\";         /* Name of description on parameter server. Typically just \"robot_description\". */\n+    std::string tcp_frame;         // = \"tool0\";                     /* Tool center point frame (name of link associated with tool. Usually the last link in the kinematic chain of the robot */\n+    std::string base_link;         //                                /* The name of the base link of the robot */\n+    std::string world_frame;       // = \"base_link\" OR \"world_frame\";/* The name of the world link in the URDF file, the frame in which you are expressing poses. */\n+                                                                     /* Typically \"world_frame\" or \"base_link\". */\n+    std::vector<std::string> joint_names;                            /* A list with the names of the mobile joints in the robot */ \n+                                                                     // 2nd param of toROSJointTrajectory()\n+    // MoveIt! params\n+    double plan_time;   // = 10.0;                      \n+    double step_size;  // = 0.01; \n+    double jump_thresh; // =0;\n+    bool moveit_replan;\n+    bool avoid_collision;\n+    std::string moveit_planner_type;\n+    \n+    // Descartes params\n+    std::string descartes_planner_type;\n+    double time_delay; // = 1.0; Last param of toROSJointTrajectory() \n+    double time_offset; // = 0.0; Used inside toROSJointTrajectory()\n+  };\n+\n+  /*  =============================== TrajectorySegment Struct ===============================\n+  * Struct to store the unplanned segments, and categorize them as free and process path. \n+  * Note: The third type \"FREE_MOTION_START_END_ONLY\" isn't used right now.\n+  * The idea is to call the MoveIt planner via a MotionPlanning Request in this case, via the PlanHybrid method.  \n+  * TODO Add more data structures in TrajectorySegment - joint vals, descartes type itself, etc */\n+\n+  struct TrajectorySegment\n+  {\n+    TrajectorySegmentType type_;      \n+    std::vector<geometry_msgs::Pose> waypoints_geom_msgs_;\n+  }; \n+\n+  /*  =============================== Hybrid Planner Class ===============================\n+   * Provides a group of functions for planning a robot path using Moveit and  the Descartes Planning Library */\n+\n+  class HybridPlanner\n+  {\n+    public:\n+      HybridPlanner();\n+      virtual ~HybridPlanner();\n+      // Initialize (descartes) robot model and planners\n+      void init();\n+\n+    protected:\n+      // Append unplanned free space/process path segments defined by \"waypoints' to unplanned_trajectory_ as a TrajectorySegment object. \n+      // TODO extend to other types - joints, descartes types, etc.\n+    \tvoid appendFreeMotionTrajectorySegment(std::vector<geometry_msgs::Pose>& waypoints);\n+    \tvoid appendProcessPathTrajectorySegment(std::vector<geometry_msgs::Pose>& waypoints);\n+\n+      // Appends unplanned free space segment, defined by start and end point only as a TrajectorySegment object. \n+      void appendFreeMotionTrajectorySegment(geometry_msgs::Pose start_pose, geometry_msgs::Pose end_pose);\n+\n+      // Iterates through the unplanned_trajectory_vector, and calls MoveIt! and Descartes planners as required.\n+      // Saves the planned, joint space trajectory in overall_robot_traj_, which can be send for execution to the controller.\n+      // TODO Not Implemented: Makes a motion planning request if the TrajetorySegemnt.type_ == FREE_MOTION_START_END_ONLY\n+    \tvoid PlanHybrid();","path":"hamilton/include/hamilton/hybrid_planner.h","position":91,"original_position":91,"commit_id":"ae80eda922f2770729426b742b8a08cf717af2f0","original_commit_id":"ae80eda922f2770729426b742b8a08cf717af2f0","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 method name doesn't follow the [method naming convention](http://wiki.ros.org/CppStyleGuide#Function_.2BAC8_Methods)","created_at":"2015-08-24T14:27:59Z","updated_at":"2015-08-24T14:27:59Z","html_url":"https://github.com/ros-industrial-consortium/hamilton/pull/3#discussion_r37756634","pull_request_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/ros-industrial-consortium/hamilton/pulls/comments/37756634"},"html":{"href":"https://github.com/ros-industrial-consortium/hamilton/pull/3#discussion_r37756634"},"pull_request":{"href":"https://api.github.com/repos/ros-industrial-consortium/hamilton/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/pulls/3","id":43052478,"html_url":"https://github.com/ros-industrial-consortium/hamilton/pull/3","diff_url":"https://github.com/ros-industrial-consortium/hamilton/pull/3.diff","patch_url":"https://github.com/ros-industrial-consortium/hamilton/pull/3.patch","issue_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/issues/3","number":3,"state":"open","locked":false,"title":"HybridPlanner class","user":{"login":"madratman","id":6305323,"avatar_url":"https://avatars.githubusercontent.com/u/6305323?v=3","gravatar_id":"","url":"https://api.github.com/users/madratman","html_url":"https://github.com/madratman","followers_url":"https://api.github.com/users/madratman/followers","following_url":"https://api.github.com/users/madratman/following{/other_user}","gists_url":"https://api.github.com/users/madratman/gists{/gist_id}","starred_url":"https://api.github.com/users/madratman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madratman/subscriptions","organizations_url":"https://api.github.com/users/madratman/orgs","repos_url":"https://api.github.com/users/madratman/repos","events_url":"https://api.github.com/users/madratman/events{/privacy}","received_events_url":"https://api.github.com/users/madratman/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-21T15:52:50Z","updated_at":"2015-08-24T14:27:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8eae0f066dde59855b3adcb6b36aca9aac29346e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/pulls/3/commits","review_comments_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/pulls/3/comments","review_comment_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/issues/3/comments","statuses_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/statuses/ae80eda922f2770729426b742b8a08cf717af2f0","head":{"label":"madratman:PR_4_OOPed_version","ref":"PR_4_OOPed_version","sha":"ae80eda922f2770729426b742b8a08cf717af2f0","user":{"login":"madratman","id":6305323,"avatar_url":"https://avatars.githubusercontent.com/u/6305323?v=3","gravatar_id":"","url":"https://api.github.com/users/madratman","html_url":"https://github.com/madratman","followers_url":"https://api.github.com/users/madratman/followers","following_url":"https://api.github.com/users/madratman/following{/other_user}","gists_url":"https://api.github.com/users/madratman/gists{/gist_id}","starred_url":"https://api.github.com/users/madratman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madratman/subscriptions","organizations_url":"https://api.github.com/users/madratman/orgs","repos_url":"https://api.github.com/users/madratman/repos","events_url":"https://api.github.com/users/madratman/events{/privacy}","received_events_url":"https://api.github.com/users/madratman/received_events","type":"User","site_admin":false},"repo":{"id":36703665,"name":"hamilton","full_name":"madratman/hamilton","owner":{"login":"madratman","id":6305323,"avatar_url":"https://avatars.githubusercontent.com/u/6305323?v=3","gravatar_id":"","url":"https://api.github.com/users/madratman","html_url":"https://github.com/madratman","followers_url":"https://api.github.com/users/madratman/followers","following_url":"https://api.github.com/users/madratman/following{/other_user}","gists_url":"https://api.github.com/users/madratman/gists{/gist_id}","starred_url":"https://api.github.com/users/madratman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madratman/subscriptions","organizations_url":"https://api.github.com/users/madratman/orgs","repos_url":"https://api.github.com/users/madratman/repos","events_url":"https://api.github.com/users/madratman/events{/privacy}","received_events_url":"https://api.github.com/users/madratman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/madratman/hamilton","description":"","fork":true,"url":"https://api.github.com/repos/madratman/hamilton","forks_url":"https://api.github.com/repos/madratman/hamilton/forks","keys_url":"https://api.github.com/repos/madratman/hamilton/keys{/key_id}","collaborators_url":"https://api.github.com/repos/madratman/hamilton/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/madratman/hamilton/teams","hooks_url":"https://api.github.com/repos/madratman/hamilton/hooks","issue_events_url":"https://api.github.com/repos/madratman/hamilton/issues/events{/number}","events_url":"https://api.github.com/repos/madratman/hamilton/events","assignees_url":"https://api.github.com/repos/madratman/hamilton/assignees{/user}","branches_url":"https://api.github.com/repos/madratman/hamilton/branches{/branch}","tags_url":"https://api.github.com/repos/madratman/hamilton/tags","blobs_url":"https://api.github.com/repos/madratman/hamilton/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/madratman/hamilton/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/madratman/hamilton/git/refs{/sha}","trees_url":"https://api.github.com/repos/madratman/hamilton/git/trees{/sha}","statuses_url":"https://api.github.com/repos/madratman/hamilton/statuses/{sha}","languages_url":"https://api.github.com/repos/madratman/hamilton/languages","stargazers_url":"https://api.github.com/repos/madratman/hamilton/stargazers","contributors_url":"https://api.github.com/repos/madratman/hamilton/contributors","subscribers_url":"https://api.github.com/repos/madratman/hamilton/subscribers","subscription_url":"https://api.github.com/repos/madratman/hamilton/subscription","commits_url":"https://api.github.com/repos/madratman/hamilton/commits{/sha}","git_commits_url":"https://api.github.com/repos/madratman/hamilton/git/commits{/sha}","comments_url":"https://api.github.com/repos/madratman/hamilton/comments{/number}","issue_comment_url":"https://api.github.com/repos/madratman/hamilton/issues/comments{/number}","contents_url":"https://api.github.com/repos/madratman/hamilton/contents/{+path}","compare_url":"https://api.github.com/repos/madratman/hamilton/compare/{base}...{head}","merges_url":"https://api.github.com/repos/madratman/hamilton/merges","archive_url":"https://api.github.com/repos/madratman/hamilton/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/madratman/hamilton/downloads","issues_url":"https://api.github.com/repos/madratman/hamilton/issues{/number}","pulls_url":"https://api.github.com/repos/madratman/hamilton/pulls{/number}","milestones_url":"https://api.github.com/repos/madratman/hamilton/milestones{/number}","notifications_url":"https://api.github.com/repos/madratman/hamilton/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/madratman/hamilton/labels{/name}","releases_url":"https://api.github.com/repos/madratman/hamilton/releases{/id}","created_at":"2015-06-02T02:50:39Z","updated_at":"2015-06-02T02:46:45Z","pushed_at":"2015-08-21T17:21:49Z","git_url":"git://github.com/madratman/hamilton.git","ssh_url":"git@github.com:madratman/hamilton.git","clone_url":"https://github.com/madratman/hamilton.git","svn_url":"https://github.com/madratman/hamilton","homepage":null,"size":30236,"stargazers_count":0,"watchers_count":0,"language":null,"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":"ros-industrial-consortium:master","ref":"master","sha":"1dfff4d58d7aa7e73ea25af6d56411194a16e60c","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":36703285,"name":"hamilton","full_name":"ros-industrial-consortium/hamilton","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/hamilton","description":"","fork":false,"url":"https://api.github.com/repos/ros-industrial-consortium/hamilton","forks_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/forks","keys_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/teams","hooks_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/hooks","issue_events_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/issues/events{/number}","events_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/events","assignees_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/assignees{/user}","branches_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/branches{/branch}","tags_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/tags","blobs_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/statuses/{sha}","languages_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/languages","stargazers_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/stargazers","contributors_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/contributors","subscribers_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/subscribers","subscription_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/subscription","commits_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/contents/{+path}","compare_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/merges","archive_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/downloads","issues_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/issues{/number}","pulls_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/pulls{/number}","milestones_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/milestones{/number}","notifications_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/labels{/name}","releases_url":"https://api.github.com/repos/ros-industrial-consortium/hamilton/releases{/id}","created_at":"2015-06-02T02:43:01Z","updated_at":"2015-08-21T15:18:47Z","pushed_at":"2015-08-21T17:21:50Z","git_url":"git://github.com/ros-industrial-consortium/hamilton.git","ssh_url":"git@github.com:ros-industrial-consortium/hamilton.git","clone_url":"https://github.com/ros-industrial-consortium/hamilton.git","svn_url":"https://github.com/ros-industrial-consortium/hamilton","homepage":null,"size":30292,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ros-industrial-consortium/hamilton/pulls/3"},"html":{"href":"https://github.com/ros-industrial-consortium/hamilton/pull/3"},"issue":{"href":"https://api.github.com/repos/ros-industrial-consortium/hamilton/issues/3"},"comments":{"href":"https://api.github.com/repos/ros-industrial-consortium/hamilton/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/ros-industrial-consortium/hamilton/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/ros-industrial-consortium/hamilton/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros-industrial-consortium/hamilton/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/ros-industrial-consortium/hamilton/statuses/ae80eda922f2770729426b742b8a08cf717af2f0"}}}}