pr2_arm_ik.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2008, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 /* Author: Sachin Chitta */
36 
37 #ifndef MOVEIT_PR2_ARM_IK_H
38 #define MOVEIT_PR2_ARM_IK_H
39 
40 #include <urdf/model.h>
41 #include <Eigen/Core>
42 #include <Eigen/LU> // provides LU decomposition
43 #include <kdl/chainiksolver.hpp>
46 
47 namespace pr2_arm_kinematics
48 {
49 class PR2ArmIK
50 {
51 public:
57  PR2ArmIK();
58  ~PR2ArmIK(){};
59 
67  bool init(const urdf::Model& robot_model, const std::string& root_name, const std::string& tip_name);
68 
74  void computeIKShoulderPan(const Eigen::Matrix4f& g_in, const double& shoulder_pan_initial_guess,
75  std::vector<std::vector<double> >& solution) const;
76 
82  void computeIKShoulderRoll(const Eigen::Matrix4f& g_in, const double& shoulder_roll_initial_guess,
83  std::vector<std::vector<double> >& solution) const;
84 
85  // std::vector<std::vector<double> > solution_ik_;/// a vector of ik solutions
86 
92  void getSolverInfo(moveit_msgs::KinematicSolverInfo& info);
93 
97  moveit_msgs::KinematicSolverInfo solver_info_;
98 
100 
101 private:
102  void addJointToChainInfo(urdf::JointConstSharedPtr joint, moveit_msgs::KinematicSolverInfo& info);
103 
104  bool checkJointLimits(const std::vector<double>& joint_values) const;
105 
106  bool checkJointLimits(const double& joint_value, const int& joint_num) const;
107 
108  Eigen::Matrix4f grhs_, gf_, home_inv_, home_;
109 
110  std::vector<double> angle_multipliers_;
111 
112  std::vector<double> solution_;
113 
116 
117  std::vector<double> min_angles_;
118 
119  std::vector<double> max_angles_;
120 
121  std::vector<bool> continuous_joint_;
122 };
123 }
124 #endif // PR2_ARM_IK_H
std::vector< double > max_angles_
Definition: pr2_arm_ik.h:119
std::vector< bool > continuous_joint_
Definition: pr2_arm_ik.h:121
Namespace for the PR2ArmKinematics.
void addJointToChainInfo(const urdf::JointConstSharedPtr &joint, moveit_msgs::KinematicSolverInfo &info)
void getSolverInfo(moveit_msgs::KinematicSolverInfo &info)
Definition: pr2_arm_ik.cpp:190
std::vector< double > min_angles_
Definition: pr2_arm_ik.h:117
Eigen::Isometry3f home_inv_
std::vector< double > solution_
Definition: pr2_arm_ik.h:112
bool init(const urdf::ModelInterface &robot_model, const std::string &root_name, const std::string &tip_name)
bool checkJointLimits(const std::vector< double > &joint_values) const
Definition: pr2_arm_ik.cpp:766
moveit_msgs::KinematicSolverInfo solver_info_
get chain information about the arm.
Definition: pr2_arm_ik.h:97
std::vector< double > angle_multipliers_
Definition: pr2_arm_ik.h:110
void computeIKShoulderPan(const Eigen::Isometry3f &g_in, const double &shoulder_pan_initial_guess, std::vector< std::vector< double > > &solution) const
void computeIKShoulderRoll(const Eigen::Isometry3f &g_in, const double &shoulder_roll_initial_guess, std::vector< std::vector< double > > &solution) const


pr2_moveit_plugins
Author(s): Ioan Sucan , Sachin Chitta
autogenerated on Mon Feb 28 2022 22:51:25