Skip to content

Commit

Permalink
Merge pull request open-rdc#8 from open-rdc/pseudo-inverse_matrix
Browse files Browse the repository at this point in the history
擬似逆行列計算部分を追加
  • Loading branch information
RyuYamamoto authored and RyuYamamoto committed Apr 12, 2016
2 parents 3358068 + 3af364f commit a53710c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Kinematics/Kinematics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ bool Kinematics::calcInverseKinematics(int to, Link target)
J = calcJacobian(idx);
err = calcVWerr(target, ulink[to]);
if(err.norm() < eps) return true;
dq = lambda * (J.inverse() * err);

if(idx == 6)
dq = lambda * (J.inverse() * err);
else
dq = lambda * ((J.transpose()*J).inverse()*J.transpose()*err);

for(size_t nn=0;nn<idx.size();nn++)
{
int j = idx[nn];
Expand Down

0 comments on commit a53710c

Please sign in to comment.