We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c42c4dc + 713c39a commit 3e61783Copy full SHA for 3e61783
orocos_kdl/src/frames.cpp
@@ -413,15 +413,13 @@ double Rotation::GetRotAngle(Vector& axis,double eps) const {
413
return angle; // return 180 deg rotation
414
}
415
416
- // If the matrix is slightly non-orthogonal, `f` may be out of the (-1, +1) range.
417
- // Therefore, clamp it between those values to avoid NaNs.
418
double f = (data[0] + data[4] + data[8] - 1) / 2;
419
- angle = acos(std::max(-1.0, std::min(1.0, f)));
420
421
x = (data[7] - data[5]);
422
y = (data[2] - data[6]);
423
z = (data[3] - data[1]);
424
axis = KDL::Vector(x, y, z);
+ angle = atan2(axis.Norm()/2,f);
425
axis.Normalize();
426
return angle;
427
0 commit comments