| 5 | namespace glomap { |
| 6 | |
| 7 | double CalcAngle(const Rigid3d& pose1, const Rigid3d& pose2) { |
| 8 | double cos_r = |
| 9 | ((pose1.rotation.inverse() * pose2.rotation).toRotationMatrix().trace() - |
| 10 | 1) / |
| 11 | 2; |
| 12 | cos_r = std::min(std::max(cos_r, -1.), 1.); |
| 13 | |
| 14 | return std::acos(cos_r) * 180 / EIGEN_PI; |
| 15 | } |
| 16 | |
| 17 | double CalcTrans(const Rigid3d& pose1, const Rigid3d& pose2) { |
| 18 | return (Inverse(pose1).translation - Inverse(pose2).translation).norm(); |
no outgoing calls
no test coverage detected