1 import matplotlib.pyplot
as plt
12 X = np.array([-mb / 2, 0, m, mb, 2 * mb])
25 plt.figure(figsize=(9, 3.5))
35 label=
"Distance lower band area",
37 plt.plot(X, [
dlb(x)
for x
in X],
"-g", label=
"distance lower bound")
39 plt.axvspan(X[0], m, alpha=0.5, hatch=
"\\", facecolor=
"r", label="Collision area")
43 ax.set_xlabel(
"Object distance")
44 ax.set_xticks([0, m, mb])
45 ax.set_xticklabels([
"0",
"security margin",
"security margin\n+ break distance"])
47 ax.set_yticklabels([
"0",
"break distance"])
48 ax.grid(which=
"major", ls=
"solid")
49 ax.grid(which=
"minor", ls=
"dashed")
51 plt.axvline(0, ls=
"solid")
54 plt.axhline(0.0, ls=
"solid")
56 plt.title(
"Collision and distance lower band")
57 plt.legend(loc=
"lower right")
61 import os.path
as path
63 dir_path = path.dirname(path.realpath(__file__))
65 path.join(dir_path,
"distance_computation.png"),
67 orientation=
"landscape",