File tree Expand file tree Collapse file tree 2 files changed +2
-14
lines changed Expand file tree Collapse file tree 2 files changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -12,17 +12,10 @@ auto least_squares(const Eigen::MatrixXd & jac) -> Eigen::MatrixXd
12
12
return jac.completeOrthogonalDecomposition ().pseudoInverse ();
13
13
}
14
14
15
- auto damped_least_squares (const Eigen::MatrixXd & jac, const Eigen::VectorXd & damping) -> Eigen::MatrixXd
16
- {
17
- if (damping.size () != jac.rows ()) {
18
- throw std::invalid_argument (" Damping vector must have the same size as the number of rows in the Jacobian." );
19
- }
20
- return jac.transpose () * ((jac * jac.transpose ()) + damping.asDiagonal ().toDenseMatrix ()).inverse ();
21
- }
22
-
23
15
auto damped_least_squares (const Eigen::MatrixXd & jac, double damping) -> Eigen::MatrixXd
24
16
{
25
- return damped_least_squares (jac, damping * Eigen::MatrixXd::Identity (jac.rows (), jac.rows ()));
17
+ const Eigen::MatrixXd eye = Eigen::MatrixXd::Identity (jac.rows (), jac.rows ());
18
+ return jac.transpose () * ((jac * jac.transpose ()) + (damping * eye)).inverse ();
26
19
}
27
20
28
21
} // namespace ik_solvers::pinv
Original file line number Diff line number Diff line change @@ -28,11 +28,6 @@ namespace ik_solvers::pinv
28
28
// / Calculate the pseudoinverse of a Jacobian matrix using the Moore-Penrose method.
29
29
auto least_squares (const Eigen::MatrixXd & jac) -> Eigen::MatrixXd;
30
30
31
- // / Calculate the pseudoinverse of a Jacobian matrix using the damped least squares method.
32
- // /
33
- // / This version allows for more granular selection of the damping values to tune the solution velocities.
34
- auto damped_least_squares (const Eigen::MatrixXd & jac, const Eigen::VectorXd & damping) -> Eigen::MatrixXd;
35
-
36
31
// / Calculate the pseudoinverse of a Jacobian matrix using the damped least squares method.
37
32
auto damped_least_squares (const Eigen::MatrixXd & jac, double damping) -> Eigen::MatrixXd;
38
33
You can’t perform that action at this time.
0 commit comments