KDL  1.4.0
treeiksolverpos_online.hpp
Go to the documentation of this file.
1 // Copyright (C) 2011 PAL Robotics S.L. All rights reserved.
2 // Copyright (C) 2007-2008 Ruben Smits <ruben dot smits at mech dot kuleuven dot be>
3 // Copyright (C) 2008 Mikael Mayer
4 // Copyright (C) 2008 Julia Jesse
5 
6 // Version: 1.0
7 // Author: Marcus Liebhardt
8 // This class has been derived from the KDL::TreeIkSolverPos_NR_JL class
9 // by Julia Jesse, Mikael Mayer and Ruben Smits
10 
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the GNU Lesser General Public
13 // License as published by the Free Software Foundation; either
14 // version 2.1 of the License, or (at your option) any later version.
15 
16 // This library is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 // Lesser General Public License for more details.
20 
21 // You should have received a copy of the GNU Lesser General Public
22 // License along with this library; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 
25 #ifndef KDLTREEIKSOLVERPOS_ONLINE_HPP
26 #define KDLTREEIKSOLVERPOS_ONLINE_HPP
27 
28 #include <vector>
29 #include <string>
30 #include "treeiksolver.hpp"
31 #include "treefksolver.hpp"
32 
33 namespace KDL {
34 
45 public:
64  TreeIkSolverPos_Online(const double& nr_of_jnts,
65  const std::vector<std::string>& endpoints,
66  const JntArray& q_min,
67  const JntArray& q_max,
68  const JntArray& q_dot_max,
69  const double x_dot_trans_max,
70  const double x_dot_rot_max,
71  TreeFkSolverPos& fksolver,
72  TreeIkSolverVel& iksolver);
73 
75 
76  virtual double CartToJnt(const JntArray& q_in, const Frames& p_in, JntArray& q_out);
77 
78 private:
83  void enforceJointVelLimits();
84 
90  void enforceCartVelLimits();
91 
103 };
104 
105 } // namespace
106 
107 #endif /* KDLTREEIKSOLVERPOS_ONLINE_HPP */
108 
KDL::Frame::Identity
static Frame Identity()
Definition: frames.inl:695
KDL::Vector::y
double y() const
Definition: frames.inl:76
KDL::Twist::rot
Vector rot
The rotational velocity of that point.
Definition: frames.hpp:723
KDL::JntArray
Definition: jntarray.hpp:70
KDL::TreeIkSolverPos_Online::CartToJnt
virtual double CartToJnt(const JntArray &q_in, const Frames &p_in, JntArray &q_out)
Calculate inverse position kinematics, from cartesian coordinates to joint coordinates.
Definition: treeiksolverpos_online.cpp:63
KDL::TreeFkSolverPos
Definition: treefksolver.hpp:45
KDL::TreeIkSolverPos
This abstract class encapsulates the inverse position solver for a KDL::Chain.
Definition: treeiksolver.hpp:28
treeiksolver.hpp
KDL::Add
void Add(const JntArray &src1, const JntArray &src2, JntArray &dest)
Function to add two joint arrays, all the arguments must have the same size: A + B = C.
Definition: jntarray.cpp:82
KDL::TreeIkSolverVel
This abstract class encapsulates the inverse velocity solver for a KDL::Tree.
Definition: treeiksolver.hpp:54
KDL::TreeIkSolverPos_Online::q_max_
JntArray q_max_
Definition: treeiksolverpos_online.hpp:93
KDL::Multiply
void Multiply(const JntArray &src, const double &factor, JntArray &dest)
Function to multiply all the array values with a scalar factor: A*b=C.
Definition: jntarray.cpp:92
KDL::TreeIkSolverPos_Online::q_dot_
JntArray q_dot_
Definition: treeiksolverpos_online.hpp:99
KDL
Definition: articulatedbodyinertia.cpp:28
KDL::TreeIkSolverPos_Online::iksolver_
TreeIkSolverVel & iksolver_
Definition: treeiksolverpos_online.hpp:98
KDL::TreeIkSolverPos_Online::~TreeIkSolverPos_Online
~TreeIkSolverPos_Online()
Definition: treeiksolverpos_online.cpp:59
KDL::Twist
represents both translational and rotational velocities.
Definition: frames.hpp:720
treefksolver.hpp
KDL::Twists
std::map< std::string, Twist > Twists
Definition: treeiksolver.hpp:18
KDL::Vector::z
double z() const
Definition: frames.inl:77
KDL::TreeIkSolverPos_Online::frames_
Frames frames_
Definition: treeiksolverpos_online.hpp:101
KDL::JntArray::rows
unsigned int rows() const
Returns the number of rows (size) of the array.
Definition: jntarray.cpp:72
KDL::TreeIkSolverPos_Online::x_dot_trans_max_
double x_dot_trans_max_
Definition: treeiksolverpos_online.hpp:95
KDL::TreeIkSolverVel::CartToJnt
virtual double CartToJnt(const JntArray &q_in, const Twists &v_in, JntArray &qdot_out)=0
Calculate inverse velocity kinematics, from joint positions and cartesian velocities to joint velocit...
KDL::TreeFkSolverPos::JntToCart
virtual int JntToCart(const JntArray &q_in, Frame &p_out, std::string segmentName)=0
Calculate forward position kinematics for a KDL::Tree, from joint coordinates to cartesian pose.
KDL::TreeIkSolverPos_Online::TreeIkSolverPos_Online
TreeIkSolverPos_Online(const double &nr_of_jnts, const std::vector< std::string > &endpoints, const JntArray &q_min, const JntArray &q_max, const JntArray &q_dot_max, const double x_dot_trans_max, const double x_dot_rot_max, TreeFkSolverPos &fksolver, TreeIkSolverVel &iksolver)
Constructor of the solver, it needs the number of joints of the tree, a list of the endpoints you are...
Definition: treeiksolverpos_online.cpp:29
KDL::TreeIkSolverPos_Online::q_min_
JntArray q_min_
Definition: treeiksolverpos_online.hpp:92
KDL::TreeIkSolverPos_Online::twist_
Twist twist_
Definition: treeiksolverpos_online.hpp:100
KDL::TreeIkSolverPos_Online
Implementation of a general inverse position kinematics algorithm to calculate the position transform...
Definition: treeiksolverpos_online.hpp:44
KDL::Twist::vel
Vector vel
The velocity of that point.
Definition: frames.hpp:722
KDL::Twist::Zero
static Twist Zero()
Definition: frames.inl:290
KDL::TreeIkSolverPos_Online::q_dot_max_
JntArray q_dot_max_
Definition: treeiksolverpos_online.hpp:94
KDL::TreeIkSolverPos_Online::x_dot_rot_max_
double x_dot_rot_max_
Definition: treeiksolverpos_online.hpp:96
KDL::TreeIkSolverPos_Online::enforceJointVelLimits
void enforceJointVelLimits()
Scales the class member KDL::JntArray q_dot_, if one (or more) joint velocity exceeds the maximum val...
Definition: treeiksolverpos_online.cpp:115
KDL::diff
IMETHOD Vector diff(const Vector &p_w_a, const Vector &p_w_b, double dt=1)
determines the difference of vector b with vector a.
KDL::TreeIkSolverPos_Online::fksolver_
TreeFkSolverPos & fksolver_
Definition: treeiksolverpos_online.hpp:97
treeiksolverpos_online.hpp
KDL::Vector::x
double x() const
Definition: frames.inl:75
KDL::TreeIkSolverPos_Online::delta_twists_
Twists delta_twists_
Definition: treeiksolverpos_online.hpp:102
KDL::Frames
std::map< std::string, Frame > Frames
Definition: treeiksolver.hpp:20
KDL::TreeIkSolverPos_Online::enforceCartVelLimits
void enforceCartVelLimits()
Scales translational and rotational velocity vectors of the class member KDL::Twist twist_,...
Definition: treeiksolverpos_online.cpp:153