irsim.env.env_plot3d#

Classes#

EnvPlot3D

EnvPlot class for visualizing the environment.

Module Contents#

class irsim.env.env_plot3d.EnvPlot3D(world: Any, objects: list[Any] | None = None, **kwargs: Any)[source]#

Bases: irsim.env.env_plot.EnvPlot

EnvPlot class for visualizing the environment.

Parameters:
  • world – The world object with ranges and a plot_parse dictionary that configures plotting (e.g., saved_figure, figure_pixels, show_title, no_axis, tight).

  • objects (list, optional) – Initial objects to draw. Default is [].

  • kwargs – Plot overrides that update world.plot_parse at runtime (e.g., saved_figure, figure_pixels, show_title, no_axis, 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#
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()

update_title() None[source]#

Override the parent’s update_title method to handle 3D plots properly.