Modify damped least square IK formulation. Test setting joint damping coefficients for IK.

This commit is contained in:
yunfeibai
2017-01-31 22:58:37 -08:00
parent 2fa3e267fc
commit 0022d0dafb
8 changed files with 59 additions and 5 deletions

View File

@@ -251,6 +251,18 @@ MatrixRmn& MatrixRmn::AddToDiagonal( double d ) // Adds d to each diagonal en
return *this;
}
// Add a vector to the entries on the diagonal
MatrixRmn& MatrixRmn::AddToDiagonal( const VectorRn& dVec ) // Adds dVec to the diagonal entries
{
long diagLen = Min( NumRows, NumCols );
double* dPtr = x;
for (int i = 0; i < diagLen && i < dVec.GetLength(); ++i) {
*dPtr += dVec[i];
dPtr += NumRows+1;
}
return *this;
}
// Multiply two MatrixRmn's
MatrixRmn& MatrixRmn::Multiply( const MatrixRmn& A, const MatrixRmn& B, MatrixRmn& dst )
{