KrisLibrary  1.0.0
AnalyticIK.h
1 #ifndef ANALYTICAL_IK_SOLVERS_H
2 #define ANALYTICAL_IK_SOLVERS_H
3 
4 #include "RobotKinematics3D.h"
5 #include "IK.h"
6 #include <memory>
7 #include <vector>
8 #include <map>
9 
10 
15 {
17  void DeleteMinimalDistance();
18 
19  std::vector<Vector> solutions;
20  std::vector<bool> minimalDistance;
21  bool infinite;
22 };
23 
36 {
37  public:
39  ~AnalyticalIKSolver() {}
40  virtual bool Solve(int base,int ee,
41  const RigidTransform& T,
42  AnalyticIKSolution& solution) const
43  { return false; }
44 };
45 
47 {
48  public:
49  void GetIndices(const RobotKinematics3D& robot,
50  const IKGoal& goal,
51  std::vector<int>& indices) const;
52  bool Solve(RobotKinematics3D& robot,
53  const IKGoal& goal,
54  AnalyticIKSolution& solution) const;
55  bool Solve(int base,int ee,
56  const RigidTransform& T,
57  AnalyticIKSolution& solution) const;
58 
59  void UpdateRobot(int base,int ee,
60  const AnalyticIKSolution& solution,
61  int index,RobotKinematics3D& robot) const;
62 
64  std::map<std::pair<int,int>,std::shared_ptr<AnalyticalIKSolver> > solvers;
65 };
66 
67 #endif
Hook for an analytic inverse kinematics solver. The Solve method must be defined by the subclass...
Definition: AnalyticIK.h:35
std::vector< bool > minimalDistance
one per solution: true if the desired point is not reached, but rather the distance is minimized ...
Definition: AnalyticIK.h:20
std::vector< Vector > solutions
an array of the IK solutions (3D-6D)
Definition: AnalyticIK.h:19
A rigid-body transformation.
Definition: math3d/primitives.h:820
Definition: AnalyticIK.h:46
A structure defining a link&#39;s desired configuration for IK.
Definition: IK.h:14
std::map< std::pair< int, int >, std::shared_ptr< AnalyticalIKSolver > > solvers
Map of (base,ee) pairs to solvers.
Definition: AnalyticIK.h:64
bool infinite
true if infinite # of solutions
Definition: AnalyticIK.h:21
Class defining kinematics of a robot, and commonly used functions.
Definition: RobotKinematics3D.h:33
A structure containing computed analytic IK solutions.
Definition: AnalyticIK.h:14