Skip to content

Commit

Permalink
Avoid computation of full SVD
Browse files Browse the repository at this point in the history
... when only singular values are needed.
Actually, it might suffice to compute the determinant!
  • Loading branch information
rhaschke committed Oct 7, 2022
1 parent 49c4e11 commit f6c2b35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion franka_gazebo/src/model_kdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bool ModelKDL::isCloseToSingularity(const KDL::Jacobian& jacobian) const {
return false;
}
Eigen::Matrix<double, 6, 6> mat = jacobian.data * jacobian.data.transpose();
Eigen::JacobiSVD<Eigen::MatrixXd> svd(mat, Eigen::ComputeFullU | Eigen::ComputeFullV);
Eigen::JacobiSVD<Eigen::Matrix<double, 6, 6>> svd(mat);
double critical = svd.singularValues().tail(1)(0);
return critical < this->singularity_threshold_;
}
Expand Down

0 comments on commit f6c2b35

Please sign in to comment.