irsim.env.env_plot3d#
Classes#
EnvPlot class for visualizing the environment. |
Module Contents#
- class irsim.env.env_plot3d.EnvPlot3D(world, objects=[], saved_figure=dict(), figure_pixels: list = [1180, 1080], show_title: bool = True, **kwargs)[source]#
Bases:
irsim.env.env_plot.EnvPlotEnvPlot class for visualizing the environment.
- Parameters:
world – The world object containing environment information including grid_map, x_range, y_range.
objects (list, optional) – List of objects in the environment. Default is [].
saved_figure (dict, optional) – Keyword arguments for saving the figure. See https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.savefig.html for details. Default is dict().
figure_pixels (list, optional) – Width and height of the figure in pixels. Default is [1180, 1080].
show_title (bool, optional) – Whether to show the title. Default is True.
kwargs – Additional options such as color_map, no_axis, and tight.
Initialize the EnvPlot instance.
Sets up the matplotlib figure, configures plotting parameters, and initializes the plot with world data and objects.
- ax#
- z_range#
- draw_points(points, s=10, c='m', refresh=True, **kwargs)[source]#
Draw points on the plot.
- Parameters:
points (list) – List of points, each point as [x, y, z].
s (int) – Size of the points.
c (str) – Color of the points.
refresh (bool) – Whether to refresh the plot.
kwargs – Additional plotting options.
- draw_quiver(point, refresh=False, **kwargs)[source]#
Draw a quiver plot on the plot.
- Parameters:
points (6*1 np.ndarray) – List of points, each point as [x, y, z, u, v, w]. u, v, w are the components of the vector.
kwargs – Additional plotting options.
- draw_quivers(points, refresh=False, **kwargs)[source]#
Draw a series of quiver plot on the plot.
- Parameters:
points (list or np.ndarray) – List of points, each point as [x, y, z, u, v, w]. u, v, w are the components of the vector.
- draw_trajectory(traj, traj_type='g-', label='trajectory', show_direction=False, refresh=False, **kwargs)[source]#
Draw a trajectory on the plot.
- Parameters:
traj (list or np.ndarray) – List of points or array of points [x, y, z].
traj_type (str) – Type of trajectory line (e.g., ‘g-‘). See https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.plot.html for details.
label (str) – Label for the trajectory.
show_direction (bool) – Whether to show the direction of the trajectory.
refresh (bool) – Whether to refresh the plot.
kwargs – Additional plotting options for ax.plot()