3 #ifndef __SCREW_THEORY_IK_PROBLEM_HPP__
4 #define __SCREW_THEORY_IK_PROBLEM_HPP__
9 #include <kdl/frames.hpp>
10 #include <kdl/jntarray.hpp>
12 #include "ProductOfExponentials.hpp"
98 using Steps = std::vector<const ScrewTheoryIkSubproblem *>;
151 using Frames = std::vector<KDL::Frame>;
152 using PoeTerms = std::vector<poe_term>;
155 ScrewTheoryIkProblem(
const PoeExpression & poe,
const Steps & steps,
bool reversed);
157 void recalculateFrames(
const Solutions &
solutions, Frames & frames, PoeTerms & poeTerms);
158 bool recalculateFrames(
const Solutions &
solutions, Frames & frames, PoeTerms & poeTerms,
bool backwards);
160 KDL::Frame transformPoint(
const KDL::JntArray & jointValues,
const PoeTerms & poeTerms);
162 const PoeExpression poe;
188 PoeTerm() : known(
false), simplified(
false) {}
189 bool known, simplified;
207 static std::vector<KDL::Vector> searchPoints(
const PoeExpression & poe);
211 void refreshSimplificationState();
213 void simplify(
int depth);
214 void simplifyWithPadenKahanOne(
const KDL::Vector & point);
215 void simplifyWithPadenKahanThree(
const KDL::Vector & point);
216 void simplifyWithPardosOne();
222 std::vector<KDL::Vector> points;
223 std::vector<KDL::Vector> testPoints;
225 std::vector<PoeTerm> poeTerms;
227 static const int MAX_SIMPLIFICATION_DEPTH = 2;
Abstraction of a product of exponentials (POE) formula.
Definition: ProductOfExponentials.hpp:28
Automated IK solution finder.
Definition: ScrewTheoryIkProblem.hpp:183
ScrewTheoryIkProblem * build()
Finds a valid sequence of geometric subproblems that solve a global IK problem.
Definition: ScrewTheoryIkProblemBuilder.cpp:231
ScrewTheoryIkProblemBuilder(const PoeExpression &poe)
Constructor.
Definition: ScrewTheoryIkProblemBuilder.cpp:144
Proxy IK problem solver class that iterates over a sequence of subproblems.
Definition: ScrewTheoryIkProblem.hpp:95
static ScrewTheoryIkProblem * create(const PoeExpression &poe, const Steps &steps, bool reversed=false)
Creates an IK solver instance given a sequence of known subproblems.
Definition: ScrewTheoryIkProblem.cpp:265
const Steps & getSteps() const
Solution of the IK problem (if available)
Definition: ScrewTheoryIkProblem.hpp:125
bool solve(const KDL::Frame &H_S_T, Solutions &solutions)
Find all available solutions.
Definition: ScrewTheoryIkProblem.cpp:62
std::vector< KDL::JntArray > Solutions
Collection of global IK solutions.
Definition: ScrewTheoryIkProblem.hpp:101
~ScrewTheoryIkProblem()
Destructor.
Definition: ScrewTheoryIkProblem.cpp:52
bool isReversed() const
Whether the computed solution is reversed.
Definition: ScrewTheoryIkProblem.hpp:129
std::vector< const ScrewTheoryIkSubproblem * > Steps
Ordered sequence of IK subproblems needed to solve a IK problem.
Definition: ScrewTheoryIkProblem.hpp:98
int solutions() const
Number of global IK solutions.
Definition: ScrewTheoryIkProblem.hpp:121
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
std::vector< JointIdToSolution > JointIdsToSolutions
At least one joint-id+value pair per solution.
Definition: ScrewTheoryIkProblem.hpp:32
virtual int solutions() const =0
Number of local IK solutions.
virtual ~ScrewTheoryIkSubproblem()=default
Destructor.
virtual bool solve(const KDL::Frame &rhs, const KDL::Frame &pointTransform, Solutions &solutions) const =0
Finds a closed geometric solution for this IK subproblem.
virtual const char * describe() const =0
Return a human-readable description of this IK subproblem.
std::pair< int, double > JointIdToSolution
Maps a joint id to a screw magnitude.
Definition: ScrewTheoryIkProblem.hpp:29
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:6
Helper structure that holds the state of a POE term.
Definition: ScrewTheoryIkProblem.hpp:187