From b30a7685dba77db29977c8a45c6266c751d5a064 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Thu, 9 Jun 2016 00:19:54 -0700 Subject: [PATCH] Fix IMU example --- python/gtsam_examples/ImuFactorExample.py | 2 +- python/gtsam_examples/PreintegrationExample.py | 2 +- python/gtsam_utils/plot.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/gtsam_examples/ImuFactorExample.py b/python/gtsam_examples/ImuFactorExample.py index 0c80c2fb5..781dae118 100644 --- a/python/gtsam_examples/ImuFactorExample.py +++ b/python/gtsam_examples/ImuFactorExample.py @@ -69,7 +69,7 @@ class ImuFactorExample(PreintegrationExample): # get measurements and add them to PIM measuredOmega = self.runner.measuredAngularVelocity(t) measuredAcc = self.runner.measuredSpecificForce(t) - pim.integrateMeasurement(measuredAcc, measuredOmega, self.dt, H9, H9) + pim.integrateMeasurement(measuredAcc, measuredOmega, self.dt) # Plot IMU many times if k % 10 == 0: diff --git a/python/gtsam_examples/PreintegrationExample.py b/python/gtsam_examples/PreintegrationExample.py index 6b0d83b10..b441ffecb 100644 --- a/python/gtsam_examples/PreintegrationExample.py +++ b/python/gtsam_examples/PreintegrationExample.py @@ -101,7 +101,7 @@ class PreintegrationExample(object): actualPose = self.scenario.pose(t) plotPose3(POSES_FIG, actualPose, 0.3) t = actualPose.translation() - self.maxDim = max([abs(t.x()), abs(t.y()), abs(t.z()), self.maxDim]) + self.maxDim = max([abs(t[0]), abs(t[1]), abs(t[2]), self.maxDim]) ax = plt.gca() ax.set_xlim3d(-self.maxDim, self.maxDim) ax.set_ylim3d(-self.maxDim, self.maxDim) diff --git a/python/gtsam_utils/plot.py b/python/gtsam_utils/plot.py index 01ec85009..8863f427e 100644 --- a/python/gtsam_utils/plot.py +++ b/python/gtsam_utils/plot.py @@ -33,7 +33,7 @@ def plot3DPoints(fignum, values, linespec, marginals=None): def plotPose3OnAxes(ax, pose, axisLength=0.1): # get rotation and translation (center) gRp = pose.rotation().matrix() # rotation from pose to global - C = pose.translation().vector() + C = pose.translation() # draw the camera axes xAxis = C + gRp[:, 0] * axisLength