test_dataset.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 Unit tests for testing dataset access.
9 Author: Frank Dellaert & Duy Nguyen Ta (Python)
10 """
11 # pylint: disable=invalid-name, no-name-in-module, no-member
12 
13 from __future__ import print_function
14 
15 import unittest
16 
17 import gtsam
18 from gtsam import BetweenFactorPose3
19 from gtsam.utils.test_case import GtsamTestCase
20 
21 
23  """Tests for datasets.h wrapper."""
24 
25  def setUp(self):
26  """Get some common paths."""
28  "pose3example.txt")
29 
30  def test_readG2o3D(self):
31  """Test reading directly into factor graph."""
32  is3D = True
33  graph, initial = gtsam.readG2o(self.pose3_example_g2o_file, is3D)
34  self.assertEqual(graph.size(), 6)
35  self.assertEqual(initial.size(), 5)
36 
38  """Test parsing into data structure."""
40  self.assertEqual(len(factors), 6)
41  self.assertIsInstance(factors[0], BetweenFactorPose3)
42 
43 
44 if __name__ == '__main__':
45  unittest.main()
BetweenFactorPose3s parse3DFactors(const std::string &filename, const noiseModel::Diagonal::shared_ptr &model, size_t maxIndex)
Definition: dataset.cpp:1302
GTSAM_EXPORT GraphAndValues readG2o(const std::string &g2oFile, const bool is3D=false, KernelFunctionType kernelFunctionType=KernelFunctionTypeNONE)
This function parses a g2o file and stores the measurements into a NonlinearFactorGraph and the initi...
Definition: dataset.cpp:615
size_t len(handle h)
Definition: pytypes.h:1514
GTSAM_EXPORT std::string findExampleDataFile(const std::string &name)
Definition: dataset.cpp:65


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