From b02cc3f7e3aba926392d29e4b734e05ef2d4c6ee Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Fri, 31 Jul 2020 12:42:09 -0400 Subject: [PATCH] remove function import --- python/gtsam/utils/circlePose3.py | 5 +++-- python/gtsam/utils/visual_data_generator.py | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/python/gtsam/utils/circlePose3.py b/python/gtsam/utils/circlePose3.py index 37e7c5568..e1def9427 100644 --- a/python/gtsam/utils/circlePose3.py +++ b/python/gtsam/utils/circlePose3.py @@ -1,6 +1,7 @@ import gtsam +import math import numpy as np -from math import pi, cos, sin +from math import pi def circlePose3(numPoses=8, radius=1.0, symbolChar='\0'): @@ -25,7 +26,7 @@ def circlePose3(numPoses=8, radius=1.0, symbolChar='\0'): np.array([[0., 1., 0.], [1., 0., 0.], [0., 0., -1.]], order='F')) for i in range(numPoses): key = gtsam.symbol(symbolChar, i) - gti = gtsam.Point3(radius * cos(theta), radius * sin(theta), 0) + gti = gtsam.Point3(radius * math.cos(theta), radius * math.sin(theta), 0) oRi = gtsam.Rot3.Yaw( -theta) # negative yaw goes counterclockwise, with Z down ! gTi = gtsam.Pose3(gRo.compose(oRi), gti) diff --git a/python/gtsam/utils/visual_data_generator.py b/python/gtsam/utils/visual_data_generator.py index 24404ca03..c6e5b8c63 100644 --- a/python/gtsam/utils/visual_data_generator.py +++ b/python/gtsam/utils/visual_data_generator.py @@ -1,7 +1,8 @@ from __future__ import print_function import numpy as np -from math import pi, cos, sin +import math +from math import pi import gtsam from gtsam import PinholeCameraCal3_S2 @@ -85,7 +86,7 @@ def generate_data(options): r = 10 for j in range(len(truth.points)): theta = j * 2 * pi / nrPoints - truth.points[j] = gtsam.Point3(r * cos(theta), r * sin(theta), 0) + truth.points[j] = gtsam.Point3(r * math.cos(theta), r * math.sin(theta), 0) else: # 3D landmarks as vertices of a cube truth.points = [ gtsam.Point3(10, 10, 10), gtsam.Point3(-10, 10, 10), @@ -99,7 +100,7 @@ def generate_data(options): r = 40 for i in range(options.nrCameras): theta = i * 2 * pi / options.nrCameras - t = gtsam.Point3(r * cos(theta), r * sin(theta), height) + t = gtsam.Point3(r * math.cos(theta), r * math.sin(theta), height) truth.cameras[i] = PinholeCameraCal3_S2.Lookat(t, gtsam.Point3(0, 0, 0), gtsam.Point3(0, 0, 1),