Visualisation

mantrap.visualization.prediction.visualize_prediction(env: mantrap.environment.base.graph_based.GraphBasedEnvironment, ego_planned: torch.Tensor = None, ado_planned: torch.Tensor = None, ado_planned_wo: torch.Tensor = None, ado_actual: torch.Tensor = None, ado_histories: torch.Tensor = None, ego_goal: torch.Tensor = None, display_wo: bool = True, legend: bool = False, title: str = None, file_path: str = None, ax: matplotlib.axes._axes.Axes = None)

Visualize robot/ado trajectories and distributions.

Draw trajectories in (quadratic) plot, thereby differentiate the actual trajectories from the baseline trajectories (without) using a different line markup. Also add little dots (plt.Circle) at the agents current positions.

Parameters
  • ado_planned_wo – ado trajectories without robot (num_ados, num_samples, t_horizon + 1, num_modes = 1, 5).

  • env – simulation environment, just used statically here (e.g. to convert ids to agents, roll out trajectories, etc.).

  • ego_planned – planned/optimized ego trajectory (t_horizon + 1, 5).

  • ado_actual – actual ado trajectories (num_ados, t_horizon + 1, 1, 5).

  • ado_planned – according ado trajectory conditioned on ego_planned (num_ados, num_samples, t_horizon + 1, 1, 5).

  • ado_histories – ado history trajectory used instead of internally stored on (num_ados, -1, >=2).

  • ego_goal – optimization robot goal state.

  • display_wo – display ado-wo-trajectories.

  • legend – draw legend in paths plot (might be a mess for many agents).

  • title – plot title (none by default).

  • file_path – storage path, if None return as HTML video object.

  • ax – optionally the plot can be drawn in an already existing axis.

mantrap.visualization.optimization.visualize_optimization(ego_planned: torch.Tensor, ado_actual: torch.Tensor, ado_planned: torch.Tensor, ado_planned_wo: torch.Tensor, env: mantrap.environment.base.graph_based.GraphBasedEnvironment, ego_goal: torch.Tensor = None, legend: bool = False, frame_interval: float = 400, restart_delay: float = 2000, file_path: str = None)

Visualize robot/ado trajectories and distributions over full optimization (multiple time-steps).

Draw trajectories in (quadratic) plot, thereby differentiate the actual trajectories from the baseline trajectories (without) using a different line markup. Also add little dots (plt.Circle) at the agents current positions.

Parameters
  • ego_planned – planned/optimized ego trajectory (time-step, t_horizon + 1, 5).

  • ado_actual – actual ado trajectory (num_ados, time_step, 1, 5).

  • ado_planned – according ado trajectory conditioned on ego_planned (time-steps, num_ados, num_samples, t_horizon + 1, 1, 5).

  • ado_planned_wo – ado trajectories without robot (time-steps, num_ados, num_samples, t_horizon + 1, num_modes = 1, 5).

  • env – simulation environment, just used statically here (e.g. to convert ids to agents, roll out trajectories, etc.).

  • ego_goal – optimization robot goal state.

  • legend – draw legend in paths plot (might be a mess for many agents).

  • file_path – storage path, if None return as HTML video object.

  • frame_interval – video frame displaying time interval [ms].

  • restart_delay – video restart delay time interval [ms].