test_Cal3Unified.py
Go to the documentation of this file.
1 """
2 GTSAM Copyright 2010-2019, Georgia Tech Research Corporation,
3 Atlanta, Georgia 30332-0415
4 All Rights Reserved
5 
6 See LICENSE for the license information
7 
8 Cal3Unified unit tests.
9 Author: Frank Dellaert & Duy Nguyen Ta (Python)
10 """
11 import unittest
12 
13 import numpy as np
14 
15 import gtsam
16 from gtsam.utils.test_case import GtsamTestCase
17 
18 
20 
21  def test_Cal3Unified(self):
22  K = gtsam.Cal3Unified()
23  self.assertEqual(K.fx(), 1.)
24  self.assertEqual(K.fx(), 1.)
25 
26  def test_retract(self):
27  expected = gtsam.Cal3Unified(100 + 2, 105 + 3, 0.0 + 4, 320 + 5, 240 + 6,
28  1e-3 + 7, 2.0*1e-3 + 8, 3.0*1e-3 + 9, 4.0*1e-3 + 10, 0.1 + 1)
29  K = gtsam.Cal3Unified(100, 105, 0.0, 320, 240,
30  1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3, 0.1)
31  d = np.array([2, 3, 4, 5, 6, 7, 8, 9, 10, 1], order='F')
32  actual = K.retract(d)
33  self.gtsamAssertEquals(actual, expected)
34  np.testing.assert_allclose(d, K.localCoordinates(actual))
35 
36 
37 if __name__ == "__main__":
38  unittest.main()
def gtsamAssertEquals(self, actual, expected, tol=1e-9)
Definition: test_case.py:18


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:46:03