fix call to Ellipse, plus some formatting
parent
6f89bd8ddf
commit
6f365b330b
|
@ -32,6 +32,7 @@ from gtsam import Marginals, Point2, Point3, Pose2, Pose3, Values
|
||||||
# 2D 39.34693 86.46647 98.88910 99.96645 99.99963
|
# 2D 39.34693 86.46647 98.88910 99.96645 99.99963
|
||||||
# 3D 19.87480 73.85359 97.07091 99.88660 99.99846
|
# 3D 19.87480 73.85359 97.07091 99.88660 99.99846
|
||||||
|
|
||||||
|
|
||||||
def set_axes_equal(fignum: int) -> None:
|
def set_axes_equal(fignum: int) -> None:
|
||||||
"""
|
"""
|
||||||
Make axes of 3D plot have equal scale so that spheres appear as spheres,
|
Make axes of 3D plot have equal scale so that spheres appear as spheres,
|
||||||
|
@ -127,8 +128,7 @@ def plot_covariance_ellipse_3d(axes,
|
||||||
axes.plot_surface(x, y, z, alpha=alpha, cmap='hot')
|
axes.plot_surface(x, y, z, alpha=alpha, cmap='hot')
|
||||||
|
|
||||||
|
|
||||||
def plot_covariance_ellipse_2d(axes,
|
def plot_covariance_ellipse_2d(axes, origin: Point2,
|
||||||
origin: Point2,
|
|
||||||
covariance: np.ndarray) -> None:
|
covariance: np.ndarray) -> None:
|
||||||
"""
|
"""
|
||||||
Plots a Gaussian as an uncertainty ellipse
|
Plots a Gaussian as an uncertainty ellipse
|
||||||
|
@ -154,7 +154,7 @@ def plot_covariance_ellipse_2d(axes,
|
||||||
e1 = patches.Ellipse(origin,
|
e1 = patches.Ellipse(origin,
|
||||||
np.sqrt(w[0]) * 2 * k,
|
np.sqrt(w[0]) * 2 * k,
|
||||||
np.sqrt(w[1]) * 2 * k,
|
np.sqrt(w[1]) * 2 * k,
|
||||||
np.rad2deg(angle),
|
angle=np.rad2deg(angle),
|
||||||
fill=False)
|
fill=False)
|
||||||
axes.add_patch(e1)
|
axes.add_patch(e1)
|
||||||
|
|
||||||
|
@ -180,6 +180,7 @@ def plot_point2_on_axes(axes,
|
||||||
if P is not None:
|
if P is not None:
|
||||||
plot_covariance_ellipse_2d(axes, point, P)
|
plot_covariance_ellipse_2d(axes, point, P)
|
||||||
|
|
||||||
|
|
||||||
def plot_point2(
|
def plot_point2(
|
||||||
fignum: int,
|
fignum: int,
|
||||||
point: Point2,
|
point: Point2,
|
||||||
|
|
Loading…
Reference in New Issue