25 JointPath::JointPath()
32 : linkPath(base, end),
33 joints(linkPath.
size())
137 for(
int i=0;
i <
n; ++
i){
146 Vector3 arm(targetLink->
p + targetLink->
R * local_p - link->
p);
151 out_J.col(
i) << dp, omega;
161 out_J.col(
i) << dp, Vector3::Zero();
166 out_J.col(
i).setZero();
182 for (
int i=0;
i <
n; ++
i) {
191 Vector3 arm(targetLink->
p + targetLink->
R * local_p - link->
p);
194 Vector3 armDot(targetLink->
v +
hat(targetLink->
w) * targetLink->
R * local_p - link->
v);
201 Vector3 ddp(omegaDot.cross(arm) + omega.cross(armDot));
203 out_dJ.col(
i) << ddp, omegaDot;
213 out_dJ.col(
i) << ddp, Vector3::Zero();
218 out_dJ.col(
i).setZero();
241 baseLink->
p = base_p;
242 baseLink->
R = base_R;
254 static const int MAX_IK_ITERATION = 50;
255 static const double LAMBDA = 0.9;
256 static const double JOINT_LIMIT_MARGIN = 0.05;
276 std::vector<double> qorg(n);
277 for(
int i=0;
i <
n; ++
i){
286 bool converged =
false;
288 for(
int i=0;
i < MAX_IK_ITERATION;
i++){
296 const double errsqr0 = errsqr;
297 errsqr = dp.dot(dp) + omega.dot(omega);
303 const double errsqr = dp.dot(dp) + omega.dot(omega);
318 for(
int j=0;
j <
n; ++
j){
331 for(
int i=0;
i <
n; ++
i){
350 for(
int i=0;
i <
n; ++
i){
bool isDownward(int index) const
virtual void onJointPathUpdated()
bool isJointDownward(int index) const
int solveLinearEquationSVD(const dmatrix &_a, const dvector &_b, dvector &_x, double _sv_ratio)
std::vector< Link * > joints
translational joint (1 dof)
Vector3 w
angular velocity, omega
void calcJacobian(dmatrix &out_J, const Vector3 &local_p=Vector3::Zero()) const
virtual bool hasAnalyticalIK()
void calcForwardKinematics(bool calcVelocity=false, bool calcAcceleration=false) const
def j(str, encoding="cp932")
Link * joint(int index) const
The header file of the LinkPath and JointPath classes.
unsigned int numJoints() const
bool find(Link *base, Link *end)
Matrix33 hat(const Vector3 &c)
int jointId
jointId value written in a model file
virtual bool calcInverseKinematics(const Vector3 &end_p, const Matrix33 &end_R)
HRP_UTIL_EXPORT Vector3 omegaFromRot(const Matrix33 &r)
virtual void setMaxIKError(double e)
void calcJacobianDot(dmatrix &out_dJ, const Vector3 &local_p=Vector3::Zero()) const
int numUpwardJointConnections
std::ostream & operator<<(std::ostream &os, JointPath &path)
Vector3 a
rotational joint axis (self local)
Vector3 d
translation joint axis (self local)
int solveLinearEquationLU(dmatrix a, const dmatrix &b, dmatrix &out_x)
bool find(Link *base, Link *end)
virtual void setBestEffortIKMode(bool on)