MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / CalcAngle

Function CalcAngle

deps/glomap/glomap/math/rigid3d.cc:7–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace glomap {
6
7double 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
17double CalcTrans(const Rigid3d& pose1, const Rigid3d& pose2) {
18 return (Inverse(pose1).translation - Inverse(pose2).translation).norm();

Callers 2

FilterRotationsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected