Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef GRASPSEQUENCEVALIDATOR_H_
00009 #define GRASPSEQUENCEVALIDATOR_H_
00010
00011
00012 #include "object_manipulator/grasp_execution/approach_lift_grasp.h"
00013 #include <arm_kinematics_constraint_aware/arm_kinematics_solver_constraint_aware.h>
00014 #include <pluginlib/class_loader.h>
00015 #include <object_manipulator/grasp_execution/grasp_tester_fast.h>
00016
00018
00036 class GraspSequenceValidator : public object_manipulator::GraspTester
00037 {
00038 public:
00039 struct GraspSequenceDetails: public object_manipulator::GraspExecutionInfo
00040 {
00041 public:
00042
00043 trajectory_msgs::JointTrajectory twist_trajectory_;
00044 };
00045
00046 protected:
00047
00049 virtual std::vector<arm_navigation_msgs::LinkPadding>
00050 linkPaddingForGrasp(const object_manipulation_msgs::PickupGoal &pickup_goal);
00051
00052 bool getInterpolatedIK(const std::string& arm_name,
00053 const tf::Transform& first_pose,
00054 const tf::Vector3& direction,
00055 const double& distance,
00056 const std::vector<double>& ik_solution,
00057 const bool& reverse,
00058 const bool& premultiply,
00059 trajectory_msgs::JointTrajectory& traj);
00060
00061 bool getInterpolatedIK(const std::string& arm_name,
00062 const tf::Transform& initialTransform,
00063 const tf::Quaternion &rot,
00064 const std::vector<double>& ikSolutionAtStart,
00065 std::vector<double>& ikSolutionAtEnd,
00066 trajectory_msgs::JointTrajectory& traj);
00067
00068 std::map<std::string, arm_kinematics_constraint_aware::ArmKinematicsSolverConstraintAware*> ik_solver_map_;
00069 double consistent_angle_;
00070 unsigned int num_points_;
00071 unsigned int redundancy_;
00072
00073 ros::Publisher vis_marker_array_publisher_;
00074 ros::Publisher vis_marker_publisher_;
00075
00076 planning_environment::CollisionModels* getCollisionModels();
00077 planning_models::KinematicState* getPlanningSceneState();
00078
00079 planning_environment::CollisionModels* cm_;
00080 planning_models::KinematicState* state_;
00081
00082 public:
00083
00084 pluginlib::ClassLoader<kinematics::KinematicsBase> kinematics_loader_;
00085
00087 GraspSequenceValidator(planning_environment::CollisionModels* cm = NULL,
00088 const std::string& plugin_name="");
00089
00090 ~GraspSequenceValidator();
00091
00092 void setPlanningSceneState(planning_models::KinematicState* state)
00093 {
00094 state_ = state;
00095 }
00096
00097 void getGroupJoints(const std::string& group_name,
00098 std::vector<std::string>& group_links);
00099
00100 void getGroupLinks(const std::string& group_name,
00101 std::vector<std::string>& group_links);
00102
00103 virtual void testGrasp(const object_manipulation_msgs::PickupGoal &pickup_goal,
00104 const object_manipulation_msgs::Grasp &grasp,
00105 object_manipulator::GraspExecutionInfo &execution_info)
00106 {
00107
00108
00109 }
00110
00111 virtual void testGrasps(const object_manipulation_msgs::PickupGoal &pickup_goal,
00112 const std::vector<object_manipulation_msgs::Grasp> &grasps,
00113 std::vector<object_manipulator::GraspExecutionInfo> &execution_info,
00114 bool return_on_first_hit);
00115
00116 virtual void testGrasps(const object_manipulation_msgs::PickupGoal &pickup_goal,
00117 const std::vector<object_manipulation_msgs::Grasp> &grasps,double twistAngle,
00118 std::vector<GraspSequenceDetails> &execution_info,
00119 bool return_on_first_hit);
00120 };
00121
00122
00123 #endif