rotating_hand.h
Go to the documentation of this file.
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 ROTATING_HAND_H
00033 #define ROTATING_HAND_H
00034 
00035 #include <Eigen/Dense>
00036 #include <iostream>
00037 #include <pcl/point_types.h>
00038 #include <pcl/visualization/pcl_visualizer.h>
00039 #include <vector>
00040 
00041 #include <agile_grasp/antipodal.h>
00042 #include <agile_grasp/finger_hand.h>
00043 #include <agile_grasp/grasp_hypothesis.h>
00044 
00055 class RotatingHand
00056 {
00057 public:
00058 
00062   RotatingHand() : tolerant_antipodal_(true), cam_source_(-1) { }
00063 
00069         RotatingHand(bool tolerant_antipodal, int cam_source) 
00070     : tolerant_antipodal_(tolerant_antipodal), cam_source_(cam_source)
00071         {       }
00072 
00081         RotatingHand(const Eigen::VectorXd& camera_origin_left, const Eigen::VectorXd& camera_origin_right,
00082                         const FingerHand& finger_hand, bool tolerant_antipodal, int cam_source);
00083 
00093         void transformPoints(const Eigen::Matrix3Xd& points, const Eigen::Vector3d& normal,
00094                         const Eigen::Vector3d& axis, const Eigen::Matrix3Xd& normals, const Eigen::VectorXi& points_cam_source,
00095                         double hand_height);
00096         
00103         std::vector<GraspHypothesis> evaluateHand(double init_bite, const Eigen::Vector3d& sample, bool use_antipodal);
00104                           
00109   const Eigen::Matrix<double, 3, 2>& getCams() const 
00110   {
00111     return cams_;
00112   }
00113   
00118   const Eigen::VectorXi& getPointsCamSource() const 
00119   {
00120     return points_cam_source_;
00121   }
00122   
00127   int getCamSource() const
00128   {
00129     return cam_source_;
00130   }
00131 
00132 
00133 private:
00134 
00135   int cam_source_; 
00136         Eigen::Matrix<double, 3, 2> cams_; 
00137         Eigen::VectorXd angles_; 
00138         Eigen::Matrix3Xd points_; 
00139         Eigen::Vector3d hand_axis_; 
00140         Eigen::Matrix3d frame_; 
00141         Eigen::Matrix3Xd normals_; 
00142         Eigen::VectorXi points_cam_source_;      
00143   FingerHand finger_hand_; 
00144   
00146   bool tolerant_antipodal_; 
00147 };
00148 
00149 #endif


agile_grasp
Author(s): Andreas ten Pas
autogenerated on Sat Jun 8 2019 20:08:27