Go to the documentation of this file.
25 JointPath::JointPath()
32 : linkPath(base, end),
33 joints(linkPath.
size())
42 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();
240 Link* baseLink = linkPath.baseLink();
241 baseLink->
p = base_p;
242 baseLink->
R = base_R;
244 if(!hasAnalyticalIK()){
245 calcForwardKinematics();
248 return calcInverseKinematics(end_p, end_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){
319 joints[j]->q += LAMBDA * dq(j);
331 for(
int i=0;
i <
n; ++
i){
350 for(
int i=0;
i <
n; ++
i){
HRP_UTIL_EXPORT Vector3 omegaFromRot(const Matrix33 &r)
@ ROTATIONAL_JOINT
6-DOF root link
Link * joint(int index) const
std::ostream & operator<<(std::ostream &os, JointPath &path)
bool find(Link *base, Link *end)
int numUpwardJointConnections
unsigned int numJoints() const
Vector3 w
angular velocity, omega
void calcForwardKinematics(bool calcVelocity=false, bool calcAcceleration=false) const
@ SLIDE_JOINT
translational joint (1 dof)
virtual bool calcInverseKinematics(const Vector3 &end_p, const Matrix33 &end_R)
The header file of the LinkPath and JointPath classes.
Matrix33 hat(const Vector3 &c)
virtual void onJointPathUpdated()
virtual void setMaxIKError(double e)
bool find(Link *base, Link *end)
bool isJointDownward(int index) const
virtual void setBestEffortIKMode(bool on)
void calcJacobian(dmatrix &out_J, const Vector3 &local_p=Vector3::Zero()) const
int solveLinearEquationSVD(const dmatrix &_a, const dvector &_b, dvector &_x, double _sv_ratio)
Vector3 a
rotational joint axis (self local)
Vector3 d
translation joint axis (self local)
virtual bool hasAnalyticalIK()
void calcJacobianDot(dmatrix &out_dJ, const Vector3 &local_p=Vector3::Zero()) const
std::vector< Link * > joints
int jointId
jointId value written in a model file
bool isDownward(int index) const
int solveLinearEquationLU(dmatrix a, const dmatrix &b, dmatrix &out_x)
openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:03