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

Function AnalyzeRotation

Utility/Plot/PlotFigure.py:84–135  ·  view source on GitHub ↗
(runs: list[tuple[PlotableMotions, PlotableMotions]], file_name: Path)

Source from the content-addressed store, hash-verified

82
83
84def AnalyzeRotation(runs: list[tuple[PlotableMotions, PlotableMotions]], file_name: Path):
85 GRID_SHAPE = (3, 6)
86 _ = plt.figure(figsize=(16, 6), dpi=300)
87 ax = plt.subplot2grid(GRID_SHAPE, (0, 0), rowspan=3, colspan=2)
88 for ref_traj, est_traj in runs:
89 plot_MotionROE(ax, ref_traj, est_traj)
90 ax.legend(frameon=False)
91 ax.grid(visible=True, linestyle="--")
92 ax.set_title("Rotation Error (rad)", loc="left")
93
94 ax = plt.subplot2grid(GRID_SHAPE, (0, 2), rowspan=1, colspan=2)
95 for ref_traj, est_traj in runs:
96 plot_MotionROE_axes(ax, ref_traj, est_traj, axis=0)
97 ax.grid(visible=True, linestyle="--")
98 ax.set_title("Rotation Error on x-axis (rad)", loc="left")
99
100 ax = plt.subplot2grid(GRID_SHAPE, (1, 2), rowspan=1, colspan=2)
101 for ref_traj, est_traj in runs:
102 plot_MotionROE_axes(ax, ref_traj, est_traj, axis=1)
103 ax.grid(visible=True, linestyle="--")
104 ax.set_title("Rotation Error on y-axis (rad)", loc="left")
105
106 ax = plt.subplot2grid(GRID_SHAPE, (2, 2), rowspan=1, colspan=2)
107 for ref_traj, est_traj in runs:
108 plot_MotionROE_axes(ax, ref_traj, est_traj, axis=2)
109 ax.grid(visible=True, linestyle="--")
110 ax.set_title("Rotation Error on z-axis (rad)", loc="left")
111
112 ax = plt.subplot2grid(GRID_SHAPE, (0, 4), rowspan=1, colspan=2)
113 plot_Rotation_axes(ax, runs[0][0], axis=0)
114 for ref_traj, est_traj in runs:
115 plot_Rotation_axes(ax, est_traj, axis=0)
116 ax.grid(visible=True, linestyle="--")
117 ax.set_title("Rotation on x-axis (rad)", loc="left")
118
119 ax = plt.subplot2grid(GRID_SHAPE, (1, 4), rowspan=1, colspan=2)
120 plot_Rotation_axes(ax, runs[0][0], axis=1)
121 for ref_traj, est_traj in runs:
122 plot_Rotation_axes(ax, est_traj, axis=1)
123 ax.grid(visible=True, linestyle="--")
124 ax.set_title("Rotation on y-axis (rad)", loc="left")
125
126 ax = plt.subplot2grid(GRID_SHAPE, (2, 4), rowspan=1, colspan=2)
127 plot_Rotation_axes(ax, runs[0][0], axis=2)
128 for ref_traj, est_traj in runs:
129 plot_Rotation_axes(ax, est_traj, axis=2)
130 ax.grid(visible=True, linestyle="--")
131 ax.set_title("Rotation on z-axis (rad)", loc="left")
132
133 plt.tight_layout()
134 plt.savefig(str(file_name))
135 plt.close()
136
137
138def PlotTrajectory(trajs: list[PlotableTrajectory], file_name: Path):

Callers 2

plot_separatelyFunction · 0.90
plot_jointlyFunction · 0.90

Calls 4

plot_MotionROEFunction · 0.85
plot_MotionROE_axesFunction · 0.85
plot_Rotation_axesFunction · 0.85
closeMethod · 0.80

Tested by

no test coverage detected