From aef38d0ccca33efc9e8f4dd17e098a9b81d42ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20R=C3=B6smann?= Date: Thu, 21 May 2020 12:18:31 +0200 Subject: [PATCH] grid: The time difference is now initialized to dt_ref for reference trajectory caching --- .../src/optimal_control/full_discretization_grid_base_se2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mpc_local_planner/src/optimal_control/full_discretization_grid_base_se2.cpp b/mpc_local_planner/src/optimal_control/full_discretization_grid_base_se2.cpp index b322b83..396304c 100644 --- a/mpc_local_planner/src/optimal_control/full_discretization_grid_base_se2.cpp +++ b/mpc_local_planner/src/optimal_control/full_discretization_grid_base_se2.cpp @@ -58,6 +58,7 @@ corbo::GridUpdateResult FullDiscretizationGridBaseSE2::update(const Eigen::Vecto // check if we need to cache the reference trajectory values // TODO(roesmann): we could restrict this to new_run==true only as long as we do not // have a grid resize... int n = std::max(std::max(getNRef(), getN()), _n_adapt); + if (_dt.value() <= 0) _dt.value() = _dt_ref; // initialize _dt to _dt_ref in case it has not been optimized before if (!xref.isCached(getDt(), n, t)) xref.precompute(getDt(), n, t); if (!uref.isCached(getDt(), n, t)) uref.precompute(getDt(), n, t); if (sref && !sref->isCached(getDt(), n, t)) sref->precompute(getDt(), n, t);