Functions | |
def | ellipsoid (rx, ry, rz, n) |
def | plot_3d_points (fignum, values, linespec="g*", marginals=None, title="3D Points", axis_labels=('X axis', 'Y axis', 'Z axis')) |
def | plot_covariance_ellipse_3d (axes, origin, P, scale=1, n=8, alpha=0.5) |
def | plot_incremental_trajectory (fignum, values, start=0, scale=1, marginals=None, time_interval=0.0) |
def | plot_point3 (fignum, point, linespec, P=None, axis_labels=('X axis', 'Y axis', 'Z axis')) |
def | plot_point3_on_axes (axes, point, linespec, P=None) |
def | plot_pose2 (fignum, pose, axis_length=0.1, covariance=None, axis_labels=('X axis', 'Y axis', 'Z axis')) |
def | plot_pose2_on_axes (axes, pose, axis_length=0.1, covariance=None) |
def | plot_pose3 (fignum, pose, axis_length=0.1, P=None, axis_labels=('X axis', 'Y axis', 'Z axis')) |
def | plot_pose3_on_axes (axes, pose, axis_length=0.1, P=None, scale=1) |
def | plot_trajectory (fignum, values, scale=1, marginals=None, title="Plot Trajectory", axis_labels=('X axis', 'Y axis', 'Z axis')) |
def | set_axes_equal (fignum) |
Various plotting utlities.
def gtsam.utils.plot.ellipsoid | ( | rx, | |
ry, | |||
rz, | |||
n | |||
) |
Numpy equivalent of Matlab's ellipsoid function. Args: rx (double): Radius of ellipsoid in X-axis. ry (double): Radius of ellipsoid in Y-axis. rz (double): Radius of ellipsoid in Z-axis. n (int): The granularity of the ellipsoid plotted. Returns: tuple[numpy.ndarray]: The points in the x, y and z axes to use for the surface plot.
def gtsam.utils.plot.plot_3d_points | ( | fignum, | |
values, | |||
linespec = "g*" , |
|||
marginals = None , |
|||
title = "3D Points" , |
|||
axis_labels = ('X axis', 'Y axis', 'Z axis') |
|||
) |
Plots the Point3s in `values`, with optional covariances. Finds all the Point3 objects in the given Values object and plots them. If a Marginals object is given, this function will also plot marginal covariance ellipses for each point. Args: fignum (int): Integer representing the figure number to use for plotting. values (gtsam.Values): Values dictionary consisting of points to be plotted. linespec (string): String representing formatting options for Matplotlib. marginals (numpy.ndarray): Marginal covariance matrix to plot the uncertainty of the estimation. title (string): The title of the plot. axis_labels (iterable[string]): List of axis labels to set.
def gtsam.utils.plot.plot_covariance_ellipse_3d | ( | axes, | |
origin, | |||
P, | |||
scale = 1 , |
|||
n = 8 , |
|||
alpha = 0.5 |
|||
) |
Plots a Gaussian as an uncertainty ellipse Based on Maybeck Vol 1, page 366 k=2.296 corresponds to 1 std, 68.26% of all probability k=11.82 corresponds to 3 std, 99.74% of all probability Args: axes (matplotlib.axes.Axes): Matplotlib axes. origin (gtsam.Point3): The origin in the world frame. P (numpy.ndarray): The marginal covariance matrix of the 3D point which will be represented as an ellipse. scale (float): Scaling factor of the radii of the covariance ellipse. n (int): Defines the granularity of the ellipse. Higher values indicate finer ellipses. alpha (float): Transparency value for the plotted surface in the range [0, 1].
def gtsam.utils.plot.plot_incremental_trajectory | ( | fignum, | |
values, | |||
start = 0 , |
|||
scale = 1 , |
|||
marginals = None , |
|||
time_interval = 0.0 |
|||
) |
Incrementally plot a complete 3D trajectory using poses in `values`. Args: fignum (int): Integer representing the figure number to use for plotting. values (gtsam.Values): Values dict containing the poses. start (int): Starting index to start plotting from. scale (float): Value to scale the poses by. marginals (gtsam.Marginals): Marginalized probability values of the estimation. Used to plot uncertainty bounds. time_interval (float): Time in seconds to pause between each rendering. Used to create animation effect.
def gtsam.utils.plot.plot_point3 | ( | fignum, | |
point, | |||
linespec, | |||
P = None , |
|||
axis_labels = ('X axis', 'Y axis', 'Z axis') |
|||
) |
Plot a 3D point on given figure with given `linespec`. Args: fignum (int): Integer representing the figure number to use for plotting. point (gtsam.Point3): The point to be plotted. linespec (string): String representing formatting options for Matplotlib. P (numpy.ndarray): Marginal covariance matrix to plot the uncertainty of the estimation. axis_labels (iterable[string]): List of axis labels to set. Returns: fig: The matplotlib figure.
def gtsam.utils.plot.plot_point3_on_axes | ( | axes, | |
point, | |||
linespec, | |||
P = None |
|||
) |
Plot a 3D point on given axis `axes` with given `linespec`. Args: axes (matplotlib.axes.Axes): Matplotlib axes. point (gtsam.Point3): The point to be plotted. linespec (string): String representing formatting options for Matplotlib. P (numpy.ndarray): Marginal covariance matrix to plot the uncertainty of the estimation.
def gtsam.utils.plot.plot_pose2 | ( | fignum, | |
pose, | |||
axis_length = 0.1 , |
|||
covariance = None , |
|||
axis_labels = ('X axis', 'Y axis', 'Z axis') |
|||
) |
Plot a 2D pose on given figure with given `axis_length`. Args: fignum (int): Integer representing the figure number to use for plotting. pose (gtsam.Pose2): The pose to be plotted. axis_length (float): The length of the camera axes. covariance (numpy.ndarray): Marginal covariance matrix to plot the uncertainty of the estimation. axis_labels (iterable[string]): List of axis labels to set.
def gtsam.utils.plot.plot_pose2_on_axes | ( | axes, | |
pose, | |||
axis_length = 0.1 , |
|||
covariance = None |
|||
) |
Plot a 2D pose on given axis `axes` with given `axis_length`. Args: axes (matplotlib.axes.Axes): Matplotlib axes. pose (gtsam.Pose2): The pose to be plotted. axis_length (float): The length of the camera axes. covariance (numpy.ndarray): Marginal covariance matrix to plot the uncertainty of the estimation.
def gtsam.utils.plot.plot_pose3 | ( | fignum, | |
pose, | |||
axis_length = 0.1 , |
|||
P = None , |
|||
axis_labels = ('X axis', 'Y axis', 'Z axis') |
|||
) |
Plot a 3D pose on given figure with given `axis_length`. Args: fignum (int): Integer representing the figure number to use for plotting. pose (gtsam.Pose3): 3D pose to be plotted. linespec (string): String representing formatting options for Matplotlib. P (numpy.ndarray): Marginal covariance matrix to plot the uncertainty of the estimation. axis_labels (iterable[string]): List of axis labels to set. Returns: fig: The matplotlib figure.
def gtsam.utils.plot.plot_pose3_on_axes | ( | axes, | |
pose, | |||
axis_length = 0.1 , |
|||
P = None , |
|||
scale = 1 |
|||
) |
Plot a 3D pose on given axis `axes` with given `axis_length`. Args: axes (matplotlib.axes.Axes): Matplotlib axes. point (gtsam.Point3): The point to be plotted. linespec (string): String representing formatting options for Matplotlib. P (numpy.ndarray): Marginal covariance matrix to plot the uncertainty of the estimation.
def gtsam.utils.plot.plot_trajectory | ( | fignum, | |
values, | |||
scale = 1 , |
|||
marginals = None , |
|||
title = "Plot Trajectory" , |
|||
axis_labels = ('X axis', 'Y axis', 'Z axis') |
|||
) |
Plot a complete 2D/3D trajectory using poses in `values`. Args: fignum (int): Integer representing the figure number to use for plotting. values (gtsam.Values): Values containing some Pose2 and/or Pose3 values. scale (float): Value to scale the poses by. marginals (gtsam.Marginals): Marginalized probability values of the estimation. Used to plot uncertainty bounds. title (string): The title of the plot. axis_labels (iterable[string]): List of axis labels to set.
def gtsam.utils.plot.set_axes_equal | ( | fignum | ) |
Make axes of 3D plot have equal scale so that spheres appear as spheres, cubes as cubes, etc.. This is one possible solution to Matplotlib's ax.set_aspect('equal') and ax.axis('equal') not working for 3D. Args: fignum (int): An integer representing the figure number for Matplotlib.