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"
77 virtual 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
82 virtual 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
87 bool solve(
const KDL::Frame & rhs,
const KDL::Frame & pointTransform,
Solutions & _solutions)
const
115 using Steps = std::vector<JointIdsToSubproblem>;
175 using Frames = std::vector<KDL::Frame>;
176 using PoeTerms = std::vector<poe_term>;
179 ScrewTheoryIkProblem(
const PoeExpression & poe,
const Steps & steps,
bool reversed);
181 void recalculateFrames(
const Solutions &
solutions, Frames & frames, PoeTerms & poeTerms);
182 bool recalculateFrames(
const Solutions &
solutions, Frames & frames, PoeTerms & poeTerms,
bool backwards);
184 KDL::Frame transformPoint(
const KDL::JntArray & jointValues,
const PoeTerms & poeTerms);
186 const PoeExpression poe;
193 std::vector<bool> reachability;
215 PoeTerm() : known(
false), simplified(
false) {}
216 bool known, simplified;
234 static std::vector<KDL::Vector> searchPoints(
const PoeExpression & poe);
238 void refreshSimplificationState();
240 void simplify(
int depth);
241 void simplifyWithPadenKahanOne(
const KDL::Vector & point);
242 void simplifyWithPadenKahanThree(
const KDL::Vector & point);
243 void simplifyWithPardosOne();
244 void simplifyWithPardosFive();
251 std::vector<KDL::Vector> points;
252 std::vector<KDL::Vector> testPoints;
254 std::vector<PoeTerm> poeTerms;
256 static const int MAX_SIMPLIFICATION_DEPTH = 2;
Abstraction of a term in a product of exponentials (POE) formula.
Definition MatrixExponential.hpp:19
Abstraction of a product of exponentials (POE) formula.
Definition ProductOfExponentials.hpp:28
int size() const
Size of this POE.
Definition ProductOfExponentials.hpp:76
Automated IK solution finder.
Definition ScrewTheoryIkProblem.hpp:210
ScrewTheoryIkProblem * build()
Finds a valid sequence of geometric subproblems that solve a global IK problem.
Definition ScrewTheoryIkProblemBuilder.cpp:232
Proxy IK problem solver class that iterates over a sequence of subproblems.
Definition ScrewTheoryIkProblem.hpp:109
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:294
std::vector< KDL::JntArray > Solutions
Collection of global IK solutions.
Definition ScrewTheoryIkProblem.hpp:118
~ScrewTheoryIkProblem()
Destructor.
Definition ScrewTheoryIkProblem.cpp:71
std::pair< std::vector< int >, const ScrewTheoryIkSubproblem * > JointIdsToSubproblem
Pair of joint ids and an their associated local IK subproblem.
Definition ScrewTheoryIkProblem.hpp:112
const Steps & getSteps() const
Solution of the IK problem (if available)
Definition ScrewTheoryIkProblem.hpp:149
std::vector< bool > solve(const KDL::Frame &H_S_T, const KDL::JntArray &reference, Solutions &solutions)
Find all available solutions.
Definition ScrewTheoryIkProblem.cpp:81
bool isReversed() const
Whether the computed solution is reversed.
Definition ScrewTheoryIkProblem.hpp:153
std::vector< JointIdsToSubproblem > Steps
Ordered sequence of IK subproblems that solve a global IK problem.
Definition ScrewTheoryIkProblem.hpp:115
int solutions() const
Number of global IK solutions.
Definition ScrewTheoryIkProblem.hpp:145
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.
virtual const char * describe() const =0
Return a human-readable description of this IK subproblem.
virtual int solutions() const =0
Number of local IK solutions.
virtual ~ScrewTheoryIkSubproblem()=default
Destructor.
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
Helper structure that holds the state of a POE term.
Definition ScrewTheoryIkProblem.hpp:214