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 
48 namespace pr2_arm_kinematics
49 {
50 class PR2ArmIK
51 {
52 public:
53 
59  PR2ArmIK();
60  ~PR2ArmIK(){};
61 
69  bool init(const urdf::Model &robot_model, const std::string &root_name, const std::string &tip_name);
70 
76  void computeIKShoulderPan(const Eigen::Matrix4f &g_in, const double &shoulder_pan_initial_guess,std::vector<std::vector<double> > &solution) const;
77 
83  void computeIKShoulderRoll(const Eigen::Matrix4f &g_in, const double &shoulder_roll_initial_guess,std::vector<std::vector<double> > &solution) const;
84 
85 
86  // std::vector<std::vector<double> > solution_ik_;/// a vector of ik solutions
87 
92  void getSolverInfo(moveit_msgs::KinematicSolverInfo &info);
93 
97  moveit_msgs::KinematicSolverInfo solver_info_;
98 
100 
101  private:
102 
103  void addJointToChainInfo(urdf::JointConstSharedPtr joint,moveit_msgs::KinematicSolverInfo &info);
104 
105  bool checkJointLimits(const std::vector<double> &joint_values) const;
106 
107  bool checkJointLimits(const double &joint_value, const int &joint_num) const;
108 
109  Eigen::Matrix4f grhs_, gf_, home_inv_, home_;
110 
111  std::vector<double> angle_multipliers_;
112 
113  std::vector<double> solution_;
114 
116 
117  std::vector<double> min_angles_;
118 
119  std::vector<double> max_angles_;
120 
121  std::vector<bool> continuous_joint_;
122 
123 };
124 }
125 #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 computeIKShoulderRoll(const Eigen::Affine3f &g_in, const double &shoulder_roll_initial_guess, std::vector< std::vector< double > > &solution) const
void addJointToChainInfo(urdf::JointConstSharedPtr joint, moveit_msgs::KinematicSolverInfo &info)
Definition: pr2_arm_ik.cpp:151
void getSolverInfo(moveit_msgs::KinematicSolverInfo &info)
Definition: pr2_arm_ik.cpp:190
std::vector< double > min_angles_
Definition: pr2_arm_ik.h:117
std::vector< double > solution_
Definition: pr2_arm_ik.h:113
void computeIKShoulderPan(const Eigen::Affine3f &g_in, const double &shoulder_pan_initial_guess, std::vector< std::vector< double > > &solution) const
bool init(const urdf::ModelInterface &robot_model, const std::string &root_name, const std::string &tip_name)
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:111
bool checkJointLimits(const std::vector< double > &joint_values) const
Definition: pr2_arm_ik.cpp:677


pr2_arm_kinematics
Author(s): Sachin Chitta
autogenerated on Sun May 9 2021 02:19:39