1 from __future__
import print_function
8 """ Returns example pose values of 3 points A, B and C in the world frame """ 12 T.append(
gtsam.Point3(np.array([-1.0590e+00, -3.6017e-02, -1.5720e+00])))
13 T.append(
gtsam.Point3(np.array([8.5034e+00, 6.7499e+00, -3.6383e+00])))
16 for i
in range(
len(T)):
20 """ Returns binary measurements for the points in the given edges.""" 23 for edge
in graph_edges:
24 Ta = gt_poses.atPose3(edge[0]).translation()
25 Tb = gt_poses.atPose3(edge[1]).translation()
26 measurements.append(gtsam.BinaryMeasurementUnit3( \
31 """ Tests for the translation recovery class """ 33 """Test selected Translation Recovery methods.""" 36 """Construct from binary measurements.""" 46 lmParams.setVerbosityLM(
"silent")
50 result = algorithm.run(scale)
52 w_aTc = gt_poses.atPose3(2).translation() - gt_poses.atPose3(0).translation()
53 w_aTb = gt_poses.atPose3(1).translation() - gt_poses.atPose3(0).translation()
54 w_aTc_expected = w_aTc*scale/np.linalg.norm(w_aTb)
55 w_aTb_expected = w_aTb*scale/np.linalg.norm(w_aTb)
57 np.testing.assert_array_almost_equal(result.atPoint3(0), np.array([0,0,0]), 6,
"Origin result is incorrect.")
58 np.testing.assert_array_almost_equal(result.atPoint3(1), w_aTb_expected, 6,
"Point B result is incorrect.")
59 np.testing.assert_array_almost_equal(result.atPoint3(2), w_aTc_expected, 6,
"Point C result is incorrect.")
61 if __name__ ==
"__main__":
std::vector< BinaryMeasurement< Unit3 >> BinaryMeasurementsUnit3
Represents a 3D point on a unit sphere.
def test_constructor(self)
def SimulateMeasurements(gt_poses, graph_edges)
static shared_ptr Sigma(size_t dim, double sigma, bool smart=true)