Skip to content

Commit 0feb61e

Browse files
committed
Avoid computation of full SVD
... when only singular values are needed. Actually, it might suffice to compute the determinant!
1 parent ae57b33 commit 0feb61e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

franka_gazebo/src/model_kdl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ bool ModelKDL::isCloseToSingularity(const KDL::Jacobian& jacobian) const {
3737
return false;
3838
}
3939
Eigen::Matrix<double, 6, 6> mat = jacobian.data * jacobian.data.transpose();
40-
Eigen::JacobiSVD<Eigen::MatrixXd> svd(mat, Eigen::ComputeFullU | Eigen::ComputeFullV);
40+
Eigen::JacobiSVD<Eigen::Matrix<double, 6, 6>> svd(mat);
4141
double critical = svd.singularValues().tail(1)(0);
4242
return critical < this->singularity_threshold_;
4343
}

0 commit comments

Comments
 (0)