Skip to content

Commit

Permalink
add contigency for rank deficient J (when on purpose due to joint num)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fadi-AlMasalmah authored and Thibault Poignonec committed Aug 23, 2024
1 parent 5921f9a commit e94d0de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,12 @@ bool VanillaCartesianAdmittanceRule::compute_controls(
RCLCPP_DEBUG(logger_, "Computing J_pinv...");
const Eigen::JacobiSVD<Eigen::MatrixXd> J_svd =
Eigen::JacobiSVD<Eigen::MatrixXd>(J_, Eigen::ComputeThinU | Eigen::ComputeThinV);
double conditioning_J = J_svd.singularValues()(0) / J_svd.singularValues()(dims - 1);
double conditioning_J = 1000.0;
if (J_.cols() < 6) {
conditioning_J = J_svd.singularValues()(0) / J_svd.singularValues()(J_.cols() - 1);
} else {
conditioning_J = J_svd.singularValues()(0) / J_svd.singularValues()(dims - 1);
}
if (conditioning_J > 30) {
success = false;
RCLCPP_ERROR(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ bool VanillaCartesianImpedanceRule::compute_controls(
RCLCPP_DEBUG(logger_, "Computing J_pinv...");
const Eigen::JacobiSVD<Eigen::MatrixXd> J_svd =
Eigen::JacobiSVD<Eigen::MatrixXd>(J_, Eigen::ComputeThinU | Eigen::ComputeThinV);
double conditioning_J = J_svd.singularValues()(0) / J_svd.singularValues()(dims - 1);
double conditioning_J = 1000.0;
if (J_.cols() < 6) {
conditioning_J = J_svd.singularValues()(0) / J_svd.singularValues()(J_.cols() - 1);
} else {
conditioning_J = J_svd.singularValues()(0) / J_svd.singularValues()(dims - 1);
}
if (conditioning_J > 30) {
success = false;
RCLCPP_ERROR(
Expand Down

0 comments on commit e94d0de

Please sign in to comment.