From 4c004afd33286adf8053323ed502610eff4e3044 Mon Sep 17 00:00:00 2001 From: Liangliang Zhang Date: Mon, 17 Sep 2018 20:31:42 -0700 Subject: [PATCH] Control: fixed a bug in control. --- modules/control/common/interpolation_2d.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/control/common/interpolation_2d.cc b/modules/control/common/interpolation_2d.cc index 9bc13f2926..d572e9c95d 100644 --- a/modules/control/common/interpolation_2d.cc +++ b/modules/control/common/interpolation_2d.cc @@ -52,7 +52,9 @@ double Interpolation2D::Interpolate(const KeyType &xy) const { auto itr_after = xyz_.lower_bound(xy.first); auto itr_before = itr_after; - --itr_before; + if (itr_before != xyz_.begin()) { + --itr_before; + } double x_before = itr_before->first; double z_before = InterpolateYz(itr_before->second, xy.second); -- GitLab