irsim.env.env_plot3d#
Classes#
EnvPlot class for visualizing the environment. |
Module Contents#
- class irsim.env.env_plot3d.EnvPlot3D(world: Any, objects: list[Any] | None = None, saved_figure: dict[str, Any] | None = None, figure_pixels: list[int] | None = None, show_title: bool = True, **kwargs: Any)[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.
Create a 3D plot for the environment.
- Parameters:
world – World-like object that provides ranges and grid map.
objects (list | None) – Objects to initialize on the plot.
saved_figure (dict | None) – Savefig keyword arguments.
figure_pixels (list[int] | None) – Figure size in pixels [w, h].
show_title (bool) – Whether to show the title.
**kwargs – Additional drawing options passed downstream.
- ax#
- z_range#
- draw_points(points: list | numpy.ndarray | None, s: int = 10, c: str = 'm', refresh: bool = True, **kwargs: Any) None[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: numpy.ndarray | None, refresh: bool = False, **kwargs: Any) None[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: list | numpy.ndarray, refresh: bool = False, **kwargs: Any) None[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: list | numpy.ndarray, traj_type: str = 'g-', label: str = 'trajectory', show_direction: bool = False, refresh: bool = False, **kwargs: Any) None[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()