update python functions to include namespace

release/4.3a0
Varun Agrawal 2020-06-10 15:14:07 -05:00
parent 083569f97d
commit 8008d69dc6
5 changed files with 7 additions and 8 deletions

View File

@ -82,7 +82,7 @@ else:
print ("Done!") print ("Done!")
if args.plot: if args.plot:
resultPoses = gtsam.extractPose2(result) resultPoses = gtsam.utilities_extractPose2(result)
for i in range(resultPoses.shape[0]): for i in range(resultPoses.shape[0]):
plot.plot_pose2(1, gtsam.Pose2(resultPoses[i, :])) plot.plot_pose2(1, gtsam.Pose2(resultPoses[i, :]))
plt.show() plt.show()

View File

@ -65,7 +65,7 @@ else:
print ("Done!") print ("Done!")
if args.plot: if args.plot:
resultPoses = gtsam.allPose3s(result) resultPoses = gtsam.utilities_allPose3s(result)
for i in range(resultPoses.size()): for i in range(resultPoses.size()):
plot.plot_pose3(1, resultPoses.atPose3(i)) plot.plot_pose3(1, resultPoses.atPose3(i))
plt.show() plt.show()

View File

@ -10,15 +10,14 @@ A structure-from-motion problem on a simulated dataset
""" """
from __future__ import print_function from __future__ import print_function
import gtsam
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy as np import numpy as np
import gtsam
from gtsam.examples import SFMdata from gtsam.examples import SFMdata
from gtsam.gtsam import (Cal3_S2, DoglegOptimizer, from gtsam.gtsam import (Cal3_S2, DoglegOptimizer,
GenericProjectionFactorCal3_S2, Marginals, GenericProjectionFactorCal3_S2, Marginals,
NonlinearFactorGraph, Point3, Pose3, NonlinearFactorGraph, PinholeCameraCal3_S2, Point3,
PriorFactorPoint3, PriorFactorPose3, Rot3, Pose3, PriorFactorPoint3, PriorFactorPose3, Rot3,
SimpleCamera, Values) SimpleCamera, Values)
from gtsam.utils import plot from gtsam.utils import plot

View File

@ -33,7 +33,7 @@ class TestDSFMap(GtsamTestCase):
# testing the merge feature of dsf # testing the merge feature of dsf
dsf.merge(pair1, pair2) dsf.merge(pair1, pair2)
self.assertEquals(key(dsf.find(pair1)), key(dsf.find(pair2))) self.assertEqual(key(dsf.find(pair1)), key(dsf.find(pair2)))
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -279,7 +279,7 @@ def plot_trajectory(fignum, values, scale=1, marginals=None):
marginals (gtsam.Marginals): Marginalized probability values of the estimation. marginals (gtsam.Marginals): Marginalized probability values of the estimation.
Used to plot uncertainty bounds. Used to plot uncertainty bounds.
""" """
pose3Values = gtsam.allPose3s(values) pose3Values = gtsam.utilities_allPose3s(values)
keys = gtsam.KeyVector(pose3Values.keys()) keys = gtsam.KeyVector(pose3Values.keys())
lastIndex = None lastIndex = None