00001
00002 #ifndef INCLUDED_IKGradientSolver_h_
00003 #define INCLUDED_IKGradientSolver_h_
00004
00005 #include "IKSolver.h"
00006
00007
00008
00009
00010 class IKGradientSolver : public IKSolver {
00011 public:
00012
00013 IKGradientSolver(unsigned int iter=75, float posTolerance=0.5f, float oriTolerance=.001f) :
00014 IKSolver(), PTOL(posTolerance), OTOL(oriTolerance), QTOL(oriTolerance/50), MAX_ITER(iter) {}
00015
00016
00017 IKGradientSolver(unsigned int iter, float posTolerance, float oriTolerance, float qTolerance) :
00018 IKSolver(), PTOL(posTolerance), OTOL(oriTolerance), QTOL(qTolerance), MAX_ITER(iter) {}
00019
00020 virtual bool solve(const Point& pEff, const Rotation& oriEff, KinematicJoint& j,
00021 const Position& pTgt, float posPri, const Orientation& oriTgt, float oriPri) const;
00022
00023 virtual bool solve(const Point& pEff, const Rotation& oriEff, KinematicJoint& j,
00024 const Position& pTgt, float posPri, const Orientation& oriTgt, float oriPri, unsigned int root) const;
00025
00026 using IKSolver::solve;
00027
00028 virtual IKSolver::StepResult_t step(const Point& pEff, const Rotation& oriEff, KinematicJoint& j,
00029 const Position& pTgt, float pDist, float posPri,
00030 const Orientation& oriTgt, float oriDist, float oriPri) const {
00031 return step(pEff,oriEff,j,pTgt,pDist,posPri,oriTgt,oriDist,oriPri,true);
00032 }
00033
00034 virtual IKSolver::StepResult_t step(const Point& pEff, const Rotation& oriEff, KinematicJoint& j,
00035 const Position& pTgt, float pDist, float posPri,
00036 const Orientation& oriTgt, float oriDist, float oriPri,
00037 bool successInReach) const;
00038 virtual IKSolver::StepResult_t step(const Point& pEff, const Rotation& oriEff, KinematicJoint& j,
00039 const Position& pTgt, float pDist, float posPri,
00040 const Orientation& oriTgt, float oriDist, float oriPri,
00041 bool successInReach, unsigned int root) const;
00042 using IKSolver::step;
00043
00044 protected:
00045 const float PTOL;
00046 const float OTOL;
00047 const float QTOL;
00048 const unsigned int MAX_ITER;
00049 private:
00050
00051 static const std::string autoRegisterIKGradientSolver;
00052
00053 static const std::string autoRegisterDefaultIKSolver;
00054 };
00055
00056
00057
00058
00059
00060
00061 #endif