8 """ Returns example pose values of 3 points A, B and C in the world frame """
11 T.append(
gtsam.Point3(np.array([-1.0590e+00, -3.6017e-02, -1.5720e+00])))
12 T.append(
gtsam.Point3(np.array([8.5034e+00, 6.7499e+00, -3.6383e+00])))
15 for i, t
in enumerate(T):
21 """ Returns binary measurements for the points in the given edges."""
23 for edge
in graph_edges:
26 measurements.append(gtsam.BinaryMeasurementUnit3( \
33 """ Tests for the translation recovery class."""
36 """Construct from binary measurements."""
44 """Test selected Translation Recovery methods."""
50 lmParams.setVerbosityLM(
"silent")
54 result = algorithm.run(measurements, scale)
56 w_aTc = gt_poses.atPose3(2).
translation() - gt_poses.atPose3(
58 w_aTb = gt_poses.atPose3(1).
translation() - gt_poses.atPose3(
60 w_aTc_expected = w_aTc * scale / np.linalg.norm(w_aTb)
61 w_aTb_expected = w_aTb * scale / np.linalg.norm(w_aTb)
63 np.testing.assert_array_almost_equal(result.atPoint3(0),
64 np.array([0, 0, 0]), 6,
65 "Origin result is incorrect.")
66 np.testing.assert_array_almost_equal(result.atPoint3(1),
68 "Point B result is incorrect.")
69 np.testing.assert_array_almost_equal(result.atPoint3(2),
71 "Point C result is incorrect.")
74 if __name__ ==
"__main__":