pr2_arm_kinematics.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2008, Willow Garage, Inc.
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  *   * Neither the name of Willow Garage nor the names of its
00018  *     contributors may be used to endorse or promote products derived
00019  *     from this software without specific prior written permission.
00020  *
00021  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00025  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00028  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00029  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00031  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00032  *  POSSIBILITY OF SUCH DAMAGE.
00033  *********************************************************************/
00034 
00035 /* Author: Sachin Chitta */
00036 
00037 #ifndef PR2_ARM_IK_NODE_H
00038 #define PR2_ARM_IK_NODE_H
00039 
00040 #include <ros/ros.h>
00041 #include <tf/tf.h>
00042 #include <tf/transform_listener.h>
00043 
00044 #include <angles/angles.h>
00045 #include <pr2_arm_kinematics/pr2_arm_ik_solver.h>
00046 #include <tf_conversions/tf_kdl.h>
00047 
00048 #include <moveit_msgs/GetPositionFK.h>
00049 #include <moveit_msgs/GetPositionIK.h>
00050 #include <moveit_msgs/GetKinematicSolverInfo.h>
00051 #include <moveit_msgs/MoveItErrorCodes.h>
00052 
00053 #include <kdl/chainfksolverpos_recursive.hpp>
00054 
00055 #include <boost/shared_ptr.hpp>
00056 
00057 namespace pr2_arm_kinematics
00058 {
00059   class PR2ArmKinematics
00060   {
00061     public:
00062 
00073     PR2ArmKinematics(bool create_transform_listener = true);
00074 
00075     virtual ~PR2ArmKinematics();
00076 
00081     bool isActive();
00082 
00088     virtual bool getPositionIK(moveit_msgs::GetPositionIK::Request &request,
00089                                moveit_msgs::GetPositionIK::Response &response);
00090 
00096     bool getIKSolverInfo(moveit_msgs::GetKinematicSolverInfo::Request &request,
00097                          moveit_msgs::GetKinematicSolverInfo::Response &response);
00098 
00104     bool getFKSolverInfo(moveit_msgs::GetKinematicSolverInfo::Request &request,
00105                          moveit_msgs::GetKinematicSolverInfo::Response &response);
00106 
00112     bool getPositionFK(moveit_msgs::GetPositionFK::Request &request,
00113                        moveit_msgs::GetPositionFK::Response &response);
00114 
00115     protected:
00116 
00117     // Helper function that assumes that everything is in the correct frame
00118     bool getPositionIKHelper(moveit_msgs::GetPositionIK::Request &request,
00119                  moveit_msgs::GetPositionIK::Response &response);
00120 
00121     virtual bool transformPose(const std::string& des_frame,
00122                    const geometry_msgs::PoseStamped& pose_in,
00123                    geometry_msgs::PoseStamped& pose_out);
00124 
00125     bool active_;
00126     int free_angle_;
00127     urdf::Model robot_model_;
00128     double search_discretization_;
00129     ros::NodeHandle node_handle_, root_handle_;
00130     boost::shared_ptr<pr2_arm_kinematics::PR2ArmIKSolver> pr2_arm_ik_solver_;
00131     ros::ServiceServer ik_service_,fk_service_,ik_solver_info_service_,fk_solver_info_service_;
00132     tf::TransformListener* tf_;
00133     std::string root_name_;
00134     int dimension_;
00135     boost::shared_ptr<KDL::ChainFkSolverPos_recursive> jnt_to_pose_solver_;
00136     KDL::Chain kdl_chain_;
00137     moveit_msgs::KinematicSolverInfo ik_solver_info_, fk_solver_info_;
00138   };
00139 }
00140 
00141 #endif


pr2_arm_kinematics
Author(s): Sachin Chitta
autogenerated on Thu Jun 6 2019 20:11:52