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