Skip to content

Commit c2ff958

Browse files
committed
Merge pull request #208 from release-1.3
Forward port Release 1.3 fixes
2 parents 4a9d5a1 + 3e61783 commit c2ff958

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

orocos_kdl/src/frames.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,15 +417,13 @@ double Rotation::GetRotAngle(Vector& axis,double eps) const {
417417
return angle; // return 180 deg rotation
418418
}
419419

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.
422420
double f = (data[0] + data[4] + data[8] - 1) / 2;
423-
angle = acos(std::max(-1.0, std::min(1.0, f)));
424421

425422
x = (data[7] - data[5]);
426423
y = (data[2] - data[6]);
427424
z = (data[3] - data[1]);
428425
axis = KDL::Vector(x, y, z);
426+
angle = atan2(axis.Norm()/2,f);
429427
axis.Normalize();
430428
return angle;
431429
}

0 commit comments

Comments
 (0)