00001 /* 00002 * Software License Agreement (BSD License) 00003 * 00004 * Copyright (c) 2015, Andreas ten Pas 00005 * All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * * Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * * Redistributions in binary form must reproduce the above 00014 * copyright notice, this list of conditions and the following 00015 * disclaimer in the documentation and/or other materials provided 00016 * with the distribution. 00017 * 00018 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00019 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00020 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00021 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00022 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00023 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00024 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00025 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00026 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00027 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00028 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00029 * POSSIBILITY OF SUCH DAMAGE. 00030 */ 00031 00032 #ifndef HANDLE_H_ 00033 #define HANDLE_H_ 00034 00035 #include <Eigen/Dense> 00036 #include <iostream> 00037 #include <vector> 00038 00039 #include <agile_grasp/grasp_hypothesis.h> 00040 00049 class Handle 00050 { 00051 public: 00052 00058 Handle(const std::vector<GraspHypothesis>& hand_list, const std::vector<int>& inliers); 00059 00064 const Eigen::Vector3d& getApproach() const 00065 { 00066 return approach_; 00067 } 00068 00073 const Eigen::Vector3d& getAxis() const 00074 { 00075 return axis_; 00076 } 00077 00082 const Eigen::Vector3d& getCenter() const 00083 { 00084 return center_; 00085 } 00086 00091 const Eigen::Vector3d& getHandsCenter() const 00092 { 00093 return hands_center_; 00094 } 00095 00100 double getWidth() const 00101 { 00102 return width_; 00103 } 00104 00109 const std::vector<GraspHypothesis>& getHandList() const 00110 { 00111 return hand_list_; 00112 } 00113 00118 const std::vector<int>& getInliers() const 00119 { 00120 return inliers_; 00121 } 00122 00123 const Eigen::Vector3d& getBinormal() const { 00124 return binormal_; 00125 } 00126 00127 private: 00128 00132 void setGraspVariables(); 00133 00137 void setAxis(); 00138 00142 void setDistAlongHandle(); 00143 00147 void setGraspWidth(); 00148 00149 std::vector<int> inliers_; 00150 std::vector<GraspHypothesis> hand_list_; 00151 Eigen::Vector3d center_; 00152 Eigen::Vector3d axis_; 00153 Eigen::Vector3d approach_; 00154 Eigen::Vector3d binormal_; 00155 double width_; 00156 Eigen::Vector3d hands_center_; 00157 Eigen::VectorXd dist_along_handle_; 00158 }; 00159 00160 #endif /* HANDLE_H_ */