chainiksolver_pos_lma_jl_mimic.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2016, CRI group, NTU, Singapore
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 CRI group 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: Francisco Suarez-Ruiz */
36 
37 #ifndef KDLCHAINIKSOLVERPOS_LMA_JL_MIMIC_H
38 #define KDLCHAINIKSOLVERPOS_LMA_JL_MIMIC_H
39 
40 #include "kdl/chainiksolverpos_lma.hpp" // Solver for the inverse position kinematics that uses Levenberg-Marquardt.
41 #include "kdl/chainfksolver.hpp"
42 
44 
45 namespace KDL
46 {
56 {
57 public:
77  double eps = 1e-6, bool position_ik = false);
78 
80 
81  virtual int CartToJnt(const JntArray& q_init, const Frame& p_in, JntArray& q_out);
82 
83  virtual int CartToJntAdvanced(const JntArray& q_init, const Frame& p_in, JntArray& q_out, bool lock_redundant_joints);
84 
85  bool setMimicJoints(const std::vector<lma_kinematics_plugin::JointMimic>& mimic_joints);
86 
87 private:
88  const Chain chain;
89  JntArray q_min; // These are the limits for the "reduced" state consisting of only active DOFs
90  JntArray q_min_mimic; // These are the limits for the full state
91  JntArray q_max; // These are the limits for the "reduced" state consisting of only active DOFs
92  JntArray q_max_mimic; // These are the limits for the full state
99  unsigned int maxiter;
100  double eps;
101  std::vector<lma_kinematics_plugin::JointMimic> mimic_joints;
102  void qToqMimic(const JntArray& q,
103  JntArray& q_result); // Convert from the "reduced" state (only active DOFs) to the "full" state
104  void qMimicToq(const JntArray& q, JntArray& q_result); // Convert from the "full" state to the "reduced" state
105  void harmonize(JntArray& q_out); // Puts the angles within [-2PI, 2PI]
106  bool obeysLimits(const KDL::JntArray& q_out); // Checks that a set of joint angles obey the urdf limits
108 };
109 }
110 
111 #endif
std::vector< lma_kinematics_plugin::JointMimic > mimic_joints
ChainIkSolverPos_LMA_JL_Mimic(const Chain &chain, const JntArray &q_min, const JntArray &q_max, ChainFkSolverPos &fksolver, ChainIkSolverPos_LMA &iksolver, unsigned int maxiter=100, double eps=1e-6, bool position_ik=false)
virtual int CartToJntAdvanced(const JntArray &q_init, const Frame &p_in, JntArray &q_out, bool lock_redundant_joints)
void qMimicToq(const JntArray &q, JntArray &q_result)
bool setMimicJoints(const std::vector< lma_kinematics_plugin::JointMimic > &mimic_joints)
void qToqMimic(const JntArray &q, JntArray &q_result)
virtual int CartToJnt(const JntArray &q_init, const Frame &p_in, JntArray &q_out)


moveit_kinematics
Author(s): Dave Coleman , Ioan Sucan , Sachin Chitta
autogenerated on Mon Oct 15 2018 03:46:21