7 #ifndef CNOID_BODY_JOINT_PATH_H 8 #define CNOID_BODY_JOINT_PATH_H 12 #include <cnoid/Referenced> 13 #include <cnoid/EigenTypes> 14 #include <boost/function.hpp> 19 class JointPathIkImpl;
31 bool setPath(
Link* end);
39 return joints.empty();
51 return linkPath.baseLink();
55 return linkPath.endLink();
59 return (index >= numUpwardJointConnections);
63 linkPath.calcForwardKinematics(calcVelocity, calcAcceleration);
66 int indexOf(
const Link* link)
const;
68 bool isBestEffortIKmode()
const;
69 void setBestEffortIKmode(
bool on);
71 void setNumericalIKmaxIKerror(
double e);
72 void setNumericalIKdeltaScale(
double s);
73 void setNumericalIKmaxIterations(
int n);
74 void setNumericalIKdampingConstant(
double lambda);
76 static double numericalIKdefaultDeltaScale();
77 static int numericalIKdefaultMaxIterations();
78 static double numericalIKdefaultMaxIKerror();
79 static double numericalIKdefaultDampingConstant();
82 int numTargetElements,
83 boost::function<
double(VectorXd& out_error)> errorFunc,
84 boost::function<
void(MatrixXd& out_Jacobian)> jacobianFunc);
87 virtual bool hasAnalyticalIK()
const;
92 targetTranslationGoal = end_p;
93 targetRotationGoal = end_R;
99 virtual bool calcInverseKinematics();
105 int numIterations()
const;
108 void calcJacobian(Eigen::MatrixXd& out_J)
const;
110 virtual bool calcInverseKinematics(
const Vector3& end_p,
const Matrix3& end_R);
112 bool calcInverseKinematics(
115 void setNumericalIKtruncateRatio(
double r);
117 static double numericalIKdefaultTruncateRatio();
121 virtual void onJointPathUpdated();
128 void extractJoints();
129 JointPathIkImpl* getOrCreateIK();
132 std::vector<Link*> joints;
133 int numUpwardJointConnections;
136 bool needForwardKinematicsBeforeIK;
boost::shared_ptr< JointPath > JointPathPtr
Definition: BodyMotionPoseProvider.h:20
Link * joint(int index) const
Definition: JointPath.h:46
Link * baseLink() const
Definition: JointPath.h:50
Definition: InverseKinematics.h:14
JointPath & setGoal(const Vector3 &end_p, const Matrix3 &end_R)
Definition: JointPath.h:91
bool find(Link *end)
Deprecated. Use "setPath()" instead of this.
Definition: JointPath.h:36
int numJoints() const
Definition: JointPath.h:42
virtual bool calcInverseKinematics()
Definition: JointPath.cpp:366
Link * endLink() const
Definition: JointPath.h:54
void calcForwardKinematics(bool calcVelocity=false, bool calcAcceleration=false) const
Definition: JointPath.h:62
bool isJointDownward(int index) const
Definition: JointPath.h:58
Definition: JointPath.h:21
Definition: LinkPath.h:14
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
bool calcNumericalIK()
Definition: JointPath.h:101
bool find(Link *base, Link *end)
Deprecated. Use "setPath()" instead of this.
Definition: JointPath.h:34
bool empty() const
Definition: JointPath.h:38
Eigen::Vector3d Vector3
Definition: EigenTypes.h:58
#define CNOID_EXPORT
Definition: Util/exportdecl.h:37
CNOID_EXPORT JointPathPtr getCustomJointPath(Body *body, Link *baseLink, Link *targetLink)
Definition: JointPath.cpp:625
Eigen::Matrix3d Matrix3
Definition: EigenTypes.h:57