kinematics-dynamics
ScrewTheoryIkSubproblems.hpp
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 #ifndef __SCREW_THEORY_IK_SUBPROBLEMS_HPP__
4 #define __SCREW_THEORY_IK_SUBPROBLEMS_HPP__
5 
6 #include <kdl/frames.hpp>
7 
8 #include "ScrewTheoryIkProblem.hpp"
9 #include "MatrixExponential.hpp"
10 
11 namespace roboticslab
12 {
13 
24 {
25 public:
33  PadenKahanOne(int id, const MatrixExponential & exp, const KDL::Vector & p);
34 
35  bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, Solutions & solutions) const override;
36 
37  int solutions() const override
38  { return 1; }
39 
40  const char * describe() const override
41  { return "PK1"; }
42 
43 private:
44  const int id;
45  const MatrixExponential exp;
46  const KDL::Vector p;
47  const KDL::Rotation axisPow;
48 };
49 
60 {
61 public:
72  PadenKahanTwo(int id1, int id2, const MatrixExponential & exp1, const MatrixExponential & exp2, const KDL::Vector & p, const KDL::Vector & r);
73 
74  bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, Solutions & solutions) const override;
75 
76  int solutions() const override
77  { return 2; }
78 
79  const char * describe() const override
80  { return "PK2"; }
81 
82 private:
83  const int id1, id2;
84  const MatrixExponential exp1, exp2;
85  const KDL::Vector p, r, axesCross;
86  const KDL::Rotation axisPow1, axisPow2;
87  const double axesDot;
88 };
89 
100 {
101 public:
110  PadenKahanThree(int id, const MatrixExponential & exp, const KDL::Vector & p, const KDL::Vector & k);
111 
112  bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, Solutions & solutions) const override;
113 
114  int solutions() const override
115  { return 2; }
116 
117  const char * describe() const override
118  { return "PK3"; }
119 
120 private:
121  const int id;
122  const MatrixExponential exp;
123  const KDL::Vector p, k;
124  const KDL::Rotation axisPow;
125 };
126 
137 {
138 public:
146  PardosGotorOne(int id, const MatrixExponential & exp, const KDL::Vector & p);
147 
148  bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, Solutions & solutions) const override;
149 
150  int solutions() const override
151  { return 1; }
152 
153  const char * describe() const override
154  { return "PG1"; }
155 
156 private:
157  const int id;
158  const MatrixExponential exp;
159  const KDL::Vector p;
160 };
161 
172 {
173 public:
183  PardosGotorTwo(int id1, int id2, const MatrixExponential & exp1, const MatrixExponential & exp2, const KDL::Vector & p);
184 
185  bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, Solutions & solutions) const override;
186 
187  int solutions() const override
188  { return 1; }
189 
190  const char * describe() const override
191  { return "PG2"; }
192 
193 private:
194  const int id1, id2;
195  const MatrixExponential exp1, exp2;
196  const KDL::Vector p, crossPr2;
197  const double crossPr2Norm;
198 };
199 
211 {
212 public:
221  PardosGotorThree(int id, const MatrixExponential & exp, const KDL::Vector & p, const KDL::Vector & k);
222 
223  bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, Solutions & solutions) const override;
224 
225  int solutions() const override
226  { return 2; }
227 
228  const char * describe() const override
229  { return "PG3"; }
230 
231 private:
232  const int id;
233  const MatrixExponential exp;
234  const KDL::Vector p, k;
235 };
236 
248 {
249 public:
259  PardosGotorFour(int id1, int id2, const MatrixExponential & exp1, const MatrixExponential & exp2, const KDL::Vector & p);
260 
261  bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, Solutions & solutions) const override;
262 
263  int solutions() const override
264  { return 2; }
265 
266  const char * describe() const override
267  { return "PG4"; }
268 
269 private:
270  const int id1, id2;
271  const MatrixExponential exp1, exp2;
272  const KDL::Vector p, n;
273  const KDL::Rotation axisPow;
274 };
275 
276 } // namespace roboticslab
277 
278 #endif // __SCREW_THEORY_IK_SUBPROBLEMS_HPP__
Abstraction of a term in a product of exponentials (POE) formula.
Definition: MatrixExponential.hpp:19
First Paden-Kahan subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:24
PadenKahanOne(int id, const MatrixExponential &exp, const KDL::Vector &p)
Constructor.
Definition: PadenKahanSubproblems.cpp:13
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition: PadenKahanSubproblems.cpp:22
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:40
int solutions() const override
Number of local IK solutions.
Definition: ScrewTheoryIkSubproblems.hpp:37
Third Paden-Kahan subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:100
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition: PadenKahanSubproblems.cpp:161
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:117
int solutions() const override
Number of local IK solutions.
Definition: ScrewTheoryIkSubproblems.hpp:114
PadenKahanThree(int id, const MatrixExponential &exp, const KDL::Vector &p, const KDL::Vector &k)
Constructor.
Definition: PadenKahanSubproblems.cpp:151
Second Paden-Kahan subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:60
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition: PadenKahanSubproblems.cpp:64
PadenKahanTwo(int id1, int id2, const MatrixExponential &exp1, const MatrixExponential &exp2, const KDL::Vector &p, const KDL::Vector &r)
Constructor.
Definition: PadenKahanSubproblems.cpp:49
int solutions() const override
Number of local IK solutions.
Definition: ScrewTheoryIkSubproblems.hpp:76
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:79
Fourth Pardos-Gotor subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:248
PardosGotorFour(int id1, int id2, const MatrixExponential &exp1, const MatrixExponential &exp2, const KDL::Vector &p)
Constructor.
Definition: PardosGotorSubproblems.cpp:148
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition: PardosGotorSubproblems.cpp:160
int solutions() const override
Number of local IK solutions.
Definition: ScrewTheoryIkSubproblems.hpp:263
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:266
First Pardos-Gotor subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:137
int solutions() const override
Number of local IK solutions.
Definition: ScrewTheoryIkSubproblems.hpp:150
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition: PardosGotorSubproblems.cpp:32
PardosGotorOne(int id, const MatrixExponential &exp, const KDL::Vector &p)
Constructor.
Definition: PardosGotorSubproblems.cpp:24
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:153
Third Pardos-Gotor subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:211
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:228
int solutions() const override
Number of local IK solutions.
Definition: ScrewTheoryIkSubproblems.hpp:225
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition: PardosGotorSubproblems.cpp:107
PardosGotorThree(int id, const MatrixExponential &exp, const KDL::Vector &p, const KDL::Vector &k)
Constructor.
Definition: PardosGotorSubproblems.cpp:98
Second Pardos-Gotor subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:172
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition: PardosGotorSubproblems.cpp:63
PardosGotorTwo(int id1, int id2, const MatrixExponential &exp1, const MatrixExponential &exp2, const KDL::Vector &p)
Constructor.
Definition: PardosGotorSubproblems.cpp:51
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition: ScrewTheoryIkSubproblems.hpp:190
int solutions() const override
Number of local IK solutions.
Definition: ScrewTheoryIkSubproblems.hpp:187
Interface shared by all IK subproblems found in Screw Theory applied to Robotics.
Definition: ScrewTheoryIkProblem.hpp:26
std::vector< JointIdsToSolutions > Solutions
Collection of local IK solutions.
Definition: ScrewTheoryIkProblem.hpp:35
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:6