Visualization#

Visualization utilities for trajectories, parameter estimates, and errors.

Publication-quality plotting functions for TAG-K experiments.

Provides: - 3-D trajectory visualisation with orientation arrows - Residual error time-series plots - Cumulative distribution function (CDF) plots for benchmark comparison

online_estimators.visualization.plotting.visualize_3d_traj(result, quat_fmt='wxyz', n_arrows=50, arrow_length=0.05, figsize=(8, 6), title=None)[source]#

3-D trajectory plot with orientation arrows.

Parameters:
  • result (dict) – Must contain 'x_meas_traj' (T, 13) and 'x_ref_traj' (T, 13) or (T, 3).

  • quat_fmt ("wxyz" or "xyzw") – Quaternion ordering convention.

  • n_arrows (int) – Number of body-frame orientation arrows to draw.

  • arrow_length (float) – Arrow length in world units.

  • figsize (tuple)

  • title (str or None)

Return type:

matplotlib.figure.Figure

online_estimators.visualization.plotting.visualize_residual_errors(result, eps=1e-12, logy=False)[source]#

Plot absolute and relative residual errors for theta_gt and theta_est.

Parameters:
  • result (dict) – Must contain A_snapshots, b_snapshots, theta_gt_traj, theta_est_traj, and t.

  • eps (float) – Floor for relative error denominator.

  • logy (bool) – If True, use log-scale on the y-axis.

Return type:

matplotlib.figure.Figure

online_estimators.visualization.plotting.plot_error_cdfs(npz_paths, algos=None, figsize=(5.0, 4.0), title=None, save_prefix=None, x_max=0.05)[source]#

Plot CDF curves of per-trial tracking errors for multiple algorithms.

Reads one or more .npz result files and plots the empirical CDF of position / velocity / orientation errors.

Parameters:
  • npz_paths (sequence of paths) – Result files.

  • algos (sequence of str or None) – Algorithm names in display order. Auto-discovered if None.

  • figsize (tuple)

  • title (str or None)

  • save_prefix (str, Path, or None) – If provided, saves <prefix>_pos_cdf.png, etc.

  • x_max (float) – X-axis upper limit.

Return type:

tuple[Dict[str, Figure], Dict[str, Axes]]

Returns:

  • figs (dict) – {"pos": Figure, "vel": Figure, "ori": Figure}

  • axes (dict) – {"pos": Axes, "vel": Axes, "ori": Axes}