1 import matplotlib.pyplot
as plt
11 X = np.array([-mb / 2, 0, m, mb, 2 * mb])
24 plt.figure(figsize=(9, 3.5))
34 label=
"Distance lower band area",
36 plt.plot(X, [
dlb(x)
for x
in X],
"-g", label=
"distance lower bound")
38 plt.axvspan(X[0], m, alpha=0.5, hatch=
"\\", facecolor=
"r", label=
"Collision area")
42 ax.set_xlabel(
"Object distance")
43 ax.set_xticks([0, m, mb])
44 ax.set_xticklabels([
"0",
"security margin",
"security margin\n+ break distance"])
46 ax.set_yticklabels([
"0",
"break distance"])
47 ax.grid(which=
"major", ls=
"solid")
48 ax.grid(which=
"minor", ls=
"dashed")
50 plt.axvline(0, ls=
"solid")
53 plt.axhline(0.0, ls=
"solid")
55 plt.title(
"Collision and distance lower band")
56 plt.legend(loc=
"lower right")
60 import os.path
as path
62 dir_path = path.dirname(path.realpath(__file__))
64 path.join(dir_path,
"distance_computation.png"),
66 orientation=
"landscape",