irsim.world.object_plot#

Matplotlib rendering for irsim.world.object_base.ObjectBase.

Classes#

VisibilityOptions

Control which components of an object are rendered.

PatchStyle

Style shared by object and goal patches.

ImageStyle

Style specific to an object's description image.

LineStyle

Style and history length for a trajectory line.

TextStyle

Style and offset for object and goal labels.

TrailStyle

Style, frequency, and retention policy for object trails.

ArrowStyle

Style and dimensions for the velocity arrow.

FovStyle

Style for the field-of-view patch.

ObjectPlotOptions

Complete immutable plotting configuration for one object.

ObjectPlot

Render and update the Matplotlib artists for one simulation object.

Module Contents#

class irsim.world.object_plot.VisibilityOptions[源代码]#

Control which components of an object are rendered.

goal: bool = False#
goal_text: bool = False#
goals: bool = False#
text: bool = False#
arrow: bool = False#
trajectory: bool = False#
trail: bool = False#
sensor: bool = True#
fov: bool = False#
class irsim.world.object_plot.PatchStyle[源代码]#

Style shared by object and goal patches.

color: Any = 'k'#
alpha: float = 1.0#
zorder: int = 1#
linestyle: str = '-'#
line_width: float = 1.0#
class irsim.world.object_plot.ImageStyle[源代码]#

Style specific to an object's description image.

zorder: int = 2#
class irsim.world.object_plot.LineStyle[源代码]#

Style and history length for a trajectory line.

color: Any = 'k'#
style: str = '-'#
width: float = 1.0#
alpha: float = 0.5#
zorder: int = 0#
keep_length: int = 0#
class irsim.world.object_plot.TextStyle[源代码]#

Style and offset for object and goal labels.

color: Any = 'k'#
size: float = 10.0#
position: tuple[float, float] = (0.0, 0.0)#
alpha: float = 1.0#
zorder: int = 2#
class irsim.world.object_plot.TrailStyle[源代码]#

Style, frequency, and retention policy for object trails.

shape: str = 'circle'#
edge_color: Any = 'k'#
line_width: float = 0.8#
alpha: float = 0.7#
fill: bool = False#
color: Any = 'k'#
zorder: int = 0#
frequency: int = 2#
keep_length: int = 0#
class irsim.world.object_plot.ArrowStyle[源代码]#

Style and dimensions for the velocity arrow.

color: Any = 'gold'#
alpha: float = 1.0#
zorder: int = 3#
length: float = 0.4#
width: float = 0.6#
class irsim.world.object_plot.FovStyle[源代码]#

Style for the field-of-view patch.

color: Any = 'lightblue'#
edge_color: Any = 'blue'#
alpha: float = 0.5#
zorder: int = 1#
class irsim.world.object_plot.ObjectPlotOptions[源代码]#

Complete immutable plotting configuration for one object.

visibility: VisibilityOptions#
object: PatchStyle#
image: ImageStyle#
goal: PatchStyle#
trajectory: LineStyle#
text: TextStyle#
trail: TrailStyle#
arrow: ArrowStyle#
fov: FovStyle#
classmethod defaults(*, color: Any, width: float, radius: float, shape: str, object_zorder: int) ObjectPlotOptions[源代码]#

Create owner-dependent plotting defaults.

with_overrides(values: collections.abc.Mapping[str, Any]) ObjectPlotOptions[源代码]#

Return a new options value with legacy keyword overrides applied.

class irsim.world.object_plot.ObjectPlot(owner: irsim.world.object_base.ObjectBase)[源代码]#

Render and update the Matplotlib artists for one simulation object.

Simulation and artist state is accessed explicitly through owner. Artist attributes intentionally remain on ObjectBase to preserve the existing plotting API while moving rendering behavior out of the model.

options#
property owner: irsim.world.object_base.ObjectBase#

Return the owner through the explicit renderer interface.

plot(ax: Any, state: numpy.ndarray | None = None, vertices: numpy.ndarray | None = None, **kwargs: Any) None[源代码]#

Plot the object on ax using optional state and vertices.

init(ax: Any, **kwargs: Any) list[str][源代码]#

Create the object's artists at its original state.

draw(ax: Any, state: numpy.ndarray, vertices: numpy.ndarray | None, initial: bool = False, **kwargs: Any) list[str][源代码]#

Create the configured artists for one object.

step(**kwargs: Any) None[源代码]#

Update existing artists from the owner's current state.

plot_object(ax: Any, state: numpy.ndarray | None = None, vertices: numpy.ndarray | None = None, _options: ObjectPlotOptions | None = None, **kwargs: Any) None[源代码]#

Draw the object's geometry or configured description image.

plot_object_image(ax: Any, state: numpy.ndarray | None = None, vertices: numpy.ndarray | None = None, description: str | None = None, **kwargs: Any) None[源代码]#

Draw an image description at the object's pose.

plot_trajectory(ax: Any, trajectory: list[Any] | None = None, keep_traj_length: int = 0, _options: ObjectPlotOptions | None = None, **kwargs: Any) None[源代码]#

Draw the object's trajectory.

plot_goal(ax: Any, goal_state: numpy.ndarray | None = None, vertices: numpy.ndarray | None = None, goal_color: str | None = None, goal_zorder: int | None = 1, goal_alpha: float | None = 0.5, _options: ObjectPlotOptions | None = None, **kwargs: Any) None[源代码]#

Draw the object's goal geometry.

plot_text(ax: Any, state: numpy.ndarray | None = None, _options: ObjectPlotOptions | None = None, **kwargs: Any) None[源代码]#

Draw the object label and optional goal label.

plot_arrow(ax: Any, state: numpy.ndarray | None = None, velocity: numpy.ndarray | None = None, arrow_theta: float | None = 0.0, arrow_length: float = 0.4, arrow_width: float = 0.6, arrow_color: str | None = None, arrow_zorder: int = 3, _options: ObjectPlotOptions | None = None, **kwargs: Any) None[源代码]#

Draw an arrow indicating the object's velocity orientation.

plot_trail(ax: Any, state: numpy.ndarray | None = None, vertices: numpy.ndarray | None = None, keep_trail_length: int = 0, _options: ObjectPlotOptions | None = None, **kwargs: Any) None[源代码]#

Draw a historical outline of the object.

plot_fov(ax: Any, _options: ObjectPlotOptions | None = None, **kwargs: Any) None[源代码]#

Draw the object's configured field of view.

plot_uncertainty(ax: Any, **kwargs: Any) None[源代码]#

Reserved for future uncertainty rendering.

clear(all: bool = False) None[源代码]#

Remove this object's artists, optionally including its trails.