fix deprecation warnings from Matplotlib
parent
91d66eeace
commit
d3591dac0b
|
@ -73,38 +73,41 @@ class PreintegrationExample(object):
|
||||||
self.runner = gtsam.ScenarioRunner(
|
self.runner = gtsam.ScenarioRunner(
|
||||||
self.scenario, self.params, self.dt, self.actualBias)
|
self.scenario, self.params, self.dt, self.actualBias)
|
||||||
|
|
||||||
|
fig, self.axes = plt.subplots(4, 3)
|
||||||
|
fig.set_tight_layout(True)
|
||||||
|
|
||||||
def plotImu(self, t, measuredOmega, measuredAcc):
|
def plotImu(self, t, measuredOmega, measuredAcc):
|
||||||
plt.figure(IMU_FIG)
|
plt.figure(IMU_FIG)
|
||||||
|
|
||||||
# plot angular velocity
|
# plot angular velocity
|
||||||
omega_b = self.scenario.omega_b(t)
|
omega_b = self.scenario.omega_b(t)
|
||||||
for i, (label, color) in enumerate(zip(self.labels, self.colors)):
|
for i, (label, color) in enumerate(zip(self.labels, self.colors)):
|
||||||
plt.subplot(4, 3, i + 1)
|
ax = self.axes[0][i]
|
||||||
plt.scatter(t, omega_b[i], color='k', marker='.')
|
ax.scatter(t, omega_b[i], color='k', marker='.')
|
||||||
plt.scatter(t, measuredOmega[i], color=color, marker='.')
|
ax.scatter(t, measuredOmega[i], color=color, marker='.')
|
||||||
plt.xlabel('angular velocity ' + label)
|
ax.set_xlabel('angular velocity ' + label)
|
||||||
|
|
||||||
# plot acceleration in nav
|
# plot acceleration in nav
|
||||||
acceleration_n = self.scenario.acceleration_n(t)
|
acceleration_n = self.scenario.acceleration_n(t)
|
||||||
for i, (label, color) in enumerate(zip(self.labels, self.colors)):
|
for i, (label, color) in enumerate(zip(self.labels, self.colors)):
|
||||||
plt.subplot(4, 3, i + 4)
|
ax = self.axes[1][i]
|
||||||
plt.scatter(t, acceleration_n[i], color=color, marker='.')
|
ax.scatter(t, acceleration_n[i], color=color, marker='.')
|
||||||
plt.xlabel('acceleration in nav ' + label)
|
ax.set_xlabel('acceleration in nav ' + label)
|
||||||
|
|
||||||
# plot acceleration in body
|
# plot acceleration in body
|
||||||
acceleration_b = self.scenario.acceleration_b(t)
|
acceleration_b = self.scenario.acceleration_b(t)
|
||||||
for i, (label, color) in enumerate(zip(self.labels, self.colors)):
|
for i, (label, color) in enumerate(zip(self.labels, self.colors)):
|
||||||
plt.subplot(4, 3, i + 7)
|
ax = self.axes[2][i]
|
||||||
plt.scatter(t, acceleration_b[i], color=color, marker='.')
|
ax.scatter(t, acceleration_b[i], color=color, marker='.')
|
||||||
plt.xlabel('acceleration in body ' + label)
|
ax.set_xlabel('acceleration in body ' + label)
|
||||||
|
|
||||||
# plot actual specific force, as well as corrupted
|
# plot actual specific force, as well as corrupted
|
||||||
actual = self.runner.actualSpecificForce(t)
|
actual = self.runner.actualSpecificForce(t)
|
||||||
for i, (label, color) in enumerate(zip(self.labels, self.colors)):
|
for i, (label, color) in enumerate(zip(self.labels, self.colors)):
|
||||||
plt.subplot(4, 3, i + 10)
|
ax = self.axes[3][i]
|
||||||
plt.scatter(t, actual[i], color='k', marker='.')
|
ax.scatter(t, actual[i], color='k', marker='.')
|
||||||
plt.scatter(t, measuredAcc[i], color=color, marker='.')
|
ax.scatter(t, measuredAcc[i], color=color, marker='.')
|
||||||
plt.xlabel('specific force ' + label)
|
ax.set_xlabel('specific force ' + label)
|
||||||
|
|
||||||
def plotGroundTruthPose(self, t):
|
def plotGroundTruthPose(self, t):
|
||||||
# plot ground truth pose, as well as prediction from integrated IMU measurements
|
# plot ground truth pose, as well as prediction from integrated IMU measurements
|
||||||
|
|
Loading…
Reference in New Issue