screw-theory-solvers
Loading...
Searching...
No Matches
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
11namespace roboticslab
12{
13
24{
25public:
27
34 PadenKahanOne(const MatrixExponential & exp, const KDL::Vector & p);
35
36 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions) const override;
37
38 int solutions() const override
39 { return 1; }
40
41 const char * describe() const override
42 { return "PK1"; }
43
44private:
45 const MatrixExponential exp;
46 const KDL::Vector p;
47 const KDL::Rotation axisPow;
48};
49
60{
61public:
63
72 PadenKahanTwo(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, const JointConfig & reference, Solutions & solutions) const override;
75
76 int solutions() const override
77 { return 2; }
78
79 const char * describe() const override
80 { return "PK2"; }
81
82private:
83 const MatrixExponential exp1, exp2;
84 const KDL::Vector p, r, axesCross;
85 const KDL::Rotation axisPow1, axisPow2;
86 const double axesDot;
87};
88
99{
100public:
102
110 PadenKahanThree(const MatrixExponential & exp, const KDL::Vector & p, const KDL::Vector & k);
111
112 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions) const override;
113
114 int solutions() const override
115 { return 2; }
116
117 const char * describe() const override
118 { return "PK3"; }
119
120private:
121 const MatrixExponential exp;
122 const KDL::Vector p, k;
123 const KDL::Rotation axisPow;
124};
125
137{
138public:
140
147 PardosGotorOne(const MatrixExponential & exp, const KDL::Vector & p);
148
149 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions) const override;
150
151 int solutions() const override
152 { return 1; }
153
154 const char * describe() const override
155 { return "PG1"; }
156
157private:
158 const MatrixExponential exp;
159 const KDL::Vector p;
160};
161
173{
174public:
176
184 PardosGotorTwo(const MatrixExponential & exp1, const MatrixExponential & exp2, const KDL::Vector & p);
185
186 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions) const override;
187
188 int solutions() const override
189 { return 1; }
190
191 const char * describe() const override
192 { return "PG2"; }
193
194private:
195 const MatrixExponential exp1, exp2;
196 const KDL::Vector p, crossPr2;
197 const double crossPr2Norm;
198};
199
211{
212public:
214
222 PardosGotorThree(const MatrixExponential & exp, const KDL::Vector & p, const KDL::Vector & k);
223
224 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions) const override;
225
226 int solutions() const override
227 { return 2; }
228
229 const char * describe() const override
230 { return "PG3"; }
231
232private:
233 const MatrixExponential exp;
234 const KDL::Vector p, k;
235};
236
248{
249public:
251
259 PardosGotorFour(const MatrixExponential & exp1, const MatrixExponential & exp2, const KDL::Vector & p);
260
261 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions) const override;
262
263 int solutions() const override
264 { return 2; }
265
266 const char * describe() const override
267 { return "PG4"; }
268
269private:
270 const MatrixExponential exp1, exp2;
271 const KDL::Vector p, n;
272 const KDL::Rotation axisPow;
273};
274
286{
287public:
289
297 PardosGotorFive(const MatrixExponential & exp, const MatrixExponential & exp_next, const KDL::Vector & p);
298
299 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions) const override;
300
301 int solutions() const override
302 { return 2; }
303
304 const char * describe() const override
305 { return "PG5"; }
306
307private:
308 const MatrixExponential exp;
309 const MatrixExponential exp_next;
310 const KDL::Vector p;
311 const KDL::Rotation axisPow;
312};
313
325{
326public:
335 PardosGotorSix(const MatrixExponential & exp1, const MatrixExponential & exp2, const KDL::Vector & p);
336
337 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions) const override;
338
339 int solutions() const override
340 { return 1; }
341
342 const char * describe() const override
343 { return "PG6"; }
344
345private:
346 const MatrixExponential exp1, exp2;
347 const KDL::Vector p, axesCross;
348 const KDL::Rotation axisPow1, axisPow2;
349 const double axesDot;
350};
351
363{
364public:
366
375 PardosGotorSeven(const MatrixExponential & exp1, const MatrixExponential & exp2, const MatrixExponential & exp3, const KDL::Vector & p);
376
377 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions) const override;
378
379 int solutions() const override
380 { return 4; }
381
382 const char * describe() const override
383 { return "PG7"; }
384
385private:
386 const MatrixExponential exp1, exp2, exp3;
387 const KDL::Vector p, axesCross, axesCross_inverted;
388 const KDL::Rotation axisPow1, axisPow2;
389 const double axesDot;
390};
391
403{
404public:
406
418 PardosGotorEight(const MatrixExponential & exp1, const MatrixExponential & exp2, const MatrixExponential & exp3, const KDL::Vector & p, const int firstID, const int lastId, const PoeExpression poe);
419
420
421 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions, const KDL::Frame & H_S_T, const KDL::JntArray & c_solutions, const KDL::Frame & H_S_T_0) const override;
422
423 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions) const override
424 {
425 return false;
426 }
427 int solutions() const override
428 { return 2; }//two sets of triple solutions
429
430 const char * describe() const override
431 { return "PG8"; }
432
433private:
434 const MatrixExponential exp1, exp2, exp3;
435 const KDL::Vector p, n;
436 const KDL::Rotation axisPow;
437 const int firstID, lastID;
438 const PoeExpression poe;
439};
440
452{
453public:
455
464 PardosGotorThreePadenKahanOne(const MatrixExponential & exp, const MatrixExponential & exp_pk1, const KDL::Vector & p, const KDL::Vector & k);
465
466 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions) const override;
467
468 int solutions() const override
469 { return 2; }
470
471 const char * describe() const override
472 { return "PG3+PK1"; }
473
474private:
475 const MatrixExponential exp_pg3, exp_pk1;
476 const KDL::Vector p, k;
477 const KDL::Rotation axisPow;
478};
479
491{
492public:
494
502 Algebraic_UR(int j1, int j2);
503
504 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions, const KDL::Frame & H_S_T, const KDL::JntArray & c_solutions) const override;
505
506 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions, const KDL::Frame & H_S_T, const KDL::JntArray & c_solutions, const KDL::Frame & H_S_T_0) const override
507 {
508 return solve(rhs, pointTransform, reference, solutions, H_S_T, c_solutions);
509 }
510
511 bool solve(const KDL::Frame & rhs, const KDL::Frame & pointTransform, const JointConfig & reference, Solutions & solutions) const override
512 {
513 return false;
514 }
515
516 int solutions() const override
517 { return 1; }
518
519 const char * describe() const override
520 { return "Algebraic"; }
521
522private:
523 const int j1, j2;
524};
525
526} // namespace roboticslab
527
528#endif // __SCREW_THEORY_IK_SUBPROBLEMS_HPP__
Algebraic approach.
Definition ScrewTheoryIkSubproblems.hpp:491
int solutions() const override
Number of local IK solutions.
Definition ScrewTheoryIkSubproblems.hpp:516
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition ScrewTheoryIkSubproblems.hpp:511
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition ScrewTheoryIkSubproblems.hpp:519
Abstraction of a term in a product of exponentials (POE) formula.
Definition MatrixExponential.hpp:19
First Paden-Kahan subproblem.
Definition ScrewTheoryIkSubproblems.hpp:24
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, 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:41
int solutions() const override
Number of local IK solutions.
Definition ScrewTheoryIkSubproblems.hpp:38
Third Paden-Kahan subproblem.
Definition ScrewTheoryIkSubproblems.hpp:99
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
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition PadenKahanSubproblems.cpp:163
Second Paden-Kahan subproblem.
Definition ScrewTheoryIkSubproblems.hpp:60
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition ScrewTheoryIkSubproblems.hpp:79
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition PadenKahanSubproblems.cpp:63
int solutions() const override
Number of local IK solutions.
Definition ScrewTheoryIkSubproblems.hpp:76
Eighth Pardos-Gotor subproblem.
Definition ScrewTheoryIkSubproblems.hpp:403
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition ScrewTheoryIkSubproblems.hpp:423
int solutions() const override
Number of local IK solutions.
Definition ScrewTheoryIkSubproblems.hpp:427
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition ScrewTheoryIkSubproblems.hpp:430
Fifth Pardos-Gotor subproblem.
Definition ScrewTheoryIkSubproblems.hpp:286
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition PardosGotorSubproblems.cpp:258
int solutions() const override
Number of local IK solutions.
Definition ScrewTheoryIkSubproblems.hpp:301
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition ScrewTheoryIkSubproblems.hpp:304
Fourth Pardos-Gotor subproblem.
Definition ScrewTheoryIkSubproblems.hpp:248
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
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition PardosGotorSubproblems.cpp:135
First Pardos-Gotor subproblem.
Definition ScrewTheoryIkSubproblems.hpp:137
int solutions() const override
Number of local IK solutions.
Definition ScrewTheoryIkSubproblems.hpp:151
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition ScrewTheoryIkSubproblems.hpp:154
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition PardosGotorSubproblems.cpp:33
Seventh Pardos-Gotor subproblem.
Definition ScrewTheoryIkSubproblems.hpp:363
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition PardosGotorSubproblems.cpp:432
int solutions() const override
Number of local IK solutions.
Definition ScrewTheoryIkSubproblems.hpp:379
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition ScrewTheoryIkSubproblems.hpp:382
Sixth Pardos-Gotor subproblem.
Definition ScrewTheoryIkSubproblems.hpp:325
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition PardosGotorSubproblems.cpp:321
int solutions() const override
Number of local IK solutions.
Definition ScrewTheoryIkSubproblems.hpp:339
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition ScrewTheoryIkSubproblems.hpp:342
Third Pardos-Gotor and First Paden Kahan subproblems.
Definition ScrewTheoryIkSubproblems.hpp:452
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition ScrewTheoryIkSubproblems.hpp:471
int solutions() const override
Number of local IK solutions.
Definition ScrewTheoryIkSubproblems.hpp:468
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition PardosGotorSubproblems.cpp:732
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:229
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition PardosGotorSubproblems.cpp:94
int solutions() const override
Number of local IK solutions.
Definition ScrewTheoryIkSubproblems.hpp:226
Second Pardos-Gotor subproblem.
Definition ScrewTheoryIkSubproblems.hpp:173
bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, Solutions &solutions) const override
Finds a closed geometric solution for this IK subproblem.
Definition PardosGotorSubproblems.cpp:57
int solutions() const override
Number of local IK solutions.
Definition ScrewTheoryIkSubproblems.hpp:188
const char * describe() const override
Return a human-readable description of this IK subproblem.
Definition ScrewTheoryIkSubproblems.hpp:191
Abstraction of a product of exponentials (POE) formula.
Definition ProductOfExponentials.hpp:28
Interface shared by all IK subproblems found in Screw Theory applied to Robotics.
Definition ScrewTheoryIkProblem.hpp:26
virtual bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, const JointConfig &reference, Solutions &solutions) const =0
Finds a closed geometric solution for this IK subproblem.
std::vector< double > JointConfig
Joint configurations.
Definition ScrewTheoryIkProblem.hpp:29
std::vector< JointConfig > Solutions
Collection of local IK solutions.
Definition ScrewTheoryIkProblem.hpp:32
The main, catch-all namespace for RoboticsLab UC3M.
Definition groups.dox:5