MCPcopy Create free account
hub / github.com/MAC-VO/MAC-VO / plot_separately

Function plot_separately

Evaluation/PlotSeq.py:18–52  ·  view source on GitHub ↗
(spaces: list[str])

Source from the content-addressed store, hash-verified

16
17
18def plot_separately(spaces: list[str]):
19 for spaceid in ColoredTqdm(spaces, desc="Plotting"):
20 exp_space = Sandbox.load(spaceid)
21 config = exp_space.config
22
23 try:
24 gt_traj, est_traj = Trajectory.from_sandbox(exp_space, align_time="est->gt")
25 est_traj.plot_kwargs |= {"color": getColor("-", 4, 0)}
26 if gt_traj is None:
27 Logger.write("warn", f"Unable to plot error analysis for {est_traj} since could not load GT trajectory.")
28 return
29
30 gt_traj.plot_kwargs |= {"linewidth": 3, "linestyle": ":"}
31
32 for key, scale in NEED_ALIGN_SCALE.items():
33 if key not in est_traj.name.lower(): continue
34
35 Logger.write("info", f"{est_traj} --[align_scale={scale}]-> {gt_traj}")
36 if scale == "Dynamic": est_traj.data = est_traj.data.align_scale(gt_traj.data)
37 else: est_traj.data = est_traj.data.scale(scale)
38 break
39
40 est_traj.data = est_traj.data.align_origin(gt_traj.data)
41 name = config.Project if hasattr(config, "Project") else est_traj.name
42 AnalyzeTranslation(
43 [(gt_traj.apply(lambda traj: traj.as_motion), est_traj.apply(lambda traj: traj.as_motion))],
44 Path("Results", f"{name}_TranslationErr.png")
45 )
46 AnalyzeRotation(
47 [(gt_traj.apply(lambda traj: traj.as_motion), est_traj.apply(lambda traj: traj.as_motion))],
48 Path("Results", f"{name}_RotationErr.png")
49 )
50 PlotTrajectory([gt_traj, est_traj], Path("Results", f"{name}_Trajectory.png"))
51 except Exception as e:
52 Logger.show_exception()
53
54
55def plot_jointly(spaces: list[str]):

Callers 1

PlotSeq.pyFile · 0.85

Calls 13

ColoredTqdmClass · 0.90
getColorFunction · 0.90
AnalyzeTranslationFunction · 0.90
AnalyzeRotationFunction · 0.90
PlotTrajectoryFunction · 0.90
loadMethod · 0.80
from_sandboxMethod · 0.80
writeMethod · 0.80
align_scaleMethod · 0.80
scaleMethod · 0.80
align_originMethod · 0.80
show_exceptionMethod · 0.80

Tested by

no test coverage detected