Commit b974c4b1 authored by Gabriele Buondonno's avatar Gabriele Buondonno
Browse files

[examples] [i-inverse-kinematics.cpp] Use JacobiSVD instead of BDCSVD

For compatibility with Eigen < 3.3
parent f2ea4d2f
......@@ -77,9 +77,9 @@ The second difference consists in the way the velocity is computed
\dontinclude i-inverse-kinematics.cpp
\skip svdOptions
\until BDCSVD
\until SVD
\skipline svd.compute
This is equivalent to using the pseudo-inverse, but way more efficient.
Also notice we have chosen to pre-allocate the space for the SVD decomposition instead of using method `bdcSvd(svdOptions)`.
Also notice we have chosen to pre-allocate the space for the SVD decomposition instead of using method `jacobiSvd(svdOptions)`.
......@@ -3,6 +3,7 @@
#
SET(${PROJECT_NAME}_EXAMPLES
i-inverse-kinematics
overview-simple
overview-lie
overview-SE3
......@@ -13,13 +14,6 @@ SET(${PROJECT_NAME}_EXAMPLES
ADD_DEFINITIONS(-DPINOCCHIO_MODEL_DIR="${PINOCCHIO_MODEL_DIR}")
IF(EIGEN3_VERSION VERSION_GREATER 3.2.90)
SET(${PROJECT_NAME}_EXAMPLES
${${PROJECT_NAME}_EXAMPLES}
i-inverse-kinematics
)
ENDIF(EIGEN3_VERSION VERSION_GREATER 3.2.90)
FOREACH(EXAMPLE ${${PROJECT_NAME}_EXAMPLES})
SET(EXAMPLE_NAME "example-${EXAMPLE}")
ADD_UNIT_TEST(${EXAMPLE_NAME} ${EXAMPLE})
......
......@@ -19,7 +19,7 @@ int main(int /* argc */, char ** /* argv */)
pinocchio::Data::Matrix6x J(6,model.nv); J.setZero();
unsigned int svdOptions = Eigen::ComputeThinU | Eigen::ComputeThinV;
Eigen::BDCSVD<pinocchio::Data::Matrix3x> svd(3,model.nv,svdOptions);
Eigen::JacobiSVD<pinocchio::Data::Matrix3x> svd(3,model.nv,svdOptions);
Eigen::Vector3d err;
for (int i=0;;i++)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment